Op 17-10-16 om 22:58 schreef Martijn Dekker:
> But look what happens if you add a redirection, even a no-op one like 1>&1:
> 
> $ echo $( (echo ${.sh.subshell} 1>&1; echo ${.sh.subshell} 1>&1) )
> 2 0

Turns out you don't actually have to read ${.sh.subshell} twice: it is
the output redirection within a command substitution that kills
${.sh.subshell}. This is finally starting to make some sense now.

$ echo $( (: 1>&1; echo ${.sh.subshell}) )
0

(expected output: 2)

- M.

_______________________________________________
ast-developers mailing list
ast-developers@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to