From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0UG-0001vr-Sp for qemu-devel@nongnu.org; Wed, 19 Nov 2014 03:20:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr0Tv-0005iV-9g for qemu-devel@nongnu.org; Wed, 19 Nov 2014 03:19:40 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:53965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0Tv-0005hw-34 for qemu-devel@nongnu.org; Wed, 19 Nov 2014 03:19:19 -0500 Received: by mail-la0-f51.google.com with SMTP id mc6so76177lab.10 for ; Wed, 19 Nov 2014 00:19:18 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1416381197-12191-1-git-send-email-famz@redhat.com> References: <1416381197-12191-1-git-send-email-famz@redhat.com> From: Peter Maydell Date: Wed, 19 Nov 2014 08:18:58 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] configure: Replace which(1) with "command -v" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: QEMU Trivial , QEMU Developers On 19 November 2014 07:13, Fam Zheng wrote: > Because which(1) is not always installed, whereas "command -v" is > the more native way to check for a command. > > Signed-off-by: Fam Zheng > --- > configure | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configure b/configure > index 47048f0..986a13d 100755 > --- a/configure > +++ b/configure > @@ -2727,7 +2727,7 @@ fi > if test "$modules" = yes; then > shacmd_probe="sha1sum sha1 shasum" > for c in $shacmd_probe; do > - if which $c >/dev/null 2>&1; then > + if command -v $c >/dev/null 2>&1; then > shacmd="$c" > break > fi Configure already provides the shell function "has" for checking for existence of a command -- can we just use that? thanks -- PMM