Hi All,
I have a unix script which runs like below.
echo -e "Y\nY"|perl test.plx
test.plx prompts for two user inputs and echo used to pass these parameters.
can anybody tell me how i can use the same in DOS/Batch program.
Thanks,
Arun
what is the dos command equivalent of echo?
Moderator: DosItHelp
Re: what is the dos command equivalent of echo?
Try these two options. It depends if perl.exe accepts redirected or piped input.
Code: Select all
@echo off
>temp.tmp echo Y
>>temp.tmp echo Y
type temp.tmp|perl test.plx
del temp.tmp
Code: Select all
@echo off
>temp.tmp echo Y
>>temp.tmp echo Y
perl test.plx <temp.tmp
del temp.tmp
Re: what is the dos command equivalent of echo?
Yes.. i tried both options.. But no luck 

Re: what is the dos command equivalent of echo?
Change the Perl script to get the arguments from the command line. It can take command line arguments the same way batch files can.
foo.pl Y N
foo.pl Y N
Re: what is the dos command equivalent of echo?
But thing is i should not be editing the perl script.. Its used by many others and just for my purpose i need this to be done.
Re: what is the dos command equivalent of echo?
Call your copy of the script something else, and make a batch file to run it.
Anyone else that uses the PC can still use the conventional commands.
Anyone else that uses the PC can still use the conventional commands.
Re: what is the dos command equivalent of echo?
there are complications again.. its not just that.. the script keeps changing.. and there are many other constraints too.. i want to if it is possible to pass two parameters using echo command.. or any other command..