delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/08/15:04:36

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: <d37e30051002080430n76b5556u60335e7415289f0a AT mail DOT gmail DOT com> <4B702BA9 DOT 2080703 AT bopp DOT 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 DOT antliff AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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 Tue, Feb 9, 2010 at 04:20, Jeremy Bopp <jeremy AT bopp DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019