On Wed, Jun 06, 2012 at 12:47:17PM +0200, Michal Hlavinka wrote:
> Hi,
> 
> we found a regression in ksh. Exporting a variable affects its attributes:
> 
> $ typeset -Z2 foo=3
> $ echo $foo
> 03
> $ typeset -p foo
> typeset -Z 2 -R 2 foo=03
> $ export foo
> $ echo $foo
> 3
> $ typeset -p foo
> typeset -x -Z 1 -R 1 foo=3
> 
> last working version is 2009-06-30, first broken version is
> 2009-09-08. Let me know if you need more information.
> 
> Michal

A similar report here:

  ksh> typeset -Z4 VAR1
  ksh> typeset | grep VAR1
  zerofill 4 rightjust 4 VAR1
  ksh> VAR1=1
  ksh> typeset | grep VAR1
  zerofill 4 rightjust 4 VAR1
  ksh> echo $VAR1
  0001
  ksh> export VAR1
  ksh> typeset | grep VAR1
  export zerofill 1 rightjust 1 VAR1
  ksh> echo $VAR1
  1

if exported first the it works

  ksh> export VAR2        
  ksh> typeset -Z4 VAR2   
  ksh> typeset | grep VAR2
  export zerofill 4 rightjust 4 VAR2
  ksh> VAR2=1
  ksh> echo $VAR2
  0001

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