Hugh Sasse Staff Elec Eng <hgs / dmu.ac.uk> writes:


> Can ruby detect the -w on the #! line?

Not just detect, but honor. Try this one:


t.rb:  #!/usr/bin/perl
       print $^O, "\n";


Then execute

       ruby t.rb

Talk about a personality change....


>  That seems an unusual arrangement!

Actually, it's pretty standard. Perl does it, as does the shell. If
you think about it, that's how Ruby gets run in the first place from
an executable script: something (either the shell or the OS) starts
reading the script, finds the #! line and says "oops, not for me, I'll 
pass this on to Ruby".


Regards



Dave