[Abcde-users] http://www.shellcheck.net/
Roger
rogerx.oss at gmail.com
Sat Mar 28 19:40:24 GMT 2015
For the fun of it, I decided to use http://www.shellcheck.net/ for checking
abcde.
There were some surprises, some known unquoted variables, and then some really
not so bright command sequences for which I said, "I thought that was odd!"
(Or they were just the old Bourne Shell method.)
The more surprising error was the quoting error at Line #3217
OUTPUTFORMAT='${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}'
SC2016 Expressions don't expand in single quotes, use double quotes for
that.
For those of you curious, you can easily check this problem by doing the
following within a Bash shell:
$ echo $HOSTNAME
localhost.local
$ echo '$HOSTNAME'
$HOSTNAME
This definitely caught my eye, and find it's a bug that should likely be
immediately fixed. Obviously fixing such dramatic bugs, can further incur
further issues. There were five more single quoted variable definitions
following this line, and there's likely other single quoted variable
definitions elsewhere as I'm just scanning through the errors.
When I'm quoting variables, I tend to utilize the format ${VARIABLE} instead of
"$VARIABLE". The curly braces seem more readable or allow the variable name to
be clearly visible from the curly braces, but on the flip curly braces are
difficult to type.
--
Roger
http://rogerx.freeshell.org/
More information about the Abcde-users
mailing list