help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mapfile -C issue


From: alex xmb ratchev
Subject: Re: mapfile -C issue
Date: Mon, 19 Jun 2023 19:34:20 +0200

On Mon, Jun 19, 2023, 19:30 Chet Ramey <chet.ramey@case.edu> wrote:

> On 6/18/23 10:12 AM, alex xmb ratchev wrote:
> > On Sun, Jun 18, 2023, 03:34 Emanuele Torre <torreemanuele6@gmail.com>
> wrote:
>
> >> Anyway,  -C C -c 3  will call C every 3 lines/records read with the
> >> current index of the array that will be set, and the current record.
> >> Note that the callback is called before that record is stored in the
> >> array.
>
> Yes, this is how it works, and how it's documented.
>
> >> And -c3 WILL NOT call C every 3 records, before assigning those three
> >> records passing   key1 value1 key2 value2 key3 value3   to C.
> >>
> >
> > i see , didnt get that so
> >
> > thanks
> >
> > That is not how it is documented to work.
>
> How so? This is how it's documented:
>
>        -C     Evaluate  callback each time quantum lines are read.  The
>               -c option specifies quantum.
>        -c     Specify the number of lines read  between  each  call  to
>               callback.
>
> and
>
>        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.
>
> Which part is not clear?
>

hi ..
first , its my issue
the other tried to help

second , i read -c , but had the impression if i -c 3 it would 3 at once
not .. empty read lines without calling -C

its some my english issue ..

gg , thanks , greets

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]