Need csh alias to match patterns in history
Marco Zagha
marcoz at MARCOZ.BOLTZ.CS.CMU.EDU
Thu Mar 30 06:36:59 AEST 1989
In article <3680046 at eecs.nwu.edu>, naim at eecs.nwu.edu (Naim Abdullah) writes:
>
> 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 ?
I think this will do the trick:
alias hh 'history | grep "\!*"'
This works because 'grep ""' is not the same as 'grep'.
Your alias produces strange behavior. Neither the "if" or the "else"
condition is ever executed. I don't know why.
== Marco (marcoz at cs.cmu.edu)
--
More information about the Comp.unix.questions
mailing list