From: Bruno Haible Date: Wed, 8 Sep 2010 08:44:26 +0000 (+0200) Subject: gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'. X-Git-Tag: v0.1~3837 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=fb5456fecc39ce2037e7968328346cf93e833a5d;p=gnulib.git 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. --- 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" \