Read in Linux Programming

the read command is used to get value to store in variable from the keyboard.

Syntax

read varname1

Example


read $a
							

the following example : write a shell script to enter first name and last name and display it.


echo "Enter Your First Name:"
read $fname
echo "Enter Your Last Name:"
read $lname
echo "Welcome - $fname $lname"
							
Share Share on Facebook Share on Twitter Share on Google+ Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit