X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <4B702BA9.2080703@bopp.net> References: <4B702BA9 DOT 2080703 AT bopp DOT net> Date: Tue, 9 Feb 2010 09:04:26 +1300 Message-ID: Subject: Re: Problems with line endings for shell scripts From: David Antliff To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 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 Tue, Feb 9, 2010 at 04:20, Jeremy Bopp wrote: > > On 2/8/2010 6:30 AM, Jurgen Defurne wrote: > > Today I am having a problem with running a shell script (sh/bash) > > which has CRLF endings. > > The problem is that Bash only supports Unix line endings Indeed - the problem gets far worse when you start using git to manage scripts - with "core.autocrlf = true" set, git converts all scripts to DOS-endings on checkout, and bash won't run them. We resolved this by putting SHELLOPTS=igncr into Cygwin.bat. This has to be done before bash starts, so it won't work in .bashrc or .bash_profile. -- David. -- 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