Hi!

While attempting to compile and tweak extconf.rb for wxruby bindings
I've discovered that backticking gives different results in Linux and in
MinGW & MSYS environment.

Here is the result:

ggd@gaura:~> ruby -v
ruby 1.8.0 (2003-07-24) [i686-linux]
ggd@gaura:~> cat t.rb
puts `wx-config --cxx`
ggd@gaura:~> ruby t.rb
c++
ggd@gaura:~> irb
irb(main):001:0> `wx-config --cxx`
=> "c++\n"

The same is if I use:

ggd@gaura:~> cat t.rb
puts %x(wx-config --cxx)


However under Win platform & MSYS environment which uses POSIX notation:

ggd@GGD ~
$ ruby -v
ruby 1.8.0 (2003-07-24) [i386-mingw32]

ggd@GGD ~
$ ruby t.rb
t.rb:1:in ``': No such file or directory - wx-config --cxx (Errno::ENOENT)
        from t.rb:1

ggd@GGD ~
$ irb
irb(main):001:0> `wx-config --cxx`
`wx-config --cxx`
Errno::ENOENT: No such file or directory - wx-config --cxx
        from (irb):1:in ``'
        from (irb):1

$ wx-config --cxx
c++


The same error if I use %x delimiter instead of backtick.

Is it a Ruby bug?

The Ruby cannot find shell script wx-config, although it is in the PATH (/mingw/bin).

Here is the output for PATH variable:

from MSYS (shell):

$ echo $PATH
.:/usr/local/bin:/mingw/bin:/bin:/mingw/BIN:/mingw/LIB:/j/DOS:/j/MERGE:/c/WINDOWS:/c/WINDOWS/COMMAND:.

from Ruby:

$ ruby t.rb
.;C:\MSYS\1.0\local\bin;c:\MinGW\bin;C:\MSYS\1.0\BIN;c:\MinGW\BIN;c:\MinGW\LIB;j:\DOS;j:\MERGE;c:\WINDOWS;c:\WINDOWS\COMMAND;.


from irb:

$ irb
irb(main):001:0> ENV['PATH']
ENV['PATH']
=> ".;C:\\MSYS\\1.0\\local\\bin;c:\\MinGW\\bin;C:\\MSYS\\1.0\\BIN;c:\\MinGW\\BIN;c:\\MinGW\\LIB;j:\\DOS;j:\\MERGE;c:\\WINDOWS;c:\\WINDOWS\\COMMAND;."
irb(main):002:0> 

Is it normal behaviour?

Under Linux, all three cases gives identical result.

Sincerely,
Gour
 
-- 
Gour
gour / mail.inet.hr
Registered Linux User #278493