Random ramblings

All | General | Motorbikes | Networking | Odds & Sods | Soapbox | Solaris
« Previous day (Mar 31, 2005) | Main | Next day (Apr 1, 2005) »
20050401 Friday April 01, 2005

Quagga 0.98.3 released

Quagga 0.98.3 has been released. Changes include:

See the changelog for the full details.

( Apr 01 2005, 09:03:25 PM IST ) Permalink Comments [0]

awk pedantry

Jason Salkeld blogged about how to find the package a file belongs to and included this command:

grep /usr/sbin/fuser /var/sadm/install/contents | awk '$2 ~ /^f$/ {print $NF}'

Two problems:

  1. as someone else already noted, grep piped to awk is redundant.
  2. Using a regex for an absolute match on a field is overkill

The following would be more efficient (well, notionally at least... ;) ):

awk '$1 == "/usr/sbin/fuser" && $2 == "f" { print $NF }' /var/sadm/install/contents

Note that the above assumes that awk is either a shell alias for or that the executable is a symlink to either GNU Awk or nawk. (GNU Awk appears to be the more efficient of the two, for this command at least).

( Apr 01 2005, 07:00:35 PM IST ) Permalink Comments [0]

Calendar

RSS Feeds

Search

Links

Navigation

Referers