On Saturday 08 July 2006 12:21 pm, Horst von Brand wrote: > > +LENGTH=$(cat .config | wc -l) > > Why the cat(1)? "wc -l < .config" is the same I believe it was originally a longer pipeline, and I can't wc the file directly or it'll spit out the filename, but < is indeed one less process spawned per loop. > > +# Loop through all lines in the file > > +I=1 > > +while true > > +do > > + if [ $I -gt $LENGTH ] > > + then > > + break > > + fi > > Could do it with: > > for I in $(seq 1 $LENGTH); do > ... > done Makes a 1/10th of a second difference to the final runtime, but if you prefer that... > or just plain read the lines > > > + > > + echo -n -e "\r"$I/$LENGTH lines $(cat "$OUTPUT" | wc -c) bytes > > Again, unnecessary cat(1). Yup, a valid cleanup. The thing is, the script's going to be dog slow no matter what I do, and most of the slowness isn't in the script, it's the config infrastructure re-parsing the config file 1500 times or so for defconfig. (The script's about 3% of the runtime overhead, and the two largest chunks of that are printing out the progress indicator and the sed invocation right above the make.) So I didn't put that much effort into optimizing it. Someday I'd like to go in and make kconfig spit out a miniconfig directly, but kconfig's not really set up to do that, and touching Roman Zippel's code would give him the opportunity to say no again. Anyway, here's a version with your fixes. Thanks for the review, Rob -- Never bet against the cheap plastic solution.