From: Rob Biedenharn Date: 2007-01-27T07:06:08+09:00 Subject: Re: script with -e command line option??? On Jan 26, 2007, at 4:55 PM, Wolfgang N�dasi-Donner wrote: > Suresh Unadrad schrieb: >> If I type in the following example from "Programming Ruby", I get an >> error: >> $ ruby -n -e "print if /wombat/" *.txt >> -e:1: No such file or directory - if (Errno::ENOENT) >> This is from a BASH command line on a linux system with ruby 1.8.4 > > My answer is from Windows 2000, Ruby 1.8.5, but the reason may be, > that there is no file in your directory which mathes "*.txt" > > >>>>> Example from Windows Console >>>>> > > C:\Dokumente und Einstellungen\wolfgang\Desktop>type otto.txt > Hello, world! > > I'm here to wombat all thinks, > whatever wombat means... > C:\Dokumente und Einstellungen\wolfgang\Desktop>ruby -n -e "print > if /wombat/" *.txt > I'm here to wombat all thinks, > whatever wombat means... > > >>>>> EoE >>>>> > > Wolfgang N�dasi-Donner I suspect Wolfgang is correct. The output that I get is: $ ruby -n -e "print if /wombat/" *.txt -e:1: No such file or directory - *.txt (Errno::ENOENT) Are you copying the exact message? It's odd that it thinks "if" is the name. When the file exists it appears to do what you probably expected. $ ls README app config doc log script tmp Rakefile components db lib public test vendor $ ruby -n -e "print if /wombat/" README* $ ruby -n -e "print if /Congratulations/" README* 2. Go to http://localhost:3000/ and get "Congratulations, you've put Ruby on Rails!" 3. Follow the guidelines on the "Congratulations, you've put Ruby on Rails!" screen Sorry, I didn't make a new .txt file, but just used what was handy. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com