My intention is to run a perl script latexdiff.pl
from a portable version of perl. There is a batch file portableshell.bat
which sets up the environment for perl. If I open it and type perl latexdiff.pl additional_arguments
, the program works nicely. However, I want to automate it. I created a batch file useLatexdiff.bat
and put the following into it:
portableshell.bat
perl ..\MiKTeX\texmfs\install\scripts\latexdiff\latexdiff.pl
The perl environment is properly set up, but the second line is not executed. How can I achieve to execute the second line?
Note: It is a common question. Another use-case is to open a Unix shell and after that execute Unix commands from that shell.
Answer
Your problem is that a batchfile works as follows: It executes a command and waits for that command to finish before going to the next.
So in your case, it waits at portableshell.bat until it fihishes, which probably does not happen.
Luckily, there are several methods you can do to execute a command and skip to the next one without waiting for the first one to finish. For calling batch files, you can use call filename.bat to call it and immediately skip to the next row.
Your batch file would look like this:
call portableshell.bat
perl ..\MiKTeX\texmfs\install\scripts\latexdiff\latexdiff.pl
If you have executables, such as the perl one that you want to have the same thing happening to, use the command start
.
Although the above should work, if it doesn't, you may want to edit the portableshell.bat file and append teh perl command at the very end.
No comments:
Post a Comment