Solved

Bash manupulating PERL5LIB for perlbrew

Posted on 2013-05-22
4
586 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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