csh(1)csh(1)NAMEcsh - a shell (command interpreter) with C-like syntax
SYNOPSIS
[command_file] [argument_list ...]
DESCRIPTION
is a command language interpreter that incorporates a command history
buffer, C-like syntax, and job control facilities.
Command Options
Command options are interpreted as follows:
Read commands from the (single) following argument which must be
present.
Any remaining arguments are placed in
C shell exits if any invoked command terminates abnormally
or yields a non-zero exit status.
Suppress execution of the
file in your home directory, thus speeding up shell
start-up time.
Force to respond interactively when called from a device
other than a computer terminal (such as another com‐
puter). normally responds non-interactively. If is
called from a computer terminal, it always responds
interactively, regardless of which options are
selected.
Parse but do
execute commands. This is useful for checking syntax
in shell scripts. All substitutions are performed
(history, command, alias, etc.).
Take command input from the standard input.
Read and execute a single line of input.
Set the shell variable, causing command input to be echoed to
the standard output device after history substitutions
are made.
Set the shell variable, causing all commands to be echoed to
the standard error immediately before execution.
Disable the tenex features which use the
ESC key for command/file name completion and CTRL-D
for listing available files (see the section below)
Set the variable before is executed so that all commands are
also echoed to the standard output.
Set the variable before is executed so that all commands are
also echoed to the standard output.
After processing the command options, if arguments remain in the argu‐
ment list, and the or options were not specified, the first remaining
argument is taken as the name of a file of commands to be executed.
COMMANDS
A simple command is a sequence of words, the first of which specifies
the command to be executed. A sequence of simple commands separated by
vertical bar characters forms a pipeline. The output of each command
in a pipeline becomes the input for the next command in the pipeline.
Sequences of pipelines can be separated by semicolons which causes them
to be executed sequentially. A sequence of pipelines can be executed
in background mode by adding an ampersand character after the last
entry.
Any pipeline can be placed in parentheses to form a simple command
which, in turn, can be a component of another pipeline. Pipelines can
also be separated by or indicating, as in the C language, that the sec‐
ond pipeline is to be executed only if the first fails or succeeds,
respectively.
Jobs
associates a with each pipeline and keeps a table of current jobs
(printed by the command) and assigns them small integer numbers. When
a job is started asynchronously using the shell prints a line resem‐
bling:
[1] 1234
indicating that the job which was started asynchronously was job number
1 and had one (top-level) process, whose process id was 1234.
If you are running a job and want to do something else, you can type
the currently defined suspend character (see termio(7)) which sends a
stop signal to the current job. then normally indicates that the job
has been `Stopped', and prints another prompt. You can then manipulate
the state of this job, putting it in the background with the command,
run some other commands, and then eventually bring the job back into
the foreground with the foreground command A suspend takes effect imme‐
diately and is like an interrupt in that pending output and unread
input are discarded when it is typed. There is a delayed suspend char‐
acter which does not generate a stop signal until a program attempts to
read(2) it. This can usefully be typed ahead when you have prepared
some commands for a job which you want to stop after it has read them.
A job being run in the background stops if it tries to read from the
terminal. Background jobs are normally allowed to produce output, but
this can be disabled by giving the command (see stty(1)). If you set
this tty option, background jobs stop when they try to produce output,
just as they do when they try to read input. Keyboard signals and
line-hangup signals from the terminal interface are not sent to back‐
ground jobs on such systems. This means that background jobs are
immune to the effects of logging out or typing the interrupt, quit,
suspend, and delayed suspend characters (see termio(7)).
There are several ways to refer to jobs in the shell. The character
introduces a job name. If you wish to refer to job number 1, you can
name it as Just naming a job brings it to the foreground; thus is a
synonym for bringing job 1 back into the foreground. Similarly, typing
resumes job 1 in the background. Jobs can also be named by prefixes of
the string typed in to start them if these prefixes are unambiguous;
thus normally restarts a suspended ex(1) job, if there is only one sus‐
pended job whose name begins with the string It is also possible to say
which specifies a job whose text contains string, if there is only one
such job.
maintains a notion of the current and previous jobs. In output per‐
taining to jobs, the current job is marked with a and the previous job
with a The abbreviation refers to the current job and refers to the
previous job. For close analogy with the syntax of the mechanism
(described below), is also a synonym for the current job.
learns immediately whenever a process changes state. It normally
informs you whenever a job becomes blocked so that no further progress
is possible, but only just before printing a prompt. This is done so
that it does not otherwise disturb your work. If, however, you set the
shell variable notifies you immediately of changes in status of back‐
ground jobs. There is also a built-in command called which marks a
single process so that any status change is immediately reported. By
default, marks the current process. Simply type after starting a back‐
ground job to mark it.
If you try to leave the shell while jobs are stopped, sends the warning
message: Use the command to see what they are. If you do this or imme‐
diately try to exit again, does not warn you a second time, and the
suspended jobs are terminated (see exit(2)).
Built-In Commands
Built-in commands are executed within the shell without spawning a new
process. If a built-in command occurs as any component of a pipeline
except the last, it is executed in a subshell. The built-in commands
are:
The first form prints all aliases.
The second form prints the
alias for name. The third
form assigns the specified
wordlist as the alias of
name. Command and file name
substitution are performed
on wordlist. name cannot be
or
Put the current
(job not specified) or spec‐
ified jobs into the back‐
ground, continuing them if
they were stopped.
Causes execution to resume after the
of the nearest enclosing or
The remaining commands on
the current line are exe‐
cuted. Multi-level breaks
are thus possible by writing
them all on one line.
Causes a break from a
resuming after the
A label in a
statement as discussed
below.
Change
the
shell's
cur‐
rent
work‐
ing
direc‐
tory
to direc‐
tory_name.
If
not
spec‐
i‐
fied,
direc‐
tory_name
defaults
to
your
home
direc‐
tory.
If
direc‐
tory_name
is
not
found
as
a
sub‐
di‐
rec‐
tory
of
the
cur‐
rent
work‐
ing
direc‐
tory
(and
does
not
begin
with
or
each
com‐
po‐
nent
of
the
vari‐
able
cdpath
is
checked
to
see
if
it
has
a
sub‐
di‐
rec‐
tory
direc‐
tory_name.
Finally,
if
all
else
fails,
treats
direc‐
tory_name
as
a
shell
vari‐
able.
If
its
value
begins
with
this
is
tried
to
see
if
it
is
a
direc‐
tory.
See
also
cd(1).
Con‐
tinue
exe‐
cu‐
tion
of
the
near‐
est
enclos‐
ing or
The
rest
of
the
com‐
mands
on
the
cur‐
rent
line
are
exe‐
cuted.
Labels
the
default
case
in
a state‐
ment.
The
default
should
come
after
all
other
labels.
Prints
the
direc‐
tory
stack;
the
top
of
the
stack
is
at
the
left; the
first
direc‐
tory
in
the
stack
is
the
cur‐
rent
direc‐
tory.
The
spec‐
i‐
fied
words
are
writ‐
ten
to
the
shell's
stan‐
dard
out‐
put, sep‐
a‐
rated
by
spa‐
ces,
and
ter‐
mi‐
nated
with
a
new-
line
unless
the
option
is
spec‐
i‐
fied.
See
also
echo(1).
See
the
descrip‐
tions
of
the
and
state‐
ments
below.
(Same
behav‐
ior
as sh(1).)
argu‐
ments
are
read
as
input
to
the
shell
and
the
result‐
ing
com‐
mand(s)
exe‐
cuted.
This
is
usu‐
ally
used
to
exe‐
cute
com‐
mands
gen‐
er‐
ated
as
the
result
of
com‐
mand
or
vari‐
able
sub‐
sti‐
tu‐
tion,
since
pars‐
ing
occurs
before
these
sub‐
sti‐
tu‐
tions.
The
spec‐
i‐
fied
com‐
mand
is
exe‐
cuted
in
place
of
the
cur‐
rent
shell.
exits
either
with
the
value
of
the vari‐
able
(first
form)
or
with
the
value
of
the
spec‐
i‐
fied
expres‐
sion
(sec‐
ond
form).
Brings
the
cur‐
rent (job
not
spec‐
i‐
fied)
or
spec‐
i‐
fied
jobs
into
the
fore‐
ground,
con‐
tin‐
u‐
ing
them
if
they
were
stopped.
The
vari‐
able name
is
suc‐
ces‐
sively
set
to
each
mem‐
ber
of
wordlist
and
the
sequence
of
com‐
mands
between
this
com‐
mand
and
the
match‐
ing
are
exe‐
cuted.
(Both
and
must
appear
alone
on
sep‐
a‐
rate
lines.)
The
built-
in
com‐
mand
can
be
used
to
con‐
tinue
the
loop
pre‐
ma‐
turely;
the
built-
in
com‐
mand
to
ter‐
mi‐
nate
it
pre‐
ma‐
turely.
When
this
com‐
mand
is
read
from
the
ter‐
mi‐
nal,
the
loop
is
read
once,
prompt‐
ing
with
before
any
state‐
ments
in
the
loop
are
exe‐
cuted.
If
you
make
a
mis‐
take
while
typ‐
ing
in
a
loop
at
the
ter‐
mi‐
nal,
use
the
erase
or
line-
kill
char‐
ac‐
ter
as
appro‐
pri‐
ate
to
recover.
Like but
no
escapes
are
rec‐
og‐
nized
and
words
are
delim‐
ited
by
null
char‐
ac‐
ters
in
the
out‐
put.
Use‐
ful
in
pro‐
grams
that
use
the
shell
to
per‐
form
file
name
expan‐
sion
on
a
list
of
words.
The
spec‐
i‐
fied word
is
file
name
and
com‐
mand
expanded
to
yield
a
string
of
the
form
The
shell
rewinds
its
input
as
much
as
pos‐
si‐
ble
and
searches
for
a
line
of
the
form
pos‐
si‐
bly
pre‐
ceded
by
blanks
or
tabs.
Exe‐
cu‐
tion
con‐
tin‐
ues
after
the
spec‐
i‐
fied
line.
Print
a
sta‐
tis‐
tics
line
indi‐
cat‐
ing
how
effec‐
tive
the
inter‐
nal
hash ta‐
ble
has
been
at
locat‐
ing
com‐
mands
(and
avoid‐
ing
An
is
attempted
for
each
com‐
po‐
nent
of
the
path
where
the
hash
func‐
tion
indi‐
cates
a
pos‐
si‐
ble
hit,
and
in
each
com‐
po‐
nent
that
does
not
begin
with
a
Dis‐
plays
the
his‐
tory
event
list. If
n
is
given,
only
the
n
most
recent
events
are
printed.
The
option
reverses
the
order
of
print‐
out
to
be
most
recent
first
rather
than
old‐
est
first.
The
option
prints
the
his‐
tory
list
with‐
out
lead‐
ing
num‐
bers
for
pro‐
duc‐
ing
files
suit‐
able
for
the
com‐
mand.
If expres‐
sion
eval‐
u‐
ates
true,
the
sin‐
gle
com‐
mand
with
argu‐
ments
is
exe‐
cuted.
Vari‐
able
sub‐
sti‐
tu‐
tion
on
com‐
mand
hap‐
pens
early,
at
the
same
time
it
does
for
the
rest
of
the
com‐
mand.
com‐
mand
must
be
a
sim‐
ple
com‐
mand;
not
a
pipe‐
line,
a
com‐
mand
list,
a
paren‐
the‐
sized
com‐
mand
list,
or
an
aliased
com‐
mand.
Input/out‐
put
re‐
di‐
rect‐
ion
occurs
even
if
expres‐
sion
is
false,
mean‐
ing
that
com‐
mand
is
exe‐
cuted
(this
is
a
bug).
If expres‐
sion1
is
true,
all
com‐
mands
down
to
the
first
are
exe‐
cuted;
oth‐
er‐
wise
if
expres‐
sion2
is
true,
all
com‐
mands
from
the
first
down
to
the
sec‐
ond
are
exe‐
cuted,
etc.
Any
num‐
ber
of
pairs
are
pos‐
si‐
ble,
but
only
one
is
needed.
The
part
is
like‐
wise
optional.
(The
words
and
must
appear
at
the
begin‐
ning
of
input
lines.
The
must
appear
alone
on
its
input
line
or
after
an
Lists
active
jobs. The
option
lists
process
IDs
in
addi‐
tion
to
the
usual
infor‐
ma‐
tion.
Sends
either
the TERM
(ter‐
mi‐
nate)
sig‐
nal
or
the
spec‐
i‐
fied
sig‐
nal
to
the
spec‐
i‐
fied
jobs
or
pro‐
cesses.
Sig‐
nals
are
either
given
by
num‐
ber
or
by
names
(as
given
in
stripped
of
the
pre‐
fix
(see
sig‐
nal(2)).
The
sig‐
nal
names
are
listed
by
There
is
no
default,
so
used
alone
does
not
send
a
sig‐
nal
to
the
cur‐
rent
job.
If
the
sig‐
nal
being
sent
is
TERM
(ter‐
mi‐
nate)
or
HUP
(hangup),
the
job
or
process
is
sent
a
CONT
(con‐
tinue)
sig‐
nal
as
well.
See
also
kill(1).
Lim‐
its
the
usage
by
the
cur‐
rent
process
and
each
process it
cre‐
ates
not
to
(indi‐
vid‐
u‐
ally)
exceed
max‐
i‐
mum_use
on
the
spec‐
i‐
fied
resource.
If
max‐
i‐
mum_use
is
not
spec‐
i‐
fied,
then
the
cur‐
rent
limit
is
dis‐
played;
if
resource
is
not
spec‐
i‐
fied,
then
all
lim‐
i‐
ta‐
tions
are
given.
If
the
flag
is
spec‐
i‐
fied,
the
hard
lim‐
its
are
used
instead
of
the
cur‐
rent
lim‐
its.
The
hard
lim‐
its
impose
a
ceil‐
ing
on
the
val‐
ues
of
the
cur‐
rent
lim‐
its.
Only
the
supe‐
ruser
can
raise
the
hard
lim‐
its,
but
a
user
can
lower
or
raise
the
cur‐
rent
lim‐
its
within
the
legal
range.
Con‐
trol‐
lable
resources
cur‐
rently
include:
Max‐
i‐
mum
address
space
in
bytes
for
a
process
Size
of
the
largest
core
dump
that
is
cre‐
ated
Max‐
i‐
mum
num‐
ber
of
CPU
sec‐
onds
to
be
used
by
each
process
Max‐
i‐
mum
growth
of
the
data
region
allowed beyond
the
end
of
the
pro‐
gram
text
Max‐
i‐
mum
num‐
ber
of
open
files
for
each
process
Largest
sin‐
gle
file
that
can
be
cre‐
ated
Max‐
i‐
mum
size
to
which
a
process's
res‐
i‐
dent
set
size
can
grow
Max‐
i‐
mum
size
of
the
auto‐
mat‐
i‐
cally
extended
stack
region
The
max‐
i‐
mum_use
argu‐
ment
can
be
spec‐
i‐
fied
as
a
float‐
ing-
point
or
inte‐
ger
num‐
ber
fol‐
lowed
by
a
scale
fac‐
tor:
k
or
kilo‐
bytes
(1024
bytes),
m
or
megabytes,
or
b
or
blocks
(the
units
used
by
the
ulimit
sys‐
tem
call).
For
both
resource
names
and
scale
fac‐
tors,
unam‐
bigu‐
ous
pre‐
fixes
of
the
names
can
be
used.
file‐
size
can
be
low‐
ered
by
an
instance
of
but
can
only
be
raised
by
an
instance
whose
effec‐
tive
user
ID
is
root.
For
more
infor‐
ma‐
tion,
refer
to
the
doc‐
u‐
men‐
ta‐
tion
for
the
ulimit
sys‐
tem
call.
Ter‐
mi‐
nates
a
login
shell,
replac‐
ing
it
with
an
instance
of
This
is
one
way
to
log
off,
included
for
com‐
pat‐
i‐
bil‐
ity
with
sh(1).
Ter‐
mi‐
nates
a
login
shell. Espe‐
cially
use‐
ful
if
ignoreeof
is
set.
A
sim‐
i‐
lar
func‐
tion,
which
works
for
ses‐
sions
that
are
not
login
shells,
is
pro‐
vided
for
his‐
tor‐
i‐
cal
rea‐
sons.
Its
use
is
not
rec‐
om‐
mended
because
it
is
not
part
of
the
stan‐
dard
BSD
and
may
not
be
sup‐
ported
in
future
releases.
Changes
the
group
iden‐
ti‐
fi‐
ca‐
tion
of
the
call‐
er;
for
details
see new‐
grp(1).
A
new
shell
is
exe‐
cuted
by
so
that
the
cur‐
rent
shell
envi‐
ron‐
ment
is
lost.
The
first
form
sets
the nice
(run
com‐
mand
pri‐
or‐
ity)
for
this
shell
to
4
(the
default).
The
sec‐
ond
form
sets
the
pri‐
or‐
ity
to
the
given
num‐
ber.
The
final
two
forms
run
com‐
mand
at
pri‐
or‐
ity
4
and
num‐
ber
respec‐
tively.
The
user
with
appro‐
pri‐
ate
priv‐
i‐
leges
can
raise
the
pri‐
or‐
ity
by
spec‐
i‐
fy‐
ing
neg‐
a‐
tive
nice‐
ness
using
com‐
mand
is
always
exe‐
cuted
in
a
sub-
shell,
and
restric‐
tions
placed
on
com‐
mands
in
sim‐
ple
state‐
ments
apply.
See
also
nice(1).
With‐
out
an
argu‐
ment, can
be
used
in
shell
scripts
to
cause
hangups
to
be
ignored
for
the
remain‐
der
of
the
script.
With
an
argu‐
ment,
causes
the
spec‐
i‐
fied
com‐
mand
to
be
run
with
hangups
ignored.
All
pro‐
cesses
exe‐
cuted
in
the
back‐
ground
with
are
effec‐
tively
as
described
under
Jobs
in
the
sec‐
tion.
Causes
the
shell
to
notify
the
user
asyn‐
chronously
when
the
sta‐
tus
of
the
cur‐
rent
(job
not
spec‐
i‐
fied)
or
spec‐
i‐
fied
jobs
changes;
nor‐
mally
noti‐
fi‐
ca‐
tion
is
pre‐
sented
before
a
prompt.
This
is
auto‐
matic
if
the
shell
vari‐
able
notify
is
set.
Con‐
trols
the
action
of
the
shell
on
inter‐
rupts. With
no
argu‐
ments,
onintr
restores
the
default
action
of
the
shell
on
inter‐
rupts,
which
action
is
to
ter‐
mi‐
nate
shell
scripts
or
return
to
the
ter‐
mi‐
nal
com‐
mand
input
level.
If
is
spec‐
i‐
fied,
all
inter‐
rupts
are
ignored.
If
a
label
is
given,
the
shell
exe‐
cutes
a
when
an
inter‐
rupt
is
received
or
a
child
process
ter‐
mi‐
nates
because
it
was
inter‐
rupted.
If
the
shell
is
run‐
ning
in
the
back‐
ground
and
inter‐
rupts
are
being
ignored,
onintr
has
no
effect;
inter‐
rupts
con‐
tinue
to
be
ignored
by
the
shell
and
all
invoked
com‐
mands.
Pops
the
direc‐
tory
stack,
return‐
ing
to
the
new
top
direc‐
tory. With
an
argu‐
ment,
dis‐
cards
the
nth
entry
in
the
stack.
The
ele‐
ments
of
the
direc‐
tory
stack
are
num‐
bered
from
0
start‐
ing
at
the
top.
A
syn‐
onym
for
called
is
pro‐
vided
for
his‐
tor‐
i‐
cal
rea‐
sons.
Its
use
is
not
rec‐
om‐
mended
because
it
is
not
part
of
the
stan‐
dard
BSD
and
may
not
be
sup‐
ported
in
future
releases.
With
no
argu‐
ments, pushd
exchanges
the
top
two
ele‐
ments
of
the
direc‐
tory
stack.
Given
a
name
argu‐
ment,
pushd
changes
to
the
new
direc‐
tory
(using
cd)
and
pushes
the
old
cur‐
rent
work‐
ing
direc‐
tory
(as
in
csw)
onto
the
direc‐
tory
stack.
With
a
numeric
argu‐
ment,
pushd
rotates
the
nth
argu‐
ment
of
the
direc‐
tory
stack
around
to
be
the
top
ele‐
ment
and
changes
to
that
direc‐
tory.
The
mem‐
bers
of
the
direc‐
tory
stack
are
num‐
bered
from
the
top
start‐
ing
at
0.
A
syn‐
onym
for
pushd,
called
gd,
is
pro‐
vided
for
his‐
tor‐
i‐
cal
rea‐
sons.
Its
use
is
not
rec‐
om‐
mended
since
it
is
not
part
of
the
stan‐
dard
BSD
and
may
not
be
sup‐
ported
in
future
releases.
Causes
the
inter‐
nal
hash
ta‐
ble
of
the
con‐
tents
of
the
direc‐
to‐
ries
in
the path
vari‐
able
to
be
recom‐
puted.
This
is
needed
if
new
com‐
mands
are
added
to
direc‐
to‐
ries
in
the
path
while
you
are
logged
in.
This
should
only
be
nec‐
es‐
sary
if
you
add
com‐
mands
to
one
of
your
own
direc‐
to‐
ries
or
if
a
sys‐
tems
pro‐
gram‐
mer
changes
the
con‐
tents
of
one
of
the
sys‐
tem
direc‐
to‐
ries.
The
spec‐
i‐
fied com‐
mand
(which
is
sub‐
ject
to
the
same
restric‐
tions
as
the
com‐
mand
in
the
one-
line
state‐
ment
above)
is
exe‐
cuted
count
times.
I/O
redi‐
rec‐
tions
occur
exactly
once,
even
if
count
is
0.
The
first
form
of shows
the
value
of
all
shell
vari‐
ables.
Vari‐
ables
whose
value
is
other
than
a
sin‐
gle
word
print
as
a
paren‐
the‐
sized
word
list.
The
sec‐
ond
form
sets
name
to
the
null
string.
The
third
form
sets
name
to
the
sin‐
gle
word.
The
fourth
form
sets
the
indexth
com‐
po‐
nent
of
name
to
word;
this
com‐
po‐
nent
must
already
exist.
The
final
form
sets
name
to
the
list
of
words
in
wordlist.
In
all
cases
the
value
is
com‐
mand
and
file-
name
expanded.
These
argu‐
ments
can
be
repeated
to
set
mul‐
ti‐
ple
val‐
ues
in
a
sin‐
gle
set
com‐
mand.
Note,
how‐
ever,
that
vari‐
able
expan‐
sion
hap‐
pens
for
all
argu‐
ments
before
any
set‐
ting
occurs.
Sets
the
value
of
envi‐
ron‐
ment
vari‐
able name
to
be
value,
a
sin‐
gle
string.
The
most
com‐
monly
used
envi‐
ron‐
ment
vari‐
ables,
and
are
auto‐
mat‐
i‐
cally
imported
to
and
exported
from
the
vari‐
ables
user,
term,
and
path;
there
is
no
need
to
use
for
these.
If
no
argu‐
ment
is
given,
the
mem‐
bers
of are
shifted
to
the
left,
dis‐
card‐
ing
An
error
occurs
if
is
not
set
or
has
less
than
two
strings
assigned
to
it.
When
vari‐
able
is
spec‐
i‐
fied,
shift
per‐
forms
the
same
func‐
tion
on
the
spec‐
i‐
fied
vari‐
able.
reads
com‐
mands
from name.
com‐
mands
can
be
nested,
but
if
nested
too
deeply
the
shell
may
run
out
of
file
descrip‐
tors
or
reach
the
max
stack
size
(see
maxs‐
siz(5)).
An
error
in
a
at
any
level
ter‐
mi‐
nates
all
nested
com‐
mands.
Nor‐
mally,
input
dur‐
ing
com‐
mands
is
not
placed
on
the
his‐
tory
list.
The
option
can
be
used
to
place
com‐
mands
in
the
his‐
tory
list
with‐
out
being
exe‐
cut‐
ing
them.
Stops
the
cur‐
rent
(no
argu‐
ment)
or
spec‐
i‐
fied
jobs
exe‐
cut‐
ing
in
the
back‐
ground.
Causes to
stop
as
if
it
had
been
sent
a
sus‐
pend
sig‐
nal.
Since
nor‐
mally
ignores
sus‐
pend
sig‐
nals,
this
is
the
only
way
to
sus‐
pend
the
shell.
This
com‐
mand
gives
an
error
mes‐
sage
if
attempted
from
a
login
shell.
Each label
(str1)
is
suc‐
ces‐
sively
matched
against
the
spec‐
i‐
fied
string
which
is
first
com‐
mand
and
file
name
expanded.
The
form
of
the
labels
is
the
Pat‐
tern
Match‐
ing
Nota‐
tion
with
the
excep‐
tion
that
non-
match‐
ing
lists
in
bracket
expres‐
sions
are
not
sup‐
ported
(see
reg‐
exp(5)).
If
none
of
the
labels
match
before
a
label
is
found,
the
exe‐
cu‐
tion
begins
after
the
label.
Each
label
and
the
label
must
appear
at
the
begin‐
ning
of
a
line.
The
com‐
mand
causes
exe‐
cu‐
tion
to
con‐
tinue
after
the
endsw.
Oth‐
er‐
wise,
con‐
trol
may
fall
through
labels
and
labels
as
in
C.
If
no
label
matches
and
there
is
no
default,
exe‐
cu‐
tion
con‐
tin‐
ues
after
the
When com‐
mand
is
not
spec‐
i‐
fied,
a
sum‐
mary
of
time
used
by
this
shell
and
its
chil‐
dren
is
printed.
If
spec‐
i‐
fied,
the
sim‐
ple
com‐
mand
is
timed
and
a
time
sum‐
mary
as
described
under
the
vari‐
able
is
printed.
If
nec‐
es‐
sary,
an
extra
shell
is
cre‐
ated
to
print
the
time
statis‐
tic
when
the
com‐
mand
com‐
pletes.
The
cur‐
rent
file
cre‐
ation
mask
is
dis‐
played (value
not
spec‐
i‐
fied)
or
set
to
the
spec‐
i‐
fied
value.
The
mask
is
given
in
octal.
Com‐
mon
val‐
ues
for
the
mask
are
which
gives
all
per‐
mis‐
sions
to
the
owner
and
group
and
read
and
exe‐
cute
per‐
mis‐
sions
to
all
oth‐
ers,
or
which
gives
all
per‐
mis‐
sions
to
the
owner,
and
only
read
and
exe‐
cute
per‐
mis‐
sion
to
the
group
and
all
oth‐
ers.
See
also
umask(1).
All
aliases
whose
names
match
the
spec‐
i‐
fied pat‐
tern
are
dis‐
carded.
Thus,
all
aliases
are
removed
by
No
error
occurs
if
pat‐
tern
does
not
match
an
exist‐
ing
alias.
Use
of
the
inter‐
nal
hash
ta‐
ble to
speed
loca‐
tion
of
exe‐
cuted
pro‐
grams
is
dis‐
abled.
All
vari‐
ables
whose
names
match
the
spec‐
i‐
fied pat‐
tern
are
removed.
Thus,
all
vari‐
ables
are
removed
by
this
has
notice‐
ably
unde‐
sir‐
able
side-
effects.
No
error
occurs
if
pat‐
tern
matches
noth‐
ing.
Removes
all
vari‐
ables
whose
names
match
the
spec‐
i‐
fied pat‐
tern
from
the
envi‐
ron‐
ment.
See
also
the
com‐
mand
above
and
print‐
env(1).
Waits
for
all
back‐
ground
jobs
to
ter‐
mi‐
nate. If
the
shell
is
inter‐
ac‐
tive,
an
inter‐
rupt
can
dis‐
rupt
the
wait,
at
which
time
the
shell
prints
names
and
job
num‐
bers
of
all
jobs
known
to
be
out‐
stand‐
ing.
While
the
spec‐
i‐
fied expres‐
sion
eval‐
u‐
ates
non-
zero,
the
com‐
mands
between
the
and
the
match‐
ing
are
eval‐
u‐
ated.
and
can
be
used
to
ter‐
mi‐
nate
or
con‐
tinue
the
loop
pre‐
ma‐
turely.
(The
and
must
appear
alone
on
their
input
lines.)
If
the
input
is
a
ter‐
mi‐
nal
(i.e.,
not
a
script),
prompt‐
ing
occurs
the
first
time
through
the
loop
as
for
the
state‐
ment.
Brings
the
spec‐
i‐
fied
job
into
the
fore‐
ground.
Con‐
tin‐
ues
the
spec‐
i‐
fied
job
in
the
back‐
ground.
The
first
form
prints
the
val‐
ues
of
all
the
shell
vari‐
ables.
The
sec‐
ond
form
sets
the
spec‐
i‐
fied
name
to
the
value
of
expres‐
sion.
If
the
expres‐
sion
con‐
tains
or
at
least
this
part
of
the
expres‐
sion
must
be
placed
within
paren‐
the‐
ses.
The
third
form
assigns
the
value
of
expres‐
sion
to
the
indexth
argu‐
ment
of
name.
Both
name
and
its
indexth
com‐
po‐
nent
must
already
exist.
The
oper‐
a‐
tors
etc.,
are
avail‐
able
as
in
C.
White
space
can
option‐
ally
sep‐
a‐
rate
the
name
from
the
assign‐
ment
oper‐
a‐
tor.
How‐
ever,
spa‐
ces
are
manda‐
tory
in
sep‐
a‐
rat‐
ing
com‐
po‐
nents
of
expres‐
sion
which
would
oth‐
er‐
wise
be
sin‐
gle
words.
Spe‐
cial
post‐
fix
and
oper‐
a‐
tors
incre‐
ment
and
decre‐
ment
name,
respec‐
tively
(e.g.,
Non-
Built-
In
Com‐
mand
Exe‐
cu‐
tion
When
a
com‐
mand
to
be
exe‐
cuted
is
not
a
built-
in
com‐
mand,
attempts
to
exe‐
cute
the
com‐
mand
via
exec(2).
Each
word
in
the
vari‐
able
path
names
a
direc‐
tory
in
which
the
shell
attempts
to
find
the
com‐
mand
(if
the
com‐
mand
does
not
begin
with
If
nei‐
ther
nor
is
given,
the
shell
hashes
the
names
in
these
direc‐
to‐
ries
into
an
inter‐
nal
ta‐
ble
so
that
an
exec
is
attempted
only
in
those
direc‐
to‐
ries
where
the
com‐
mand
might
pos‐
si‐
bly
reside.
This
greatly
speeds
com‐
mand
loca‐
tion
when
a
large
num‐
ber
of
direc‐
to‐
ries
are
present
in
the
search
path.
If
this
mech‐
a‐
nism
has
been
turned
off
(via
or
if
or
was
given,
or
if
any
direc‐
tory
com‐
po‐
nent
of
path
does
not
begin
with
a
the
shell
con‐
cate‐
nates
the
direc‐
tory
name
and
the
given
com‐
mand
name
to
form
a
path
name
of
a
file
which
it
then
attempts
to
exe‐
cute.
Com‐
mands
placed
inside
paren‐
the‐
ses
are
always
exe‐
cuted
in
a
sub‐
shell.
Thus
prints
the
home
direc‐
tory
then
returns
to
the
cur‐
rent
direc‐
tory
upon
com‐
ple‐
tion,
whereas:
remains
in
the
home
direc‐
tory
upon
com‐
ple‐
tion.
When
com‐
mands
are
placed
inside
paren‐
the‐
ses,
it
is
usu‐
ally
to
pre‐
vent
chdir
from
affect‐
ing
the
cur‐
rent
shell.
If
the
file
has
exe‐
cute
per‐
mis‐
sions
but
is
not
an
exe‐
cutable
binary
file,
it
is
assumed
to
be
a
script
file,
which
is
a
file
of
data
for
an
inter‐
preter
that
is
exe‐
cuted
as
a
sep‐
a‐
rate
process.
first
attempts
to
load
and
exe‐
cute
the
script
file
(see
exec(2)).
If
the
first
two
char‐
ac‐
ters
of
the
script
file
are
exec(2)
expects
an
inter‐
preter
path
name
to
fol‐
low
and
attempts
to
exe‐
cute
the
spec‐
i‐
fied
inter‐
preter
as
a
sep‐
a‐
rate
process
to
read
the
entire
script
file.
If
no
is
named,
and
there
is
an
alias
for
the
shell,
the
words
of
the
alias
are
inserted
at
the
begin‐
ning
of
the
argu‐
ment
list
to
form
the
shell
com‐
mand.
The
first
word
of
the
alias
should
be
the
full
path
name
of
the
com‐
mand
to
be
used.
Note
that
this
is
a
spe‐
cial,
late-
occur‐
ring
case
of
alias
sub‐
sti‐
tu‐
tion,
which
inserts
words
into
the
argu‐
ment
list
with‐
out
mod‐
i‐
fi‐
ca‐
tion.
If
no
is
named
and
there
is
no
shell
alias,
but
the
first
char‐
ac‐
ter
of
the
file
is
the
inter‐
preter
named
by
the
vari‐
able
is
exe‐
cuted
(note
that
this
nor‐
mally
would
be
unless
the
user
has
reset
If
is
not
set,
is
exe‐
cuted.
If
no
is
named,
and
there
is
no
shell
alias,
and
the
first
char‐
ac‐
ter
of
the
file
is
not
is
exe‐
cuted
to
inter‐
pret
the
script
file.
His‐
tory
Sub‐
sti‐
tu‐
tions
His‐
tory
sub‐
sti‐
tu‐
tions
enable
you
to
repeat
com‐
mands,
use
words
from
pre‐
vi‐
ous
com‐
mands
as
por‐
tions
of
new
com‐
mands,
repeat
argu‐
ments
of
a
pre‐
vi‐
ous
com‐
mand
in
the
cur‐
rent
com‐
mand,
and
fix
spell‐
ing
or
typ‐
ing
mis‐
takes
in
an
ear‐
lier
com‐
mand.
His‐
tory
sub‐
sti‐
tu‐
tions
begin
with
an
excla‐
ma‐
tion
point
Sub‐
sti‐
tu‐
tions
can
begin
any‐
where
in
the
input
stream,
but
can‐
not
be
nested.
The
excla‐
ma‐
tion
point
can
be
pre‐
ceded
by
a
back‐
slash
to
can‐
cel
its
spe‐
cial
mean‐
ing.
For
con‐
ve‐
nience,
an
excla‐
ma‐
tion
point
is
passed
to
the
parser
unchanged
when
it
is
fol‐
lowed
by
a
blank,
tab,
new‐
line,
equal
sign,
or
left
paren‐
the‐
sis.
Any
input
line
that
con‐
tains
his‐
tory
sub‐
sti‐
tu‐
tion
is
echoed
on
the
ter‐
mi‐
nal
before
it
is
exe‐
cuted
for
ver‐
i‐
fi‐
ca‐
tion.
Com‐
mands
input
from
the
ter‐
mi‐
nal
that
con‐
sist
of
one
or
more
words
are
saved
on
the
his‐
tory
list.
The
his‐
tory
sub‐
sti‐
tu‐
tions
rein‐
tro‐
duce
sequences
of
words
from
these
saved
com‐
mands
into
the
input
stream.
The
num‐
ber
of
pre‐
vi‐
ous
com‐
mands
saved
is
con‐
trolled
by
the
vari‐
able.
The
pre‐
vi‐
ous
com‐
mand
is
always
saved,
regard‐
less
of
its
value.
Com‐
mands
are
num‐
bered
sequen‐
tially
from
1.
You
can
refer
to
pre‐
vi‐
ous
events
by
event
num‐
ber
(such
as
for
event
10),
rel‐
a‐
tive
event
loca‐
tion
(such
as
for
the
sec‐
ond
pre‐
vi‐
ous
event),
full
or
par‐
tial
com‐
mand
name
(such
as
for
the
last
event
using
a
com‐
mand
with
ini‐
tial
char‐
ac‐
ter
and
string
expres‐
sion
(such
as
refer‐
ring
to
an
event
con‐
tain‐
ing
the
char‐
ac‐
ters
These
forms,
with‐
out
fur‐
ther
mod‐
i‐
fi‐
ca‐
tion,
sim‐
ply
rein‐
tro‐
duce
the
words
of
the
spec‐
i‐
fied
events,
each
sep‐
a‐
rated
by
a
sin‐
gle
blank.
As
a
spe‐
cial
case,
is
a
re-
do;
it
refers
to
the
pre‐
vi‐
ous
com‐
mand.
To
select
words
from
a
com‐
mand,
use
a
colon
and
a
des‐
ig‐
na‐
tor
for
the
desired
words
after
the
event
spec‐
i‐
fi‐
ca‐
tion.
The
words
of
an
input
line
are
num‐
bered
from
zero.
The
basic
word
des‐
ig‐
na‐
tors
are:
First
word
(i.e.,
the
com‐
mand
name
itself).
n nth
word.
First
argu‐
ment.
(This
is
equiv‐
a‐
lent
to
Last
word.
Range
of
words
from
a
through
b.
Spe‐
cial
cases
are
an
abbre‐
vi‐
a‐
tion
for
``word
0
through
word
y'';
and
which
means
``word
x
up
to,
but
not
includ‐
ing,
word
Range
from
the
sec‐
ond
word
through
the
last
word.
Used
with
a
search
sequence
to
sub‐
sti‐
tute
the
imme‐
di‐
ately
pre‐
ced‐
ing
match‐
ing
word.
The
colon
sep‐
a‐
rat‐
ing
the
com‐
mand
spec‐
i‐
fi‐
ca‐
tion
from
the
word
des‐
ig‐
na‐
tor
can
be
omit‐
ted
if
the
argu‐
ment
selec‐
tor
begins
with
a
or
After
word
des‐
ig‐
na‐
tor
can
be
fol‐
lowed
by
a
sequence
of
mod‐
i‐
fiers,
each
pre‐
ceded
by
a
colon.
The
fol‐
low‐
ing
mod‐
i‐
fiers
are
defined:
Use
only
the
first
com‐
po‐
nent
of
a
path
name
by
remov‐
ing
all
fol‐
low‐
ing
com‐
po‐
nents.
Use
the
root
file
name
by
remov‐
ing
any
trail‐
ing
suf‐
fix
(.xxx).
Use
the
file
name's
trail‐
ing
suf‐
fix
by
remov‐
ing
the
root
name.
sub‐
sti‐
tute
the
value
of
r
for
the
value
l
in
the
indi‐
cated
com‐
mand.
Use
only
the
final
file
name
of
a
path
name
by
remov‐
ing
all
lead‐
ing
path
name
com‐
po‐
nents.
Repeat
the
pre‐
vi‐
ous
sub‐
sti‐
tu‐
tion.
Print
the
new
com‐
mand
but
do
not
exe‐
cute
it.
Quote
the
sub‐
sti‐
tuted
words,
pre‐
vent‐
ing
fur‐
ther
sub‐
sti‐
tu‐
tions.
Like but
break
into
words
at
blanks,
tabs
and
new‐
lines.
Use
a com‐
mand
as
a
pre‐
fix
to
another
mod‐
i‐
fier
to
cause
the
spec‐
i‐
fied
change
to
be
made
glob‐
ally.
All
words
in
the
com‐
mand
are
changed,
one
change
per
word,
and
each
string
enclosed
in
sin‐
gle
quotes
or
dou‐
ble
quotes
is
treated
as
a
sin‐
gle
word.
Unless
pre‐
ceded
by
a
the
mod‐
i‐
fi‐
ca‐
tion
is
applied
only
to
the
first
mod‐
i‐
fi‐
able
word.
An
error
results
if
a
sub‐
sti‐
tu‐
tion
is
attempted
and
can‐
not
be
com‐
pleted
(i.e.,
if
you
ask
for
a
sub‐
sti‐
tu‐
tion
of
on
a
his‐
tory
buf‐
fer
con‐
tain‐
ing
only
10
com‐
mands).
The
left
hand
side
of
sub‐
sti‐
tu‐
tions
are
strings;
not
reg‐
u‐
lar
expres‐
sions
in
the
sense
of
HP-
UX
edi‐
tors.
Any
char‐
ac‐
ter
can
be
used
as
the
delim‐
iter
in
place
of
a
slash
Use
a
back‐
slash
to
quote
a
delim‐
iter
char‐
ac‐
ter
if
it
is
used
in
the
l
or
r
string.
The
char‐
ac‐
ter
in
the
right-
hand
side
is
replaced
by
the
text
from
the
left.
A
also
quotes
A
null
l
string
uses
the
pre‐
vi‐
ous
string
either
from
an
l
or
from
a
con‐
tex‐
tual
scan
string
s
in
The
trail‐
ing
delim‐
iter
in
the
sub‐
sti‐
tu‐
tion
can
be
omit‐
ted
if
a
new-
line
char‐
ac‐
ter
fol‐
lows
imme‐
di‐
ately,
as
may
the
trail‐
ing
in
a
con‐
tex‐
tual
scan.
A
his‐
tory
ref‐
er‐
ence
can
be
given
with‐
out
an
event
spec‐
i‐
fi‐
ca‐
tion
(as
in
In
this
case,
the
ref‐
er‐
ence
is
to
the
pre‐
vi‐
ous
com‐
mand
unless
a
pre‐
vi‐
ous
his‐
tory
ref‐
er‐
ence
occurred
on
the
same
line,
in
which
case
this
form
repeats
the
pre‐
vi‐
ous
ref‐
er‐
ence.
Thus
gives
the
first
and
last
argu‐
ments
from
the
com‐
mand
match‐
ing
A
spe‐
cial
abbre‐
vi‐
a‐
tion
of
a
his‐
tory
ref‐
er‐
ence
occurs
when
the
first
non-
blank
char‐
ac‐
ter
of
an
input
line
is
a
cir‐
cum‐
flex
This
is
equiv‐
a‐
lent
to
pro‐
vid‐
ing
a
con‐
ve‐
nient
short‐
hand
for
sub‐
sti‐
tu‐
tions
on
the
text
of
the
pre‐
vi‐
ous
line.
Thus
fixes
the
spell‐
ing
of
in
the
pre‐
vi‐
ous
com‐
mand.
Finally,
a
his‐
tory
sub‐
sti‐
tu‐
tion
can
be
enclosed
within
curly
braces
if
nec‐
es‐
sary
to
insu‐
late
it
from
the
char‐
ac‐
ters
which
fol‐
low.
Thus,
after
one
could
exe‐
cute
to
do
while
would
look
for
a
com‐
mand
start‐
ing
with
Quot‐
ing
with
Sin‐
gle
and
Dou‐
ble
Quotes
The
quo‐
ta‐
tion
of
strings
by
sin‐
gle
quotes
and
dou‐
ble
quotes
can
be
used
to
pre‐
vent
all
or
some
of
the
remain‐
ing
sub‐
sti‐
tu‐
tions.
Strings
enclosed
in
sin‐
gle
quotes
are
pro‐
tected
from
any
fur‐
ther
inter‐
pre‐
ta‐
tion.
Strings
enclosed
in
dou‐
ble
quotes
are
still
vari‐
able-
and
com‐
mand-
expanded
as
described
below.
In
both
cases
the
result‐
ing
text
becomes
(all
or
part
of)
a
sin‐
gle
word.
Only
in
one
spe‐
cial
case
(see
below)
does
a
dou‐
ble-
quoted
string
yield
parts
of
more
than
one
word;
sin‐
gle-
quoted
strings
never
do.
Alias
Sub‐
sti‐
tu‐
tion
main‐
tains
a
list
of
aliases
that
can
be
estab‐
lished,
dis‐
played,
and
mod‐
i‐
fied
by
the
and
com‐
mands.
After
a
com‐
mand
line
is
scanned,
it
is
parsed
into
dis‐
tinct
com‐
mands
and
the
first
word
of
each
com‐
mand,
left-
to-
right,
is
checked
to
see
if
it
has
an
alias.
If
it
does,
the
text
which
is
the
alias
for
that
com‐
mand
is
reread
with
the
his‐
tory
mech‐
a‐
nism
avail‐
able
as
if
that
com‐
mand
was
the
pre‐
vi‐
ous
input
line.
The
result‐
ing
words
replace
the
com‐
mand
and
argu‐
ment
list.
If
no
ref‐
er‐
ence
is
made
to
the
his‐
tory
list,
the
argu‐
ment
list
is
left
unchanged.
Thus,
if
the
alias
for
is
the
com‐
mand
maps
to
leav‐
ing
the
argu‐
ment
list
undis‐
turbed.
Sim‐
i‐
larly,
if
the
alias
for
was
maps
to
If
an
alias
is
found,
the
word
trans‐
for‐
ma‐
tion
of
the
input
text
is
per‐
formed
and
the
alias‐
ing
process
begins
again
on
the
re-
formed
input
line.
Loop‐
ing
is
pre‐
vented
if
the
first
word
of
the
new
text
is
the
same
as
the
old
by
flag‐
ging
it
to
pre‐
vent
fur‐
ther
alias‐
ing.
Other
loops
are
detected
and
cause
an
error.
Note
that
the
mech‐
a‐
nism
allows
aliases
to
intro‐
duce
parser
meta‐
syn‐
tax.
Thus:
makes
a
com‐
mand
that
uses
pr(1)
to
print
its
argu‐
ments
on
the
line
printer.
Expres‐
sions
Some
of
the
built-
in
com‐
mands
take
expres‐
sions
in
which
the
oper‐
a‐
tors
are
sim‐
i‐
lar
to
those
of
C,
with
the
same
prece‐
dence.
These
expres‐
sions
appear
in
the
and
com‐
mands.
The
fol‐
low‐
ing
oper‐
a‐
tors
are
avail‐
able
(shown
in
order
of
increas‐
ing
prece‐
dence):
The
fol‐
low‐
ing
list
shows
the
group‐
ing
of
these
oper‐
a‐
tors.
The
prece‐
dence
decreases
from
top
to
bot‐
tom
in
the
list:
The
oper‐
a‐
tors
and
com‐
pare
their
argu‐
ments
as
strings;
all
oth‐
ers
oper‐
ate
on
num‐
bers.
The
oper‐
a‐
tors
and
are
sim‐
i‐
lar
to
and
except
that
the
right-
hand
side
is
a
pat‐
tern
(con‐
tain‐
ing
and
instances
of
against
which
the
left
hand
op‐
er‐
and
is
matched.
This
reduces
the
need
for
use
of
the
state‐
ment
in
shell
scripts
when
all
that
is
really
needed
is
pat‐
tern
match‐
ing.
Strings
begin‐
ning
with
are
con‐
sid‐
ered
octal
num‐
bers.
Null
or
miss‐
ing
argu‐
ments
are
con‐
sid‐
ered
The
result
of
all
expres‐
sions
are
strings
that
rep‐
re‐
sent
dec‐
i‐
mal
num‐
bers.
It
is
impor‐
tant
to
note
that
no
two
com‐
po‐
nents
of
an
expres‐
sion
can
appear
in
the
same
word.
These
com‐
po‐
nents
should
be
sur‐
rounded
by
spa‐
ces
except
when
adja‐
cent
to
com‐
po‐
nents
of
expres‐
sions
that
are
syn‐
tac‐
ti‐
cally
sig‐
nif‐
i‐
cant
to
the
parser:
and
Also
avail‐
able
in
expres‐
sions
as
prim‐
i‐
tive
op‐
er‐
ands
are
com‐
mand
exe‐
cu‐
tions
enclosed
in
curly
braces
and
file
enquiries
of
the
form
where
l
is
one
of:
read
access
write
access
exe‐
cute
access
exis‐
tence
own‐
er‐
ship
zero
size
plain
file
direc‐
tory
The
spec‐
i‐
fied
file‐
name
is
com‐
mand-
and
file-
name
expanded
then
tested
to
see
if
it
has
the
spec‐
i‐
fied
rela‐
tion‐
ship
to
the
real
user.
If
the
file
does
not
exist
or
is
inac‐
ces‐
si‐
ble,
all
inquiries
return
false
(0).
Com‐
mand
exe‐
cu‐
tions
suc‐
ceed,
return‐
ing
true,
if
the
com‐
mand
exits
with
sta‐
tus
0;
oth‐
er‐
wise
they
fail,
return‐
ing
false.
If
more
detailed
sta‐
tus
infor‐
ma‐
tion
is
required,
the
com‐
mand
should
be
exe‐
cuted
out‐
side
of
an
expres‐
sion
and
the
vari‐
able
exam‐
ined.
Con‐
trol
of
the
Flow
con‐
tains
a
num‐
ber
of
com‐
mands
that
can
be
used
to
reg‐
u‐
late
the
flow
of
con‐
trol
in
com‐
mand
files
(shell
scripts)
and
(in
lim‐
ited
but
use‐
ful
ways)
from
ter‐
mi‐
nal
input.
These
com‐
mands
all
oper‐
ate
by
forc‐
ing
the
shell
to
reread
or
skip
parts
of
its
input
and,
due
to
the
imple‐
men‐
ta‐
tion,
restrict
the
place‐
ment
of
some
of
the
com‐
mands.
The
and
state‐
ments,
as
well
as
the
form
of
the
state‐
ment
require
that
the
major
key‐
words
appear
in
a
sin‐
gle
sim‐
ple
com‐
mand
on
an
input
line
as
shown
below.
If
the
shell's
input
is
not
seek‐
able,
the
shell
buf‐
fers
input
when‐
ever
a
loop
is
being
read
and
per‐
forms
seeks
in
this
inter‐
nal
buf‐
fer
to
accom‐
plish
the
reread‐
ing
implied
by
the
loop.
(To
the
extent
that
this
allows,
back‐
ward
suc‐
ceed
on
non-
seek‐
able
inputs.)
Sig‐
nal
Han‐
dling
nor‐
mally
ignores
quit
sig‐
nals.
Jobs
run‐
ning
in
back‐
ground
mode
are
immune
to
sig‐
nals
gen‐
er‐
ated
from
the
key‐
board,
includ‐
ing
hangups.
Other
sig‐
nals
have
the
val‐
ues
which
the
shell
inher‐
ited
from
its
par‐
ent.
han‐
dling
of
inter‐
rupts
and
ter‐
mi‐
nate
sig‐
nals
in
shell
scripts
can
be
con‐
trolled
by
onintr.
Login
shells
catch
the
ter‐
mi‐
nate
sig‐
nal;
oth‐
er‐
wise
this
sig‐
nal
is
passed
on
to
chil‐
dren
from
the
state
in
the
shell's
par‐
ent.
In
no
case
are
inter‐
rupts
allowed
when
a
login
shell
is
read‐
ing
the
file
Com‐
mand
Line
Pars‐
ing
splits
input
lines
into
words
at
blanks
and
tabs.
The
fol‐
low‐
ing
excep‐
tions
(parser
metachar‐
ac‐
ters)
are
con‐
sid‐
ered
sep‐
a‐
rate
words:
amper‐
sand;
ver‐
ti‐
cal
bar;
semi‐
colon;
less-
than
sign;
greater-
than
sign;
left
paren‐
the‐
sis;
right
paren‐
the‐
sis;
dou‐
ble
amper‐
sand;
dou‐
ble
ver‐
ti‐
cal
bar;
dou‐
ble
less-
than
sign;
dou‐
ble
greater-
than
sign;
com‐
ment
delim‐
iter
The
back‐
slash
removes
the
spe‐
cial
mean‐
ing
of
these
parser
metachar‐
ac‐
ters.
A
parser
metachar‐
ac‐
ter
pre‐
ceded
by
a
back‐
slash
is
inter‐
preted
as
its
ASCII
value.
A
new‐
line
char‐
ac‐
ter
(ASCII
10)
pre‐
ceded
by
a
back‐
slash
is
equiv‐
a‐
lent
to
a
blank.
Strings
enclosed
in
sin‐
gle
or
dou‐
ble
quotes
form
parts
of
a
word.
Metachar‐
ac‐
ters
in
these
strings,
includ‐
ing
blanks
and
tabs,
do
not
form
sep‐
a‐
rate
words.
Within
pairs
of
back‐
slashes
or
quotes,
a
new‐
line
pre‐
ceded
by
a
back‐
slash
gives
a
true
new‐
line
char‐
ac‐
ter.
When
input
is
not
a
ter‐
mi‐
nal,
the
char‐
ac‐
ter
intro‐
duces
a
com‐
ment
ter‐
mi‐
nated
by
a
new‐
line.
CSH
VARI‐
ABLES
main‐
tains
a
set
of
vari‐
ables.
Each
vari‐
able
has
a
value
equal
to
zero
or
more
strings
(words).
Vari‐
ables
have
names
con‐
sist‐
ing
of
up
to
80
let‐
ters
and
dig‐
its
start‐
ing
with
a
let‐
ter.
The
under‐
score
char‐
ac‐
ter
is
con‐
sid‐
ered
a
let‐
ter.
The
value
of
a
vari‐
able
may
be
dis‐
played
and
changed
by
using
the
and
com‐
mands.
Some
of
the
vari‐
ables
are
Bool‐
ean,
that
is,
the
shell
does
not
care
what
their
value
is,
only
whether
they
are
set
or
not.
Some
oper‐
a‐
tions
treat
vari‐
ables
numer‐
i‐
cally.
The
at
sign
com‐
mand
per‐
mits
numeric
cal‐
cu‐
la‐
tions
to
be
per‐
formed
and
the
result
assigned
to
a
vari‐
able.
The
null
string
is
con‐
sid‐
ered
to
be
zero,
and
any
sub‐
se‐
quent
words
of
multi-
word
val‐
ues
are
ignored.
After
the
input
line
is
aliased
and
parsed,
and
before
each
com‐
mand
is
exe‐
cuted,
vari‐
able
expan‐
sion
is
per‐
formed
keyed
by
the
dol‐
lar
sign
char‐
ac‐
ter.
Vari‐
able
expan‐
sion
can
be
pre‐
vented
by
pre‐
ced‐
ing
the
dol‐
lar
sign
with
a
back‐
slash
char‐
ac‐
ter
except
within
dou‐
ble
quotes
where
sub‐
sti‐
tu‐
tion
occurs.
Vari‐
ables
are
never
expanded
if
enclosed
in
sin‐
gle
quotes.
Strings
quoted
by
sin‐
gle
quotes
are
inter‐
preted
later
(see
so
vari‐
able
sub‐
sti‐
tu‐
tion
does
not
occur
there
until
later,
if
at
all.
A
dol‐
lar
sign
is
passed
unchanged
if
fol‐
lowed
by
a
blank,
tab,
or
end-
of-
line.
Input/out‐
put
redi‐
rec‐
tions
are
rec‐
og‐
nized
before
vari‐
able
expan‐
sion,
and
are
vari‐
able
expanded
sep‐
a‐
rately.
Oth‐
er‐
wise,
the
com‐
mand
name
and
entire
argu‐
ment
list
are
expanded
together.
Unless
enclosed
in
dou‐
ble
quotes
or
given
the
mod‐
i‐
fier,
the
results
of
vari‐
able
sub‐
sti‐
tu‐
tion
may
even‐
tu‐
ally
be
com‐
mand
and
file
name
sub‐
sti‐
tuted.
Within
dou‐
ble
quotes,
a
vari‐
able
whose
value
con‐
sists
of
mul‐
ti‐
ple
words
expands
to
a
por‐
tion
of
a
sin‐
gle
word,
with
the
words
of
the
vari‐
able's
value
sep‐
a‐
rated
by
blanks.
When
the
mod‐
i‐
fier
is
applied
to
a
sub‐
sti‐
tu‐
tion,
the
vari‐
able
expands
to
mul‐
ti‐
ple
words
with
each
word
sep‐
a‐
rated
by
a
blank
and
quoted
to
pre‐
vent
later
com‐
mand
or
file
name
sub‐
sti‐
tu‐
tion.
The
fol‐
low‐
ing
metase‐
quences
are
pro‐
vided
for
intro‐
duc‐
ing
vari‐
able
val‐
ues
into
the
shell
input.
Except
as
noted,
it
is
an
error
to
ref‐
er‐
ence
a
vari‐
able
that
is
not
set.
When
inter‐
preted,
this
sequence
is
replaced
by
the
words
of
the
value
of
the
vari‐
able
vari‐
able_name,
each
sep‐
a‐
rated
by
a
blank.
Braces
insu‐
late
vari‐
able_name
from
sub‐
se‐
quent
char‐
ac‐
ters
that
would
oth‐
er‐
wise
be
inter‐
preted
to
be
part
of
the
vari‐
able
name
itself.
If
vari‐
able_name
is
not
a
vari‐
able,
but
is
set
in
the
envi‐
ron‐
ment,
that
value
is
used.
vari‐
ables
can‐
not
be
mod‐
i‐
fied
as
shown
below.
This
mod‐
i‐
fi‐
ca‐
tion
selects
only
some
of
the
words
from
the
value
of
vari‐
able_name.
The
selec‐
tor
is
sub‐
jected
to
vari‐
able
sub‐
sti‐
tu‐
tion,
and
can
con‐
sist
of
a
sin‐
gle
num‐
ber
or
two
num‐
bers
sep‐
a‐
rated
by
a
dash.
The
first
word
of
a
vari‐
able's
value
is
num‐
bered
If
the
first
num‐
ber
of
a
range
is
omit‐
ted
it
defaults
to
If
the
last
mem‐
ber
of
a
range
is
omit‐
ted
it
defaults
to
the
total
num‐
ber
of
words
in
the
vari‐
able
An
aster‐
isk
metachar‐
ac‐
ter
used
as
a
selec‐
tor
selects
all
words.
This
form
gives
the
num‐
ber
of
words
in
the
vari‐
able,
and
is
use‐
ful
for
forms
using
a
[selec‐
tor]
option.
This
form
sub‐
sti‐
tutes
the
name
of
the
file
from
which
com‐
mand
input
is
being
read.
An
error
occurs
if
the
file
name
is
not
known.
This
form
is
equiv‐
a‐
lent
to
an
indexed
selec‐
tion
from
the
vari‐
able
This
is
equiv‐
a‐
lent
to
select‐
ing
all
of
argv
The
mod‐
i‐
fiers
and
can
be
applied
to
the
sub‐
sti‐
tu‐
tions
above,
as
can
and
If
curly
braces
appear
in
the
com‐
mand
form,
the
mod‐
i‐
fiers
must
appear
within
the
braces.
The
cur‐
rent
imple‐
men‐
ta‐
tion
allows
only
one
mod‐
i‐
fier
on
each
expan‐
sion.
The
fol‐
low‐
ing
sub‐
sti‐
tu‐
tions
can‐
not
be
mod‐
i‐
fied
with
mod‐
i‐
fiers:
Sub‐
sti‐
tutes
the
string
if
vari‐
able_name
is
set,
if
it
is
not.
Sub‐
sti‐
tutes
if
the
cur‐
rent
input
file
name
is
known,
if
it
is
not.
Sub‐
sti‐
tutes
the
(dec‐
i‐
mal)
process
num‐
ber
of
the
(par‐
ent)
shell.
Sub‐
sti‐
tutes
a
line
from
the
stan‐
dard
input,
with
no
fur‐
ther
inter‐
pre‐
ta‐
tion
there‐
after.
It
can
be
used
to
read
from
the
key‐
board
in
a
shell
script.
Pre-
Defined
and
Envi‐
ron‐
ment
Vari‐
ables
The
fol‐
low‐
ing
vari‐
ables
have
spe‐
cial
mean‐
ing
to
the
shell.
Of
these
and
are
always
set
by
the
shell.
Except
for
and
this
set‐
ting
occurs
only
at
ini‐
tial‐
iza‐
tion
(ini‐
tial
exe‐
cu‐
tion
of
These
vari‐
ables
are
not
mod‐
i‐
fied
unless
mod‐
i‐
fied
explic‐
itly
by
the
user.
copies
the
HP-
UX
envi‐
ron‐
ment
vari‐
able
into
the
shell
vari‐
able
the
envi‐
ron‐
ment
vari‐
able
into
the
envi‐
ron‐
ment
vari‐
able
into
and
into
copies
these
val‐
ues
back
into
the
envi‐
ron‐
ment
when‐
ever
the
vari‐
ables
are
reset.
In
a
win‐
dowed
envi‐
ron‐
ment,
if
detects
that
the
win‐
dow
has
changed
size,
sets
the
envi‐
ron‐
ment
vari‐
ables
and
to
match
the
new
win‐
dow
size.
This
vari‐
able
is
set
to
the
argu‐
ments
of
the com‐
mand
state‐
ment.
It
is
from
this
vari‐
able
that
posi‐
tional
param‐
e‐
ters
are
sub‐
sti‐
tuted;
i.e.,
is
replaced
by
etc.
This
vari‐
able
gives
a
list
of
alter‐
nate
direc‐
to‐
ries
searched to
find
sub‐
di‐
rec‐
to‐
ries
in
chdir
com‐
mands.
This
vari‐
able
con‐
tains
the
abso‐
lute
path
name of
the
cur‐
rent
work‐
ing
direc‐
tory.
When‐
ever
chang‐
ing
direc‐
to‐
ries
(using
cd),
this
vari‐
able
is
updated.
This
vari‐
able
is
set
by
the com‐
mand
line
option.
If
set,
all
built-
in
com‐
mands
and
their
argu‐
ments
are
echoed
to
the
stan‐
dard
out‐
put
device
just
before
being
exe‐
cuted.
Built-
in
com‐
mands
are
echoed
before
com‐
mand
and
file
name
sub‐
sti‐
tu‐
tion,
since
these
sub‐
sti‐
tu‐
tions
are
then
done
selec‐
tively.
For
non-
built-
in
com‐
mands,
all
expan‐
sions
occur
before
echo‐
ing.
This
vari‐
able
is
used
to
cre‐
ate
the
com‐
mand
his‐
tory
buf‐
fer and
to
set
its
size.
If
this
vari‐
able
is
not
set,
no
com‐
mand
his‐
tory
is
main‐
tained
and
his‐
tory
sub‐
sti‐
tu‐
tions
can‐
not
be
made.
Very
large
val‐
ues
of
can
cause
shell
mem‐
ory
over‐
flow.
Val‐
ues
of
10
or
20
are
nor‐
mal.
All
com‐
mands,
exe‐
cutable
or
not,
are
saved
in
the
com‐
mand
his‐
tory
buf‐
fer.
This
vari‐
able
con‐
tains
the
abso‐
lute
path
name
to
your
home
direc‐
tory. The
vari‐
able
is
ini‐
tial‐
ized
from
the
HP-
UX
envi‐
ron‐
ment.
File
name
expan‐
sion
of
tilde
refers
to
this
vari‐
able.
If
set, ignores
end-
of-
file
char‐
ac‐
ters
from
input
devices
that
are
ter‐
mi‐
nals.
exits
nor‐
mally
when
it
encoun‐
ters
the
end-
of-
file
con‐
di‐
tion
typed
as
the
first
char‐
ac‐
ter
on
a
com‐
mand
line).
Set‐
ting
ignoreeof
pre‐
vents
the
cur‐
rent
shell
from
being
killed
by
an
acci‐
den‐
tal
How‐
ever,
to
pre‐
vent
an
infi‐
nite
loop
of
EOF
input,
ter‐
mi‐
nates
if
it
receives
26
con‐
sec‐
u‐
tive
EOFs.
This
vari‐
able
con‐
tains
a
list
of
the
files
where checks
for
your
mail.
peri‐
od‐
i‐
cally
(default
is
10
min‐
utes)
checks
this
vari‐
able
before
pro‐
duc‐
ing
a
prompt
upon
com‐
mand
com‐
ple‐
tion.
If
the
vari‐
able
con‐
tains
a
file
name
that
has
been
mod‐
i‐
fied
since
the
last
check
(result‐
ing
from
mail
being
put
in
the
file),
prints
If
the
first
word
of
the
value
of
is
numeric,
that
num‐
ber
spec‐
i‐
fies
a
dif‐
fer‐
ent
mail
check‐
ing
inter‐
val
in
sec‐
onds.
If
mul‐
ti‐
ple
mail
files
are
spec‐
i‐
fied,
the
shell
says
file_name,
where
file_name
is
the
file
con‐
tain‐
ing
the
mail.
This
vari‐
able
places
restric‐
tions
on
out‐
put
re‐
di‐
rect‐
ion to
ensure
that
reg‐
u‐
lar
files
are
not
acci‐
den‐
tally
destroyed,
and
that
com‐
mands
using
append
re‐
di‐
rect‐
ion
refer
to
exist‐
ing
files.
If
set,
file
name
expan‐
sion
is
inhib‐
ited. This
is
most
use‐
ful
in
shell
scripts
that
are
not
deal‐
ing
with
file
names,
or
after
a
list
of
file
names
has
been
obtained
and
fur‐
ther
expan‐
sions
are
not
desir‐
able.
If
set,
it
is
no
longer
an
error for
a
file
name
expan‐
sion
to
not
match
any
exist‐
ing
files.
If
there
is
no
match,
the
prim‐
i‐
tive
pat‐
tern
is
returned.
It
is
still
an
error
for
the
prim‐
i‐
tive
pat‐
tern
to
be
mal‐
formed.
For
exam‐
ple,
still
gives
an
error.
If
set, noti‐
fies
you
imme‐
di‐
ately
(through
your
stan‐
dard
out‐
put
device)
of
back‐
ground
job
com‐
ple‐
tions.
The
default
is
(indi‐
cate
job
com‐
ple‐
tions
just
before
print‐
ing
a
prompt).
Each
word
of
the
path
vari‐
able
spec‐
i‐
fies
a
direc‐
tory in
which
com‐
mands
are
to
be
sought
for
exe‐
cu‐
tion.
A
null
word
spec‐
i‐
fies
your
cur‐
rent
work‐
ing
direc‐
tory.
If
there
is
no
path
vari‐
able,
only
full
path
names
can
be
exe‐
cuted.
When
path
is
not
set
and
when
users
do
not
spec‐
ify
full
path
names,
searches
for
the
com‐
mand
through
the
direc‐
to‐
ries
(cur‐
rent
direc‐
tory)
and
A
which
is
given
nei‐
ther
the
nor
the
option
nor‐
mally
hashes
the
con‐
tents
of
the
direc‐
to‐
ries
in
the
vari‐
able
after
read‐
ing
and
each
time
the
vari‐
able
is
reset.
If
new
com‐
mands
are
added
to
these
direc‐
to‐
ries
while
the
shell
is
active,
it
is
nec‐
es‐
sary
to
exe‐
cute
for
to
access
these
new
com‐
mands.
This
vari‐
able
lets
you
select
your
own
prompt
char‐
ac‐
ter
string. The
prompt
is
printed
before
each
com‐
mand
is
read
from
an
inter‐
ac‐
tive
ter‐
mi‐
nal
input.
If
a
appears
in
the
string,
it
is
replaced
by
the
cur‐
rent
com‐
mand
his‐
tory
buf‐
fer
event
num‐
ber
unless
a
pre‐
ced‐
ing
is
given.
The
default
prompt
is
the
per‐
cent
sign
for
users
and
the
char‐
ac‐
ter
for
the
super-
user.
The
num‐
ber
of
lines
from
the
his‐
tory
list
that
are
saved in
when
the
user
logs
out.
Large
val‐
ues
for
slow
down
the
dur‐
ing
startup.
This
vari‐
able
con‐
tains
the
name
of
the
file
in
which
the
pro‐
gram
resides.
This
vari‐
able
is
used
in
fork‐
ing
shells
to
inter‐
pret
files
that
have
their
exe‐
cute
bits
set
but
which
are
not
exe‐
cutable
by
the
sys‐
tem.
(See
the
descrip‐
tion
of
This
vari‐
able
con‐
tains
the
sta‐
tus
value
returned
by
the
last
com‐
mand. If
the
com‐
mand
ter‐
mi‐
nated
abnor‐
mally,
0200
is
added
to
the
sta‐
tus
vari‐
able's
value.
Built-
in
com‐
mands
which
ter‐
mi‐
nated
abnor‐
mally
return
exit
sta‐
tus
and
all
other
built-
in
com‐
mands
set
sta‐
tus
to
This
vari‐
able
con‐
tains
a
numeric
value that
con‐
trols
the
auto‐
matic
tim‐
ing
of
com‐
mands.
If
set,
prints,
for
any
com‐
mand
tak‐
ing
more
than
the
spec‐
i‐
fied
num‐
ber
of
cpu
sec‐
onds,
a
line
of
infor‐
ma‐
tion
to
the
stan‐
dard
out‐
put
device
giv‐
ing
user,
sys‐
tem,
and
real
exe‐
cu‐
tion
times
plus
a
uti‐
liza‐
tion
per‐
cent‐
age.
The
uti‐
liza‐
tion
per‐
cent‐
age
is
the
ratio
of
user
plus
sys‐
tem
times
to
real
time.
This
mes‐
sage
is
printed
after
the
com‐
mand
fin‐
ishes
exe‐
cu‐
tion.
This
vari‐
able
is
set
by
the
com‐
mand
line
option.
If
set,
the
words
of
each
com‐
mand
are
printed
on
the
stan‐
dard
out‐
put
device
after
his‐
tory
sub‐
sti‐
tu‐
tions
have
been
made.
Com‐
mand
and
File
name
Sub‐
sti‐
tu‐
tion
The
remain‐
ing
sub‐
sti‐
tu‐
tions,
com‐
mand
and
file
name
sub‐
sti‐
tu‐
tion,
are
applied
selec‐
tively
to
the
argu‐
ments
of
built-
in
com‐
mands.
This
means
that
por‐
tions
of
expres‐
sions
that
are
not
eval‐
u‐
ated
are
not
sub‐
jected
to
these
expan‐
sions.
For
com‐
mands
which
are
not
inter‐
nal
to
the
shell,
the
com‐
mand
name
is
sub‐
sti‐
tuted
sep‐
a‐
rately
from
the
argu‐
ment
list.
This
occurs
very
late,
after
input-
out‐
put
re‐
di‐
rect‐
ion
is
per‐
formed,
and
in
a
child
of
the
main
shell.
Com‐
mand
Sub‐
sti‐
tu‐
tion
Com‐
mand
sub‐
sti‐
tu‐
tion
is
indi‐
cated
by
a
com‐
mand
enclosed
in
grave
accents
The
out‐
put
from
such
a
com‐
mand
is
nor‐
mally
bro‐
ken
into
sep‐
a‐
rate
words
at
blanks,
tabs
and
new‐
lines,
with
null
words
being
dis‐
carded;
this
text
then
replac‐
ing
the
orig‐
i‐
nal
string.
Within
dou‐
ble
quotes,
only
new‐
lines
force
new
words;
blanks
and
tabs
are
pre‐
served.
In
any
case,
the
sin‐
gle
final
new‐
line
does
not
force
a
new
word.
Note
that
it
is
thus
pos‐
si‐
ble
for
a
com‐
mand
sub‐
sti‐
tu‐
tion
to
yield
only
part
of
a
word,
even
if
the
com‐
mand
out‐
puts
a
com‐
plete
line.
File
name
Sub‐
sti‐
tu‐
tion
Each
com‐
mand
word
is
pro‐
cessed
as
a
pat‐
tern
for
file
name
sub‐
sti‐
tu‐
tion,
also
known
as
and
replaced
with
a
sorted
list
of
file
names
which
match
the
pat‐
tern.
The
form
of
the
pat‐
terns
is
the
Pat‐
tern
Match‐
ing
Nota‐
tion
defined
by
reg‐
exp(5)
with
the
fol‐
low‐
ing
excep‐
tions:
· Non-
match‐
ing
lists
in
bracket
expres‐
sions
are
not
sup‐
ported.
· In
a
list
of
words
spec‐
i‐
fy‐
ing
file
name
sub‐
sti‐
tu‐
tion
it
is
an
error
for
no
pat‐
tern
to
match
an
exist‐
ing
file
name,
but
it
is
not
required
for
each
pat‐
tern
to
match.
· The
metan‐
o‐
ta‐
tion
a{b,c,d}e
is
a
short‐
hand
for
"abe
ace
ade".
Left
to
right
order
is
pre‐
served,
with
results
of
matches
being
sorted
sep‐
a‐
rately
at
a
low
level
to
pre‐
serve
this
order.
This
con‐
struct
may
be
nested.
Thus:
expands
to
whether
or
not
these
files
exist,
with‐
out
any
chance
of
error
if
the
home
direc‐
tory
for
is
Sim‐
i‐
larly,
might
expand
to
(Note
that
was
not
sorted
with
the
results
of
match‐
ing
As
a
spe‐
cial
case,
and
are
passed
undis‐
turbed.
Input/Out‐
put
The
stan‐
dard
input
and
stan‐
dard
out‐
put
of
a
com‐
mand
can
be
redi‐
rected
with
the
fol‐
low‐
ing
syn‐
tax:
Open
file name
(which
is
first
vari‐
able,
com‐
mand
and
file
name
expanded)
as
the
stan‐
dard
input.
Read
the
shell
input
up
to
a
line
which
is
iden‐
ti‐
cal
to word.
word
is
not
sub‐
jected
to
vari‐
able,
file
name
or
com‐
mand
sub‐
sti‐
tu‐
tion,
and
each
input
line
is
com‐
pared
to
word
before
any
sub‐
sti‐
tu‐
tions
are
done
on
this
input
line.
Unless
a
quot‐
ing
or
appears
in
word,
vari‐
able
and
com‐
mand
sub‐
sti‐
tu‐
tion
is
per‐
formed
on
the
inter‐
ven‐
ing
lines,
allow‐
ing
to
quote
and
Com‐
mands
which
are
sub‐
sti‐
tuted
have
all
blanks,
tabs,
and
new‐
lines
pre‐
served,
except
for
the
final
new‐
line
which
is
dropped.
The
resul‐
tant
text
is
placed
in
an
anony‐
mous
tem‐
po‐
rary
file
which
is
given
to
the
com‐
mand
as
stan‐
dard
input.
The
file name
is
used
as
stan‐
dard
out‐
put.
If
the
file
does
not
exist,
it
is
cre‐
ated;
if
the
file
exists,
it
is
trun‐
cated,
and
its
pre‐
vi‐
ous
con‐
tents
are
lost.
If
the
vari‐
able
is
set,
the
file
must
not
exist
or
be
a
char‐
ac‐
ter
spe‐
cial
file
(e.g.,
a
ter‐
mi‐
nal
or
or
an
error
results.
This
helps
pre‐
vent
acci‐
den‐
tal
destruc‐
tion
of
files.
In
this
case
the
excla‐
ma‐
tion
point
forms
can
be
used
to
sup‐
press
this
check.
Note
that
the
test
is
only
applied
to
reg‐
u‐
lar
files,
not
to
named
pipes
or
other
file
types.
The
forms
involv‐
ing
the
amper‐
sand
char‐
ac‐
ter
route
the
stan‐
dard
error
into
the
spec‐
i‐
fied
file
as
well
as
the
stan‐
dard
out‐
put.
name
is
expanded
in
the
same
way
as
<
input
file
names
are.
Uses
file name
as
stan‐
dard
out‐
put
the
same
as
but
appends
out‐
put
to
the
end
of
the
file.
If
the
vari‐
able
is
set,
it
is
an
error
for
the
file
not
to
exist
unless
one
of
the
forms
is
given.
Oth‐
er‐
wise,
it
is
sim‐
i‐
lar
to
A
com‐
mand
receives
the
envi‐
ron‐
ment
in
which
the
shell
was
invoked
as
mod‐
i‐
fied
by
the
input-
out‐
put
param‐
e‐
ters
and
the
pres‐
ence
of
the
com‐
mand
in
a
pipe‐
line.
Thus,
unlike
some
pre‐
vi‐
ous
shells,
com‐
mands
exe‐
cuted
from
a
shell
script
have
no
access
to
the
text
of
the
com‐
mands
by
default;
rather
they
receive
the
orig‐
i‐
nal
stan‐
dard
input
of
the
shell.
The
mech‐
a‐
nism
should
be
used
to
present
inline
data.
This
per‐
mits
shell
scripts
to
func‐
tion
as
com‐
po‐
nents
of
pipe‐
lines
and
allows
the
shell
to
block-
read
its
input.
Diag‐
nos‐
tic
out‐
put
can
be
directed
through
a
pipe
with
the
stan‐
dard
out‐
put.
Sim‐
ply
use
the
form
rather
than
by
itself.
CSH
UTIL‐
I‐
TIES
File
Name
Com‐
ple‐
tion
In
typ‐
ing
file
names
as
argu‐
ments
to
com‐
mands,
it
is
no
longer
nec‐
es‐
sary
to
type
a
com‐
plete
name,
only
a
unique
abbre‐
vi‐
a‐
tion
is
nec‐
es‐
sary.
When
you
want
the
sys‐
tem
to
try
to
match
your
abbre‐
vi‐
a‐
tion,
press
the
ESC
key.
The
sys‐
tem
then
com‐
pletes
the
file
name
for
you,
echo‐
ing
the
full
name
on
your
ter‐
mi‐
nal.
If
the
abbre‐
vi‐
a‐
tion
does
not
match
an
avail‐
able
file
name,
the
ter‐
mi‐
nal's
bell
is
sounded.
The
file
name
may
be
par‐
tially
com‐
pleted
if
the
pre‐
fix
matches
sev‐
eral
longer
file
names.
In
this
case,
the
name
is
extended
up
to
the
ambigu‐
ous
devi‐
a‐
tion,
and
the
bell
is
sounded.
File
name
com‐
ple‐
tion
works
equally
well
when
other
direc‐
to‐
ries
are
addressed.
In
addi‐
tion,
the
tilde
con‐
ven‐
tion
for
home
direc‐
to‐
ries
is
under‐
stood
in
this
con‐
text.
View‐
ing
a
File
or
Direc‐
tory
List
At
any
point
in
typ‐
ing
a
com‐
mand,
you
can
request
"what
files
are
avail‐
able"
or
"what
files
match
my
cur‐
rent
spec‐
i‐
fi‐
ca‐
tion".
Thus,
when
you
have
typed:
you
may
wish
to
know
what
files
or
sub‐
di‐
rec‐
to‐
ries
exist
(in
with‐
out
abort‐
ing
the
com‐
mand
you
are
typ‐
ing.
Typ‐
ing
at
this
point
lists
the
files
avail‐
able.
Files
are
listed
in
mul‐
ti‐
col‐
umn
for‐
mat,
sorted
by
col‐
umn.
Direc‐
to‐
ries
and
exe‐
cutable
files
are
iden‐
ti‐
fied
by
a
trail‐
ing
and
respec‐
tively.
Once
printed,
the
com‐
mand
is
re-
echoed
for
you
to
com‐
plete.
Addi‐
tion‐
ally,
you
may
want
to
know
which
files
match
a
pre‐
fix,
the
cur‐
rent
file
spec‐
i‐
fi‐
ca‐
tion
so
far.
If
you
had
typed:
fol‐
lowed
by
a
all
files
and
sub‐
di‐
rec‐
to‐
ries
whose
pre‐
fix
was
in
the
direc‐
tory
would
be
printed.
Notice
that
the
exam‐
ple
before
was
sim‐
ply
a
degen‐
er‐
ate
case
of
this
with
a
null
trail‐
ing
file
name.
(The
null
string
is
a
pre‐
fix
of
all
strings.)
Notice
also
that
a
trail‐
ing
slash
is
required
to
pass
to
a
new
sub-
direc‐
tory
for
both
file
name
com‐
ple‐
tion
and
list‐
ing.
Note
that
the
degen‐
er‐
ate
case
prints
a
full
list
of
login
names
on
the
cur‐
rent
sys‐
tem.
Com‐
mand
Name
Recog‐
ni‐
tion
Com‐
mand
name
recog‐
ni‐
tion
and
com‐
ple‐
tion
works
in
the
same
man‐
ner
as
file
name
recog‐
ni‐
tion
and
com‐
ple‐
tion
above.
The
cur‐
rent
value
of
the
envi‐
ron‐
ment
vari‐
able
is
used
in
search‐
ing
for
the
com‐
mand.
For
exam‐
ple
might
expand
to
Also,
lists
all
com‐
mands
(along
that
begin
with
As
an
option,
if
the
shell
vari‐
able
is
set,
a
num‐
ber
indi‐
cat‐
ing
the
index
in
is
printed
next
to
each
com‐
mand
on
a
[Con‐
trol]-[D]
list‐
ing.
Autol‐
o‐
gout
A
new
shell
vari‐
able
has
been
added
called
If
the
ter‐
mi‐
nal
remains
idle
(no
char‐
ac‐
ter
input)
at
the
shell's
top
level
for
a
num‐
ber
of
min‐
utes
greater
than
the
value
assigned
to
you
are
auto‐
mat‐
i‐
cally
logged
off.
The
fea‐
ture
is
tem‐
po‐
rar‐
ily
dis‐
abled
while
a
com‐
mand
is
exe‐
cut‐
ing.
The
ini‐
tial
value
of
is
600.
If
unset
or
set
to
0,
is
entirely
dis‐
abled.
Com‐
mand
Line
Con‐
trol
A
re-
prints
the
cur‐
rent
com‐
mand
line;
erases
the
last
word
entered
on
the
cur‐
rent
com‐
mand
line.
San‐
ity
C
shell
restores
your
ter‐
mi‐
nal
to
a
sane
mode
if
it
appears
to
return
from
some
com‐
mand
in
raw,
cbreak,
or
noe‐
cho
mode.
Sav‐
ing
Your
His‐
tory
Buf‐
fer
has
the
abil‐
ity
to
save
your
his‐
tory
list
between
login
ses‐
sions.
If
the
shell
vari‐
able
is
set
to
a
num‐
ber,
that
num‐
ber
of
com‐
mand
events
from
your
his‐
tory
list
is
saved.
For
exam‐
ple,
plac‐
ing
the
line
in
your
file
main‐
tains
a
his‐
tory
buf‐
fer
of
length
10
and
saves
the
entire
list
when
you
logout.
When
you
log
back
in,
the
entire
buf‐
fer
is
restored.
The
com‐
mands
are
saved
in
the
file
in
your
login
direc‐
tory.
EXTER‐
NAL
INFLU‐
ENCES
Envi‐
ron‐
ment
Vari‐
ables
deter‐
mines
the
col‐
lat‐
ing
sequence
used
in
eval‐
u‐
at‐
ing
pat‐
tern
match‐
ing
nota‐
tion
for
file
name
sub‐
sti‐
tu‐
tion.
deter‐
mines
the
inter‐
pre‐
ta‐
tion
of
text
as
sin‐
gle
and/or
multi-
byte
char‐
ac‐
ters,
the
clas‐
si‐
fi‐
ca‐
tion
of
char‐
ac‐
ters
as
let‐
ters,
and
the
char‐
ac‐
ters
matched
by
char‐
ac‐
ter
class
expres‐
sions
in
pat‐
tern
match‐
ing
nota‐
tion.
deter‐
mines
the
lan‐
guage
in
which
mes‐
sages
are
dis‐
played.
If
or
is
not
spec‐
i‐
fied
in
the
envi‐
ron‐
ment
or
is
set
to
the
empty
string,
the
value
of
is
used
as
a
default
for
each
unspec‐
i‐
fied
or
empty
vari‐
able.
If
is
not
spec‐
i‐
fied
or
is
set
to
the
empty
string,
a
default
of
"C"
(see
lang(5))
is
used
instead
of
If
any
inter‐
na‐
tion‐
al‐
iza‐
tion
vari‐
able
con‐
tains
an
invalid
set‐
ting,
behaves
as
if
all
inter‐
na‐
tion‐
al‐
iza‐
tion
vari‐
ables
are
set
to
"C".
See
env‐
i‐
ron(5).
when
defined,
enables
to
exe‐
cute
scripts
that
are
larger
than
1
GB.
Inter‐
na‐
tional
Code
Set
Sup‐
port
Sin‐
gle-
and
multi-
byte
char‐
ac‐
ter
code
sets
are
sup‐
ported.
WARN‐
INGS
The
file
should
be
struc‐
tured
such
that
it
can‐
not
gen‐
er‐
ate
any
out‐
put
on
stan‐
dard
out‐
put
or
stan‐
dard
error,
includ‐
ing
occa‐
sions
when
it
is
invoked
with‐
out
an
affil‐
i‐
ated
ter‐
mi‐
nal.
rcp(1)
causes
to
be
sourced,
and
any
out‐
put
gen‐
er‐
ated
by
this
file,
even
to
stan‐
dard
error
causes
prob‐
lems.
Com‐
mands
such
as
stty(1)
should
be
placed
in
not
in
so
that
their
out‐
put
can‐
not
affect
rcp(1).
has
cer‐
tain
lim‐
i‐
ta‐
tions.
Words
or
envi‐
ron‐
ment
vari‐
ables
can
be
no
longer
than
10240
bytes.
The
sys‐
tem
lim‐
its
argu‐
ment
lists
to
10240
bytes.
The
num‐
ber
of
argu‐
ments
to
a
com‐
mand
which
involves
file
name
expan‐
sion
is
lim‐
ited
to
one-
sixth
the
num‐
ber
of
bytes
allowed
in
an
argu‐
ment
list.
Com‐
mand
sub‐
sti‐
tu‐
tions
may
sub‐
sti‐
tute
no
more
bytes
than
are
allowed
in
an
argu‐
ment
list.
To
detect
loop‐
ing,
the
shell
restricts
the
num‐
ber
of
sub‐
sti‐
tu‐
tions
on
a
sin‐
gle
line
to
20.
When
a
com‐
mand
is
restarted
from
a
stop,
prints
the
direc‐
tory
it
started
in
if
it
is
dif‐
fer‐
ent
from
the
cur‐
rent
direc‐
tory;
this
can
be
mis‐
lead‐
ing
(i.e.,
wrong)
because
the
job
may
have
changed
direc‐
to‐
ries
inter‐
nally.
Shell
built-
in
func‐
tions
are
not
stop‐
pable/restartable.
Com‐
mand
sequences
of
the
form
are
also
not
han‐
dled
grace‐
fully
when
stop‐
ping
is
attempted.
If
you
inter‐
rupt
the
shell
then
imme‐
di‐
ately
exe‐
cutes
This
is
espe‐
cially
notice‐
able
if
this
expan‐
sion
results
from
an
It
suf‐
fices
to
place
the
sequence
of
com‐
mands
in
paren‐
the‐
ses
to
force
it
into
a
sub‐
shell;
i.e.,
Because
of
the
sig‐
nal
han‐
dling
required
by
csh,
inter‐
rupts
are
dis‐
abled
just
before
a
com‐
mand
is
exe‐
cuted,
and
restored
as
the
com‐
mand
begins
exe‐
cu‐
tion.
There
may
be
a
few
sec‐
onds
delay
between
when
a
com‐
mand
is
given
and
when
inter‐
rupts
are
rec‐
og‐
nized.
Con‐
trol
over
tty
out‐
put
after
pro‐
cesses
are
started
is
prim‐
i‐
tive;
per‐
haps
this
will
inspire
some‐
one
to
work
on
a
good
vir‐
tual
ter‐
mi‐
nal
inter‐
face.
In
a
vir‐
tual
ter‐
mi‐
nal
inter‐
face
much
more
inter‐
est‐
ing
things
could
be
done
with
out‐
put
con‐
trol.
Alias
sub‐
sti‐
tu‐
tion
is
most
often
used
to
clum‐
sily
sim‐
u‐
late
shell
pro‐
ce‐
dures;
shell
pro‐
ce‐
dures
should
be
pro‐
vided
rather
than
aliases.
Com‐
mands
within
loops,
prompted
for
by
are
not
placed
in
the
his‐
tory
list.
Con‐
trol
struc‐
ture
should
be
parsed
rather
than
being
rec‐
og‐
nized
as
built-
in
com‐
mands.
This
would
allow
con‐
trol
com‐
mands
to
be
placed
any‐
where,
to
be
com‐
bined
with
and
to
be
used
with
and
meta‐
syn‐
tax.
It
should
be
pos‐
si‐
ble
to
use
the
mod‐
i‐
fiers
on
the
out‐
put
of
com‐
mand
sub‐
sti‐
tu‐
tions.
All
and
more
than
one
mod‐
i‐
fier
should
be
allowed
on
sub‐
sti‐
tu‐
tions.
Ter‐
mi‐
nal
type
is
exam‐
ined
only
the
first
time
you
attempt
recog‐
ni‐
tion.
To
list
all
com‐
mands
on
the
sys‐
tem
along
enter
The
csh
metase‐
quence
does
not
work.
In
an
inter‐
na‐
tional
envi‐
ron‐
ment,
char‐
ac‐
ter
order‐
ing
is
deter‐
mined
by
the
set‐
ting
of
rather
than
by
the
binary
order‐
ing
of
char‐
ac‐
ter
val‐
ues
in
the
machine
col‐
lat‐
ing
sequence.
This
brings
with
it
cer‐
tain
atten‐
dant
dan‐
gers,
par‐
tic‐
u‐
larly
when
using
range
expres‐
sions
in
file
name
gen‐
er‐
a‐
tion
pat‐
terns.
For
exam‐
ple,
the
com‐
mand,
might
be
expected
to
match
all
file
names
begin‐
ning
with
a
low‐
er‐
case
alpha‐
betic
char‐
ac‐
ter.
How‐
ever,
if
dic‐
tio‐
nary
order‐
ing
is
spec‐
i‐
fied
by
it
would
also
match
file
names
begin‐
ning
with
an
upper‐
case
char‐
ac‐
ter
(as
well
as
those
begin‐
ning
with
accented
let‐
ters).
Con‐
versely,
it
would
fail
to
match
let‐
ters
col‐
lated
after
in
lan‐
guages
such
as
Nor‐
we‐
gian.
The
cor‐
rect
(and
safe)
way
to
match
spe‐
cific
char‐
ac‐
ter
classes
in
an
inter‐
na‐
tional
envi‐
ron‐
ment
is
to
use
a
pat‐
tern
of
the
form:
This
uses
to
deter‐
mine
char‐
ac‐
ter
classes
and
works
pre‐
dictably
for
all
sup‐
ported
lan‐
guages
and
code‐
sets.
For
shell
scripts
pro‐
duced
on
non-
inter‐
na‐
tion‐
al‐
ized
sys‐
tems
(or
with‐
out
con‐
sid‐
er‐
a‐
tion
for
the
above
dan‐
gers),
it
is
rec‐
om‐
mended
that
they
be
exe‐
cuted
in
a
non-
NLS
envi‐
ron‐
ment.
This
requires
that
etc.,
be
set
to
"C"
or
not
set
at
all.
imple‐
ments
com‐
mand
sub‐
sti‐
tu‐
tion
by
cre‐
at‐
ing
a
pipe
between
itself
and
the
com‐
mand.
If
the
root
file
sys‐
tem
is
full,
the
sub‐
sti‐
tuted
com‐
mand
can‐
not
write
to
the
pipe.
As
a
result,
the
shell
receives
no
input
from
the
com‐
mand,
and
the
result
of
the
sub‐
sti‐
tu‐
tion
is
null.
In
par‐
tic‐
u‐
lar,
using
com‐
mand
sub‐
sti‐
tu‐
tion
for
vari‐
able
assign‐
ment
under
such
cir‐
cum‐
stances
results
in
the
vari‐
able
being
silently
assigned
a
NULL
value.
Rel‐
a‐
tive
path
changes
(such
as
when
in
a
sym‐
bol‐
i‐
cally
linked
direc‐
tory,
cause
knowl‐
edge
of
the
work‐
ing
direc‐
tory
to
be
along
the
sym‐
bolic
path
instead
of
the
phys‐
i‐
cal
path.
Prior
to
HP-
UX
Release
9.0,
when
get‐
ting
its
input
from
a
file,
would
exit
imme‐
di‐
ately
if
unable
to
exe‐
cute
a
com‐
mand
(such
as
if
it
was
unable
to
find
the
com‐
mand).
Begin‐
ning
at
Release
9.0,
con‐
tin‐
ues
on
and
attempts
to
exe‐
cute
the
remain‐
ing
com‐
mands
in
the
file.
How‐
ever,
if
the
old
behav‐
ior
is
desired
for
com‐
pat‐
i‐
bil‐
ity
pur‐
poses,
set
the
envi‐
ron‐
ment
vari‐
able
to
1.
When
is
defined,
the
shell
retains
as
lit‐
tle
input
as
pos‐
si‐
ble
in
mem‐
ory.
Thus,
cer‐
tain
con‐
structs
like
that
involve
rewind‐
ing
of
the
shell's
input,
may
not
work
prop‐
erly.
Non-
inter‐
ac‐
tive
shells
will
not
read
the
file
at
the
begin‐
ning
of
exe‐
cu‐
tion.
If
required
by
the
script,
the
file
needs
to
be
read
explic‐
itly,
using
the
com‐
mand.
AUTHOR
was
devel‐
oped
by
the
Uni‐
ver‐
sity
of
Cal‐
i‐
for‐
nia,
Berke‐
ley
and
HP.
FILES
A
csh
script
sourced
(exe‐
cuted)
at
the
begin‐
ning
of
exe‐
cu‐
tion
by
each
shell. See
A
csh
script
sourced
(exe‐
cuted)
by
login
shell,
after at
login.
A
csh
script
read
at
the
begin‐
ning
of
the
exe‐
cu‐
tion
by
an
inter‐
ac‐
tive
shell. See
A
csh
script
sourced
(exe‐
cuted)
by
login
shell,
at
logout.
Source
of
home
direc‐
to‐
ries
for
Stan‐
dard
shell,
for
shell
scripts
not
start‐
ing
with
a
A
csh
script
sourced
(exe‐
cuted)
before and
when
start‐
ing
a
csh
login
(anal‐
o‐
gous
to
in
the
POSIX
shell).
Tem‐
po‐
rary
file
for
SEE
ALSO
cd(1),
echo(1),
kill(1),
nice(1),
sh(1),
umask(1),
access(2),
exec(2),
fork(2),
pipe(2),
umask(2),
wait(2),
a.out(4),
env‐
i‐
ron(5),
lang(5),
reg‐
exp(5),
tty(7).
tuto‐
rial
in
csh(1)