From: thefed Date: 2008-01-09T06:53:21+09:00 Subject: Re: Ruby's Kernel::exec (and system and %x) On Jan 8, 2008, at 9:59 AM, JJ wrote: > On Jan 7, 5:14 pm, Nobuyoshi Nakada wrote: >> Hi, >> >> At Mon, 7 Jan 2008 05:14:59 +0900, >> JJ wrote in [ruby-talk:286375]: >> >>> In Perl, one can force the no-shell-interpreter path by calling exec >>> (and system) like so: >> >>> my $cmd = "C:\\Program Files\\..."; >>> exec( { $cmd } $cmd ); >> >> cmd = "C:/Program Files/..." >> exec([cmd, cmd]) >> >> Citing from `ri exec': >> If the first argument is a two-element array, the first >> element is the command to be executed, and the second >> argument is used as the +argv[0]+ value, which may show up >> in process listings. > > Thank you. This executes the command directly and doesn't use a sub- > shell. This is exactly what I was looking for. How would one pass args here, though? exec( ["/usr/bin/ls", "ls"], "-al") Is that right?