Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!rutgers!sun-barr!newstop!texsun!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.shell Subject: Re: Aliases for csh command line editing Keywords: csh, history, edit Message-ID: <1990Dec18.162023.6592@convex.com> Date: 18 Dec 90 16:20:23 GMT References: <1406@umvlsi.ecs.umass.edu> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 31 Nntp-Posting-Host: pixel.convex.com [too busy to leave much comment. just play.] % alias e 'source ~/scripts/redo.csh' % cat ~/scripts/redo.csh # Edit history list at line containing last command (open mode). # To work properly, put in .login: alias r source ~/redo # Origianl uthor unknown. Mods by tchrist. history -h >! /tmp/redo.$$ # Make CR map to :wq! and start ex quietly at 2nd to last line in open mode. # map Q to quit and not execute ex - '+map tail -1 /tmp/redo.$$ >! /tmp/cmd.$$ # Insert into history without executing. source -h /tmp/cmd.$$ # Clear out temporaries. /bin/rm -f /tmp/{cmd,redo}.$$ # If thing chosen to redo is the redo alias itself then DON'T redo it. if ("!-2:0" != "!!:0") then !! endif -- Tom Christiansen tchrist@convex.com convex!tchrist "With a kernel dive, all things are possible, but it sure makes it hard to look at yourself in the mirror the next morning." -me