From owner-freebsd-questions Wed Jul 17 5:50:33 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95E0F37B400 for ; Wed, 17 Jul 2002 05:50:31 -0700 (PDT) Received: from anchorageinternet.org (groggy.anc.acsalaska.net [208.151.119.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3DAC143E4A for ; Wed, 17 Jul 2002 05:50:10 -0700 (PDT) (envelope-from abc@anchorageinternet.org) Received: (from abc@localhost) by anchorageinternet.org (8.12.3/8.11.6) id g6HClE8B083466; Wed, 17 Jul 2002 12:47:14 GMT (envelope-from abc@anchorageinternet.org) Date: Wed, 17 Jul 2002 12:47:14 GMT From: Abc Xyz Message-Id: <200207171247.g6HClE8B083466@anchorageinternet.org> Subject: Re: /dev/null and 2>&- X-Mailer: Umail v2.3 To: "Mauritz Sundell" To: "freebsd-questions" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > i just installed 4.6-RELEASE, and notice that > > the '2>&-' sh (FBSD) construct seems to be broken. > > i am going thru all my scripts having to change > > it to /dev/null ... > In what way is it broken? > If the construct is generally used for hiding errormessages, one > should probably replace it with '2>/dev/null' anyway, since 2>&- > only closes filedescriptor 2 at startup of program and the first file > the program opens will be assigned the very same and all output > to stderr will come up in that file. > Example, > sh> tee < /dev/null 2>&- empty /nonexistent/missingfile > sh> cat empty > tee: /nonexistent/missingfile: No such file or directory > sh> this example above is incorrect with regards to 4.6-RELEASE. with 4.6-RELEASE, output is as follows: Example, sh> tee < /dev/null 2>&- empty /nonexistent/missingfile tee: /nonexistent/missingfile: No such file or directory sh> cat empty sh> > sh> tee < /dev/null 2>/dev/null empty /nonexistent/missingfile > sh> cat empty > sh> > > i figure it's not realistic to assume a bug this > > obvious would make it to release stage, so my > > question is - is something else going on? > > or is this just due to changes in 'sh'? > > is it a bug? or is it a permenent change? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message