in reply to using "#!/<perlpath>/bin/perl" to exec a shell script?

cadphile:

How about using symlinks? You might symlink /usr/arch/bin to /usr/i386/bin for your i386 boxes, and to /usr/sparc/bin on your solaris boxes. Then your scripts could all just use /usr/arch/bin....

Untested, so it may not work all that well, but I think that's what I'd try first. If it works, you don't need to figure out the wrapper.

...roboticus

  • Comment on Re: using "#!/<perlpath>/bin/perl" to exec a shell script?

Replies are listed 'Best First'.
Re^2: using "#!/<perlpath>/bin/perl" to exec a shell script?
by cadphile (Beadle) on Oct 04, 2007 at 03:23 UTC
    Hi Roboticus, unfortunately, the perl installation is on a common automounted partition, that is shared across all platforms. We run almost entirely on servers, and don't have individual machines. Also, if I have a script that has
       #!/common/bin/perl
    
    and this resolves to:
      /common/bin/perl -> <perlpath>/bin/perl
    
    so that the common executable path is a link to the wrapper, you still have the same problem: i.e. the unix kernel can't exec the file <perlpath>/bin/perl, because it's not binary, and doesn't return the "magic number". So, the perl script just gets parsed by /bin/csh, which croaks...

    I'm really thinking there is no good solution to getting <perlpath>/bin/perl to trick the kernel into thinking that it's a real binary shell interpreter...