shift - Shift positional parameters

Synopsis

shift [ n ]

Description

You can use shift to shift the positional parameters to the left by n. Positional parameter 1 is assigned the value of positional parameter (1+n), positional parameter 2 is assigned the value of positional parameter (2+n), and so forth. The special parameter # is updated with the new number of positional parameters.

Options

None.

Operands

The value of n must be an unsigned integer less than or equal to the special parameter #. If n is not specified, the default value is 1. If n is 0, there are no changes to the positional parameters.

Exit Status

Related information

Examples
  1. Shift the positional parameters by two: shift 2