From owner-freebsd-questions Fri Nov 28 00:47:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA01105 for questions-outgoing; Fri, 28 Nov 1997 00:47:41 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA01100 for ; Fri, 28 Nov 1997 00:47:36 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.5) id TAA25122; Fri, 28 Nov 1997 19:15:56 +1030 (CST) Message-ID: <19971128191555.28319@lemis.com> Date: Fri, 28 Nov 1997 19:15:55 +1030 From: Greg Lehey To: Jacques Hugo Cc: questions@FreeBSD.ORG Subject: Re: 2>&1 ??? References: <347E7CEE.41C67EA6@wired.ctech.ac.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84e In-Reply-To: <347E7CEE.41C67EA6@wired.ctech.ac.za>; from Jacques Hugo on Fri, Nov 28, 1997 at 10:12:30AM +0200 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Fri, Nov 28, 1997 at 10:12:30AM +0200, Jacques Hugo wrote: > Hi there ... > > What exacltly does this means under sh/bash: > do something 2>&1 wherever. Presumably you don't mean 'do' in the line above. The 2>&1 means "redirect file descriptor 2 (stderr) to file descriptor 1 (stdout)". This allows you, for example, to pipe both output streams to another process. > What does the 2>&1 do and where can you use > other vatiations with it? There are lots of variations. Read O'Reilly's "UNIX Power Tools" for some neat suggestions. Greg