[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: echo vs. printf regression (darwin8)

From: Paolo Bonzini
Subject: Re: echo vs. printf regression (darwin8)
Date: Mon, 16 Aug 2010 14:37:34 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5

On 08/16/2010 12:54 AM, David Fang wrote:
Actually, 'pogma' pointed out that this comes from the autoconf macros
in libtool.m4, near AC_MSG_CHECKING([how to print strings]).
I'm using libtool-2.2.10 right now.

I don't understand, is it breaking in Makefiles that you wrote? I don't know of anything in {autoconf,automake,libtool} that would use $ECHO this way.

In fact, I see you used var=`$(ECHO) ...` as the example earlier in this thread. This simply cannot work reliably, since shell variable expansion is very different from Makefile variable substitution, even though it may have worked in the past. So this is sort of a regression in libtool (introduced by yours truly...); but I say "sort of", because it is also a misuse of interfaces that were never meant to be public.

Also, var=`echo ...` is a "useless use of echo", similar to the classic "useless use of cat". You can just say var="...", or if you need to perform filename expansion, use one of the following:

1) set and $*:

  set ...

2) expand ECHO as a shell variable:

  ECHO='$(ECHO)'; ... var=`$$ECHO ...`

3) Depending on what is in the ellipsis, you may just use "echo". $(ECHO) is needed only to protect against arguments that may begin with a dash or contain a backslash.

Hope this helps,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]