Help! Csh is eating my brain....
P. D. Guthrie
pdg at ihdev.UUCP
Sat Oct 19 02:34:07 AEST 1985
In article <366 at zaphod.UUCP> flory at zaphod.UUCP (Trevor Flory) writes:
>Hello All;
> I'm trying to debug a csh script written by someone who
> knew what he was doing I'm sure. Below is a fragment of
> the script which I find rather difficult to understand:
> ...
> alias readandset 'echo -n \!:1 ; set \!:2 = $< '
> ...
> readandset "Choice? " chvar
> ...
> if("$chvar" == "quit") ....
>
> In particular I'd like to know what \!:1 or \!:2 means/does.
>
This notation simply replaces itself with the corresponding arguments in
the original line, so it echos the first argument, and sets the second
one to a line from stdin. Why doesn't ksh have something like this? I
hate having to use fc and mess around with its output - and that's soooo
inefficient!
Paul Guthrie
More information about the Comp.unix
mailing list