Next: Index
Up: Shell Scripts
Previous: Error Messages
The csh shell is not without bugs, and it helps to know about them. Since observing scripts
currently run under pretty much generic csh, most of these
bugs are reproducible on many machines.
This list is not exhaustive
or even near complete but you have been warned:
-
The command following an if statement on the same line
cannot be an alias. It is not expanded, and the shell will
try to find a true executable, and normally complain
``command not found''.
-
Perhaps not a bug but a feature, but
aliases cannot span multiple lines if separated by the
\ symbol.
Although the alias command does appear to report the
complete intended expanded command, during executing only the first
defined line of the alias is executed. You need to use
\\ at the end of the line, and no other characters may
appear after that, it must be followed by a newline.
-
Perhaps not so much a bug, but more a not widely known feature:
shell scripts are interpreted, and a relatively small buffer
(perhaps even one line) is kept in memory. Hence, if you edit
a running script, unpredictable things may happen.
- [?]
else clause embedded in an if causes if to end.
SUN OS 4.1.3
- [?]
if in a switch inside an if fails, missing
endif. HP/UX 9.01
Next: Index
Up: Shell Scripts
Previous: Error Messages
Peter Teuben
9/29/2000