SHIFT(I) - Manuals

SHIFT(I) SHIFT(I)

shift - adjust Shell arguments

shift

Shift is used in Shell command files to shift the argument list left by 1, so that old $2 can now be referred to by $1 and so forth. Shift is useful to iterate over several arguments to a command file. For example, the command file

	: loop
	if $1x = x exit
	pr -3 $1
	shift
	goto loop

prints each of its arguments in 3-column format.

Shift is executed within the Shell.

sh(I)

8/21/73

UNIX® is a registered trademark of The Open Group.

Copyright © 2003-2019 .
All rights reserved. Contact