I'm currently working on cleaning up some shell scripts. While doing that, I came across something that looks like this:
if [ ${#VARA} -eq 0 ] || [ ${#$VARB} -eq 0 ] || [ ${$VARC} -eq 0 ]; then
...
fi
As you can see, there are three different types of things going on here with variables: ${#V}
, ${#$V}
, and ${$V}
. I would love an explanation of each of these please. (Plus Shellcheck is complaining about the last one.)