Solved

Bash manupulating PERL5LIB for perlbrew

Posted on 2013-05-22
4
528 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

708 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

14 Experts available now in Live!

Get 1:1 Help Now