On Jun 9, 2001, "Tim Van Holder" <[EMAIL PROTECTED]> wrote:
Alexandre> IMO, the best way to go is for autoconf to come up with a
Alexandre> safe echo, i.e., one that won't mess up any characters,
Alexandre> will preserve backslashes, etc, in a similar way that
Alexandre> libtool does. In fact, this would help libtool a lot as we
Alexandre> move more of it into m4sh.
>> > Well, why not!
>> Err... Because someone has to do it? :-)
> Well, an easy situation would be if the shell is bash; it's builtin echo
> has a -E option to do just that (i.e. not expand anything). I had to
> use that option in a few changes I made for the DJGPP package, as
> autoconf would otherwise seriously mess up DOS-style paths.
> Not sure if other incarnations of echo are so friendly as to provide
> such a option though.
I'm afraid not even -E is a complete solution. Try, for example:
echo -E -e '\a'
and note that `-e' isn't echoed, and you get a beep, not a literal
`\a'.
That's why libtool always uses:
$echo "X$whatever" | $Xsed
where Xsed is:
sed -e '1s/^X//'
But this is another problem of portable echoing. It's amazing that
something as simple as plain echoing can't be done easily :-(
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me