Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bash manupulating PERL5LIB for perlbrew

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

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 85

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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 …
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
Suggested Courses

824 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