Aliases for csh command line editing

Robert D. Kaminsky rkaminsk at umvlsi.ecs.umass.edu
Tue Dec 18 01:29:24 AEST 1990


I find the following aliases useful.  Possibly you will too...

The first two aliases allow for command line editing from the history.
They are meant to be used only in the csh.  The next two aliases print the
history in 2 and 3 column format.

Just source (i.e source filename) the stuff below "CUT HERE".

--------------------------------- CUT HERE -------------------------------
#  The following aliases allow for editing commands given in the csh.
#
#     e n  -  visual edits command n (as numbered by history)    
#     ee   -  visual edits last command
#
#  Note: Both use an invisible work file called ".e_cmd" in the home directory.
#
#  By Robert Kaminsky  11/19/90

alias e '( history | sed -n "/^ *\!*[^0-9]/p" | sed 's/.......//' ) >&! ~/.e_cmd ; \vi -w002 ~/.e_cmd ; source -h ~/.e_cmd ; source ~/.e_cmd'
alias ee '( history | tail -2 | sed -n "1p" | sed "s/.......//" ) >&! ~/.e_cmd ; \vi -w002 ~/.e_cmd ; source -h ~/.e_cmd ; source ~/.e_cmd'

# ---------------------------------------------------------------------------
#  The following alias print out the command history in 2 and 3 column format.

alias his3 'history 45 | pr -3 -l15 -t | expand | cut -c1-71,72'
alias his2 'history 30 | pr -2 -l15 -t | expand | cut -c1-71,72'



More information about the Comp.unix.shell mailing list