Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

exec() and double quotes..  RSS feed

 
craig sanders
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in java 1.1.8.7 for aix i'm run into an interesting problem.. in my servlet i run the following: <edited for length>
...
sProcess = sPath + "User -create -login " + sEmpID + " -address " + eEmpEmail + " -name \"" + sEmpName + "\"";
Process createUser = Runtime.getRuntime().exec(sProcess);
...
the java (or servlet engine - WebSphere 3.0.2.2) seems to be stripping off the double quotes that i need around the name above.. any ideas on how to fix this? (without upgrading java -- because WebSphere will supposedly not work w/ a higher version)
-cs
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might try one of the other forms of exec, that take an array of String for the command line parameters. That will eliminate the parsing step which appears to strip the quotes.
Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!