diff options
author | Bruno Haible <bruno@clisp.org> | 2010-09-09 11:39:51 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-09-09 11:41:12 +0200 |
commit | 779b5db53e13d9371a95def7d8aeeabc62c70164 (patch) | |
tree | 98f55eef05435bb6b7f5afaa63f7bc8242b6ac4d /gnulib-tool | |
parent | f7a9af7f49d267d084e47fab6853c81ad65f09e9 (diff) | |
download | gnulib-779b5db53e13d9371a95def7d8aeeabc62c70164.tar.gz |
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.
Diffstat (limited to 'gnulib-tool')
-rwxr-xr-x | gnulib-tool | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gnulib-tool b/gnulib-tool index e359ae65e8..9c1176a2e7 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -836,28 +836,24 @@ fi # 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" \ |