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!

Redirect Question 2

Status
Not open for further replies.

smicro

MIS
Dec 26, 2002
281
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!
 
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.
 
Thanks MM,

Is it possible to add an outputfile3 to that? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top