How to read input from command line from shell script
to read dynamically the input argument from command prompt or ssh . in this tutorial we will create a new file
example3.sh
#!/bin/sh
echo "What is your fouravitue number"
read NUMBER
echo "Your luck number is $NUMBER"
after saving the above file , try to execute in the command line
sh example3.sh
it will ask for input , please enter your desired number,
The same number will be printed on the screen
to read dynamically the input argument from command prompt or ssh . in this tutorial we will create a new file
example3.sh
#!/bin/sh
echo "What is your fouravitue number"
read NUMBER
echo "Your luck number is $NUMBER"
after saving the above file , try to execute in the command line
sh example3.sh
it will ask for input , please enter your desired number,
The same number will be printed on the screen
Comments
Post a Comment