This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Newbie Questions
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Warren Young <warren at etr-usa dot com>, cygwin at cygwin dot com
- Date: Thu, 6 Feb 2014 02:07:38 +0400
- Subject: Re: Newbie Questions
- Authentication-results: sourceware.org; auth=none
- References: <1898639722 dot 6893470 dot 1391541591920 dot JavaMail dot root at ptd dot net> <52F153AE dot 5080704 at gmail dot com> <52F28215 dot 5030801 at ptd dot net> <52F28330 dot 6060101 at cygwin dot com> <52F2AA5D dot 4000000 at etr-usa dot com> <52F2AD84 dot 1050008 at etr-usa dot com>
- Reply-to: Andrey Repin <cygwin at cygwin dot com>
Greetings, Warren Young!
> 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.
Not necessarily. Especially not, when using ShellExecute(Ex)?...
> .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.
Have you actually tried that?
Try it, you'll be surprised.
> 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().
Try it yourself... you'll be surprised.
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 06.02.2014, <02:02>
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