How to prevent tee from sending output to the screen?
I'm writing a script that puts a short line of text into each of the files f1, f2, and f3.
When done, the script prints a message that all files have been created. This is what I have:
touch newDir/f3 newDir/dir1/f1 newDir/dir1/f1 newDir/dir1/f2
echo This is the first line of text | tee newDir/f3 newDir/dir1/f1 newDir/dir1/f2
echo All files and subdirectories created!
The problem is that tee directs output to the files AND the screen. How do I prevent output to the screen? I tried to redirect the output by using > newDir/f3 newDir/dir1/f1 newDir/dir1/f2 (because I want to do them all in the same line), but I don't get the results I'm looking for.
Please explain your answer. Thank you in advance!
|