shift

shift KornShell positional parameters

KornShell Built-in


SYNOPSIS

shift [expression]


DESCRIPTION

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.


EXAMPLES

The commands:
set a b c d
shift 2
echo $*
produce:
c d

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.

bad shift count expr

You specified an expression that did not evaluate to a number in the range from 0 to the number of remaining positional parameters.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0.

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 MKS KornShell.


SEE ALSO

Commands:
set, sh


Updated MKS Toolkit [3khat16.ico]HP3000 [3khat16.ico]3kMail [archive16.gif]