in reply to Re^4: Indirect variable expansion
in thread Indirect variable expansion
Well, yes. At the time the variable substitution occurs, the variable has not been set yet. eg.:
$ quux=foo echo $quux $
"Fix" it by separating the one command into 2:
$ quux=foo; echo $quux foo $
It isn't just bash, BTW. Any Bourne-compatible shell should behave like this.
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Indirect variable expansion
by jeffenstein (Hermit) on Nov 18, 2024 at 16:10 UTC | |
by LanX (Saint) on Nov 18, 2024 at 16:35 UTC |