On 12/29/2010 08:27 PM, David Kramer wrote: > On 12/29/2010 02:27 PM, Jerry Feldman wrote: >> On 12/29/2010 11:52 AM, David Kramer wrote: >>> Is there a linux tool that can work as a pipe (read stdin, write to stdout) >>> and colorize any text >>> matching an regex? If not, I'll have to write one. Not that hard, but I >>> would hate to reinvent >>> it. >> While I'm not specifically answering this, I do want to comment on >> terminology. First, a PIPE is a channel that can connect 2 ports. In >> this case, the output of 1 program to the input of another program. A >> Unix program that reads from stdin and outputs to stdout (most Unix >> commands) is called a FILTER when used in this context. For instance, >> the pr(1) command is almost always used in this context. As also >> mentioned, grep(1) is also a filter, and many times it is: >> cat foo | grep <pattern> | grep -v <excluded stuff> >> This is kind of an example of using grep as a filter. > Yup. I meant filter. Thanks. I was trying to fit the email in during > a compile cycle, so I didn't give it as much thought as I should have. > > While "I knew what I meant", thank you for clarifying in case I > confuzled anyone on the list. > >> I don't think that grep is the answer, but sed(1) is another command >> that can alter a line of text based upon regular expressions. I don't >> know exactly what you mean by colorize, but you certainly can take one >> or more patterns(regex) and convert them to whatever you want. > Yes, sed would be much more appropriate for this that grep (because I > use search and replace to do more complicated things), if colorize > doesn't work out for some reason. Please let us know the results.
-- Jerry Feldman <g...@blu.org> Boston Linux and Unix PGP key id: 537C5846 PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB CA3B 4607 4319 537C 5846
_______________________________________________ Discuss mailing list Discuss@blu.org http://lists.blu.org/mailman/listinfo/discuss