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!

I/O Redirection

Status
Not open for further replies.

johndrake

Technical User
Jul 25, 2002
97
Hi All,

I'm a newbie and I have a question. Below is an excerpt from a script that I am writing---this code is
in the script that I am executing:

for i in `find . -type f |cat`
do
`compress $i 1> $ARCH_LOG 2> $ARCH_LOG `
done

I want to capture the standard error and output into this
log file. Unfortunately, it still comes back to the screen and the file is 0 bytes in size.

How would I capture the Standard Error/Output to above file?

Thanks!

-Joe
 
You may try this:
Code:
   for i in `find . -type f ! -name '*.Z'`
   do
       compress $i
   done >$ARCH_LOG 2>&1

Obviously the ARCH_LOG variable contains a valid pathname ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi,

Thanks! Works like a charm.

-Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top