Shell Scripting Tutorial – 2


I am Aaditya Purani, and today i will teach you Input variables using `Read` in Shell Scripting. I have also made a video as usual for you guys, which is at bottom of the article 🙂


So, This command takes the input and will save it into a variable.

   read var1



echo “Hello, what is your name?”;

read varname

echo “Welcome dear”.$varname;

This code will print , the name which you inputted in the terminal.

Similarly to print many names code is



echo “Hello, which are your best 3 movies”;

read movie1
read movie2
read movie3

echo “Cool you liked”.$movie1;
echo “Impressive you liked”.$movie2;
echo “ahha finally you liked”.$movie3;


Now, you can Input Username and Password using “Read”


read -p “Username: ” uservar

read -p “Password:” userpass

echo “Welcome”.$uservar.”Your Password is”.$userpass;

Thanks for reading. Hope you all like it 🙂 Please follow me on




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s