shift — Shell Built-in Function to Traverse Either a Shell’s Argument List or a List of Field-Separated Words

Synopsis

sh
shift [n] 
csh
shift [variable] 
ksh
* 
shift [n] 

Description

The shift command is a shell built-in command that traverses either the argument list of the shell or a list of field-separated words.

Bourne Shell

The positional parameters from $n +1... are renamed $1.... The default n is 1.

C Shell

The components of argv, or variable , if supplied, are shifted to the left, discarding the first component. It is an error for the variable not to be set or to have a null value.

Korn Shell

The positional parameters from $n +1 $n +1... are renamed $1.... The default n is 1. The parameter n can be any arithmetic expression ...

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.