James G. Sack (jim) wrote:
> 
> Ahhh, thanks.
> 
>   grep -h -E '^(Package|Description): \
>       '/var/lib/apt/lists/*Packages|head -4
> gives
> Package: apache2
> Description: Next generation, scalable, extendable web server
> Package: apache2-doc
> Description: documentation for apache2
> 
> Making the perl a bit more meaningful.
> (Maybe <someone> will offer a sed or awk version.)

A smart person would have realised that as soon as he reached for Perl,
that was all he needed:

$ perl -ne '/^Package: (.*)/ and $p=$1;/^Description: (.*)/ and print "$p: 
$1\n"' /var/lib/apt/lists/*Packages

sed:

$ sed -ne 's/^Package: \(.*\)/\1: /p; s/^Description: \(.*\)/\1/p' 
/var/lib/apt/lists/*Packages

You will have to delete the extra newline yourself, I can't find a way
to do it.

awk:

Left as an excercise for the reader.

-john


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to