From: Garance A Drosehn Date: 2007-02-02T07:51:34+09:00 Subject: Re: proper usr/bin/env ruby shebang On 2/1/07, Paul Brannan wrote: > On Thu, Feb 01, 2007 at 08:35:08AM +0900, gga wrote: > > What will work across platforms and OSes is this: > > > > #! /usr/bin/env ruby > > This will not work for platforms that put env in /bin or don't have /usr > mounted. Well, on many of my systems, if /usr is not mounted, then 'ruby' itself is also not available! :-) I have a bigger concern with using /usr/bin/env for this. The /usr/bin/env trick will only work if ruby *IS* in the PATH of the person who is running the ruby script, and if that version of ruby is the version expected by the script. On many systems that is a safe assumption, but it isn't always true. Consider something like MacOS 10, for instance, where Apple ships one version of ruby in /usr/bin, but many people will install a newer version in /opt/local/bin. I've had some scripts fail because the user running them didn't have /opt/local/bin in their PATH. (ie, I helped them install ruby into /opt/local/bin using macports, but they didn't update their settings for PATH) -- Garance Alistair Drosehn = drosihn@gmail.com Senior Systems Programmer Rensselaer Polytechnic Institute; Troy, NY; USA