autoconf-patches
[Top][All Lists]
Advanced

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

[PATCH] Mention how to silence program probes.


From: Eric Blake
Subject: [PATCH] Mention how to silence program probes.
Date: Tue, 11 May 2010 08:06:00 -0600

* doc/autoconf.texi (File Descriptors): Document how to silence a
program probe.

Signed-off-by: Eric Blake <address@hidden>
---

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  <address@hidden>
+
+       Mention how to silence program probes.
+       * doc/autoconf.texi (File Descriptors): Document how to silence a
+       program probe.
+
 2010-04-26  Ralf Wildenhues  <address@hidden>

        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
address@hidden/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:
+
address@hidden
+$ @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'}
address@hidden example
+
 FreeBSD 6.2 sh may mix the trace output lines from the statements in a
 shell pipeline.

-- 
1.7.0.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]