From owner-freebsd-questions Wed Feb 23 16:17: 5 2000 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 422E137BA11 for ; Wed, 23 Feb 2000 16:16:59 -0800 (PST) (envelope-from ben@scientia.demon.co.uk) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.12 #1) id 12NkEG-0007fh-00; Wed, 23 Feb 2000 22:25:56 +0000 Received: (from ben) by strontium.scientia.demon.co.uk (Exim 3.12 #7) id 12NkEG-000N4T-00; Wed, 23 Feb 2000 22:25:56 +0000 Date: Wed, 23 Feb 2000 22:25:56 +0000 From: Ben Smithurst To: R Joseph Wright Cc: questions@FreeBSD.ORG Subject: Re: how to capture errors to a file Message-ID: <20000223222556.B38611@strontium.scientia.demon.co.uk> References: <10002221732.aa23317@ccstores.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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