public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] splitdebug
Date: Thu, 15 Jun 2006 09:53:23 +0100	[thread overview]
Message-ID: <20060615095323.3712545c@krikkit.digimed.co.uk> (raw)
In-Reply-To: <7573e9640606141701m41ed179cs4bbfe7b5db4c1dc6@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2006-06-15  8:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-14 20:57 [gentoo-user] splitdebug Bo Ørsted Andresen
2006-06-14 21:28 ` Richard Fish
2006-06-14 21:45   ` Bo Ørsted Andresen
2006-06-15  0:01     ` Richard Fish
2006-06-15  0:25       ` Bo Ørsted Andresen
2006-06-15  1:09         ` Bo Ørsted Andresen
2006-06-15  1:57           ` Richard Fish
2006-06-15  8:53       ` Neil Bothwick [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060615095323.3712545c@krikkit.digimed.co.uk \
    --to=neil@digimed.co.uk \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox