X-Recipient: archive-cygwin@delorie.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: <d37e30051002080430n76b5556u60335e7415289f0a@mail.gmail.com> 	 <4B702BA9.2080703@bopp.net>
Date: Tue, 9 Feb 2010 09:04:26 +1300
Message-ID: <db95995b1002081204g2f17983cpb7df291240d001d3@mail.gmail.com>
Subject: Re: Problems with line endings for shell scripts
From: David Antliff <david.antliff@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Tue, Feb 9, 2010 at 04:20, Jeremy Bopp <jeremy@bopp.net> 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

