Useful csh alias and free csh bug

Eugene Kligerman eugene at utcsri.UUCP
Fri Mar 29 03:33:49 AEST 1985


In article <175 at tektools.UUCP> jerryp at tektools.UUCP (Jerry Peek) writes:
>In article <2592 at garfield.UUCP> andrew at garfield.UUCP (Andrew Draskoy) writes:
>> Here is a useful csh alias which I use to edit my last command.
>> I'm posting it here since others have told me that they have also
>> found it useful.
>> 
>> alias ec source ~/bin/ec
>> where ~/bin/ec contains:
>> 
>> echo !-1:q > /tmp/ec$$
>> $EDITOR /tmp/ec$$
>> cat /tmp/ec$$
>> eval `cat /tmp/ec$$`
>> rm /tmp/ec$$
>
>The first line of "ec", !-1:q, referred to the ec command *itself*,
>instead of the previous command... it should look like this instead:
>
>	echo !-2:q > /tmp/ec$$
>
>Otherwise, "ec" works great.
>
>--Jerry Peek, UNIX Training Instructor, Tektronix, Inc.

Is it possible to make this shell script accept the number of the history
command or the first few letters of the command (rather than working on the
last command)?

--

Eugene Kligerman, Department of Computer Science, University of Toronto

UUCP: {linus ihnp4 allegra floyd utzoo cornell decwrl uw-beaver}!utcsri!eugene



More information about the Comp.unix mailing list