Note: C shell
(csh) is the default shell for your Virtual Server.
Information on each of
these shells can be obtained from a man page
query:
You can change a Virtual Server's default login shell by using the chsh
command. When you run this command, it starts up whatever
you have set as your default editor, and it allows you
to change any of the following information:
Since C shell is the
standard with the Virtual Server, you must understand
how it works with your Virtual Server. Each shell language
is also an interpreter. Shells can be used like Perl
or other interpreted languages to write scripts, or
automate systems administration tasks. For example,
a simple csh script might look like the following:
Note: If this
script were called from the Web, the user's "environment"
would be output to the browser.
The C shell configuration
files are found in the users $HOME directory:
Other important configuration
files can be found in your ~/etc/ directory:
Note: You can
also get information about other shells, such as the
ksh, using this technique.
Obtaining Information
about C-Shell CommandsConnect to your server
via Telnet. At the command prompt type:
Note: Replace
ls with any command that you need more information
about.
C-Shell (CSH) Commands
and Descriptions
|
Command |
Description |
|
#A comment |
A script that has
the symbol # as the first character is
considered a CSH script |
|
#!shell |
Used to specify
a different shell for the script. Replace the
name shell with the path to the shell (including
Perl) that you want to use for the script |
|
Null |
Returns an exit
status of Zero |
|
* |
Wildcard symbol,
matches "any" value |
|
@ |
Assign a value
of an arithmetic expression to the variable alias
Allows you to assign an alias for a unix command. |
If you use DOS , you
may want to make aliases for DOS commands that you may
confuse with Unix commands. Store the commands .cshrc
file.
If you overwrite the
standard unix convention, call the original by appending
the forward slash to the front of the command, by entering:
|
Command |
Description |
|
bg |
Put the current
job in the background |
|
break |
Resume execution
(break out of while or foreach loop) |
|
breaksw |
Break out of switch
statement |
|
case |
Identify a pattern
in a switch statement |
|
cd |
Change Directory.
Default changes user to home directory |
|
chdir |
Same as cd |
|
continue |
Resume execution
of while or for each loop |
|
default |
Label the default
case in a switch statement |
|
dirs |
Print the directory
stack |
|
echo |
Write supplied
string to stdout |
|
end |
Ends a foreach
or switch statement |
|
endif |
Ends an if
statement |
|
eval |
Eval is
usually passed an argument. It resolves the variable
then runs the resulting command |
|
exec |
Executes a command |
|
exit |
Exit a shell script |
|
fg |
Bring job to the
foreground (see bg) |
|
foreach/end |
Runs a foreach
loop |
|
glob |
Similar to echo,
except no \ escapes are recognized. Often
used in scripts to force a value to remain the
same for the rest of the script |
|
goto |
Skips to a line
beginning with whatever string you put after the
goto command |
|
hashstat |
Display statistics
that show the success level of locating commands
via the path variable |
|
history |
Display a list
of events |
|
if |
Begin a conditional
statement |
|
Jobs-1 |
List all running
or stopped jobs |
|
kill options
id |
Terminate the process
ID(s) or job ID(s) specified |
|
kill (proc id) |
Kill the process
id number given, usually found through a ps
-auxw command. |
|
Name |
No. |
Function |
|
HUP |
1 |
Hang up |
|
INT |
2 |
Interrupt |
|
QUIT |
3 |
Quit |
|
ABRT |
6 |
Abort |
|
KILL |
9 |
Non-catchable,
non-ignorable kill, the big bomb |
|
ALRM |
14 |
Alarm Clock |
|
TERM |
15 |
Software termination
signal |
|
limit |
|
Display limits
set on a process or all limits if no arguments
are given |
|
login |
|
Replace users login
shell with /bin/login |
|
logout |
|
Terminate login
shell |
|
nice |
|
Change execution
priority for specified command |
|
nohup |
|
Prevents "command"
from terminating after terminal line is closed |
|
Notify |
|
Reports immediately
when a background job completes |
|
onintr |
|
"On Interrupt"
Handles interrupts in scripts |
|
popd |
|
Pop a value from
the stack |
|
pushd |
|
Push a value onto
the stack |
|
rehash |
|
Recompute the hash
table for the PATH variable (when you create
a new command, run rehash so the has table
finds the command |
|
Repeat |
|
Execute command
for the specified number of times |
|
Set |
|
Set a variable
to a value |
|
Setenv |
|
Assign a value
to an environmental variable name |
|
shift |
|
Shifts wordlist
variables. For example, name [2] becomes
name [1]. Use this to get values from a
wordlist in a script. |
|
source |
|
Read and execute
commands in a CSH script. For example,
if you add or modify your .cshrc file,
you can do a source .cshrc. |
|
stop |
|
Stop a background
job from running. |
|
suspend |
|
Suspend the current
foreground job (<ctrl>-z) |
|
switch |
|
Set up and argument
where what is executed depends on the value of
the variable you are matching. Used in conjunction
with the case variable. |
|
time |
|
Run a command to
show how much time it uses. Use this in a shell
script to tell how long that it took to run. |
|
umask |
|
Display or set
the file creation mask. |
|
unalias |
|
Remove an alias
from the alias list |
|
unhash |
|
Remove the internal
hash table (and instead spends the path in the
PATH variable) |
|
unlimit |
|
Remove allocation
limits on resource. |
|
unset |
|
Remove one or more
variables (as set by the set command) |
|
unsetenv |
|
Remove an environmental
variable |
|
wait |
|
Do not execute
until all background jobs are completed. |
|
while/end |
|
While loop. |