Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 04-19-2011, 07:47 AM   #1
Registered: Aug 2010
Posts: 103

Rep: Reputation: 5
export command help ?

Hello y'all. I would like to know what happens when you use the EXPORT command. Yeah, I know its works as the name sound maybe you want to make a change to a variable, like let. Say PS1, you make the change and you export it. The crux of my curiosity really is this, so to what file or where does the exported change really go, and why is the change not parmanent ? All this I would like answered and explained. Thanks distro is Red hat
Old 04-19-2011, 08:47 AM   #2
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,837

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Exporting a variable or function makes it available to any subshells that are spawned from that shell. When a subshell is opened, say when running a script or piped command, it makes a local copy of any variables that have the export flag set. Without exporting, it may only be available to the level where it was set (depending on what it is. I'm not sure about all the details).

All shell environment settings are held only in the memory dedicated to that process and so are lost when the shell closes. You can only make such things "permanent" by ensuring that your start-up scripts or spawning shells set them during initialization.

Last edited by David the H.; 04-19-2011 at 08:51 AM. Reason: added link and expanded explanation.
Old 04-19-2011, 09:39 AM   #3
LQ 5k Club
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
"export" does not save it to any kind of file, and it's not permanent.

It simply means that the variable will be made visible to processes spawned by the shell.


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
export command brgsousa Linux - Software 1 03-20-2010 08:10 PM
[SOLVED] export command deostroll Linux - Newbie 5 02-20-2010 07:55 AM
export command rohr Mandriva 1 04-11-2005 06:24 AM
BASH export command galalleni Slackware 4 09-08-2003 01:44 AM
Export Command choawk Linux - General 1 06-06-2003 02:26 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:43 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