On Sun, Mar 10, 2013 at 11:22 PM, Roland Mainz <[email protected]>wrote:

> Hi!
>
> ----
>
> We found an issue with subshells not restoring the previous .sh.match
> value when the subshell exists:
>

See http://lists.research.att.com/pipermail/ast-users/2012q2/003170.html


> The following outout is AFAIK completely correct...
> -- snip --
> $ ksh -c 'x="abc123" ; true "${x//~(E)../X}" ; ( ulimit -c 0 ; true
> "${x//~(E)./X}" ; print "#mark 1" ; print -v .sh.match ) ; print "#
> mark2" ; print -v .sh.match'
> #mark 1
> (
>         (
>                 a
>                 b
>                 c
>                 1
>                 2
>                 3
>         )
> )
> # mark2
> (
>         (
>                 ab
>                 c1
>                 23
>         )
> )
> -- snip --
> ... but removing the "ulimit -c 0" (which causes ksh93 to call
> |fork()| when in a new subshell) causes the output to be wrong (e.g.
> the change of .sh.match within the subshell affects the value of
> .sh.match outside the subshell):
> -- snip --
> $ ksh -c 'x="abc123" ; true "${x//~(E)../X}" ; ( true "${x//~(E)./X}"
> ; print "#mark 1" ; print -v .sh.match ) ; print "# mark2" ; print -v
> .sh.match'
> #mark 1
> (
>         (
>                 a
>                 b
>                 c
>                 1
>                 2
>                 3
>         )
> )
> # mark2
> (
>         (
>                 a
>                 b
>                 c
>                 1
>                 2
>                 3
>         )
> )
> -- snip --
>
>
> ----
>
> Bye,
> Roland
>
> --
>   __ .  . __
>  (o.\ \/ /.o) [email protected]
>   \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
>   /O /==\ O\  TEL +49 641 3992797
>  (;O/ \/ \O;)
> _______________________________________________
> ast-developers mailing list
> [email protected]
> http://lists.research.att.com/mailman/listinfo/ast-developers
>
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to