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


Groups > gnu.bash.bug > #14800

Re: [mapfile]: problem reentrance with normal file

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: [mapfile]: problem reentrance with normal file
Date 2018-11-12 13:05 -0500
Organization ITS, Case Western Reserve University
Message-ID <mailman.3931.1542045976.1284.bug-bash@gnu.org> (permalink)
References <CACXkx7VreuDnWv8EWvCAiU0E09RRMSgXkabFP5UkBPSgzcVGRA@mail.gmail.com> <cdc5932c-847e-1e55-5785-4e01e2833570@case.edu> <CACXkx7WFFO8nK=H6aKYjVdthgwM_q0p916cJnjLV11FRnoMDEA@mail.gmail.com>

Show all headers | View raw


On 11/12/18 10:48 AM, Didou Serge wrote:
> Ok, in this case, this should not work either:
> 
> mapfile -C xx -c 1 UU  < <( echo -e "Premiere ligne" A{1..45} "\nDeuxieme
> ligne" B{1..45} "\nTroisieme ligne" C{1..45})
> 
> But, this form work fine.

Because the read function underlying mapfile notes that the file descriptor
is not seekable and reads only a single line at a time rather than a full
buffer of data.

Chet

-- 
``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: [mapfile]: problem reentrance with normal file Chet Ramey <chet.ramey@case.edu> - 2018-11-12 13:05 -0500

csiph-web