[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: The "which -s" flag



On Fri, Aug 14, 2020 at 02:46:39PM +0200, Jonas Smedegaard wrote:
> Regardless of the -s option, why is command preferred over which?  Due 
> to it being POSIX or for some other reason?

developers-reference (11.0.7) unstable; urgency=medium

  * best-pkging-practices: recommend "command -v" instead of "which"
    (Closes: #904246) and simplify paragraph.


https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.en.html#best-practices-for-maintainer-scripts
has the full text.

In #904246 Sean Whitton wrote:

Section 6.4 should perhaps recommend `command -v` not `which`, because
Debian Policy 4.1.5.0 allows maintainer scripts to assume SUSv4, which
requires support for `command -v`.


and further on he explained that "command" is a shell builtin for the
most common shells (including dash) while "which" is just a builtin on zsh.
so that's why.


-- 
cheers,
	Holger

-------------------------------------------------------------------------------
               holger@(debian|reproducible-builds|layer-acht).org
       PGP fingerprint: B8BF 5413 7B09 D35C F026 FE9D 091A B856 069A AA1C

"There's no glory in prevention." (Christian Drosten)

Attachment: signature.asc
Description: PGP signature


Reply to: