execline: use of define, export, unexport, import

From: John Vogel <jvogel4_at_stny.rr.com>
Date: Mon, 25 Aug 2014 22:59:42 -0400

If I define a variable to some value at the top level of an execline script,
there seems no way to redefine it.

Stripped down example:

define var 0
foreground { echo $var }
define var 1
foreground { echo $var }
export var 2
import var
foreground { echo $var }
unexport var
export var 3
import var
echo $var
# end of script

All output is "0" from the first define. If I change the first define, then
all output will be what ever I set that to.

Am I missing something basic here? If no state is maintained, should the
definition persist? The perplexing part is that I would have thought that the
lines that unexported, exported, then imported would force the redefinition.

I will work on redesigning the script I was trying to redefine a variable in.
Maybe I am making it too complex.

Received on Tue Aug 26 2014 - 02:59:42 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC