Hi all,
I was messing around trying to see how easy it would be to count
the number of passed tests from output of the GMP test suite. I'm
updating the GMP package (GCC uses it, and I'm really updating GCC)
and it is critical that all the tests pass.
Here's what I came up with. As I've really never tried to use Bash
to do things like this (I prefer Perl for parsing logs, but wanted
to use Bash for the 'educational benefit' it may provide the readers),
it is something probably everyone has been doing for years, but I
thought I'd throw it out anyway.
echo $((`grep 'tests passed' check.log | \
awk '{print $2}' | \
sed "s/.*/+&/"`))
It returns '139' when you execute it.
If anyone can provide a better solution, please pass it along as I'd
like to put something in the book.
--
Randy
rmlscsi: [bogomips 1003.28] [GNU ld version 2.16.1] [gcc (GCC) 4.0.3]
[GNU C Library stable release version 2.3.6] [Linux 2.6.14.3 i686]
08:31:00 up 32 days, 20:08, 1 user, load average: 0.00, 0.00, 0.00
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page