This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: make, sh, bash and echo


>
> Makefile:
>
> all:
> 	echo -ne "foo\nbar" > bar
>
> $ make --unix
> $ cat bar
> -ne foo\nbar
>
> Seems like the wrong echo is executed because SHELL is
> /bin/sh.exe and PATH isn't set correctly, you know why.
> On Unix of course the right one and only echo is executed.
It is inherently non-portable. You cannot expect echo to understand any
option at all.
> If I add the line SHELL=/bin/bash.exe it works the way i expect.
>
The way you expect is not neccessarily how it works in real life.
> Is there any better solution ?
>
Yes, use portable constructs. Look in Autoconf manual that has good overview
of common portability problems with assorted tools (including echo).
-andrej
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

AltStyle によって変換されたページ (->オリジナル) /