Path: utzoo!mnetor!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!ucsfcgl!pixar!unicom!daniel From: daniel@unicom.UUCP (Dan Smith, not your average Lithuanian...) Newsgroups: comp.bugs.4bsd Subject: Re: yet another csh bug and fix Message-ID: <297@unicom.UUCP> Date: 29 Mar 88 05:55:03 GMT References: <470@sbsvax.UUCP> Reply-To: daniel@unicom.UUCP (Dan Smith, not your average Lithuanian...) Organization: Science Computer Center, MCC, Kentfield, CA Lines: 34 Keywords: csh bug alias substitution endless-loop In article <470@sbsvax.UUCP> greim@sbsvax.UUCP (Michael Greim) writes: >Symptoms: > > There is an 4bsd undocumented feature of history mechanism in csh. > With !# you can get the whole last command. > When you try > alias a '\!#' > b;a > the csh will take a loooooooong time. Quite probably it will dump > core. It is not neccessary for b to have any special value or > even to exist. > whoa! quick comment time... I'm running 4.3 BSD on a Vax 11/750, and Sun 4.2 R3.5 on various Suns. The use of "!#" is "the command line typed in so far..." very useful for things like renaming files via: mv longfilename.c really!#:1 which gives you "reallylongfilename.c". I've never had to use things like "!#:2-4", but that's possible, as well as: "echo this is !#:1:s/is/at" For more clarification (This is *not* "the last command", at least on the versions I mentioned...), see "The C Shell Field Guide" by Gail & Paul Anderson. I hope this averts some confusion among csh users reading this :-) dan dan smith, island graphics, marin co, ca|"A womp ba ba lu ba, a womp bam boom!" uucp: {ucbvax!ucbcad,sun}!island!daniel | ph: +1 (415) 491 1000 (W), 332 FAST, uucp: pixar!unicom!daniel, well!daniels | 332 EASY (H)| unix/guitars/films/tuna