J
jimmy_please
Hi all,
I'm trying to execute a string of command using Runtime.exec. This
string may contain space or other meta-charcters which has been
escaped. Does anyone know any tools out there does the parsing and
possibly put them into an array or in a collection for me?
i.e. on the extreme side, here is a possible string (assuming user
always uses double slashes)
"\"C:\\My Test\\my test batch.bat" argA \"arg B\" \"arg\ C\" \"arg\tD\"
\"arg \/E\""
This may or may not be an everyday usecase, but it does happens.
Does anyone out there know how java.exe parse the command line string
to a string array which then used by "static void main(String[] args)"?
Thank you guys!
Jimmy
I'm trying to execute a string of command using Runtime.exec. This
string may contain space or other meta-charcters which has been
escaped. Does anyone know any tools out there does the parsing and
possibly put them into an array or in a collection for me?
i.e. on the extreme side, here is a possible string (assuming user
always uses double slashes)
"\"C:\\My Test\\my test batch.bat" argA \"arg B\" \"arg\ C\" \"arg\tD\"
\"arg \/E\""
This may or may not be an everyday usecase, but it does happens.
Does anyone out there know how java.exe parse the command line string
to a string array which then used by "static void main(String[] args)"?
Thank you guys!
Jimmy