NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/52687: can't suppress warnings from /bin/sh



The following reply was made to PR bin/52687; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/52687: can't suppress warnings from /bin/sh
Date: Wed, 01 Nov 2017 22:22:08 +0700

     Date:        Wed,  1 Nov 2017 14:35:01 +0000 (UTC)
     From:        Robert Elz <kre%munnari.OZ.AU@localhost>
     Message-ID:  <20171101143501.7CC097A1E9%mollari.NetBSD.org@localhost>
 
 And just for completeness (And not about the redirect)...
 
   |  	{ nonexistant; } 2>/dev/null
   |  
   |  works as well, without an extra fork.
 
 it is worth pointing out that POSIX allows a non-interactive shell
 to exit if an attempt is made to run a command that cannot be found.
 
 I'm not aware of any (modern) shell that makes use of that permission.
 all seem to continue after writing the error (and returning a 127 status)
 but it is worth noting that if you are deliberately running commands that
 might not exist, in a script, that doing it in a sub-shell is the portable
 way (then the shell that exits, if any does, is the sub-shell.)
 
 kre
 


Home | Main Index | Thread Index | Old Index