Closed Niols closed 5 years ago
OK, got it: it's the token ${#*}
. We should check if it's in the POSIX standard, but it's accepted by both bash and dash.
What is the meaning of ${#*} in dash or bash? I can't find it in the bash manual, and in the Posix standard neither.
In 2.6.2 Parameter Expansion:
${#parameter}
String Length.
The length in characters of the value of parameter shall be substituted. If parameter is *
or @
, the result of the expansion is unspecified. If parameter is unset and set -u
is in effect, the expansion shall fail.Although the result is unspecified, this is syntactically correct. And it could probably mean "the length of what $*
would expand to".
OK, so morbig should probably accept it. However, I would say that ${#*} should not be used in a /bin/sh maintainer script when the behaviour is unspecified.
That is which package ?
We should add a check for this in lintshell.
In the included file lib/cryptsetup/functions
Closed by #66
When running
morbig --as simple
on the file at the end of this issue, I getas an output from Morbig. The Shell script seems to be accepted by other shells. I'll try to narrow this script down to the place where the "bug" occurs.