• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exec() and double quotes..

 
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: 13061
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic