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 05:00:31 +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> <709102296 dot 20140206020738 at mtu-net dot ru> <52F2D9AF dot 1060409 at etr-usa dot com>
- Reply-to: Andrey Repin <cygwin at cygwin dot com>
Greetings, Warren Young!
> On 2/5/2014 15:07, Andrey Repin wrote:
>>
>>> 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?
> Yep.
>> Try it, you'll be surprised.
> I did try it, before sending the previous message pair.
> Save the attached file as foo.sh, then run it with "bash foo.sh", rather
> than "./foo.sh". This is what happens when you associate *.sh with
> bash.exe in Windows Explorer.
[C:\home\Daemon]$ bash -c ./foo.sh
Hello from Perl!
[C:\home\Daemon]$
> Bash tries to interpret the file as a shell script, despite the shebang
> line. This is because Bash doesn't do the shebang handling, exec()
> does, and Bash treats passed file names as names of shell scripts. It
> runs them directly, not through exec().
Perhaps, we have different bash'es...
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 06.02.2014, <04:54>
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