On Tue, 2019-04-16 at 12:38 +0700, Robert Elz wrote: > That's really hard to do and do correctly.
I was operating on the assumption that it could be done in the same way that the $? and $PIPESTATUS variables are created/updated. > There's no way to pass variables back from a subshell I think I would just ignore subshells since $PIPESTATUS is also not passed back from subshells. So the variable I propose would be related to the exit code of the subshell rather than anything it ran. If one did want to add a way to pass back variables, since bash uses itself for subshells (AFAICT), this feature could be added by using creating a shared memory segment or a pipe or something and adding a BASH_SUBSHELL_VARS environment variable that the subshell could use to determine where to write the variables back to. -- bye, pabs https://bonedaddy.net/pabs3/
signature.asc
Description: This is a digitally signed message part