Aug 9, 2006 #1 Michael42 Programmer Oct 8, 2001 1,454 US Hello, In a Bourne shell script on Solaris 8 I commonly use the below command to send the output of a command to a file: Code: mycommand >> /tmp/my.log How can I send standard out and error to both the console AND a file? Thanks, Michael42
Hello, In a Bourne shell script on Solaris 8 I commonly use the below command to send the output of a command to a file: Code: mycommand >> /tmp/my.log How can I send standard out and error to both the console AND a file? Thanks, Michael42
Aug 9, 2006 1 #2 columb IS-IT--Management Feb 5, 2004 1,231 EU Look at the 'tee' command which does exactly this. Ceci n'est pas une signature Columb Healy Upvote 0 Downvote
Aug 10, 2006 1 #3 PHV MIS Nov 8, 2002 53,708 FR mycommand 2>&1 | tee -a /tmp/my.log Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
mycommand 2>&1 | tee -a /tmp/my.log Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Aug 10, 2006 Thread starter #4 Michael42 Programmer Oct 8, 2001 1,454 US Guys, Thanks for pointing out the tee command. That is very useful! Michael42 Upvote 0 Downvote