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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fork or pipe

Status
Not open for further replies.

IMAUser

Technical User
May 28, 2003
121
CH
I am trying to do something like this

echo " Rundate is $rundate " > fileone.log
echo " Rundate is $rundate " > filetwo.log

But I dont want to do this as two lines. One the first line itself I shld be able to redirect the echo command to two files. I remember doing it some years ago, using either pipe or fork. Cant remember how.
Any clues people.

Thanks
 
#!/usr/bin/ksh

print "test"| tee file1 file2 > /dev/null

creates two files file1 and file2 with contents "test".
hth
bharix
 
You can also use the -a option of the tee command if you want to append text.

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top