Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ig!ames!ncar!boulder!pichon!rsk From: rsk@pichon.colorado.edu (Rich Kulawiec) Newsgroups: comp.mail.elm Subject: Csh alias for use with filter & filter suggestion Message-ID: <10439@boulder.Colorado.EDU> Date: 2 Aug 89 19:53:13 GMT Sender: news@boulder.Colorado.EDU Reply-To: rsk@pichon.colorado.edu (Rich Kulawiec) Organization: University of Colorado at Boulder Computer Science Department Lines: 22 I've noticed that one some occasions ([a] tracking down something logged in the .filter-errors file and [b] trying to figure why a particular message got shoved into a particular file when it's non-obvious) that I want to answer the question: "What is rule #X?" I'm not aware of any really handy way to do that, so I wrote this csh alias: alias rule 'cat -n ~/.filter-rules | egrep " \!* " | sed -e "s/ contains//" -e "s/. save/-> /"' Usage: rule This relies on your machine's cat(1) having the -n flag, which causes the lines to be numbered. It's admittedly a hack, but I was starting to type "cat -n..." quite a bit... Now for the suggestion: how about a flag to filter that causes it to replicate this behavior? That is, "filter -r 17" should print rule 17. From what I can tell, most of the code is already in there, since filter writes the number of the rules it uses in the ..filterlog/.filtersum files. Cheers, Rich Kulawiec, University of Colorado at Boulder Computer Science Department rsk@boulder.colorado.edu, boulder!rsk