X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Andrew DeFaria Subject: Re: Odd behavior of scripts in dos mode Date: Thu, 26 Apr 2012 10:21:46 -0700 Lines: 15 Message-ID: References: <4F995E78 DOT 7020607 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120420 Thunderbird/12.0 In-Reply-To: <4F995E78.7020607@redhat.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 4/26/2012 7:40 AM, Eric Blake wrote: > On 04/26/2012 08:13 AM, Andrew DeFaria wrote: >> I remember that Cygwin used to not be able to run scripts that were >> converted or were in "DOS" mode - had trailing carriage returns in the >> file. It would fail because the #! line might have /bin/bash\r which was >> not a file (bash with a carriage return that is). But the behavior has >> changed. Now it seems to ignore the trailing carriage return and it >> execs bash itself. But it fails later on with other carriage returns. > If you want bash to ignore carriage returns, then ask it to do so: > http://sourceware.org/ml/cygwin-announce/2011-02/msg00027.html Interesting and it kinda explains that this is relatively new behavior and why it seems to interpret the #! line correctly. -- Andrew DeFaria What hair color do they put on the driver's licenses of bald men? -- 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