summaryrefslogtreecommitdiff
path: root/static/unix-v10/man1/shift.1
blob: fbf2e145c070f700cec10f77965842c06cad252b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.th SHIFT I 8/21/73
.sh NAME
shift \*- adjust Shell arguments
.sh SYNOPSIS
.bd shift
.sh DESCRIPTION
.it Shift
is used in Shell command files to shift the
argument list left by 1,
so that old
.bd $2
can now be referred to by
.bd $1
and so forth.
.it Shift
is useful to iterate over several arguments
to a command file.
For example, the command file
.s3
.lp +5 0
: loop
.br
if $1x = x exit
.br
pr \*-3 $1
.br
shift
.br
goto loop
.s3
.i0
prints each of its arguments in 3-column format.
.s3
.it Shift
is executed within the Shell.
.sh "SEE ALSO"
sh (I)
.sh BUGS