diff gnulib-tool @ 13658:a597697ae97c

gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'. * gnulib-tool: Don't fiddle with file descriptors 0, 1, 2. Instead, use a reliable way to determine whether the 'alias' command works.
author Bruno Haible <bruno@clisp.org>
date Thu, 09 Sep 2010 11:39:51 +0200
parents 10c072121fd2
children 6a2c7d3ca5f0
line wrap: on
line diff
--- a/gnulib-tool	Wed Sep 08 22:24:22 2010 +0200
+++ b/gnulib-tool	Thu Sep 09 11:39:51 2010 +0200
@@ -836,28 +836,24 @@
 # that the top-level statement containing the test starts after the 'alias'
 # command.
 if test -z "$have_echo"; then
-bsd_echo ()
+  bsd_echo ()
 {
 cat <<EOF
 $*
 EOF
 }
-exec 3>&2
-exec 2>/dev/null
-alias echo=bsd_echo
-exec 2>&3
-exec 3>&-
+  if (alias echo=bsd_echo) 2>/dev/null; then
+    alias echo=bsd_echo 2>/dev/null
+  fi
 fi
 if test -z "$have_echo" \
    && echo '\t' | grep t > /dev/null; then
   have_echo=yes
 fi
 if test -z "$have_echo"; then
-  exec 3>&2
-  exec 2>/dev/null
-  unalias echo
-  exec 2>&3
-  exec 3>&-
+  if (alias echo=bsd_echo) 2>/dev/null; then
+    unalias echo 2>/dev/null
+  fi
 fi
 # For Solaris /bin/sh and OSF/1 /bin/sh: respawn using /bin/ksh.
 if test -z "$have_echo" \