Re: feature request: file_not_found_handle()

2013-08-29 Thread Aharon Robbins
Hi. > Date: Tue, 20 Aug 2013 11:02:24 -0400 > From: Greg Wooledge > To: Aharon Robbins > Cc: bug-bash@gnu.org > Subject: Re: feature request: file_not_found_handle() > > On Tue, Aug 20, 2013 at 05:48:12PM +0300, Aharon Robbins wrote: > > In article you write: > &g

Re: feature request: file_not_found_handle()

2013-08-21 Thread Ken Irving
On Wed, Aug 21, 2013 at 12:21:11PM -0700, Eduardo A. Bustamante López wrote: > On Wed, Aug 21, 2013 at 08:39:53PM +0200, Andreas Gregor Frank wrote: > > Hello Greg, > > > > this is a feature request for no_such_file_or_directory_ > > handle(). I do not want to talk about missing quotes in anyone's

Re: feature request: file_not_found_handle()

2013-08-21 Thread Chris Down
On 2013-08-21 13:12, Ken Irving wrote: > Yes I do have some idea. I read the bash-bug list regularly, and many > times (even if you can't tell) refer to the wiki you host, read the FAQs, > RTFMs, try to absorb what wisdom I can, and in general try to improve on > the bash coding I do use. But thi

Re: feature request: file_not_found_handle()

2013-08-21 Thread Ken Irving
On Wed, Aug 21, 2013 at 08:10:50AM -0400, Greg Wooledge wrote: > On Wed, Aug 21, 2013 at 02:22:24AM -0800, Ken Irving wrote: > > $ cat $(ambler.method dispatch) > > #!/bin/bash > > method=$1 && shift > > test -n "$method" || exit > > for s in $(ls|shuf); do > > tob $s.$m

Re: feature request: file_not_found_handle()

2013-08-21 Thread Andreas Gregor Frank
Hi Eduardo, thank you very much for this constructive and honest answer. Not what i hoped to see, but this is only a request. For me only a nice to have...so fine bye Andreas 2013/8/21 Eduardo A. Bustamante López > On Wed, Aug 21, 2013 at 08:39:53PM +0200, Andreas Gregor Frank wrote: > > Hell

Re: feature request: file_not_found_handle()

2013-08-21 Thread Eduardo A . Bustamante López
On Wed, Aug 21, 2013 at 08:39:53PM +0200, Andreas Gregor Frank wrote: > Hello Greg, > > this is a feature request for no_such_file_or_directory_ > handle(). I do not want to talk about missing quotes in anyone's code > example! You are free to send patches with the proposed feature. That way we w

Re: feature request: file_not_found_handle()

2013-08-21 Thread Andreas Gregor Frank
Hello Greg, this is a feature request for no_such_file_or_directory_ handle(). I do not want to talk about missing quotes in anyone's code example! And the question if it makes sense to implement a command_not_found_handle() in this or that way has nothing to do with this request, too. How someone

Re: feature request: file_not_found_handle()

2013-08-21 Thread Greg Wooledge
On Wed, Aug 21, 2013 at 02:22:24AM -0800, Ken Irving wrote: > $ cat $(ambler.method dispatch) > #!/bin/bash > method=$1 && shift > test -n "$method" || exit > for s in $(ls|shuf); do > tob $s.$method "$@" & > done As far as I can tell, this is some incredibly stupid

Re: feature request: file_not_found_handle()

2013-08-21 Thread Linda Walsh
Chris Down wrote: On 2013-08-20 18:47, Linda Walsh wrote: If it wasn't for things doing what we don't expect, many things wouldn't be around (aspirin, popcorn, digitalis, Rogain, & tons more... most things are found by NOT using them they way you are directed to use them). This is such a poo

Re: feature request: file_not_found_handle()

2013-08-21 Thread Chris Down
On 2013-08-20 18:47, Linda Walsh wrote: > If it wasn't for things doing what we don't expect, many things wouldn't be > around (aspirin, popcorn, digitalis, Rogain, & tons more... most things are > found by NOT using them they way you are directed to use them). This is such a poor analogy that I d

Re: feature request: file_not_found_handle()

2013-08-21 Thread Ken Irving
On Tue, Aug 20, 2013 at 04:44:57PM +0200, Roman Rakus wrote: > You are badly using features of bash. Write a script which will do > things for you, or use any other language/shell. There's only one feature being used, a hook that bash calls in the event that a command is not found. The request i

Re: feature request: file_not_found_handle()

2013-08-20 Thread Linda Walsh
Roman Rakus wrote: You are badly using features of bash. Write a script which will do things for you, or use any other language/shell. --- Why? Please, accept this response as a suggestion. --- Seems to be a bit provincial. command_not_found_handle is designed to do other things than you

Re: feature request: file_not_found_handle()

2013-08-20 Thread Chet Ramey
On 8/20/13 11:02 AM, Greg Wooledge wrote: > On Tue, Aug 20, 2013 at 05:48:12PM +0300, Aharon Robbins wrote: >> In article you write: >>> 1) PATH is used by the kernel (exec family) to determine how commands are >>> executed. The way PATH is used by the kernel is not likely to change. >>> Havi

Re: feature request: file_not_found_handle()

2013-08-20 Thread Greg Wooledge
On Tue, Aug 20, 2013 at 05:48:12PM +0300, Aharon Robbins wrote: > In article you write: > >1) PATH is used by the kernel (exec family) to determine how commands are > > executed. The way PATH is used by the kernel is not likely to change. > > Having the shell treat it differently would lead t

Re: feature request: file_not_found_handle()

2013-08-20 Thread Roman Rakus
You are badly using features of bash. Write a script which will do things for you, or use any other language/shell. Please, accept this response as a suggestion. command_not_found_handle is designed to do other things than you are expecting. RR On 08/19/2013 10:29 PM, Andreas Gregor Frank

Re: feature request: file_not_found_handle()

2013-08-20 Thread Greg Wooledge
On Mon, Aug 19, 2013 at 08:02:39PM -0700, Linda Walsh wrote: > Yes, I see what you mean. I guess I'm not real certain > as to why, if "CDPATH=~/Documents", and I type "cd Pictures/family" > and end up in ~/Documents/Pictures/family, then PATH shouldn't work > the same way. There are several

Re: feature request: file_not_found_handle()

2013-08-19 Thread Linda Walsh
Ken Irving wrote: On Sun, Aug 18, 2013 at 06:30:47PM -0700, Linda Walsh wrote: Chet Ramey wrote: On 8/14/13 7:44 AM, Andreas Gregor Frank wrote: Hi, i think a file_not_found_handle() or a modified command_not_found_handle(), that does not need an unsuccessful PATH search to be triggered, wo

Re: feature request: file_not_found_handle()

2013-08-19 Thread Andreas Gregor Frank
Hi Chet, sorry, i thought you talk about the bash code. I didn't want to show my own usecase but now i have to ;-): I have a File class and can construct a File "object" for example: File anObjectName /etc/passwd and then i can do e.g. anObjectName.getInode (this already works with command_not_fou

Re: feature request: file_not_found_handle()

2013-08-19 Thread Chet Ramey
On 8/19/13 6:57 AM, Andreas Gregor Frank wrote: > Hi Chet, > > I have no idea if there is "enough" demand, but i think there will be some > ideas to use this feature... > I still think it is a question of consistency to be able to handle a "No > such file or directory event", if i can do this with

Re: feature request: file_not_found_handle()

2013-08-19 Thread Chet Ramey
On 8/18/13 9:30 PM, Linda Walsh wrote: >> A PATH search is suppressed when the command to be executed contains a >> slash: the presence of a slash indicates an absolute pathname that is >> directly passed to exec(). Since there's no search done, you know exactly >> which pathname you're attemptin

Re: feature request: file_not_found_handle()

2013-08-19 Thread Andreas Gregor Frank
Hi Chet, I have no idea if there is "enough" demand, but i think there will be some ideas to use this feature... I still think it is a question of consistency to be able to handle a "No such file or directory event", if i can do this with a "command not found event" (independent of the command_not

Re: feature request: file_not_found_handle()

2013-08-18 Thread Ken Irving
On Sun, Aug 18, 2013 at 06:30:47PM -0700, Linda Walsh wrote: > > Chet Ramey wrote: > >On 8/14/13 7:44 AM, Andreas Gregor Frank wrote: > >>Hi, > >> > >>i think a file_not_found_handle() or a modified command_not_found_handle(), > >>that does not need an unsuccessful PATH search to be triggered, wou

Re: feature request: file_not_found_handle()

2013-08-18 Thread Linda Walsh
Chet Ramey wrote: On 8/14/13 7:44 AM, Andreas Gregor Frank wrote: Hi, i think a file_not_found_handle() or a modified command_not_found_handle(), that does not need an unsuccessful PATH search to be triggered, would be useful and consistent. The original rationale for command_not_found_hand

Re: feature request: file_not_found_handle()

2013-08-18 Thread Ken Irving
On Sun, Aug 18, 2013 at 02:35:49PM -0400, Chet Ramey wrote: > On 8/14/13 7:44 AM, Andreas Gregor Frank wrote: > > Hi, > > > > i think a file_not_found_handle() or a modified command_not_found_handle(), > > that does not need an unsuccessful PATH search to be triggered, would be > > useful and cons

Re: feature request: file_not_found_handle()

2013-08-18 Thread Chet Ramey
On 8/14/13 7:44 AM, Andreas Gregor Frank wrote: > Hi, > > i think a file_not_found_handle() or a modified command_not_found_handle(), > that does not need an unsuccessful PATH search to be triggered, would be > useful and consistent. The original rationale for command_not_found_handle is that the

Re: feature request: file_not_found_handle()

2013-08-18 Thread Ken Irving
On Sat, Aug 17, 2013 at 01:46:16PM +0200, Andreas Gregor Frank wrote: > same reason for me: some object-oriented shell ( > http://oobash.sourceforge.net/) We're both running commands in the form 'object.method ...', and it works very naturally on the shell using the command-not-found hook. The pr

Re: feature request: file_not_found_handle()

2013-08-17 Thread Andreas Gregor Frank
Hi Ken, same reason for me: some object-oriented shell ( http://oobash.sourceforge.net/) "But given that the first entry on a command line pretty much has to be a command, I'm not sure it makes sense to invoke file_not_found_handle()" I think you are right. But then we go in circles...: http://

Re: feature request: file_not_found_handle()

2013-08-14 Thread Ken Irving
On Wed, Aug 14, 2013 at 01:44:08PM +0200, Andreas Gregor Frank wrote: > Hi, > > i think a file_not_found_handle() or a modified command_not_found_handle(), > that does not need an unsuccessful PATH search to be triggered, would be > useful and consistent. > > i found this old (Dec, 2009) discussi

feature request: file_not_found_handle()

2013-08-14 Thread Andreas Gregor Frank
Hi, i think a file_not_found_handle() or a modified command_not_found_handle(), that does not need an unsuccessful PATH search to be triggered, would be useful and consistent. i found this old (Dec, 2009) discussion : http://gnu-bash.2382.n7.nabble.com/command-not-found-handle-not-called-if-comma