getenv - unix - fp 5.0.13
Kenneth Brody
kenbrody at bestweb.net
Tue Mar 9 14:00:51 PST 2004
Enrique Arredondo wrote:
>
> HI List,
>
> Why can't I get the Enviroment variable set when running this processing ?
>
> Then: system "FLOGO=`/usr/vsifax/bin/flog -a"<2<"`;export FLOGO"
> Then: aa(30,allup)=getenv("FLOGO")
> Then: show"@"<aa
You _are_ setting the environment variable -- in the subshell used
to execute the SYSTEM command. This value would then be in the
environment of that shell and any child processes it starts. It
will not, however, be propagated to the parent process.
> When I run the same experiment in the shell and then I use this command :"
> echo $FLOGO " here's what I get:
>
> 531384 03/09 12:01 2/0 marc chi NORMAL 1223355
That's because you are running it in the same shell. Try it in a
subshell, as is done with the SYSTEM command, and you will see that
it does not get set in the current shell:
sh -c "FLOGO=`/usr/vsifax/bin/flog -a foo`;export FLOGO"
echo $FLOGO
> If there are spaces within the result would filepro only take the first
> set of characters with no spaces to be the dummy field ? (i.e. 531384)
Spaces are irrelevent here. This is simply the defined behavior of
parent/child processes.
--
+---------+----------------------------------+-----------------------------+
| Kenneth | kenbrody at spamcop.net | "The opinions expressed |
| J. | http://www.hvcomputer.com | herein are not necessarily |
| Brody | http://www.fptech.com | those of fP Technologies." |
+---------+----------------------------------+-----------------------------+
More information about the Filepro-list
mailing list