From: Robert Klemme Date: 2008-02-12T01:59:56+09:00 Subject: Re: how to say # in ruby On 11.02.2008 14:25, Tim Hunter wrote: > Robert Klemme wrote: > >> I'm not sure what you're at here. You posted code from the Ruby >> interpreter but the magical bit of shebang is done by the shell or OS >> not Ruby. > > Bear in mind that if the shell started the program and the program > specified on the shebang line wasn't the ruby interpreter, the code > quoted above doesn't run. > > Since it is running, somehow the ruby interpreter has been started and > given a file containing text that may or may not actually be Ruby code. > This could happen if you started ruby by explicitly executing the "ruby" > command, or if you're running on Windows where there is no shell to do > shebang interpreting for you. > > That bit of code inspects the shebang line and, if the word "ruby" > doesn't appear on the line, it tries to execute what it assumes is a > program. Sure, but from the thread it's not clear whether Ben did mean that bit of magic or whether Gerry was aware of the other magic of shebang. That's why I asked. Cheers robert