From: "Stephan Kämper" Date: 2004-06-23T23:38:18+09:00 Subject: Re: [OT] #! with WinXP's cmd.exe Hi Shashank, Hmmm, I'm getting more and more puzzled by this... Shashank Date wrote: > > >>But the #! functionality (or is it a cmd.exe >>bug? ;-) ) was completely new to me. > > And so it is to me too :-0 > It must be in combination with some thing, because when I do: 8< snip -------- > > It doesn't seem to work ... or have I mis-read your statements? > -- shanko > Yes, you're right. Apparently it's not *only* the #! line... Rename j.cmd to j.rb and your example should work again. Using an unknown file suffix, say 'foobar' leads to a Windows dialog that complains about an unknown file type. Another 'experiment': I changed the #! line so as to point to my editor and saved it with the Ruby suffix (.rb). And as I (at least to a certain extent) expected the editor was opened. So my conclusions are: - My guess that cmd.exe can handle the #! line obviously is wrong. - The assoc/ftype settings do in fact determine which executable is used to run/open the given file. - Notwithstanding there's experimental evidence that changing the #! line does change the behaviour. As long as it's a Ruby file... Hey wait! Just a moment... Did I read somewhere that Ruby itself interprets a #! line? (Hey, we just managed to get on-topic again...) I faintly remember that Ruby could run Perl scripts if only they have a appropriate #! line. Is there anybody out there how could confirm this? Happy rubying Stephan