2021年5月10日(月) 8:11 Chet Ramey <chet.ra...@case.edu>: > On 5/7/21 8:35 PM, Koichi Murase wrote: > > > > Ah, I see it was based on the fact that there have been no bug > > reports. > > That't my best metric. > > > Actually, I'm wondering in what situation we can > > usefully specify the `-C callback' option because it seems like we can > > anytime process blocks of elements after the entire array is loaded. > > `mapfile' came as part of contributions associated with the bash debugger. > Maybe take a look there to see how it uses -C?
Oh, that is new information for me. Thank you. I've checked bashdb-5.0-1.1.2 and found that `-C callback' was actually used to show the progress bar for reading data. OK, the option `-C' is indeed useful in showing the progress of mapfile/readarray processing. bashdb-5.0-1.1.2/lib/filecache.sh:220 > builtin mapfile -t -O 1 -c $BIGFILE \ > -C "_Dbg_progess_show \"${progress_prefix}\" ${line_count}" \ > $_Dbg_source_array_var < "$fullname" bashdb-5.0-1.1.2/lib/filecache.sh:231 > builtin readarray -t -O 1 -c $BIGFILE \ > -C "_Dbg_progess_show \"${progress_prefix}\" ${line_count}" \ > $_Dbg_highlight_array_var < "$tempfile" bashdb-5.0-1.1.2/init/io.sh:33 > # _Dbg_progess_show --- print the progress bar > # $1: prefix string > # $2: max value > # $3: current value > function _Dbg_progess_show { -- Koichi