How can I echo a line into multiple files in a single command?
Example: echo Hello World!
into file1.log and file2.log
EDIT: Windows-XP Batch Script
CHALLENGE: Give me a one-liner =D. If it can't be done w/one line I'm not interested.
My solution was
ECHO Hello World!>tmp.log & COPY file1.log + tmp.log & COPY file2.log + tmp.log
But I'm hoping for one that is a single command and not multiple commands.
If you need it only for single lines (of input) you can write your own tee with batch.
And use it with
echo hello | singleLineTee file1.log file2.log
EDIT: The same as an one liner
The
cmd /v:on /c
is necessary to enable the delayed expansionWill this suit your requirement:
You could do something similar to jeb, but keep it in the same batch file as your calling code