linux - How do I import environment settings into my Perl program? -
I have a script whose content simply exports a variable in Linux.
export LD_LIBRARY_PATH = ....
I want to run this script in my Perl script so that anyone who is running my Perl script is < Code> LD_LIBRARY_PATH will be set. Can I do this at the beginning of my Perl script?
#! / Usr / bin / perl -w system ("/myfolder1/myfolder2/myScript.sh");
#! / Bin / sh /myfolder1/myfolder2/myScript.sh exec perl -wxS "$ 0" "$ @" #! / Usr / bin / perl -w #. Normal as your script
When you run it, it will first be executed by / bin / sh
, Which is capable of loading myScript.sh
in the local environment. sh
then exec
s pell, which is said to continue from the following line.
Comments
Post a Comment