On Thursday 06 April 2006 07:41, Alexander Skwar wrote:
> Bo Andresen wrote:
> > Heh.. this one is better ;) :
> > # cat /var/lib/portage/world | awk -F\/ '{system("eix -F -C "$1" -e "$2"
> > -c | head -n 1")}'
>
> Nah, it's NOT, because of the "Useless Use Of Cat". Even
> better:
>
> awk -F\/ '{system("eix -F -C "$1" -e "$2" -c | head -n 1")}' <
> /var/lib/portage/world

Useless use of cat is always... well... useless. But even despite the useless 
use of cat it is better than the original command. Here is why:

# eix ^sys-libs/libstdc++-v3$

Found 0 matches

$ eix -C sys-libs -e libstdc++-v3 -c
[I] sys-libs/libstdc++-v3 (3.3.6): Compatibility package for running binaries 
linked against a pre gcc 3.4 libstdc++

Found 1 matches

Here the original command resulted in an empty line whereas the new command 
results in the package being shown. Still I really should remember to avoid 
useless use of cat especially when posting to a mailing. :)

-- 
Bo Andresen
-- 
gentoo-user@gentoo.org mailing list

Reply via email to