On Wed, Mar 17, 1999 at 08:41:14AM +1100, Craig Sanders wrote: > b) it assumes that the 'Status' line will > always follow the corresponding 'Package' line (true in practice but > assumptions are bad). You can remove this assumption by using my grep-dctrl program. It outputs the fields in the order you specify on the command line. So the interesting three-liner would become grep-dctrl -sPackage,Status '' /var/lib/dpkg/status | sed -e 's/Package: //' -e 's/Status: //' -e 's/ ok .*//' | xargs -n 2 echo (There's a bug in grep-dctrl that when '' is the search pattern, the output includes a superfluous paragraph with empty field bodies. I'll fix it one of these days. The bug seems not bother this script, though.) -- %%% Antti-Juhani Kaijanaho % gaia@iki.fi % http://www.iki.fi/gaia/ %%% "Fight them without becoming them." (J. Michael Straczynski: Babylon 5, 3rd Season)
Attachment:
pgpvnqfjyj7hc.pgp
Description: PGP signature