[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: _AS_ECHO_N_PREPARE questions
From: |
Paul Eggert |
Subject: |
Re: _AS_ECHO_N_PREPARE questions |
Date: |
Wed, 23 Feb 2005 11:28:11 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
Thanks; I installed this patch (which incorporates a further idea to
save a process in the usual case where echo -n works).
2005-02-23 Paul Eggert <address@hidden>
* lib/m4sugar/m4sh.m4 (_AS_ECHO_N_PREPARE): Don't set ECHO_C to
newline if neither \c nor -n work, as that would output two
newlines. Prefer -n to \c. Reported by Stepan Kasal.
--- m4sh.m4 15 Feb 2005 06:40:21 -0000 1.136
+++ m4sh.m4 23 Feb 2005 19:26:35 -0000 1.137
@@ -555,13 +555,17 @@ m4_define([_AS_ECHO],
# display the checking message. In addition, caching something used once
# has little interest.
# Idea borrowed from dist 3.0. Use `*c*,', not `*c,' because if `\c'
-# failed there is also a new-line to match.
+# failed there is also a newline to match.
m4_defun([_AS_ECHO_N_PREPARE],
-[case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+[ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
])# _AS_ECHO_N_PREPARE
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: _AS_ECHO_N_PREPARE questions,
Paul Eggert <=