gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
authorBruno Haible <bruno@clisp.org>
Wed, 8 Sep 2010 08:44:26 +0000 (10:44 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 8 Sep 2010 08:44:26 +0000 (10:44 +0200)
* gnulib-tool: Use stderr redirection around the 'alias' and 'unalias'
commands, because some shells ignore redirections when there is an
error in the command lookup.
Reported by Eric Blake.

ChangeLog
gnulib-tool

index 2891ccf..f36acb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-08  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
+       * gnulib-tool: Use stderr redirection around the 'alias' and 'unalias'
+       commands, because some shells ignore redirections when there is an
+       error in the command lookup.
+       Reported by Eric Blake.
+
 2010-09-07  Reuben Thomas  <rrt@sc3d.org>
 
        * lib/regex.h: Fix a mention of `regex_compile' (should be
index 28d5b69..e359ae6 100755 (executable)
@@ -842,14 +842,22 @@ cat <<EOF
 $*
 EOF
 }
-alias echo=bsd_echo 2>/dev/null
+exec 3>&2
+exec 2>/dev/null
+alias echo=bsd_echo
+exec 2>&3
+exec 3>&-
 fi
 if test -z "$have_echo" \
    && echo '\t' | grep t > /dev/null; then
   have_echo=yes
 fi
 if test -z "$have_echo"; then
-  unalias echo 2>/dev/null
+  exec 3>&2
+  exec 2>/dev/null
+  unalias echo
+  exec 2>&3
+  exec 3>&-
 fi
 # For Solaris /bin/sh and OSF/1 /bin/sh: respawn using /bin/ksh.
 if test -z "$have_echo" \