On Sun, Apr 23, 2017 at 1:12 PM, Florian Mayer <mayerflor...@me.com> wrote:
> Consider > > $ foo=bar; bar=moo; moo=123 > $ echo $foo $bar $moo > => bar moo 123 > $ echo $((foo)) > => 123 > $ echo $foo $bar $moo > => bar moo 123 > $ # so far so good but > $ ((foo++)) > $ echo $foo $bar $moo > => 123 moo 123 > > Now my chain of indirections is broken… > It prints "124 moo 123" no? It's because it's not really indirection, rather the content of the variable is evaluated: $ foo=1+2;echo $((foo)) 3 In the last case it evaluates the value of foo, 123, and then increment the value of foo and foo becomes 124