golf anyone?

ivan-bad@420.am ivan-bad@420.am
Tue, 25 Feb 2003 23:14:53 -0800


perl -ne '/^([\w\-]+): (.*)$/ and ${$1}=$2;next if (/^ \.$/ and $l=1
);print "$Package $Version\n" if $l && /^$/;$l=0;' /var/lib/dpkg/available

or, shorter but not as future-proof:

perl -ne '/^(\w\w)[\w\-]+: (.*)$/ and ${$1}=$2;next if (/^ \.$/ and $l=1
);print "$Pa $Ve\n" if $l && /^$/;$l=0;' /var/lib/dpkg/available

-- 
_ivan