Your message dated Sat, 10 Sep 2005 13:09:49 +0200
with message-id <[EMAIL PROTECTED]>
and subject line Bug#291197: "command -v" prints pathnames of non-executable
files
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 19 Jan 2005 11:14:50 +0000
>From [EMAIL PROTECTED] Wed Jan 19 03:14:50 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mailservice.tudelft.nl [130.161.131.5]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1CrDnV-0005B5-00; Wed, 19 Jan 2005 03:14:49 -0800
Received: from localhost (localhost [127.0.0.1])
by rav.antivirus (Postfix) with ESMTP id BA272222F0C;
Wed, 19 Jan 2005 12:14:18 +0100 (CET)
Received: from localhost (x117.decis.nl [130.161.177.117])
by mx0.tudelft.nl (Postfix) with ESMTP id 361D7222EF1;
Wed, 19 Jan 2005 12:14:18 +0100 (CET)
Received: by localhost (Postfix, from userid 1001)
id 5C4BD10D5EA; Wed, 19 Jan 2005 12:13:35 +0100 (CET)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Thomas Hood <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: "command -v" prints pathnames of non-executable files
X-Mailer: reportbug 3.2
Date: Wed, 19 Jan 2005 12:13:35 +0100
Message-Id: <[EMAIL PROTECTED]>
X-Virus-Scanned: by amavisd-new at tudelft.nl
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level:
Package: bash
Version: 3.0-5
Severity: normal
Please consider the following sequence of commands which illustrates
that "command -v foo" prints the name of the first executable file "foo"
it finds on the PATH, failing which it prints the first non-executable
file "foo" it finds on the PATH.
[EMAIL PROTECTED]:~$ echo $PATH
/home/jdthood/bin:/usr/local/bin:/bin:/usr/bin:/usr/bin/X11:/usr/games
[EMAIL PROTECTED]:~$ which foo
[EMAIL PROTECTED]:~$ command -v foo
bash: command: foo: not found
[EMAIL PROTECTED]:~$ touch /home/jdthood/bin/foo
[EMAIL PROTECTED]:~$ ls -l /home/jdthood/bin/foo
-rw-r--r-- 1 jdthood jdthood 0 2005-01-18 10:40 /home/jdthood/bin/foo
[EMAIL PROTECTED]:~$ which foo
[EMAIL PROTECTED]:~$ command -v foo
/home/jdthood/bin/foo
[EMAIL PROTECTED]:~$ sudo touch /usr/local/bin/foo
[EMAIL PROTECTED]:~$ which foo
[EMAIL PROTECTED]:~$ command -v foo
/home/jdthood/bin/foo
[EMAIL PROTECTED]:~$ ls -l /usr/local/bin/foo
-rw-r--r-- 1 root staff 0 2005-01-18 10:41 /usr/local/bin/foo
[EMAIL PROTECTED]:~$ sudo chmod ugo+x /usr/local/bin/foo
[EMAIL PROTECTED]:~$ ls -l /usr/local/bin/foo
-rwxr-xr-x 1 root staff 0 2005-01-18 10:41 /usr/local/bin/foo
[EMAIL PROTECTED]:~$ which foo
/usr/local/bin/foo
[EMAIL PROTECTED]:~$ command -v foo
/usr/local/bin/foo
Because of this behavior, "command -v foo" alone cannot be used to tell
whether or not there is an executable program named 'foo' on the PATH.
One has to do something like this to work around the problem:
if CMD="$(command -v foo 2>/dev/null)" && [ -x "$CMD" ] ; then
...
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (500, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.9
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Versions of packages bash depends on:
ii base-files 3.1.2 Debian base system miscellaneous f
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
ii libncurses5 5.4-4 Shared libraries for terminal hand
ii passwd 1:4.0.3-30.7 Change and administer password and
-- no debconf information
---------------------------------------
Received: (at 291197-done) by bugs.debian.org; 10 Sep 2005 11:09:55 +0000
>From [EMAIL PROTECTED] Sat Sep 10 04:09:55 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1EE3F4-0004ky-00; Sat, 10 Sep 2005 04:09:55 -0700
Received: from mailhost.cs.tu-berlin.de ([EMAIL PROTECTED] [130.149.17.13])
by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id NAA09379;
Sat, 10 Sep 2005 13:09:51 +0200 (MEST)
Received: from localhost (localhost [127.0.0.1])
by mailhost.cs.tu-berlin.de (Postfix) with ESMTP id 98F56FD4B;
Sat, 10 Sep 2005 13:09:51 +0200 (MEST)
Received: from mailhost.cs.tu-berlin.de ([127.0.0.1])
by localhost (bueno [127.0.0.1]) (amavisd-new, port 10224) with ESMTP
id 24163-25; Sat, 10 Sep 2005 13:09:50 +0200 (MEST) 11330
Received: from bolero.cs.tu-berlin.de (bolero.cs.tu-berlin.de [130.149.19.1])
by mailhost.cs.tu-berlin.de (Postfix) with ESMTP;
Sat, 10 Sep 2005 13:09:50 +0200 (MEST)
Received: (from [EMAIL PROTECTED])
by bolero.cs.tu-berlin.de (8.12.10+Sun/8.12.8/Submit) id j8AB9ofr006971;
Sat, 10 Sep 2005 13:09:50 +0200 (MEST)
From: Matthias Klose <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 10 Sep 2005 13:09:49 +0200
To: Thomas Hood <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: Bug#291197: "command -v" prints pathnames of non-executable files
X-Mailer: VM 7.17 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid
X-Virus-Scanned: by amavisd-new at cs.tu-berlin.de
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER
autolearn=no version=2.60-bugs.debian.org_2005_01_02
bug submitter writes:
> OK, I guess this can be closed or tagged wontfix then.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]