![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pipelining Processes | Trivialnight | High Level Programming | 3 | 02-23-2005 12:02 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Pipelining
My problem is more a question of how to do it more elegantly than how to do it at all. The problem: I have a pipeline which has to write to the screen AND to a logfile: proc1 | tee -a <logfile> What makes things difficult is i also need the return code of proc1. But proc1 | tee -a <logfile> ; print - "$?" will only display the exit code of tee, not of proc1. Of course I could use a solution with an intermediate file like: Code:
proc > tmpfile ; RC=$? cat tmpfile | tee -a <logfile> print - "$RC" rm tmpfile This solution would work but even not taking into account that the output is displayed after instead of concurrently to the execution of proc1 to me it looks clumsy and I'd be thankful for input on how to do it better. Thanks bakunin |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|