Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 3
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
5. Tuning the user environment
  


Marking variables for export page 8 of 13


If a variable is not marked for export, any new shells that it starts will not have that variable set. However, you can mark a variable for export by passing it to the export built-in:


$ FOO=foo
$ BAR=bar
$ export BAR
$ echo $FOO $BAR
foo bar
$ bash
$ echo $FOO $BAR
bar

In this example, the variables FOO and BAR were both set, but only BAR was marked for export. When a new bash was started, it had lost the value for FOO. If you exit this new bash, you can see that the original one still has values for both FOO and BAR:


$ exit
$ echo $FOO $BAR
foo bar

Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact