I'm trying to figure out a script used to start the Tomcat webserver, startup.bat. There's a set of lines that I believe I understand, but I'm curious to make sure
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
oneSetArgs
etc etc
It looks like an ordinary while loop -- until the value %1 is empty, add the value of %1 to the list of arguments. The thing I want to know is -- is it somehow a default of some kind that "%1" will represent one of a list of command line arguments? In this case I don't see %1 set to anything in any part of the script. I see variables set with SET all the time, but nowhere is %1 set to anything, or declared, or even mentioned, before it reaches the code lines above. So I'm presuming it's supposed to hold a value passed to the startup.bat itself in the call to startup.bat. But for that it would have to be part of the scripting languiage itself?
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
etc etc
It looks like an ordinary while loop -- until the value %1 is empty, add the value of %1 to the list of arguments. The thing I want to know is -- is it somehow a default of some kind that "%1" will represent one of a list of command line arguments? In this case I don't see %1 set to anything in any part of the script. I see variables set with SET all the time, but nowhere is %1 set to anything, or declared, or even mentioned, before it reaches the code lines above. So I'm presuming it's supposed to hold a value passed to the startup.bat itself in the call to startup.bat. But for that it would have to be part of the scripting languiage itself?
