1. Command to check number of arguments passed to shell scripts.
2. Command to list all arguments passed to shell scripts.
3. How to check if previous command execute successfully
if equal to 0, then it was successful, if anyother number then error.
4. Basic linux command to add value
scripts]$ cat first.sh
echo “Command: $0” # this is to print the command or filename
echo “one $1” # this line is to get first parameter
echo “two $2” # this line is to get second parameter
echo $* # this line is to print all parameters that is passed
echo $# # this line is to print the number of parameters that is passed
c=`expr $1 + $2`
echo “The result is :” $c
———[[email protected] scripts]$ ./first.sh 20 30
The result is : 50