Re: Lack of documentation about mapfile callback

2020-02-08 Thread Chet Ramey
ut before the array element is assigned. > > I can not find real-life implementation example of the mapfile callback > that fit the implied scenario of this behavior of invoking the callback > before the last array entry is assigned. The mapfile builtin originally came in to suppor

Lack of documentation about mapfile callback

2020-02-08 Thread Léa Gris
nd real-life implementation example of the mapfile callback that fit the implied scenario of this behavior of invoking the callback before the last array entry is assigned. What I figured out by experimentation, is that while the last element is not assigned to MAPFILE as seen from the callback

Re: Mapfile callback access to current line

2011-01-15 Thread Chet Ramey
On 1/15/11 12:28 AM, Chris F.A. Johnson wrote: > On Mon, 17 May 2010, Chet Ramey wrote: > >> On 4/15/10 11:56 PM, DennisW wrote: >>> Mapfile would be that much more powerful if the callback function had >>> access to the current line. Is there any chance this might be added in >>> the future? >> >

Re: Mapfile callback access to current line

2011-01-14 Thread Chris F.A. Johnson
On Mon, 17 May 2010, Chet Ramey wrote: On 4/15/10 11:56 PM, DennisW wrote: Mapfile would be that much more powerful if the callback function had access to the current line. Is there any chance this might be added in the future? Sure, there's a chance. What would be the most useful form? A s

Re: Mapfile callback access to current line

2010-05-17 Thread Chet Ramey
On 4/15/10 11:56 PM, DennisW wrote: > Mapfile would be that much more powerful if the callback function had > access to the current line. Is there any chance this might be added in > the future? Sure, there's a chance. What would be the most useful form? A shell variable that lives for the durat

Re: Mapfile callback access to current line

2010-05-04 Thread pk
DennisW wrote: > Mapfile would be that much more powerful if the callback function had > access to the current line. Is there any chance this might be added in > the future? Can't answer directly on this, but it looks like the gateway between this group and the mailing list hasn't worked for a l

Mapfile callback access to current line

2010-05-04 Thread DennisW
Mapfile would be that much more powerful if the callback function had access to the current line. Is there any chance this might be added in the future?

Re: mapfile callback

2009-07-19 Thread Chris F.A. Johnson
On Mon, 20 Jul 2009, Pierre Gaston wrote: On Mon, Jul 20, 2009 at 5:46 AM, Chris F.A. Johnson wrote: On Sun, 19 Jul 2009, Chet Ramey wrote: Chris F.A. Johnson wrote: mapfile callback code is executed in a subshell. It's not. It's executed in the same context as an `eval&

Re: mapfile callback

2009-07-19 Thread Pierre Gaston
On Mon, Jul 20, 2009 at 5:46 AM, Chris F.A. Johnson wrote: > On Sun, 19 Jul 2009, Chet Ramey wrote: > > Chris F.A. Johnson wrote: >> >>> >>> mapfile callback code is executed in a subshell. >>> >> >> It's not. It's executed in th

Re: mapfile callback

2009-07-19 Thread Chris F.A. Johnson
On Sun, 19 Jul 2009, Chet Ramey wrote: Chris F.A. Johnson wrote: mapfile callback code is executed in a subshell. It's not. It's executed in the same context as an `eval' or a trap command. So it is. Great! I wonder what I was doing wrong before. -- Chr

Re: mapfile callback

2009-07-19 Thread Chet Ramey
Chris F.A. Johnson wrote: > >mapfile callback code is executed in a subshell. It's not. It's executed in the same context as an `eval' or a trap command. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS

mapfile callback

2009-07-17 Thread Chris F.A. Johnson
mapfile callback code is executed in a subshell. Would it be possible to make it execute in the current shell? With mapfile -c1, this would make it possible to work on a file without an explicit loop, making it much faster. -- Chris F.A. Johnson <h