* doc/autoconf.texi (File Descriptors): Document how to silence a program probe.
Signed-off-by: Eric Blake <[email protected]> --- This recently popped up on the libvirt list; while bash, dash, ksh, and zsh are all silent, Solaris and FreeBSD 8.0 /bin/sh are noisy and check for missing programs before redirections. ChangeLog | 6 ++++++ doc/autoconf.texi | 12 ++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index 454f5aa..8b4c0f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-05-11 Eric Blake <[email protected]> + + Mention how to silence program probes. + * doc/autoconf.texi (File Descriptors): Document how to silence a + program probe. + 2010-04-26 Ralf Wildenhues <[email protected]> Error and warning message formatting cleanups. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index d6a08bc..2873578 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -14793,6 +14793,18 @@ File Descriptors @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. -- 1.7.0.1
