On Wed, 14 Jun 2006 17:01:18 -0700, Richard Fish wrote:

> ldd `which kontact kmail knode akregator` | grep '=>' | awk '{print
> $3}' \
>     | sort | uniq | xargs equery belongs | grep '/' | sort | uniq \
>     | xargs printf "=%s\n" | xargs emerge -p --oneshot
> 
> (Ok people, have at it.  Show me how you can do this in 5 commands or
> less.)

<pedant>That should be "five commands or fewer"</pedant> :)

awk does pattern matching, so you can drop the first grep and use
awk '/=>/ {print $3}'

The second grep appears redundant too, when i tried this, all lines
contained '/'.

Both invocations of uniq are unnecessary, use sort -u instead.

Replacing 'xargs printf "=%s\n"' with 'sed s/^/=/' is technically one
less command, although the same number of pipeline stages.

So that's five commands removed without thinking or adding anything
original... I should be a consultant :)


-- 
Neil Bothwick

WinErr 01B: Illegal error - You are not allowed to get this error.
            Next time you will get a penalty for that.

Attachment: signature.asc
Description: PGP signature

Reply via email to