cc: [email protected] Subject: Re: Re: [ast-users] [ksh93] $( ) affects current shell's ${.sh.match}? --------
> 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) > $ > > The reason that this works is that the shell has to fork do to the command substitution. ksh93 avoid forking with command substitution in many cases. This means that every time the prompt is displayed, a process is created. In most cases, ksh93 saves are restores variables changed in a subshell, but .sh.match is a special variable and is not being saved and restored. I have added this to my bug list so that it is handled correctly in a future release. David Korn [email protected] _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
