From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28840 invoked by alias); 6 Feb 2014 01:05:15 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 28826 invoked by uid 89); 6 Feb 2014 01:05:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=4.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtpback.ht-systems.ru Received: from smtpback.ht-systems.ru (HELO smtpback.ht-systems.ru) (78.110.50.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 06 Feb 2014 01:05:11 +0000 Received: from [91.78.166.180] (helo=darkdragon.lan) by smtp.ht-systems.ru with esmtpa (Exim 4.80.1) (envelope-from ) id 1WBDOp-0007xw-Ex; Thu, 06 Feb 2014 05:05:03 +0400 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Thu, 06 Feb 2014 01:00:31 -0000 Date: Thu, 06 Feb 2014 01:05:00 -0000 From: Andrey Repin Reply-To: Andrey Repin Message-ID: <11910654512.20140206050031@mtu-net.ru> To: Warren Young , cygwin@cygwin.com Subject: Re: Newbie Questions In-Reply-To: <52F2D9AF.1060409@etr-usa.com> 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> <52F2AD84.1050008@etr-usa.com> <709102296.20140206020738@mtu-net.ru> <52F2D9AF.1060409@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00082.txt.bz2 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