From: Eric Blake Date: Tue, 11 May 2010 14:00:56 +0000 (-0600) Subject: Mention how to silence program probes. X-Git-Tag: v2.66~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41a163620f7d4803f7e649e70b386720b8135313;p=thirdparty%2Fautoconf.git Mention how to silence program probes. * doc/autoconf.texi (File Descriptors): Document how to silence a program probe. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 454f5aaf..8b4c0f4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-05-11 Eric Blake + + Mention how to silence program probes. + * doc/autoconf.texi (File Descriptors): Document how to silence a + program probe. + 2010-04-26 Ralf Wildenhues Error and warning message formatting cleanups. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index d6a08bc1..28735782 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -14793,6 +14793,18 @@ must be done @emph{inside} the command substitution. When running @samp{: `cd /zorglub` 2>/dev/null} expect the error message to escape, while @samp{: `cd /zorglub 2>/dev/null`} works properly. +On the other hand, some shells, such as Solaris or FreeBSD +@command{/bin/sh}, warn about missing programs before performing +redirections. Therefore, to silently check whether a program exists, it +is necessary to perform redirections on a subshell: + +@example +$ @kbd{/bin/sh -c 'nosuch 2>/dev/null} +nosuch: not found +$ @kbd{/bin/sh -c '(nosuch) 2>/dev/null} +$ @kbd{bash -c 'nosuch 2>/dev/null'} +@end example + FreeBSD 6.2 sh may mix the trace output lines from the statements in a shell pipeline.