Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15879

Re: Lack of documentation about mapfile callback

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Lack of documentation about mapfile callback
Date 2020-02-08 22:57 -0500
Organization ITS, Case Western Reserve University
Message-ID <mailman.537.1581220136.2412.bug-bash@gnu.org> (permalink)
References <ec577c4e-963c-26b0-94d2-0c8113e4c09c@noiraude.net> <4271e3da-e301-ed24-f86c-e812bb8779c1@case.edu>

Show all headers | View raw


On 2/8/20 9:04 PM, Léa Gris wrote:
> man bash.1
>> When callback is evaluated, it is supplied the index of the next 
>> array element to be assigned and the line to be assigned to that 
>> element as additional arguments. callback is evaluated after the
>> line is read but 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 support the bash debugger; I
assume that is a good enough example.

-- 
``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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Lack of documentation about mapfile callback Chet Ramey <chet.ramey@case.edu> - 2020-02-08 22:57 -0500

csiph-web