Bug#733511: checkbashisms: wronglu report 'command -v' as a bashism

Adam D. Barratt adam at adam-barratt.org.uk
Sun Dec 29 17:01:02 UTC 2013


On Sun, 2013-12-29 at 16:35 +0100, Aurelien Jarno wrote:
> checkbashisms consider that command can only take the -p option:
> 
> | $ echo -e '#!/bin/sh\ncommand -v ls' > posix.sh
> | $ checkbashisms posix.sh 
> | possible bashism in posix.sh line 2 ('command' with option other than -p):
> | command -v ls
> | $
> 
> This is not true according to POSIX specification [1], -v and -V shall
> also be accepted. They are accepted in practice by both dash and bash.
> 
> [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html

This is a somewhat interesting case. The link above is for the Base
Specifications Issue 7, which is IEEE 1003.1 2013. Policy specifically
refers to IEEE 1003.1 2004, aka Issue 6, where -v and -V are listed as
User Portability Utilities extensions and therefore not required to be
supported.

Regards,

Adam



More information about the devscripts-devel mailing list