Solved

Bash manupulating PERL5LIB for perlbrew

Posted on 2013-05-22
4
542 Views
Last Modified: 2013-05-22
I am experiencing an issue where I can set PERL5LIB via shell

export PERL5LIB='/my/local/lib'

but if I run this script with the same user it does not what am I missing here this is pretty cut and dry!?

My goal is to clear PERL5LIB and set a couple local libs

#!/bin/bash

export PERL5LIB='/my/local/lib1:/my/local/lib2';

Thanks
0
Comment
Question by:hexfusion
  • 2
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 39188697
What do you mean it does not?
Did you want PERL5LIB to persist after the shell has exited?
If so, did you run it with . or as a child process?
0
 
LVL 2

Author Comment

by:hexfusion
ID: 39188722
Yes I want to maintain PERL5LIB for the user running the script.

I run the program by issuing

#./program.sh

I then test to see if it is held with
#env|grep -i 'perl'

issuing command from shell maintains change, issuing via bash script does not.
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 39188827
run it by issuing
.  program.sh
or
source program.sh

issuing via bash script as
./program.sh
runs in a child process, and when the child exits, its environment is gone
0
 
LVL 2

Author Comment

by:hexfusion
ID: 39188832
right perfect thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now