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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=NX4XNrMDfFVSSqrW2SzhqK2/B9v6fSRpnnRuqAWfFiK
	L3G6dPzoGM7gpmKNWzVDUfKn9OSdZ9D8ZOphLwQQgXZlP6b8fbpE77Abl1AKKV/w
	l3yQhs/qkj/lLRqnur5IhoA4bOXFzkYEh47fQ3GzrRC6EdikX1ERgtz3zUVrN4Sg
	=
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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=Nt3q1QuGBu1kMtoSvGZ9wgjUFXk=; b=mWA9CvjdXGgXA3wJS
	wI0/8nK4GC18ImVwf9h5nN25KcTe386iQ2BG9enSSOEI+bSnHEQst+MMfDwgg4X8
	ctTBYtDWmfcoG9oE+yb3+Xx1Dzw4VEzQKAejXUrAOZXAkLFT4844u1VwI1JQ+j20
	gVvtlf6gA8P+v106X9HIHypZ70=
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-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: etr-usa.com
Message-ID: <52F2AD84.1050008@etr-usa.com>
Date: Wed, 05 Feb 2014 14:30:44 -0700
From: Warren Young <warren@etr-usa.com>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Newbie Questions
References: <1898639722.6893470.1391541591920.JavaMail.root@ptd.net> <52F153AE.5080704@gmail.com> <52F28215.5030801@ptd.net> <52F28330.6060101@cygwin.com> <52F2AA5D.4000000@etr-usa.com>
In-Reply-To: <52F2AA5D.4000000@etr-usa.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

On 2/5/2014 14:17, Warren Young wrote:
>
> I'd bet there are more Bourne shell scripts in the world with no
> extension at all than .sh.

....That said, if you're wanting to be able to double-click on a shell 
script icon in Windows and associate that with Cygwin's bash.exe, you 
*will* need to pick a file name extension, since that's how Windows 
determines what's in a file.

.sh is indeed the standard choice when you must use a file extension for 
a Bourne shell script, for whatever reason.

These two features can interact in odd ways.

Say you have a Perl script, which you have misleadingly named foo.sh. 
 From a bash shell, you type:

	$ ./foo.sh

The Perl script will run as intended, despite the name.

But if you associate .sh with bash.exe, then double-click that script 
from Windows Explorer, it won't work right, since bash.exe will try to 
run it as a shell script.  Perl isn't close enough in syntax to Bourne 
shell for this to work for anything but trivial (or very tricky!) scripts.

What you've done here is substitute Windows Explorer for exec(), so you 
don't get the shebang handling built into exec().

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

