how to Enter data from keyboard in shell programming ?
some command similar to scanf in c
how to Enter data from keyboard in shell programming ?
some command similar to scanf in c
You can use "read
" :
$ cat ./test.sh
#!/bin/sh
echo -n "enter the value : "
read my_var
echo "The value is : $my_var"
And, executing the script :
$ sh ./test.sh
enter the value : 145
The value is : 145