in reply to Re: Can I write a transparent shell wrapper to start the correct build of Perl?
in thread Can I write a transparent shell wrapper to start the correct build of Perl?

Symlinks don't work on the shebang line, IME.
  • Comment on Re^2: Can I write a transparent shell wrapper to start the correct build of Perl?

Replies are listed 'Best First'.
Re^3: Can I write a transparent shell wrapper to start the correct build of Perl?
by almut (Canon) on Feb 06, 2008 at 13:22 UTC

    Why not, what's the problem? I've been using them like this for ages without any issues I could remember.  Resolution of symlinks is a rather low-level kernel feature, which should be handled transparently by any modern version of Unix.

    PS: anyone interested in how it's done in Linux may want to study the function load_script in linux/fs/binfmt_script.c, which calls open_exec (linux/fs/exec.c), which in turn eventually branches (via path_lookup_open) into the generic path lookup and symlink resolution code implemented in linux/fs/namei.c.

      I tried this a few weeks ago on my Debian box and it didn’t work — refused to run perl and gave an error message instead. But I’ve just tried it again and it works now. I am at a loss to explain why.