Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Saturday, November 3, 2012

Lines of Code

This is going to be a short one.  The other day, one of my friends asked me for a quick way to tell how many lines of code were in a project directory.  Here was my solution (thank you, Perl!)

$ find . -name '*.pl' | xargs perl -e \
'my $x = 0; foreach (<>) { $x++ }; print "$x\n"'

Of course the *.pl can be changed to whatever extension you would like, and TIMTOWTDI, but I happen to be fond of foreach loops and the <> operator, so...

Tuesday, October 9, 2012

Victory!

After switching virtual network cards in my hypervisor, I was able to get RH7.1 online.  Textutils compiled as statically linked binaries just as expected, and ran like a mo-f'ing CHAMP on the dettuxx machine.  This allowed me to download coreutils-5.0 and compile/install it.

I ran into another circular dependency with awk (which was a pre-req of upgrading Bash), and was able to cross compile the latest gawk and get it installed just fine via the RH7.1 machine.  Now I'm going to try compiling binutils, as another pre-req of bash, and see what happens... Hopefully I won't have to cross compile too much more.