Am 09.03.2016 um 11:37 schrieb Jean-Marc Lasgouttes <lasgout...@lyx.org>:
> 
> Le 09/03/2016 11:30, Stephan Witt a écrit :
>> If this is a bug I cannot decide - indeed this is a little bit weird:
>> 
>> $ echo -e x
>> x
>> $ which echo
>> /bin/echo
>> $ type echo
>> echo is a shell builtin
>> $ sh
>> sh-3.2$ type echo
>> echo is a shell builtin
>> sh-3.2$ echo -e x
>> -e x
>> sh-3.2$
> 
> And "help echo“?

This is misleading.

I have thought a little bit more. Now I think the current implementation is
correct. The echo command is builtin with both shells. But the standard
the Bourne shell implements is another one. And it’s a really old one.

If the sh(1) builtin echo „surprisingly“ eats and interprets the „-e“ there
is a chance greater zero to break some script and this would be rated as a
serious bug in „/bin/sh" then. The fact the „-e“ switch isn’t understood is
minor from this point of view.

The help command is another builtin and may know these detail or not.
In fact it doesn’t and the output is the same for sh and bash.

Interestingly the sh(1) implementation of echo produces the desired output
without using -e :)

>>> Personally, I did not know this -e option, and it is not very standard IMO.
>>> I do not know what is a standard way to add a line break in a make 
>>> substitution.
>> 
>> Where is it?
> 
> In frontends/qt4/Makefile.am (and probably most other make files):
> 
> liblyxqt4.cpp:
>       @echo -e '$(SOURCEFILES:%=\n#include "%")\n' > $@
> 
> Using printf might work, although we do need to use a % in there. May be with 
> a %% instead.

Without a space in SOURCEFILES this works too:

@for file in $(SOURCEFILES) ; do echo 'include "'$file'"' ; done > $@

Stephan

Reply via email to