On Wed, Mar 02, 2011 at 01:54:49PM +0100, Michal Hlavinka wrote:
> Hi,
> 
> one our user reported regression in ksh. Call from within ( cmd1; cmd2; ) 
> list changes environment.
> I've simplified scripts to following reproducers to:
> a) 
> RET=$(ksh -c '( function fx { export X=123;  } ; fx; ); echo $X')
> [ -z "$RET" ] && echo "works fine" || echo "bug present"
> 
> 2010-03-09 is last working version, 2010-05-27 and newer (latest stable 
> included) are broken
> 
> b)
> RET=$(ksh -c 'echo "/bin/true; function fx { export X=123; } ; fx;" 
> >/tmp/kshtest; ( . /tmp/kshtest >/dev/null  ); echo $X; rm -f /tmp/kshtest')
> [ -z "$RET" ] && echo "works fine" || echo "bug present"
> 
> 2010-05-27 is last working version, 2010-06-21 and newer (latest stable 
> included) are broken
> 
> In short, the problem is, that something like this
> 
> ( export X=123; ) #this is not reproducer
> 
> creates X variable even outside ( ) scope.

Yep, also preset in our 2010-06-21 build (and in newer builds):

   ksh> echo ${.sh.version}
   Version JM 93t+ 2010-06-21
   ksh> RET=$(ksh -c '( function fx { export X=123;  } ; fx; ); echo $X')
   ksh> [ -z "$RET" ] && echo "works fine" || echo "bug present"
   bug present

does there exist a fix?

   Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to