Export Problem

Les Mikesell les at futuresource.com
Sat Aug 28 23:51:40 UTC 2004


On Sat, 2004-08-28 at 16:15, Richard E Miles wrote:
> > Perhaps a tad OT. From the command line, if I do "export FOO='bar'" and
> > then do export -p, the result is as expected.
> > 
> > However, if I do the same thing in a script:
> > #!/bin/bash
> > export FOO="bar"
> > 
> > . . . it does not create the variable. export -p and it's not there.


> When you run from a script if forks and runs in it's on environment. The export
> is only seen in the script environment.

Exported variables are inherited, so they would also be seen
in any processes started by the script, but not by the
parent shell that started the script.

---
   Les Mikesell
     les at futuresource.com






More information about the fedora-list mailing list