From fb5456fecc39ce2037e7968328346cf93e833a5d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 8 Sep 2010 10:44:26 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ gnulib-tool | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2891ccfe5..f36acb6d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-09-08 Bruno Haible + + 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 * lib/regex.h: Fix a mention of `regex_compile' (should be diff --git a/gnulib-tool b/gnulib-tool index 28d5b69ad..e359ae65e 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -842,14 +842,22 @@ cat </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" \ -- 2.11.0