From: "Ævar Arnfjörð Bjarmason" Date: 2006-01-06T02:48:55+09:00 Subject: Re: Recommended command line options for new rubyists unknown wrote: > Hi -- > > On Thu, 5 Jan 2006, John Maclean wrote: > >> I find it strange that ruby -c foo.rb gives "syntax OK" but ruby -w >> foo.rb shows me all of the syntax errors. In the example below i >> make a deliberate mistake.. > > You do, but it's not a syntax error; it's a runtime error. -c doesn't > run the code, but only checks it for syntax. -w runs the code. Or to give a simpler testcase: $ cat div0 #!/usr/bin/env ruby puts 5/0 $ ruby -c div0 Syntax OK $ ruby -w div0 div0:2:in `/': divided by 0 (ZeroDivisionError) from div0:2 -- Posted via http://www.ruby-forum.com/.