X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=rljnP5/BuBVzgwpJ
	D9o28qtjPhowT288SfCZ3PeXxdQnDvztElpTCKqESOW0/tVCt9seZz8Dh9PgCHJu
	8E52JzAudCR4n5gu+tIpDLoCDxnATnCqGSpRaC793W9ig0C+wATYqpNzfXX6dnm3
	gh0JYd+VUif+55k/YxM3Seu+PRk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=BGhXiHeg1coKSu4XdmNa/j
	BzFJs=; b=RbDOXHdutAVjuo+qgfVU9h/zaOyAqjP2bBgsCD9hI1ayjnLm9JMv/0
	dQttUnKlNKrpNS+IFtkU5Uc1noLL5eh/6XS2/s4VLD+AvkqB4eNQyQb7eg0Jpv9r
	6p+lm3a8LPOTXpbntr1yasbOlvE/rtYIwoNbKjTMUsyFIGJJeUexo=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=BAYES_50,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*F:D*yandex.ru, Repin, repin, H*UA:Bat!
X-HELO: forward8p.cmail.yandex.net
Authentication-Results: smtp2j.mail.yandex.net; dkim=pass header.i=@yandex.ru
X-Yandex-Suid-Status: 1 0,1 0
Date: Thu, 4 Aug 2016 17:40:49 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <927429413.20160804174049@yandex.ru>
To: Bill Smith <bsmith@progress.com>, cygwin@cygwin.com
Subject: Re: PATHEXT is fundamental to Windows and Should be recognised by CYGWIN
In-Reply-To: <4a78e97f38e14e9bab340f9d5119df19@ntmaexbe04.bedford.progress.com>
References: <001001d1edf1$a4e1ae90$eea50bb0$@rogers.com>   <1198248887.20160804151307@yandex.ru>  <4a78e97f38e14e9bab340f9d5119df19@ntmaexbe04.bedford.progress.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Bill Smith!

> A couple of years ago I was involved with porting a very large code base of
> makefiles & shell scripts to work with Cygwin.  In our environment, the main
> issue was shell scripts calling *.bat files without the .bat suffix because
> of the $PATHEXT.

Sounds like it wasn't a *NIX code base.

> The fix was to change

> somescript

> To
> somescript${BAT}

> where ${BAT} would be set to .bat on Windows.

In this case, just changing the calls to use real names would've sufficed.

> Another option available was to create wrapper shell script.  So I would create a script named "somescript"
> that is only in $PATH on Windows and it would look something like this:

> #!/bin/sh
> adaptman.bat "$@"

> Granted our *.bat files are simple and don't have to worry about arguments with spaces.

No, this is a very messy way to do it. Highly prone to backfires.

Correct way would've been (assuming this code base of yours is not purely
Windows, like I thought) is to use same shell scripts it would call otherwise,
instead of bat files, and enhance them to find relevant bits of information if
run under Cygwin, where applicable.
Then discard the .bat files and breathe free at last.


-- 
With best regards,
Andrey Repin
Thursday, August 4, 2016 17:36:13

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

