!-substitution feature allowed previous commands to be re-executed or edited in a variety of ways.Arrays :Variables could contain multiple elements, which could be numerically indexed.
~expansion :Home directory by username lookup, using
~was popular enough that most modern, Unix-based Web servers now support it , in addition to most shells.Aliases :A command could be aliased to another command or command sequence.Math operations :Provided arithmetical operations which sh does not provide except by calling external programs.
Variable assignment was also performed slightly differently with "
set a = b" rather than Bourne shell's "
An example of possibly unwelcome behaviour of csh scripts is the following:
if (! -e foo ) echo bar > fooIt would appear to say "if file 'foo' does not exist, create it with contents 'bar'". But it will in fact create an empty file, as the line is parsed such that the output redirect is set up before the file existence is tested. (These and other criticisms do not, however, apply to the more-modern Hamilton C shell variant of the csh language. Also, if the above example were written using the full 'if then endif' construct, then the file 'foo' will contain the word 'bar' and hence csh does what was intended.)
If scripts are written in csh, it is often useful to run the script with the -f flag, (e.g. by starting with the line #!/bin/csh -f) in order to avoid running the user's setup file as this may affect the script's behaviour.
Another known problem of csh is its message "0 event not found", which yields no information about what the problem is.
Shell, GM Join on FCV, Hydrogen Project in D.C.(Shell Hydrogen, General Motors team for fuel cell vehicle, hydrogen projet)
Mar 07, 2003; Shell Hydrogen recently announced it has signed a memorandum of understanding (MOU) with General Motors (GM) Corporation to...