Could someone help me with Bash logic?
I don't think it's my environment, I think I'm having trouble getting my head around some simple logic. Can someone explain why/how the following happens, and if there's a way to alter the outcome?
number=6
echo $number
6
test=$number
echo $test
6
So far so good
number=11
echo $test
6
test=$number
echo $test
11
I have to issue test=$number
again for 11 to be displayed. Obviously this is by design, is there a way to generate 11 as the response without issuing test=$number
again?
nameref
s as described in https://unix.stackexchange.com/a/413479/70524 seems to be what you're looking for – muru Mar 28 '24 at 07:41