Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grab stderror 2

Status
Not open for further replies.

hokky

Technical User
Nov 9, 2006
170
AU
Hi guys,

Just quick question

Do you guys know how to view to stderr also grab it and put it into the file ?

like 'tee' command ? But tee only available for stdin only

I know how to put it in file ? but I need to view it on screen and put it in file at the same time.

Thanks guys
 
Only thing I can think of:

command 2>&1 | tee /dev/tty >/tmp/outfile

But then stdout and stderr are mixed in one file...


HTH,

p5wizard
 
Hi p5wizard,

can you explain what '/dev/tty' means ?

Thanks man
 
/dev/tty is a special device for your process which points to "your terminal" which could be a /dev/ttyNN or a /dev/ptyNN or a /dev/pts/NN.

So by using /dev/tty, your scripts don't have to worry about what kind of terminal connection they're running on.


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top