From: "Xavier Noƫlle" Date: 2011-03-02T22:29:04+09:00 Subject: Re: exec using sh -c or directly running the command, depending on the system 2011/3/2 Brian Candler : > Looks like there was a change in Ruby, where perhaps it now does an > optimisation to check for cases where a shell isn't required (e.g. no > pipelines or redirection) That's what I noticed with quoting, but I never managed to take advantage of this feature. Well, more precisely, I tried to cheat Ruby by quoting every command line argument, which works on a system, but not the others (don't know if it's a matter of version, system, or something else). What works is to append a fake redirection to the command itself, but it's...ugly ^^ > You could make it consistent by using the multi-argument form of exec, > which I believe will bypass the shell in all cases: Works in this case, thanks ! What about the case in which a shell is needed ? Is there a way to force Ruby to use a subshell instead of doing everything by itself ? -- Xavier NOELLE