shell lint about variable expansion in arithmetic expressions is inscrutable
I had a bit of code that pbchk was upset about:
if (( $pcidb_exit == 0 )); then printf "All tests passed successfully!\n" fi
pbchk said: " line 219: variable expansion makes arithmetic evaluation less efficient"
The problem with this message is that you need to realize that in arithmetic evaluation context that you can actually reference variable names directly without the
$ and that including it changes things around. If you're not familiar with this error message, this is mostly inscrutable. For example, the native translation from the other pbchk error message about writing this as
if [[ $pcidb_exit -eq 0 ]] will tell you to use arithmetic expressions instead. It'd really help to have these pbchk error messages be something that explain what's wrong for folks who aren't as familiar with all the intricacies of the shell especially as they're being told to rewrite things from a form that is certainly correct to another form to appease pbchk.