Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!crackers!m2c!umvlsi!rkaminsk From: rkaminsk@umvlsi.ecs.umass.edu (Robert D. Kaminsky) Newsgroups: comp.unix.shell Subject: Aliases for csh command line editing Keywords: csh, history, edit Message-ID: <1406@umvlsi.ecs.umass.edu> Date: 17 Dec 90 14:29:24 GMT Organization: University of Massachusetts, Amherst Lines: 26 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'