yet another csh bug and fix

Dan Smith, not your average Lithuanian... daniel at unicom.UUCP
Tue Mar 29 15:55:03 AEST 1988


In article <470 at sbsvax.UUCP> greim at 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



More information about the Comp.bugs.4bsd.ucb-fixes mailing list