Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ shift(1CSH) — UTek W2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

@(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)

which(1csh)



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.




Printed 10/17/86                                                1





SHIFT(1CSH)             COMMAND REFERENCE             SHIFT(1CSH)



     [1]            An error of the type described in the message
                    occurred.

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), which(1csh).



































Printed 10/17/86                                                2





































































%%index%%
na:72,104;
sy:176,128;
de:304,256;
ex:560,1178;
rv:1738,133;2015,97;
ca:2112,240;
se:2352,1531;
%%index%%000000000129

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026