Path: utzoo!attcan!uunet!iconsys!mday From: mday@iconsys.icon.com (Matt Day) Newsgroups: comp.unix.shell Subject: Re: T, csh bugs Keywords: Bugs, Bugs, Buts Message-ID: <1990Oct29.055624.8146@iconsys.icon.com> Date: 29 Oct 90 05:56:24 GMT References: <3538@idunno.Princeton.EDU> Organization: Sanyo/Icon International, Inc., Orem, Utah Lines: 39 In article <3538@idunno.Princeton.EDU> subbarao@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@iconsys.icon.com || uunet!iconsys!mday