Variables in shell scripts

Post Reply
kolla
Posts: 54
Joined: Wed Oct 24, 2018 10:38 am

Variables in shell scripts

Post by kolla »

Back in the days, some months ago, one could wite a script like this:

Code: Select all

.key BLA
.def BLA "${mybla}"
echo <BLA>
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...

Code: Select all

.key BLA
echo <BLA$${mybla}>
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.
Post Reply