* Ralf Wildenhues wrote on Thu, Jan 27, 2005 at 09:39:46AM CET:
> 
> I have attached a small script, and encourage
> people to test it on all their shells they can find on their systems.
> It should reveal at least one working echo, and, in most cases, find
> builtins to do the job.

and here it is..
#! /bin/sh

# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) 
>/dev/null 2>&1; then
  set -o posix
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh

: ${lt_ECHO=echo}

func_fallback_echo ()
{
    # Without the eval, Bourne shells create the here doc at definition time.
    eval 'cat <<_LT_EOF
$*
_LT_EOF
'
    :   # work around bash bug
}

for ECHO in "$lt_ECHO" 'print -r' 'printf %s\n' func_fallback_echo \
            '/usr/bin/printf %s\n' false
do
  if test X`{ $ECHO '\t'; } 2>/dev/null` = 'X\t'; then
    set x $ECHO; shift
    type $1
    case `{ type $1; } 2>/dev/null` in
      *builtin*) $ECHO "$ECHO is a working builtin echo." ;;
      *)         $ECHO "$ECHO is a working external echo." ;;
    esac
  fi
done
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool

Reply via email to