args.sh
echo "Total Number of Argument : "$#
echo "Programe Name : "$0
n=0
for i in $*
do
n=`expr $n + 1`
echo "\nArgumnet [ "$n" ] : "$i
done
echo "Programe Name : "$0
n=0
for i in $*
do
n=`expr $n + 1`
echo "\nArgumnet [ "$n" ] : "$i
done
This code demonstrate how to use command line arguments in linux shell script
To execute this code
- Open Terminal
- Execute args.sh
- sh args.sh this is a command line arguments in linux shell script example
No comments:
Post a Comment