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!

Standard error to output and file

Status
Not open for further replies.

parbhani

Technical User
Jul 3, 2002
125
GB
Hi friends,

A quick one.

In ksh, how to do the following ,
1) I want to direct the standard error to standard output
2) I want to direct standard output and error to a file

Please convey.

Cheers
 
1. redirect stderr to stdout
command 2>&1

2. redirect stderr & stdout to file
command 2>errfile 1>outfile

if you want both into the same file,
command 2>file 1>file
or
command > file 2>&1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top