Bug#835498: checkbashisms treats 'command' incorrectly

Eero Vuojolahti eero at vuojolahti.com
Fri Aug 26 12:06:01 UTC 2016



On 2016-08-26 14:38, Adam D. Barratt wrote:
> Control: tags -1 + moreinfo
>
> On 2016-08-26 11:47, Eero Vuojolahti wrote:
>> Secondly, there are no optional flags listed in the 2008/2013 version
>> of the 'command' specification. In the older (2004) standard, the |-v|
>> and |-V| options were part of the 'user portability' subset, not part
>> of the core.
>> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
>
> POSIX 2004 might be "older" but it is the version referenced by Debian 
> Policy - as per 
> <https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts>:
>
> "Scripts may assume that /bin/sh implements the SUSv3 Shell Command 
> Language[90] plus the following additional features not mandated by SUSv3
> [list that doesn't mention "command"]
>
> If a shell script requires non-SUSv3 features from the shell 
> interpreter other than those listed above, the appropriate shell must 
> be specified in the first line of the script (e.g., #!/bin/bash) and 
> the package must depend on the package providing the shell (unless the 
> shell package is marked "Essential", as in the case of bash).
> [...]
> 90
>
> Single UNIX Specification, version 3, which is also IEEE 1003.1-2004 
> (POSIX), and is available on the World Wide Web from The Open Group 
> after free registration.
> "
>
> checkbashisms's handling of "command" appears to be in line with that 
> Policy requirement.
>
> Regards,
>
> Adam

OK, I didn't know about that.

The first point still stands. Invalid flags and something like "command 
-p -v ls" should raise warnings then.



More information about the devscripts-devel mailing list