From: Ross Bamford Date: 2006-11-25T18:49:18+09:00 Subject: Re: syntax error On Sat, 2006-11-25 at 16:40 +0900, Une b辿vue wrote: > something strange, if i run my script like that : > > $ /opt/local/bin/ruby myscript.rb > > no prob > > the shebang in my script is : > > #!/usr/bin/env ruby -w > > which ruby give me the above ruby (under /opt) > > then, running this script as : > > $ ./myscript.rb i get an error on line 8 : > ./wav2xml.rb: line 8: syntax error near unexpected token `(' > ./wav2xml.rb: line 8: ` fxml=file.gsub(/(.*)\.wav/,'\1.xml')' > > the major difference is upon the "-w" option within the shebang however, > if i delete this option i do have the same error. > The error you're seeing isn't from Ruby - it's your shell trying to interpret the ruby code. This problem has been encountered before, e.g: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/76135 and FWIW it doesn't work on my Linux either. -- Ross Bamford - rosco@roscopeco.REMOVE.co.uk