Download command - Alabama Supercomputer Authority

Transcript
PROCESSING ON THE CRAY C90
Shell Scripts
A
A
shell script is a file that
contains one or more UNIX
commands. New shells can be
created by users issuing the sh
command.
shell is the process which interacts with the
commands issued by a logged-on user. Each
logged-on user has his own shell. A new shell (and
even multiple new shells) can be created by a user
with the command sh. The command can also
execute shell scripts.
If the file check contained the lines
#
date
who
then the command sh check would create a separate
shell from the one the user is operating under,
execute the commands (printing the date and the
current users on the screen), and return to the user's
original shell. The new shell would disappear as
soon as the commands were finished executing.
The command sh alone, without any arguments,
creates new shells that the user can treat as if they
were his original shell. Each is a separate
environment in which commands may be issued and
new processes launched. s h may be given
repeatedly, a new shell being created each time.
The command CTRL-D returns the user to the
previous shell, a series of CTRL-Ds returns the user
to the original sign-on shell. Issuing one more
CTRL-D signs off the user .
Alabama Supercomputer Center User Manual - Fifth Edition
53