Re: [Hampshire] Shell foo challenge

Top Page

Reply to this message
Author: Adam Trickett
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Shell foo challenge
On Tuesday 20 Nov 2007, Adrian Bridgett wrote:
> On Mon, Nov 19, 2007 at 23:08:02 +0000 (+0000), Adam Trickett wrote:
> > Hi,
> >
> > At work I was asked if I could direct all of standard out and all
> > standard error to the same file, while sending all of standard error to
> > the console and passing standard out through grep before it went to the
> > console. It also had to work on Windows using the windows native z shell
> > (other Unix command line tools such as sed, grep and tee etc allowed). I
> > got it to work but I'm not a shell expert, any suggestions?
>
> Sounds nasty - I hate figuring out how to join the FDs together.
>
> "multitee" might come in handy.
>
> These unfortunately don't help me that much. I know how I _want_ to
> tie them together, just not how to do it using shell syntax as opposed
> to fifos.
> http://www.tldp.org/LDP/abs/html/ioredirintro.html
> http://www.tldp.org/LDP/abs/html/io-redirection.html
>


fifos would probably work well on Linux/Unix but probably not on Windows. I'll
post my solution tomorrow from work.

--
Adam Trickett
Overton, HANTS, UK

I've found that people who are great at something are
not so much convinced of their own greatness as
mystified at why everyone else seems so incompetent.
    -- Paul Graham, "Great Hackers" 2004