I'm writing a Subversion
hook script that is expected to run with an empty %ENV
. My script needs $LD_LIBRARY_PATH
set a particular way before it starts. I've tried every shebang (#!
) line I know to try to sneak in an environment variable. Here's a simple try.
#!/usr/bin/env LD_LIBRARY_PATH=/my/lib /usr/bin/perl
This causes the env
process to churn the CPU and to never return. I never see the Perl start. I've tried others as well. Oddly, the following does start the Perl, but doesn't give me the env I need.
This, based on perlrun
, causes sh
to complain that the --
and everything after it is an invalid option.
#!/bin/sh -- # -*- perl -*-
eval 'exec /usr/bin/env LD_LIBRARY_PATH=/my/lib /usr/bin/perl -S $0
This last one fails to find all the DSOs needed by use
I can always have a completely different shell script to setup the environment and exec the Perl, but that seems crufty.
I'm on RedHat Linux 4.5, running Perl 5.8.8. Thanks for any help you can provide.