Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-11-2009, 04:20 PM   #1
LQ Newbie
Registered: Jun 2009
Location: Iowa City, IA
Distribution: SuSE 11, ubuntu Hardy
Posts: 28

Rep: Reputation: 15
Importing environment variables into bash scripts

Hello Hello!
Quick question- is there any good way to import environment variables into scripts? I tried running this script:

When I ran the script, it gave me a strange cross-shaped cursor and hung up. When I clicked anywhere, it stopped hanging and actually echoed the correct string. I can find tons of articles about exporting variables and the parent/child shell environment variable relationship, but nothing about scripts really. Any thoughts?

Old 08-11-2009, 04:27 PM   #2
LQ Newbie
Registered: Feb 2009
Distribution: Arch
Posts: 13

Rep: Reputation: 0
If you are just running it as a script and you are useing bash then these variables should already be there. when i run a bash script I don't have to "import" anything to get my variables.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing environment variables in startup scripts sanjeevkchopra Linux - General 1 07-10-2006 09:55 AM
Accessing environment variables in startup scripts sanjeevkchopra Linux - Networking 1 07-10-2006 09:54 AM
Scripts & Environment Variables geeman2.0 Linux - General 12 07-05-2005 05:10 PM
Why can't my scripts set environment variables? Matthew3 Linux - Software 5 08-28-2004 05:26 PM
Environment Variables in Scripts louisb Linux - General 3 01-15-2004 04:56 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration