I have a script that I'm running from a command line. I want the stdout and stderr to be displayed on the screen and also to be copied into a logfile with append.
What is the syntax for this piping/redirection?
command-line-interfacems-dospiperedirectwindows-xp
I have a script that I'm running from a command line. I want the stdout and stderr to be displayed on the screen and also to be copied into a logfile with append.
What is the syntax for this piping/redirection?
Best Answer
Give this a try:
The
for
command iterates over the output lines of the script. The carets escape the characters that follow them. The firstecho
goes to the screen and the second is appended to the file named "log".Note that Powershell has the
tee
command.