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

Bug#904246: developers-reference: section 6.4 should recommend command -v, not which



Hi,

thanks for your feedback, I've now rewritten the paragraph in question
to simply read:

----
If you need to check for the existence of a command, you should use
something like

::

   if command -v install-docs > /dev/null; then ...

You can use this function to search ``$PATH`` for a command name, passed
as an argument. It returns true (zero) if the command was found, and
false if not. This is really the best way, since ``command -v`` is a
shell-builtin for many shells and is defined in POSIX.

Using ``which`` is an acceptable alternative, since it is from the required
``debianutils`` package.
----

I think this is much better.


-- 
cheers,
	Holger

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

Attachment: signature.asc
Description: PGP signature


Reply to: