|
| From: | Chet Ramey |
| Subject: | Re: Kludge for handling REPL arithmetic expressions |
| Date: | Tue, 3 Aug 2021 09:58:25 -0400 |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 |
On 8/3/21 9:53 AM, Tapani Tarvainen wrote:
On Tue, Aug 03, 2021 at 09:26:32AM -0400, Chet Ramey (chet.ramey@case.edu) wrote:On 8/3/21 3:05 AM, Tapani Tarvainen wrote:Right: command_not_found_handle() is not called when there's a slash in the command. Offhand I can't any reason why it shouldn't, but making that happen would mean modifying bash source code. A wishlist item, then.It doesn't because there's no point: a slash in the command name means the shell doesn't look for it in $PATH. It's a filesystem path.Well, yes, except when someone wants to (ab)use command_not_found_handle() to catch things that are not parsed as command names to handle them in non-standard ways, like the original poster tried to do here.
Sure, that's the point. There are reasons that command_not_found_handle
behaves as it does, and if you want to get around them, you're bound to
run into the limitations of your approach.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
| [Prev in Thread] | Current Thread | [Next in Thread] |