[Rake-devel] Tracking some discrepancies on Windows
assaf at labnotes.org
Thu Oct 23 23:00:30 EDT 2008
On Thu, Oct 23, 2008 at 10:40 AM, Luis Lavena <luislavena at gmail.com> wrote:
> Hello everybody.
> I'm just investing a bit fixing some issues I found with latest 0.8.3
> release and are hitting me hard to maintain One-Click installer.
> One of those is related to rake_system call and the "call" added, and
> others are related to ruby and sh commands.
> I forked the project and added some fixed in windows branch:
> So using that as base, I found the following discrepancy:
> Keep in mind that this version of ruby (patchlevel 114) has been
> patched to solve the $? existstatus issues found in previous versions
> of Ruby for Windows.
> Looking more closer, I believe Kernel::system with mutliple arguments is
> ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]
> irb(main):001:0> ENV['FOO'] = "hello"
> => "hello"
> irb(main):002:0> system "echo", "$FOO"
> => true
> irb(main):003:0> system "echo $FOO"
> => true
If you call system with a single argument, that argument goes through shell
expansion (env variables, glob patterns, escaping, etc). If you call with
multiple arguments, the first one is the executable name, the rest are
passed as command line arguments without shell expansion. In other words,
call system with multiple arguments if you want to bypass shell expansion.
> Luis Lavena
> AREA 17
> Human beings, who are almost unique in having the ability to learn from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams
> Rake-devel mailing list
> Rake-devel at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rake-devel