In shell we have the command shift, but i saw on some example its giving shift 3
Why there is a number after shift ? and what its about ? what it does ?
Example:
echo “arg1= $1 arg2=$2 arg3=$3”
shift
echo “arg1= $1 arg2=$2 arg3=$3”
shift
echo “arg1= $1 arg2=$2 arg3=$3”
shift
echo “arg1= $1 arg2=$2 arg3=$3”
shift
The output will be:
arg1= 1 arg2=2 arg3=3
arg1= 2 arg2=3 arg3=
arg1= 3 arg2= arg3=
arg1= arg2= arg3=
But when i add that, it doesn't display it correctly.