Re: command_not_found_handle documentation omission

2017-10-08 Thread Dan Douglas
On 10/07/2017 02:53 PM, Martijn Dekker wrote: > The bash manual and info pages state: > > | If the search is unsuccessful, the shell searches for a > | defined shell function named 'command_not_found_handle'. If that > | function exists, it is invoked with the original command and the > | origina

Re: command_not_found_handle documentation omission

2017-10-08 Thread Chet Ramey
On 10/8/17 4:54 AM, Dan Douglas wrote: > On 10/07/2017 02:53 PM, Martijn Dekker wrote: >> The bash manual and info pages state: >> >> | If the search is unsuccessful, the shell searches for a >> | defined shell function named 'command_not_found_handle'. If that >> | function exists, it is invoked

Re: command_not_found_handle documentation omission

2017-10-08 Thread Dan Douglas
On 10/08/2017 09:47 AM, Chet Ramey wrote: > It was originally intended to take the place of the error message that > bash prints when it can't find a program to execute. That message was > printed by the subshell forked to execute the command, so the message could > be redirected (nearly ll shells

Re: command_not_found_handle documentation omission

2017-10-08 Thread Dan Douglas
On 10/08/2017 10:41 AM, Dan Douglas wrote: > On 10/08/2017 09:47 AM, Chet Ramey wrote: >> It was originally intended to take the place of the error message that >> bash prints when it can't find a program to execute. That message was >> printed by the subshell forked to execute the command, so the

Re: command_not_found_handle documentation omission

2017-10-08 Thread Eduardo A . Bustamante López
On Sun, Oct 08, 2017 at 11:16:33AM -0500, Dan Douglas wrote: [...] > Thinking out loud some more... it does make sense that a user in an > interactive session expects commands to not alter their shell environment, > and a badly written command_not_found_handle could do that, possibly > without the

Re: Bash handling of ENOENT on missing files and directories

2017-10-08 Thread Jonny Grant
Hello Bob Thank you for your reply On 15/09/17 02:57, Bob Proulx wrote: Jonny Grant wrote: Please keep my email address in any replies Bob Proulx wrote: Jonny Grant wrote: Yes, it's a known limitation of POSIX that it uses a shared error code for both files and directors, ENOENT. Which witho

Re: Bash handling of ENOENT on missing files and directories

2017-10-08 Thread PePa
On 10/09/2017 05:30 AM, Jonny Grant wrote: Fair enough. I agree it has been around for longer, but meant that POSIX standardized on that limitation, and didn't offer a better solution that clarified, eg ENOENTF ENOENTD I'm guessing not making the distinction saved a bit of CPU. yes, a clearer