get user input in shell script

by Ramya 2009-12-05 19:24:45

Get user input in shell script:

To get an input value from the user use the command "read".

echo "Enter file name:"
read name


O/P:
[root@localhost htdocs]# sh test.sh
Enter file name:
prince

Use this name as $name variable in the code like,
echo "Welcome $name"
Razz

Tagged in:

1031
like
0
dislike
0
mail
flag

You must LOGIN to add comments