[plug] saving screen output

Russ Pitman rjp at westnet.com.au
Tue Feb 22 21:33:50 WST 2005


Leon Brooks wrote:
> On Tuesday 22 February 2005 20:26, Russ Pitman wrote:
> > I need to save the output of a command to a file so it can be
> > included/attached to an email message.
> 
> Be aware that there are two commonly used output streams, stdout (normal 
> stuff, fd #1) and stderr (errors, #2) and one input, stderr (#0). Read 
> up on stdaux and stdprn if you're curious about the others.
> 
> > The command is 'exim -d -bt xxxxan at westnet.com.au' which produces
> > approx two pages of output.
> 
> > Running the above with '< eximcmd' appended generates a file
> > 'eximcmd' containing just two lines of text ?
> 
> That would be '> eximcmd'; but what you really wanted was:
> 
>     exim -d -bt xxxxan at westnet.com.au &> eximcmd

That's the ticket!!
Thanks Leon.

> 
> This captures stderr as well. You could do the same thing with:
> 
>     exim -d -bt xxxxan at westnet.com.au 2>&1 > eximcmd
> 
> This says "send stderr to the same place as stdout" then "jam stdout 
> into a file called eximcmd".
> 
> Type man:bash into Konqueror one day. You'll be amazed. (-:
> 
> Cheers; Leon

Thanks to all for taking the time.

This list is great.   

--
Russ.



More information about the plug mailing list