Variables in shell scripts
Posted: Wed Mar 02, 2022 6:11 pm
Back in the days, some months ago, one could wite a script like this:
And if a variable "mybla" was defined, <BLA> would be replaced with the content of that variable.
This no longer works, the above will now always spit out literally "${mybla}" and instead one has to write it like this...
Bug or bugfix, who can tell, specifications are unspecified, but a change and a regressions nevertheless - I liked the old way, since it meant setting default value on just one place. Now one must either set it on every occurance of the bracketed paramter, or rewrite script to use local variables, based on bracketeded parameter, instead of using it directly.
Code: Select all
.key BLA
.def BLA "${mybla}"
echo <BLA>
This no longer works, the above will now always spit out literally "${mybla}" and instead one has to write it like this...
Code: Select all
.key BLA
echo <BLA$${mybla}>