Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 04-08-2006, 10:12 AM   #1
Registered: Mar 2003
Posts: 178

Rep: Reputation: 30
How can I export my variables from a script?

I'm trying to set up OpenVPN and the tutorial told me to edit my vars file, then I would execute it to set environment variables for the next script. However, even though I'm using the export command the variables are not setting as environment variables. I even created a generic simple script that just set export name = Gene for a test and that wouldn't echo a result after I ran it. I know you can set global variables in /etc/bash.bashrc but I can't seem to set them anywhere else. I noticed this with Debian and Ubuntu and I'm wondering if there's a reason they set it this way? Is there a way to override it?
Old 04-08-2006, 10:18 AM   #2
Registered: Mar 2003
Posts: 178

Original Poster
Rep: Reputation: 30

Well I found out why debian works the way it does however I still would like to know how to make it so certain files can set environment variables.
Old 05-20-2006, 05:47 PM   #3
Registered: Dec 2004
Posts: 125

Rep: Reputation: 15

I was having the same issues when I found another post saying to use source script instead of running it so its working fine now.

Last edited by tgo; 05-20-2006 at 05:50 PM.


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
Unable to export variables declared in a script joehansen12 Linux - Newbie 2 10-26-2005 03:25 PM
why do we have to export variables? learnfast Linux - Newbie 2 05-27-2005 09:27 AM
export variables alaios Linux - General 3 12-04-2004 08:33 AM
keep my export variables captain-cat Linux - Newbie 9 06-23-2004 06:22 AM
export variables radnix Linux - General 2 04-28-2004 07:52 PM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:42 AM.

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