I am currently using ProcessBuilder to run commands from a java server. This server should replace the old Perl server, and many of our legacy codes define platform-specific command lines.
For example, in windows, this can be done:
command -option "hello world"
and on unix, this can do:
command -option 'hello world'
The problem is that ProcessBuilder and Runtime.exec accept in tokenized command lines (for example, {"command", "-option", "hello world"} for unix and windows).
While I prefer an independent platform, we have somewhere in the range of 30 million lines of perl code in our code base. Without me writing a tokenizer for different platforms (it doesn’t matter, I just don’t want to do WTF), is there a way to let the operating system shell tokenize the command line?
tster source share