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.
echo “Hello, what is your name?”;
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”;
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