Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bash manupulating PERL5LIB for perlbrew

Posted on 2013-05-22
4
Medium Priority
?
608 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 2000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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