free hit counter

Thursday, January 12, 2006

awk: yet another reason to love UNIX

So in past lives I have often used perl -ne to take care of super simple text processing, but for some reason I haven't gotten around to installing it in on my new machine yet.

I figured it might be faster to look at awk before installing perl, as it's already on my system. Even thought I've never used it before it took less than 15 minutes to get my text processing needs done.


#get the current revision number of the subversion repository
RepositoryRev=`svn info . | awk '/Revision:/ {print $2}'`


# count the number of modified files from the subversion repository
modifiedFileCount=`svn status .. | awk '/^M/ {numModified++} END {print numModified}'`


Linkage

Labels:

0 Comments:

Post a Comment

<< Home