Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: 8.3.1 Legacy on Pi Zero - failed upgrade.
#16
(04-18-2023, 07:24 PM)Tim Curtis Wrote: - Right, quote the args.

Hi Tim,

actually, it's not just quoting, it is having something added to the variable, in order to not have an empty string on either side of the comparison:
I usually add an "x" before, and one after, the variable name (which needs then to be enclosed by curly braces in order to not change its name...).

Of course, the same has to be done with the literal string, hence the "x${MODEL}x" "x3x", so that in case $MODEL is empty, or undefined, the comparison still reads "xx" = "x3x", which will return false, of course, but won't confuse (ehm, crash) the bash parser.

Quoting is mandatory, of course.
Reply


Messages In This Thread
RE: 8.3.1 Legacy on Pi Zero - failed upgrade. - by Nutul - 04-18-2023, 08:10 PM

Forum Jump: