ming programs.
2009/3/28 Chris F.A. Johnson
> On Fri, 27 Mar 2009, Lennart Schultz wrote:
>
> Chris,
>> I agree with you to use the right tool at the right time, and mapfile
>> seems
>> not to be the right tool for my problem, but I will just give you some
>> fac
n of the program using mapfile, and
changed line=$(echo $i) to
line=${i##+([[:space:]])}
so the mainloop is absolulty without any sub shell spawns:
time xml2e2-loadepg.new
real65m2.378s
user63m16.717s
sys 0m1.124s
Lennart
2009/3/26 Chris F.A. Johnson
> On Thu, 26 Mar 2009, Lenn
;$line" in
done
With this change the job now takes more than 48 minutes. :(
It may be that I am new to mapfiles, and there are more efficient ways to
traverse a mapfile array, but if this the case please document it.
Another suggestion for mapfile:
please introduce an option to strip le
${numbe...@]}"
done < datafile
echo "${numbe...@]}"
will generate the (correct) output:
1 0
1 0 2
1 0 2 3
1 0 2 3
The first - but buggy - form will normally be prefrred while you often need
a filter like
egrep -v '^#'
in front of the while loop
--
Regards,
Lennart Schultz