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!

Catching $?

Status
Not open for further replies.

Matsul

IS-IT--Management
May 6, 2002
140
BE
I am running

find /home -print | backup -i -f /dev/rmt0 | tee -a logfile

and I always get $? as 0 even if the backup command fails.

Of course it must be because of the tee command but is there a way to leave the tee command and catch the error level of the backup command .

thanks
 
Try this instead:
find /home -print | backup -i -f /dev/rmt0 1>/tmp/backup.log 2>/tmp/backup.err
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top