grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] grub-mkconfig: use portable 'command -v' to detect installed


From: Daniel Kiper
Subject: Re: [PATCH] grub-mkconfig: use portable 'command -v' to detect installed programs
Date: Mon, 21 Oct 2019 17:09:15 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, Oct 16, 2019 at 11:03:06PM -0400, Eli Schwartz wrote:
> The 'which' utility is not guaranteed to be installed either, and if it
> is, its behavior is not portable either.
>
> Conversely, the 'command -v' shell builtin is required to exist in all
> POSIX 2008 compliant shells, and is thus guaranteed to work everywhere.
>
> Examples of open-source shells likely to be installed as /bin/sh on
> linux, which implement the 11-year-old standard:
> bash, dash, busybox ash, ksh, mksh, zsh
>
> A side benefit of using the POSIX portable option is that it requires
> neither an external disk executable, nor (because unlike 'which', the
> exit code is reliable) a subshell fork. This therefore represents a mild
> speedup.

Missing SOB. I can add it in your behalf if this not a problem for you.
Otherwise Reviewed-by: Daniel Kiper <address@hidden>

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]