Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!eugene From: eugene@utcsri.UUCP (Eugene Kligerman) Newsgroups: net.unix Subject: Re: Useful csh alias and free csh bug Message-ID: <941@utcsri.UUCP> Date: Thu, 28-Mar-85 12:33:49 EST Article-I.D.: utcsri.941 Posted: Thu Mar 28 12:33:49 1985 Date-Received: Thu, 28-Mar-85 12:43:17 EST References: <2592@garfield.UUCP> <175@tektools.UUCP> Reply-To: eugene@utcsri.UUCP (Eugene Kligerman) Distribution: net Organization: CSRI, University of Toronto Lines: 34 Keywords: history command In article <175@tektools.UUCP> jerryp@tektools.UUCP (Jerry Peek) writes: >In article <2592@garfield.UUCP> andrew@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