postheadericon command line arguments in linux shell script


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



This code demonstrate how to use command line arguments in linux shell script

To execute this code


  1. Open  Terminal
  2. Execute args.sh
    • sh args.sh this is a command line arguments in linux shell script example




0 comments:

Blog Archive

Total Pageviews

© BipinRupadiya.com. Powered by Blogger.