[wplug] vars in bash?

Michael Semcheski lists at immuneit.com
Fri Jan 19 20:17:21 EST 2007


Zach,

Here's my (possibly flawed) understanding:

The first form (sans export) declares a variable.  That variable is only
defined in the context of the script.

The second form (with export) declares an environment variable.  That
is, the exported variable will be available after the script finishes in
the case of .bashrc. 

Make sense?  Anyone dispute what I said?

Mike

Zach wrote:
> I am looking for the canonical way to declare an environment variable
>  in the BASH shell. Which of these two forms is preferable:
>
> EDITOR=/usr/bin/emacs:"${EDITOR}"
>
> or
>
> export EDITOR=/usr/bin/emacs
>
> I have this in my .bashrc.
>
> Zach _______________________________________________ wplug mailing
> list wplug at wplug.org http://www.wplug.org/mailman/listinfo/wplug
>
>
>




More information about the wplug mailing list