Multiple redirection?

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.
 
G

Gary Smith

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.
 
P

Phil Robyn

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 ...'?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top