From: ptkwt@...2.teleport.com (Phil Tomson) Date: 2001-01-07T01:40:07+09:00 Subject: [ruby-talk:8744] Backquotes `somecommand` don't work on Windows (bug) Subject: Summary: Expires: Sender: Followup-To: Distribution: Distribution: Organization: Teleport Internet Services Keywords: Cc: Using backquotes to run a system command and collect it's output does not work in Ruby under windows - this is a bug. I searched deja.com regarding this problem. And there were several posts that said that you have to append command.com /c such as: `command.com /c ver` Problem is that under NT I get: MSDOS Version 5.005.00 Instead of: Windows NT version 4.0 which is what I get when i type "ver" at the command line. The problem I'm trying to solve is to determine what type of Windows is actually running on the machine running the script - this is very difficult given the current workings of the backquote operator in Ruby. The supposed reason this doesn't work on Windows is given in a post by Dave Thomas: "The reason is that some DOS commands (such as 'dir' are implemented within the command interpreter, rather than as external programs." OK, I don't want to sound like I'm saying that "Ruby should be just like Perl", but in this case I think it should be. In Perl I can write: $result = `ver`; print "$result\n"; And it runs just fine on the various Windows platforms, and on NT I get: Windows NT version 4.0 If they figured out how to get this to work in Perl, it should be doable in Ruby. I really think this should be fixed (and I really think its possible to fix it). Sorry if I sound a bit angry, but I've spent a few hours on this one. I really intend my comments to be constructive - to help improve Ruby. Thanks. Phil