CODE
COUNT=0
echo "You have entered $# arguments:"
for ARG in $*
do
echo "#`expr $COUNT + 1`: $ARG"
done
echo "You have entered $# arguments:"
for ARG in $*
do
echo "#`expr $COUNT + 1`: $ARG"
done
I can't seem to get the COUNT variable to increase for each listed argument. For example, if I enter something like:
CODE
./FILE_NAME one two three
I ended up getting this:
CODE
You have entered 3 arguments:
#1: one
#1: two
#1: three
#1: one
#1: two
#1: three