Multiple redirection?

  • Thread starter Thread starter Highlander
  • Start date Start date
H

Highlander

I'm running a command in a batch file that prompts for a 'Y' or 'N' and
then a press of the Enter key. I'm able to run the command unattended
by redirecting a text file (yEnt.txt) into it, feeding it the 'Y' and
an 'Enter'.

command<yEnt.txt

Works great. The problem is, I like to redirect the output of commands
into a text file for posterity. And I can't figure out how to do that
here, since there's already one redirection present. Any ideas? Thanks.
 
Highlander said:
I'm running a command in a batch file that prompts for a 'Y' or 'N' and
then a press of the Enter key. I'm able to run the command unattended
by redirecting a text file (yEnt.txt) into it, feeding it the 'Y' and
an 'Enter'.

Works great. The problem is, I like to redirect the output of commands
into a text file for posterity. And I can't figure out how to do that
here, since there's already one redirection present. Any ideas? Thanks.

command <yENT.txt >output.log

assuming that the command output can actaully be redirected. Even better
would be

echo Y>command >output.log

which eliminates the need for that 1-character text file.
 
Gary said:
command <yENT.txt >output.log

assuming that the command output can actaully be redirected. Even better
would be

echo Y>command >output.log

Shouldn't that be 'echo Y|command ...'?
 
Back
Top