Re: non-executable files in $PATH cause errors

2021-01-14 Thread Chet Ramey
On 1/14/21 5:15 AM, Robert Elz wrote: I suspect what you're being confused by, is that the "searches for" is typically done (in shells, I have no idea what the code inside bash is like) by simply taking each element of PATH, appending "/command_name" and attempting an exec. If that succeeds,

Re: non-executable files in $PATH cause errors

2021-01-14 Thread Greg Wooledge
I give up trying to quote appropriate context. Here's what bash 5.0 is doing: unicorn:~$ echo "$PATH" /home/greg/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin unicorn:~$ type moo bash: type: moo: not found unicorn:~$ echo "echo M" > ./bin/moo unicorn:~$ moo bash

Re: non-executable files in $PATH cause errors

2021-01-14 Thread Robert Elz
Date:Wed, 13 Jan 2021 21:45:08 -0500 From:wor...@alum.mit.edu (Dale R. Worley) Message-ID: <87im806xu3@hobgoblin.ariadne.com> | Of course, as described in the manual page, Bash first searches for an | executable with the right name in the PATH, and then if that

Re: non-executable files in $PATH cause errors

2021-01-13 Thread Dale R. Worley
> On 2021/01/09 23:52, n952162 wrote: >> I consider it a bug that bash (and its hash functionality) includes >> non-executable files in its execution look-up Of course, as described in the manual page, Bash first searches for an executable with the right name in the PATH, and then if that fails, i

Re: non-executable files in $PATH cause errors

2021-01-12 Thread L A Walsh
On 2021/01/09 23:52, n952162 wrote: Hello, I consider it a bug that bash (and its hash functionality) includes non-executable files in its execution look-up But bash doesn't have an execution lookup. It has a PATH lookup, and a completion lookup (for executables when appropriate), but the close

Re: non-executable files in $PATH cause errors

2021-01-10 Thread Eli Schwartz
On 1/10/21 10:49 AM, Ángel wrote: On 2021-01-10 at 08:52 +0100, n952162 wrote: Hello, I consider it a bug that bash (and its hash functionality) includes non-executable files in its execution look-up and then (inevitably) simply reports an error, because its such files aren't executable. Perh

Re: non-executable files in $PATH cause errors

2021-01-10 Thread Ángel
On 2021-01-10 at 08:52 +0100, n952162 wrote: > Hello, > > I consider it a bug that bash (and its hash functionality) includes > non-executable files in its execution look-up and then (inevitably) > simply reports an error, because its such files aren't executable. > > Perhaps it's there to suppo