From: Chris Hulan Date: 2008-02-07T15:40:01+09:00 Subject: Re: how to say # in ruby On Feb 6, 3:45 pm, Tim Hunter wrote: > Gerry Ford wrote: ... > I would've guessed that it didn't matter, but I tried > > #! garbage > > and was also surprised to learn Ruby terminates the program with the > message "test.rb:1: Can't exec garbage (fatal)". > > So I looked at the source code. In the load_file() function in ruby.c, > there is code that inspects the first line in the script. If it starts > with "#!" then the line must also contain the word "ruby". If it > doesn't, then Ruby calls execv() to run the "program" that it assumes > follows the #!. When execv() fails, Ruby terminates the program. > ... Thanks, that is interesting