From: Eric Hodel Date: 2006-08-03T03:57:19+09:00 Subject: Re: How to auto-locate interpreter image On Aug 1, 2006, at 8:15 PM, Scheming Commie wrote: > On Sat, 15 Jul 2006 21:06:25 +0000, Just Another Victim of the Ambient > Morality wrote: >> I'm pretty sure the "#!" line is meaningless on Windows and >> the shell >> doesn't even bother looking for it. Indeed, it always struck me a >> little >> weird that every script knows exactly where the interpreter image >> is. What >> if it were to move? All your scripts will suddenly break! An >> annoying, >> albeit, unlikely scenario... > > #!/usr/bin/env perl > #!/usr/bin/env ruby > .. etc > > env finds the interpreter wherever it is and runs it, as you'd expect. > > A neat trick, I don't know why it isn't used, well, universally. > > Of course it relies on env being in /usr/bin but, that changes less > (never) than where particular interpreters are. cron does not set PATH, so scripts with this #! won't work. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com