Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Feb 2000 22:25:56 +0000
From:      Ben Smithurst <ben@scientia.demon.co.uk>
To:        R Joseph Wright <rjoseph@nwlink.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: how to capture errors to a file
Message-ID:  <20000223222556.B38611@strontium.scientia.demon.co.uk>
In-Reply-To: <Pine.BSF.4.21.0002221754350.506-100000@mammalia.sea>
References:  <10002221732.aa23317@ccstores.com> <Pine.BSF.4.21.0002221754350.506-100000@mammalia.sea>

next in thread | previous in thread | raw e-mail | index | archive | help
R Joseph Wright wrote:

>>> "make 2>&1 > errorfile" - nope
> 
> What's the "2>&1 >" for?

RTFM (man sh). It means "redirect descriptor 2 to wherever descriptor
1 currently is, then redirect fd 1 to 'errorfile'". More usual is the
">file 2>&1" order which redirects fd 1 to "file", *then* redirects fd
2 onto fd 1, so both go to the file. Doing "2>&1 >file" redirects fd 2
to fd 1, then redirects only fd 1 to "file", with fd 2 probably still
pointing at the user's terminal (or wherever fd 1 was originally). Hence
the reason the above command line didn't do what was wanted.

-- 
Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000223222556.B38611>