same shell for getting input from user,command line and files.
My program is
read a read b read c echo $a echo $b echo $c when i run it as ./shell.sh it gets input from user and prints it. when i run it as ./shell.sh < file.txt it takes input from file.txt and assigns it to variables a,b and c. when i run as ./shell.sh 1 2 3 i want the arguments to be stored in a,b and c without any change of code... CAN SOMEONE HELP ME SOON??? |
There's probably a more elegant way of doing it, but this sort of thing should work:
Code:
a=$1 |
jonnybinthemix sir... thank you so much for your quick response...
|
All times are GMT -5. The time now is 10:38 PM. |