X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.8 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 <Andrew AT DeFaria DOT com> Subject: Re: Odd behavior of scripts in dos mode Date: Thu, 26 Apr 2012 07:33:22 -0700 Lines: 16 Message-ID: <jnbmbj$4h5$1@dough.gmane.org> References: <jnbl6p$qav$1 AT dough DOT gmane DOT org> <CA+sc5mmKxm=p+Tpu44GhXBfmCR_E2=LSMq3A7K_4Sgs1FRbDQg AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120309 Thunderbird/11.0 In-Reply-To: <CA+sc5mmKxm=p+Tpu44GhXBfmCR_E2=LSMq3A7K_4Sgs1FRbDQg@mail.gmail.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: <cygwin.cygwin.com> List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> 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 04/26/2012 07:26 AM, Earnie Boyd wrote: > On Thu, Apr 26, 2012 at 10: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. > http://cygwin.com/faq/#faq.api.cr-lf That's an interesting read but it really does nothing to explain the behavior I've observed. If it did then it would not be able to invoke bash\r. -- <a href="http://defaria.com">Andrew DeFaria</a><br> <small><font color="#999999">24 hours in a day...24 beers in a case...coincidence?</font></small> -- 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