LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Importing environment variables into bash scripts (https://www.linuxquestions.org/questions/linux-newbie-8/importing-environment-variables-into-bash-scripts-746826/)

JDska55 08-11-2009 04:20 PM

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:
Code:

import BUCKET_NAME

echo $BUCKET_NAME

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?

Cheers,
Jarrod

pengrath 08-11-2009 04:27 PM

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.


All times are GMT -5. The time now is 02:23 AM.