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!

How to capture output of a command to a file 1

Status
Not open for further replies.

pdtak

Technical User
Feb 25, 2008
63
US
I'm having trouble capturing output from the following command on AIX:

grpck -n ALL > error.out

It gives me the results on the screen but my file is blank.

I have no trouble capturing output from "ls > ls.out", but doesn't seem to work with the grpck command.

Any ideas?

Thanks.
 
It is probably spitting to stderr.

csh:

map both stdout to stdin >&

grpck -n ALL >& error.out

only stderr 2>

grpck -n ALL >& error.out

bourne:

map both stdout to stdin

grpck -n ALL > error.out 2>&1

only stderr, like csh


 
grpck -n ALL > error.out 2>&1 worked!
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top