Aliases for csh command line editing
Tom Christiansen
tchrist at convex.COM
Wed Dec 19 03:20:23 AEST 1990
[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 at 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
More information about the Comp.unix.shell
mailing list