Need csh alias to match patterns in history

Naim Abdullah naim at eecs.nwu.edu
Fri Mar 24 12:46:14 AEST 1989


A friend of mine wants a csh alias that will print all lines in
the history list that match a pattern if one is supplied, otherwise
just print the history.

He asked me and I suggested the following csh alias:

alias h ' \
if ( "X\!*" == "X" ) then \
history \
else \
history | grep \!* \
endif'

For some reason, this does not work. Can some kind soul explain why
and supply a working answer to this problem ?

Thanks.

		      Naim Abdullah
		      Dept. of EECS,
		      Northwestern University

		      Internet: naim at eecs.nwu.edu
		      Uucp: {oddjob, chinet, att}!nucsrl!naim



More information about the Comp.unix.questions mailing list