delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/31/07:48:27

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Envelope-Sender-Is: Andrej DOT Borsenkow AT mow DOT siemens DOT ru (at relayer david.siemens.de)
From: Borsenkow Andrej <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>
To: sg AT broesel DOT sv DOT newtron DOT net, cygwin AT cygwin DOT com
Subject: RE: make, sh, bash and echo
Date: Tue, 31 Jul 2001 15:41:34 +0400
Message-ID: <003401c119b5$c0538ac0$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: <200107311059.f6VAxtc27922@broesel.sv.newtron.net>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006
Importance: Normal

>
> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019