Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!bbn!rochester!pt.cs.cmu.edu!MARCOZ.BOLTZ.CS.CMU.EDU!marcoz From: marcoz@MARCOZ.BOLTZ.CS.CMU.EDU (Marco Zagha) Newsgroups: comp.unix.questions Subject: Re: Need csh alias to match patterns in history Message-ID: <4599@pt.cs.cmu.edu> Date: 29 Mar 89 20:36:59 GMT References: <3680046@eecs.nwu.edu> Organization: Carnegie-Mellon University, CS/RI Lines: 24 In article <3680046@eecs.nwu.edu>, naim@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@cs.cmu.edu) --