This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: make, sh, bash and echo
- To: sg at broesel dot sv dot newtron dot net, cygwin at cygwin dot com
- Subject: RE: make, sh, bash and echo
- From: Borsenkow Andrej <Andrej dot Borsenkow at mow dot siemens dot ru>
- Date: Tue, 31 Jul 2001 15:41:34 +0400
>
> 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/