From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 17 22:24:37 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EADC37B408 for ; Sun, 17 Aug 2003 22:24:37 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9E4743F75 for ; Sun, 17 Aug 2003 22:24:36 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h7I5OZV0066342; Mon, 18 Aug 2003 00:24:35 -0500 (CDT) (envelope-from dan) Date: Mon, 18 Aug 2003 00:24:35 -0500 From: Dan Nelson To: Dan Langille Message-ID: <20030818052435.GE2653@dan.emsphone.com> References: <3F402191.27576.761E5CF@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F402191.27576.761E5CF@localhost> X-OS: FreeBSD 5.1-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org Subject: Re: Is tar doing the right thing here? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2003 05:24:37 -0000 In the last episode (Aug 18), Dan Langille said: > Why is this message not being suppressed? > > $ tar -czf test.tgz / 2>&1 > /dev/null > tar: Removing leading `/' from member names What you did was dup fd1 onto fd2, then redirect fd1 to /dev/null: fd1 -> stdout fd2 -> stderr 2>&1 fd1 -> stdout fd2 -> stdout >/dev/null fd1 -> /dev/null fd2 -> stdout Swap the two redirects, so you redirect fd1 to /dev/null, then dup it onto fd2: fd1 -> stdout fd2 -> stderr >/dev/null fd1 -> /dev/null fd2 -> stdout 2>&1 fd1 -> /dev/null fd2 -> /dev/null -- Dan Nelson dnelson@allantgroup.com