From: Wyss Clemens Date: 2001-07-06T14:20:13+09:00 Subject: [ruby-talk:17379] Re: ` (back tick) on Win32 machines My logical deduction would be: "perl does NOT make use of the COMSPEC setting, but has kind of an own shell built-in". ;-) Starting from [ruby-talk:17059] I had problems with the system- (and IO.popen-) command. These commands are treated equally in the background as the back ticked command (-> popen). It ended up in [ruby-talk:17236] where I finally found the real solution/"source of problem"! I had to copy over the cygwin sh.exe into the Ruby bin directory and all commands worked as expected. Now this was with the cygwin Ruby build, but I expect, that the sh.exe also "heals" the mswin Ruby build (see below). Anybody volunteers to give the "sh.exe" a try? If cygwin is not (yet) installed on your win98/95 box I could send you the binary (and the cygwin.dll's). As the win32-build has it's own popen-command which definitely makes use of the COMSPEC (see win32/win32.c) environment variable, you would have to "set COMSPEC=c:\cygwin\sh.exe" Regards Clemens > -----Urspr�ngliche Nachricht----- > Von: Shusaku [mailto:tsyk@yk.rim.or.jp] > Gesendet am: Donnerstag, 5. Juli 2001 19:09 > An: ruby-talk@ruby-lang.org > Betreff: [ruby-talk:17333] Re: ` (back tick) on Win32 machines > > <> > > What do you get from an environment variable 'COMSPEC'? > I get this on Win2K. > > C:\WORK>echo %COMSPEC% > C:\WINNT\system32\cmd.exe > > And I get 'COMSPEC=C:\WINDOWS\COMMAND.COM' on Win98. > I'm using "ruby 1.6.4 (2001-06-04) [i586-mswin32]", compiled with VC6. > > ruby -e 'puts `dir`' # works fine. > perl -e "print `dir`" # works fine too. (ActiveState's Perl) > > Then I saw different behavior with improper COMSPEC, when perl > works still fine. > > C:\WORK>set COMSPEC=C:\Wombat.exe > C:\WORK>ruby -e 'puts `dir`' > -e:1:in ``': No such file or directory - "dir" (Errno::ENOENT) > from -e:1 > > And surprised result ... (but, Perl still worked!) > > C:\WORK>set COMSPEC= <-- remove the variable > C:\WORK>ruby -e 'puts `dir`' > -e:1: [BUG] Segmentation fault > ruby 1.6.4 (2001-06-04) [i586-mswin32] > > abnormal program termination > > -- > Shusaku >