[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

Re: Quoting problems


Hi Aaron,

Aaron Jackson wrote:
> Its quite probably that it doesnt call a subshell, rather that my
> interpretation in this case was wrong.  Reading the documentation,
> it states that calls to Runtime.exec(String[]) implies that there
> should be no parsing in the runtime as would be the case if it were
> just Runtime.exec(String).
> 
> I modified JSPCompiler.java to see if what it saw and sure enough, the args
> were correct.  This makes me think that the Win32 reference implementation
> is not passing along the arguments.  I wrote something to see what the input
> args were and sure enough, the args from Runtime.exec() did not match those
> going into the next parsing app.

Hmm, that makes it difficult/impossible to get this right. I conducted a
similar tests (see attachments); on my Linux system the arguments were
passed correctly.

> I dont know what can be done here, I tried to get around the path by using
> the
> shortened 8 format names, but Apache decided it would be smart and expand
> the names.  So for now, its probably best for me to rename all the paths or
> do a local modification to do the replacement.

I'll add a few lines explaining this to the INSTALL file.

Regards, Vincent.
public class ExecMe {
	public static void main(String args[]) {
		int		i;

		for(i = 0; i < args.length; i++) {
			System.out.println("args[" + i + "] = \"" + args[i] + "\"");
		}
	}
}

import	java.io.*;

public class ExecTest {
	public static void main(String args[]) {
		System.out.println("starting!");
		try {
			String[] arr = new String[]{"java", "ExecMe", "hoi daar"};
			Process p = Runtime.getRuntime().exec(arr);
			BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
			String line;
			while((line = in.readLine()) != null) {
				System.out.println("another line: " + line);
			}
		} catch(IOException ioexc) {
			ioexc.printStackTrace();
		}		
	}
}