Home » 2021
How to Prompt for User Input in Bash/Shell Scripts
This short tutorial will teach you to prompt the user for typed input from your Bash/Shell scripts. It’s easy to learn, easy to do, so read on! The read Command To read user input in shell scripts, use the aptly named read command. It has the following syntax: read OPTIONS VARIABLES Note that: The read command will read a line from standard input and split that input into fields Usually, standard input is the terminal with input from your keyboard, but you can also pipe or redirect input to the read command From the users perspective, they will … Read more