T, csh bugs

Matt Day mday at iconsys.icon.com
Mon Oct 29 16:56:24 AEST 1990


In article <3538 at idunno.Princeton.EDU> subbarao at phoenix.Princeton.EDU (Kartik Subbarao) writes:
>Have you ever tried typing:
>
>tcsh % ``
>
>Notice it will tell you "Segmentation Fault" in tcsh - but this is not the
>segmentation fault of tcsh -- it's that of the child process that tcsh forks
>due to this.

This bug (and many other classic csh bugs) are fixed in version 5.19, which
you can download via anonymous ftp from tesla.ee.cornell.edu:/pub/tcsh-5.19/...

>Bug 2:
>
>I also wanted to alias "which" as follows:
>
>% alias which "/bin/file `/usr/ucb/which \!*`"
>
>But did csh or tcsh let me? Of course not. csh decided to Abort and dump 8
>megs of core, and tcsh simply decided to fork tons of processes to fill up
>my process table when the command as not &'ed. If I did '&' it, it would
>simply hang.

That's because it's having trouble trying to accomplish what you asked it to
do, alias a command containing the execution of a command being passed the
current argument list, which just happens to contain the very same execution
of a command being passed the current argument list, etc ad nauseum, because
you told it to evaluate the command between the backquotes before defining
the alias, rather than "postponing" evaluation until you actually wanted to
use the alias, which I assume you wanted to do.  The poor [t]csh tries to
figure out your cute little recursive definition until it runs out of memory
or processes.  If you enclose the contents of the alias with single-quotes
rather than double-quotes, to "protect" the contents of the alias, it works
just fine.

As for multi-line alias support, it doesn't exist in the tcsh yet, but I'm
sure it wouldn't be impossible to add..
-- 
- Matthew T. Day, Sanyo/Icon, mday at iconsys.icon.com || uunet!iconsys!mday



More information about the Comp.unix.shell mailing list