Oct 19, 2005 #1 smicro MIS Joined Dec 26, 2002 Messages 281 Location US Anyone know how to redirect output of a command to two separate files? Basically what I'm trying to do is make multiple copies of a file. I tried (cp -p errormail > errormail2) >errormail3 but doesnt seem to work. Any help would be great. Thanks!
Anyone know how to redirect output of a command to two separate files? Basically what I'm trying to do is make multiple copies of a file. I tried (cp -p errormail > errormail2) >errormail3 but doesnt seem to work. Any help would be great. Thanks!
Oct 19, 2005 1 #2 MadMichael Programmer Joined Sep 30, 2004 Messages 130 Location US You need something like: cat inputfile | tee outputfile1 > outputfile2 As far as I know, the copy command doesn't put _anything_ to standard output, so your redirect there has absolutely no effect. Upvote 0 Downvote
You need something like: cat inputfile | tee outputfile1 > outputfile2 As far as I know, the copy command doesn't put _anything_ to standard output, so your redirect there has absolutely no effect.
Oct 20, 2005 Thread starter #3 smicro MIS Joined Dec 26, 2002 Messages 281 Location US Thanks MM, Is it possible to add an outputfile3 to that? Thanks. Upvote 0 Downvote
Oct 20, 2005 1 #4 hoinz MIS Joined Jan 29, 2004 Messages 944 Location DE yes, just try another "| tee Upvote 0 Downvote
Oct 21, 2005 Thread starter #5 smicro MIS Joined Dec 26, 2002 Messages 281 Location US Thanks H! Upvote 0 Downvote