[nycbug-talk] what are your usefull hacks, the real simple ones

Marc Spitzer mspitzer at gmail.com
Sun May 7 02:21:12 EDT 2006

Well I was curious how out of wack my installed ports were, after a
portsnap update, and came up with this:

pkg_version|awk '{ a[$2]++} END {for (i in a) { print i ,a[i]}}'

to give me a sumery, which got refined into this bash function:

pkg_version () { /usr/sbin/pkg_version $@ |
     awk '{ a[$2]++; print $0 } END {print ""; for (i in a) { print i ,a[i]}}';

which now sits in my .bash_profile/.profile.

any other short and quick hacks out there?

"We trained very hard, but it seemed that every time we were beginning to
form into teams we would be reorganized. I was to learn later in life that
we tend to meet any new situation by reorganizing, and a wonderful method it
can be for creating the illusion of progress, while producing confusion,
inefficiency and demoralization."
-Gaius Petronius, 1st Century AD

More information about the talk mailing list