[Rake-devel] Question about system call and multiple arguments.

James M. Lawrence quixoticsycophant at gmail.com
Sun Nov 2 21:45:47 EST 2008


On Sun, Nov 2, 2008 at 7:29 PM, James M. Lawrence
<quixoticsycophant at gmail.com> wrote:
>
> For jruby, Rake cannot use multi-argument system() for ruby().  I
> think our hand is forced on this one.  All arguments will have to be
> escaped and passed to single-argument system().  RUBY should not
> contain the bindir path, and the constant should probably be removed
> anyway.

  system("cmd.exe", "/c", "test.bat", *args)  # works
  system("cmd.exe", "/c", "c:\\path\\to\\test.bat", *args)  # works
  system("cmd.exe", "/c", "c:\\path\\to\\foo foo\\test.bat", *args)  # fails
  system("cmd.exe", "/c", "\"c:\\path\\to\\foo foo\\test.bat\"", *args)  # fails

For jruby.bat and multi-argument sh() we could use the first form
above, though bindir is still a problem.  I don't know of another
solution.


More information about the Rake-devel mailing list