in reply to Re: Redirection with Win9x batch files
in thread Redirection with Win9x batch files
Not to turn this into batchmonks, but you could also get rid of much of the redundancy in that big ol' batch file by using something like this (untested):
:Loop REM If there are no parameters left, just go run perl if !%1! == !! goto doit REM If there's a -L, set the log flag if !%1! == !-L! set log=1 REM If this isn't a -L, push it on to the params stack if not !%1! == !-L! set params=%params% %1 REM Shift that %1 off and continue (%2 is now %1, etc) shift goto Loop :doit if !%log%! == !1! goto Log c:\devt\perl\bin\perl.exe %params% goto ciao :Log c:\devt\perl\bin\perl.exe %params% > stdout.log :ciao set params= set log= echo on
Recursion is your friend!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
OT: Re...Redirection with Win9x batch files
by footpad (Abbot) on Dec 09, 2000 at 02:44 UTC |