Hello... see below. ----- Original Message ----- From: Niklas Backlund <d99-nba / nada.kth.se> To: ruby-talk ML <ruby-talk / netlab.co.jp> Sent: Monday, November 20, 2000 3:29 PM Subject: [ruby-talk:6476] %x{...} and ` not working? > Hi, > > I'm reading The Book, and I was trying out %x{dir} et al on > page 75... but all I get is: > > test.rb:1: command not found: dir > > I tried the backquote operator, other DOS commands... Nothing > worked! > > I also tried to use IO.popen -- Same deal! > > I'm running > > ruby 1.6.2 (2000-11-04) [i386-cygwin] > > under Win98... Any ideas? > > > /Niklas > I know what's happening, but I'm not sure how to fix it. Windows/DOS isn't UNIX, of course. The command "dir" is not an executable, but a built-in to the shell. I have a vague memory in the COMMAND.COM days of using a string like "command /c dir" from within a C program. I think it's called CMD.EXE nowadays; I tried something similar a day or two ago, but with no luck. Let us know what you find out. Thanks, Hal