summaryrefslogtreecommitdiff
path: root/tests/quote.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/quote.test')
-rwxr-xr-xtests/quote.test26
1 files changed, 18 insertions, 8 deletions
diff --git a/tests/quote.test b/tests/quote.test
index 16fd0967..f671f82b 100755
--- a/tests/quote.test
+++ b/tests/quote.test
@@ -16,12 +16,11 @@ status=0
echo=echo
if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
else
- # The Solaris, AIX and Digital Unix default echo program unquotes
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
# backslashes. This makes it impossible to quote backslashes using
# echo "$something" | sed 's/\\/\\\\/g'
#
- # So, first we look for a working echo in the user's PATH, and if we
- # can't find one, we emulate echo with printf '%s\n'
+ # So, first we look for a working echo in the user's PATH.
IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
for dir in $PATH /usr/ucb; do
if test -f $dir/echo && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t'; then
@@ -32,12 +31,23 @@ else
IFS="$save_ifs"
if test "X$echo" = Xecho; then
- # We didn't find a better echo, so try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t'; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running ltconfig again with it.
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
else
- # Oops. We lost, so just stick with echo.
- echo=echo
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
fi
fi
fi