Aug 9, 2006 #1 Michael42 Programmer Joined Oct 8, 2001 Messages 1,454 Location 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 Joined Feb 5, 2004 Messages 1,231 Location 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 Joined Nov 8, 2002 Messages 53,708 Location 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 Joined Oct 8, 2001 Messages 1,454 Location US Guys, Thanks for pointing out the tee command. That is very useful! Michael42 Upvote 0 Downvote