Re: Default PATH setting - reduce to something more sensible?

Liste des GroupesRevenir à cu shell 
Sujet : Re: Default PATH setting - reduce to something more sensible?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.unix.shell
Date : 24. Jan 2025, 22:38:37
Autres entêtes
Organisation : None to speak of
Message-ID : <87a5bf6gf6.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8
User-Agent : Gnus/5.13 (Gnus v5.13)
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
On 23.01.2025 22:50, Keith Thompson wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
[...]
To me it appears that not finding (by 'which') an executable but
executing it nonetheless qualifies as a bug [in Bash].
 
I wouldn't call it a bug in bash.  Rather, it's a mismatch between bash
and which.
>
I'm not sure I can follow you what you mean by "a mismatch". Kornshell,
for example, also accesses /usr/bin/which (but it behaves correctly).

/usr/bin/which is not tied to any shell.  Kornshell accesses
"/usr/bin/which" if you type "which" or "/usr/bin/which" at the
prompt -- like any other external command.

From the which(1) man page (emphasis added):

    which returns the pathnames of the files (or links) which would be
    executed in the current environment, had its arguments been given as
    commands **in a strictly POSIX-conformant shell**.  It does this by
    searching the PATH for executable files matching the names of the
    arguments.  It does not canonicalize path names.

bash, unless it's in POSIX mode, is not a strictly POSIX-conformant
shell.  The feature is disabled when bash is in POSIX mode.  It's to be
expected that "which" doesn't know about this.

One could argue that bash's behavior is a legitimate and useful
extension.  If so, this is a mismatch between bash and which.  There's
nothing inherently wrong with bash having non-POSIX extensions,
particularly since bash has a "--posix" option to disable them.

But since the feature is undocumented and can quietly lead to
inconsistent behavior, I would actually argue that it's a bug in bash,
or at least a misfeature.  (It turns out that bash has had this feature
from its earliest days.)

[...]

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Date Sujet#  Auteur
14 Jan 25 * Re: Default PATH setting - reduce to something more sensible?84Dan Cross
14 Jan 25 +- Re: Default PATH setting - reduce to something more sensible?1Richard Harnden
20 Jan 25 `* Re: Default PATH setting - reduce to something more sensible?82Wayne
20 Jan 25  `* Re: Default PATH setting - reduce to something more sensible?81Janis Papanagnou
21 Jan 25   `* Re: Default PATH setting - reduce to something more sensible?80Axel Reichert
21 Jan 25    +* Re: Default PATH setting - reduce to something more sensible?7Janis Papanagnou
22 Jan 25    i+* Soft-links to binaries (was Re: Default PATH setting)4Janis Papanagnou
22 Jan 25    ii`* Re: Soft-links to binaries (was Re: Default PATH setting)3Keith Thompson
22 Jan 25    ii +- Re: Soft-links to binaries (was Re: Default PATH setting)1Lawrence D'Oliveiro
23 Jan 25    ii `- Re: Soft-links to binaries (was Re: Default PATH setting)1Janis Papanagnou
25 Jan 25    i`* PATH for GUI applications (was: Default PATH setting - reduce to something more sensible?)2Axel Reichert
26 Jan 25    i `- Re: PATH for GUI applications (was: Default PATH setting - reduce to something more sensible?)1Lawrence D'Oliveiro
22 Jan 25    `* Re: Default PATH setting - reduce to something more sensible?72Geoff Clare
22 Jan 25     `* Re: Default PATH setting - reduce to something more sensible?71Kaz Kylheku
23 Jan 25      `* Re: Default PATH setting - reduce to something more sensible?70Geoff Clare
23 Jan 25       `* Re: Default PATH setting - reduce to something more sensible?69Kenny McCormack
23 Jan 25        +* Re: Default PATH setting - reduce to something more sensible?52Dan Cross
23 Jan 25        i`* Re: Default PATH setting - reduce to something more sensible?51Janis Papanagnou
23 Jan 25        i +* Re: Default PATH setting - reduce to something more sensible?3Keith Thompson
24 Jan 25        i i`* Re: Default PATH setting - reduce to something more sensible?2Janis Papanagnou
24 Jan 25        i i `- Re: Default PATH setting - reduce to something more sensible?1Keith Thompson
23 Jan 25        i +* Re: Default PATH setting - reduce to something more sensible?3Kaz Kylheku
24 Jan 25        i i+- Re: Default PATH setting - reduce to something more sensible?1Janis Papanagnou
24 Jan 25        i i`- Re: Default PATH setting - reduce to something more sensible?1Jerry Peters
23 Jan 25        i +- Re: Default PATH setting - reduce to something more sensible?1marrgol
24 Jan 25        i `* Re: Default PATH setting - reduce to something more sensible?43Dan Cross
24 Jan 25        i  `* Re: Default PATH setting - reduce to something more sensible?42Janis Papanagnou
24 Jan 25        i   +* Re: Default PATH setting - reduce to something more sensible?14Dan Cross
25 Jan 25        i   i+* Re: Default PATH setting - reduce to something more sensible?5Janis Papanagnou
25 Jan 25        i   ii`* Re: Default PATH setting - reduce to something more sensible?4Dan Cross
26 Jan 25        i   ii +* Re: Default PATH setting - reduce to something more sensible?2Keith Thompson
27 Jan 25        i   ii i`- Re: Default PATH setting - reduce to something more sensible?1Dan Cross
26 Jan 25        i   ii `- Re: Default PATH setting - reduce to something more sensible?1Janis Papanagnou
26 Jan 25        i   i`* Re: Default PATH setting - reduce to something more sensible?8Keith Thompson
26 Jan 25        i   i +* Re: Default PATH setting - reduce to something more sensible?3Janis Papanagnou
26 Jan 25        i   i i`* Re: Default PATH setting - reduce to something more sensible?2Christian Weisgerber
27 Jan 25        i   i i `- Re: Default PATH setting - reduce to something more sensible?1Janis Papanagnou
26 Jan 25        i   i `* Early history of Bash (was: Re: Default PATH setting - reduce to something more sensible?)4Christian Weisgerber
27 Jan 25        i   i  +- Re: Early history of Bash1Keith Thompson
27 Jan 25        i   i  `* Re: Early history of Bash2Keith Thompson
27 Jan 25        i   i   `- Re: Early history of Bash1Lawrence D'Oliveiro
24 Jan 25        i   `* Re: Default PATH setting - reduce to something more sensible?27Keith Thompson
25 Jan 25        i    `* Re: Default PATH setting - reduce to something more sensible?26Janis Papanagnou
26 Jan 25        i     `* Re: Default PATH setting - reduce to something more sensible?25Keith Thompson
26 Jan 25        i      +* Re: Default PATH setting - reduce to something more sensible?23Kaz Kylheku
26 Jan 25        i      i`* Re: Default PATH setting - reduce to something more sensible?22Janis Papanagnou
26 Jan 25        i      i +* Re: Default PATH setting - reduce to something more sensible?2Kaz Kylheku
27 Jan 25        i      i i`- Re: Default PATH setting - reduce to something more sensible?1Janis Papanagnou
26 Jan 25        i      i +* Re: Default PATH setting - reduce to something more sensible?3Keith Thompson
3 Feb 25        i      i i`* Re: Default PATH setting - reduce to something more sensible?2Keith Thompson
3 Feb 25        i      i i `- Re: Default PATH setting - reduce to something more sensible?1Kaz Kylheku
27 Jan 25        i      i `* Re: Default PATH setting - reduce to something more sensible?16Lawrence D'Oliveiro
27 Jan 25        i      i  +- Re: Default PATH setting - reduce to something more sensible?1Kenny McCormack
27 Jan 25        i      i  +* Re: Default PATH setting - reduce to something more sensible?11Alexis
27 Jan 25        i      i  i+* Re: Default PATH setting - reduce to something more sensible?2Kenny McCormack
27 Jan 25        i      i  ii`- Re: Default PATH setting - reduce to something more sensible?1Alexis
27 Jan 25        i      i  i`* Re: Default PATH setting - reduce to something more sensible?8Lawrence D'Oliveiro
27 Jan 25        i      i  i `* Re: Default PATH setting - reduce to something more sensible?7Keith Thompson
27 Jan 25        i      i  i  +* Re: Default PATH setting - reduce to something more sensible?3Kaz Kylheku
27 Jan 25        i      i  i  i`* Arbitrary characters in filenames (was Re: Default PATH setting ...)2Janis Papanagnou
27 Jan 25        i      i  i  i `- Re: Arbitrary characters in filenames (was Re: Default PATH setting ...)1Kaz Kylheku
28 Jan 25        i      i  i  `* Re: Default PATH setting - reduce to something more sensible?3Lawrence D'Oliveiro
28 Jan 25        i      i  i   +- Re: Default PATH setting - reduce to something more sensible?1Keith Thompson
28 Jan 25        i      i  i   `- Re: Default PATH setting - reduce to something more sensible?1Kenny McCormack
27 Jan 25        i      i  +* Re: Default PATH setting - reduce to something more sensible?2Janis Papanagnou
28 Jan 25        i      i  i`- Re: Default PATH setting - reduce to something more sensible?1Lawrence D'Oliveiro
27 Jan 25        i      i  `- Re: Default PATH setting - reduce to something more sensible?1Kaz Kylheku
26 Jan 25        i      `- Re: Default PATH setting - reduce to something more sensible?1Janis Papanagnou
23 Jan 25        +* Re: Default PATH setting - reduce to something more sensible?14Kaz Kylheku
23 Jan 25        i`* Re: Default PATH setting - reduce to something more sensible?13Keith Thompson
24 Jan 25        i +* Re: Default PATH setting - reduce to something more sensible?5Keith Thompson
24 Jan 25        i i`* Re: Default PATH setting - reduce to something more sensible?4Kaz Kylheku
24 Jan 25        i i `* Re: Default PATH setting - reduce to something more sensible?3Keith Thompson
24 Jan 25        i i  `* Re: Default PATH setting - reduce to something more sensible?2Lawrence D'Oliveiro
24 Jan 25        i i   `- Re: Default PATH setting - reduce to something more sensible?1Keith Thompson
24 Jan 25        i `* Re: Default PATH setting - reduce to something more sensible?7Janis Papanagnou
24 Jan 25        i  `* Re: Default PATH setting - reduce to something more sensible?6Dan Cross
24 Jan 25        i   `* Re: Default PATH setting - reduce to something more sensible?5Janis Papanagnou
24 Jan 25        i    +* Re: Default PATH setting - reduce to something more sensible?2Dan Cross
25 Jan 25        i    i`- Re: Default PATH setting - reduce to something more sensible?1Janis Papanagnou
24 Jan 25        i    `* Re: Default PATH setting - reduce to something more sensible?2Keith Thompson
25 Jan 25        i     `- Re: Default PATH setting - reduce to something more sensible?1Janis Papanagnou
24 Jan 25        `* Re: Default PATH setting - reduce to something more sensible?2Geoff Clare
24 Jan 25         `- Re: Default PATH setting - reduce to something more sensible?1Kenny McCormack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal