The C-Shell is more than just a command-interpreter and user interface.
The shell is a programming language which can be used to create
useful programs known as shell-scripts. Shell-scripts are analogous
to batch files in MSDOS machines, but are far more flexible and powerful.
Shell-scripts allow for the creation of variables and arrays, as well as
providing conditional statements and a means for statement repetition.
An example of a shell script follows:
#!/bin/csh # # Find any core files in current directory, or subdirectories of the # current directory # find . -name core -printThe first line of a shell script gives the path to the shell that will interpret the program. The pound sign (#) followed immediately by an exclamation point indicates that a new shell will be created. Any text following the sequence of a pound sign and a blank space is a comment, and will be ignored by the shell. The find command is used to do the dirty work of identifying any directories that contain files named 'core'.
After writing this code to a file, name the file something descriptive
and easy to type, like corefind. In order to run the script, you'll
need to make the file executable, with chmod:
chmod u+x corefind
When running a shell script written as above, you will notice a distinct
lag before the command does it's job. The reason for this lag is that
the shell you are creating is performing all the initializations
specified in your .cshrc file. You can add the -f option after
the name of the shell to force the shell to start up with default options,
thereby speeding up the execution of the program.
You can find out more about writing shell-scripts either with one of the many UNIX references, or by perusing the man pages under csh or tcsh.