Shell script is a fun and a powerful one if we can use it properly. As a newbie, I wrote this tutorial especially as a personal note but if you found it useful, you may adopt it to your own script. On this tutorial, I am going to learn about Read command. Read command is used to get the user input. We can then use the result from read command for other purposes.
Create a new shell script called script01.sh. You can use your favorite text editor such as Atom, nano or any others. I am using nano on this tutorial.
Now enter the following commands inside the editor:
#!/bin/bash read -p "What is your name ?" name echo "Hello $name" exit 0
Now make the script executable with this command
chmod +x script01.sh
Now run the script
As you can see the echo command display the user input after the script executed.