[net.sources] fc

amos@instable.UUCP (02/02/87)

If you like the ksh's idea of editing the history file, but all you
have is a vanilla csh, here's something for you. It puts your history
into a file, then activates vi on it. You may now find the command
you wish to change, and edit it. When you hit 'f4' (or whatever
you use in the 'map' command) it'll write the line in another file
and 'source' it.
The way I use it, is to put it in a file, say, f4, and
'alias fc source f4'
in my .login; of course you may alias the whole thing, but then *you*
will have to bother quoting everything properly...

NOTE: to prevent disaster en route, I've changed all ESC's to ^[,
make sure to change them back.
		o /		o /		o /		o /
-----------------X---------------X---------------X---------------X----
		o \		o \		o \		o \
history -h > /tmp/fc$$h
vi +"map #4 :.w /tmp/fc$$x^[:q\!^[" /tmp/fc$$h
cat /tmp/fc$$x
source /tmp/fc$$x; source -h /tmp/fc$$x; rm -f /tmp/fc$$[xh]
		o /		o /		o /		o /
-----------------X---------------X---------------X---------------X----
		o \		o \		o \		o \
-- 
	Amos Shapir
National Semiconductor (Israel)
6 Maskit st. P.O.B. 3007, Herzlia 46104, Israel
(011-972) 52-522261  amos%nsta@nsc.com 34.48'E 32.10'N