Windows Batch Script Feeding Arguments -
suppose have script takes couple of command-line arguments , dumps results stdout
.
manually invoking script this:
perl foo.pl arg1 arg2 arg3
without changing script in question, possible under windows take contents of file (e.g., input.txt
multi-line text file arg{1,3}
delimited whitespace on each line) , execute this:
foreach line in input.txt perl foo.pl current_line >> output.txt
right now, have perl script this, wondering if possible anyway.
i'm gonna yes.
i searched web google windows batch loops
, got page: http://www.robvanderwoude.com/for.php.
i dug around on site , found page: http://www.robvanderwoude.com/ntfor.php#for_f
so looks code like...
for /f %%variable in (input.txt) perl foo.pl %%variable >> output.txt
Comments
Post a Comment