On Tue, Apr 10, 2012 at 21:45, Clark J. Wang <[email protected]> wrote:
> See following example:
>
> $ echo ${.sh.version}
> Version JM 93u+ 2012-02-29
> $ PS1='$( [[ foo =~ (.*) ]]; print "$ "; )'
> $ [[ bar =~ (.*) ]]
> $ ts -p .sh.match
> typeset -a .sh.match=(foo foo) <== ???
> $
> $ PS1='$ '
> $ [[ bar =~ (.*) ]]
> $ ts -p .sh.match
> typeset -a .sh.match=(bar bar)
> $
>
I found a very weird workaround:
$ PS1='$( typeset -p .sh.match > /dev/null 2>&1; [[ foo =~ (.*) ]]; print
"$ "; )'
$ [[ bar =~ (.*) ]]
$ typeset -p .sh.match
typeset -a .sh.match=(bar bar)
$
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users