shiftshift KornShell positional parameters |
KornShell Built-in |
shift
[expression]
shift
renames the KornShell positional parameters so that
i+nth positional parameter becomes the ith
positional parameter, where n is the value of the given
arithmetic expression.
If you omit expression, the default value is 1.
The value of expression must be between zero and the number
of positional parameters ($#
), inclusive.
The value of $#
is updated.
produce:set a b c d shift 2 echo $*
c d
0
Successful completion.
1
Failure because the expression had a negative value or was greater than the number of positional parameters.
You specified an expression that did not evaluate to a number in the range from 0 to the number of remaining positional parameters.