public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Richard Fish" <bigfish@asmallpond.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] redirect
Date: Fri, 21 Jul 2006 15:43:30 -0700	[thread overview]
Message-ID: <7573e9640607211543h449e222dwd559550852ce0bac@mail.gmail.com> (raw)
In-Reply-To: <44C14314.8050303@lockie.ca>

On 7/21/06, James Lockie <bjlockie@lockie.ca> wrote:
> How do I redirect the error from an emerge?
> I did 'emerge system 2>&1 >t' and that does most of it but it misses the
> actual error message.

2>&1 >foo is the wrong syntax for what you want.  This first copies
stderr to stdout, and the second part redirects stdout to a file, but
stderr is still going to the file descriptor that stdout originally
refered to.  It is logically the equivalent of:

stdout=1
stderr=2
stderr=$stdout
stdout=foo
echo $stderr

The correct syntax is ">foo 2>&1", which does the logical equivalent of:

stdout=1
stderr=2
stdout=foo
stderr=$stdout

HTH,
-Richard
-- 
gentoo-user@gentoo.org mailing list



  parent reply	other threads:[~2006-07-21 22:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-21 21:11 [gentoo-user] redirect James Lockie
2006-07-21 22:26 ` Neil Bothwick
2006-07-21 22:43 ` Richard Fish [this message]
2006-07-22  8:34   ` Neil Bothwick

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=7573e9640607211543h449e222dwd559550852ce0bac@mail.gmail.com \
    --to=bigfish@asmallpond.org \
    --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