SHIFT(1CSH) COMMAND REFERENCE SHIFT(1CSH)
NAME
shift - reposition vector variables (csh built-in)
SYNOPSIS
shift [ variable ]
DESCRIPTION
The shift command shifts all memebers of the named variable,
or argv if none given, discarding element number 1.
EXAMPLES
The major use of shift is in parsing arguments. The
following shell script fragment parses the arguments given
to it, allowing the arguments -a, -b, and -c, and printing
an error message for others. At the end of the parsing,
argv contains the remaining arguments.
#!/bin/csh -f
set aflag="0" bflag="0" cflag="0"
while ($#argv)
if ("x"$argv[1] =~ x-*) then
switch ($argv[1])
case -a:
set aflag=1
breaksw
case -b:
set bflag=1
breaksw
case -c:
set cflag=1
breaksw
default:
echo "$0 : Unknown option $argv[1]"
exit 1
endsw
shift
else
break
endif
end
RETURN VALUE
[NO_ERRS] Command completed without error.
[1] An error of the type described in the message
occurred.
Printed 4/6/89 1
SHIFT(1CSH) COMMAND REFERENCE SHIFT(1CSH)
CAVEATS
This version of shift is different from shift(1sh) in that
it does not take an argument for the number of shifts to do
at once.
SEE ALSO
@(1csh), alias(1csh), bg(1csh), break(1csh), cd(1csh),
chdir(1csh), continue(1csh), csh(1csh), dirs(1csh),
echo(1csh), eval(1csh), exec(1csh), exit(1csh), fg(1csh),
glob(1csh), goto(1csh), hashstat(1csh), history(1csh),
jobs(1csh), kill(1csh), limit(1csh), logout(1csh),
nice(1csh), nohup(1csh), notify(1csh), onintr(1csh),
popd(1csh), pushd(1csh), rehash(1csh), repeat(1csh),
set(1csh), setenv(1csh), sh(1sh), shift(1sh), source(1csh),
stop(1csh), suspend(1csh), time(1csh), umask(1csh),
unhash(1csh), unalias(1csh), unlimit(1csh), unset(1csh),
unsetenv(1csh), wait(1csh), and which(1csh).
Printed 4/6/89 2
%%index%%
na:336,132;
sy:468,180;
de:648,320;
ex:968,1263;
rv:2231,274;
ca:2913,288;
se:3201,1566;
%%index%%000000000122