MPE/iX Shell and Utilities Reference Manual, Vol 2

shift(1) MPE/iX Shell and Utilities shift(1)
NAME
shift — shift positional parameters
SYNOPSIS
shift [expression]
DESCRIPTION
shift renames the 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 num-
ber of positional parameters ($#), inclusive.
EXAMPLE
The commands:
setabcd
shift 2
echo $*
produce:
cd
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 Failure because the expression had a negative value or was greater than the number of
positional parameters.
Messages
Because this utility is built into the
MPE/iX Shell, see the sh(1) man page for a complete list of
error messages that you may receive when using it.
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems.
Allowing an expression, rather than just a number, is an extension found in the KornShell.
NOTE
This is a special built-in command of the shell.
SEE ALSO
set(1), sh(1)
1-556 Commands and Utilities