|Judago, congratulations for your article. It is helpful and clear. |
Knowing some concepts, practices, resources like that you have treated are essential and certainly save everyone a lot of digging.
I thing batch scripting is lacking of more detailed (and clear!) material for study. Nothing massive but only a good collection of catchs and tips designed for "advanced beginners" and low intermediate level users.
For instance, a beginner would never figure out this code (bellow) unless he had seen it before:
type input.txt | find /v "string1" | find /v "string2" >> output.txt
This code is trivial and everyone will see it everywhere, then it doesn't requires any help.
But there are codings that are not so trivial, like your "call echo %%test%%" or "java -version 2> #".
This second is a snippet of code by M2 in the topic "Pull Multiple Lines into Text File". It was to suit a very peculiar problem and was unthinkable for me.
Not trivial: "A code block is treated as a line ...."
Bellow, not trivial (endlocal without reset some variables / return has to be in the same code block or line).
When I get more skilled in bats I intend to make something like a handy compendium of scripts and shortcut concepts for beginners. I will do it for my son, I am certain he will enjoy it, as many others will do.
(Get cool, Judago! I will not pirate your How-To.)