shift

Shift positional parameters to the left by n.
SYNTAX
      shift [n]

OPTIONS
      n  : The number of parameters to shift (default = 1)

The positional parameters from
n+1 ... $#
are renamed to
$1 ... $#-n+1

Parameters represented by the numbers $# to n+1 are unset.

n must be a positive number less than or equal to $#.

The return status is zero unless n is greater than $# or less than zero.

shift is a BOURNE shell command and a POSIX `special' builtin.

Related commands:

getopts - Parse positional parameters

Equivalent Windows NT commands:

SHIFT - Shift the position of replaceable parameters in a batch file



Back to the Top

Simon Sheppard
SS64.com