File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes exec() and double quotes.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "exec() and double quotes.." Watch "exec() and double quotes.." New topic
Author

exec() and double quotes..

craig sanders
Greenhorn

Joined: Sep 20, 2000
Posts: 2
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

Joined: Mar 22, 2000
Posts: 12769
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exec() and double quotes..