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: <20091212024903.GA3452@KCJs-Computer>
References: <26753996.post@talk.nabble.com> 	 <20091212024903.GA3452@KCJs-Computer>
Date: Sun, 13 Dec 2009 21:55:12 +1300
Message-ID: <db95995b0912130055r762e443ucb43fe5041ab5f33@mail.gmail.com>
Subject: Re: BASH Shell - Configuration Problem?
From: David Antliff <david.antliff@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
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 Sat, Dec 12, 2009 at 15:49, Gary Johnson <garyjohn@spocom.com> wrote:
> On 2009-12-11, rgc3679 wrote:
>> Any ideas?
>
> Thanks for all the details. =A0That really helps. =A0It looks to me as
> though your script file has CR-LF (DOS) line endings rather than LF
> (Unix) line endings. =A0The current version of Cygwin's bash sees only
> the LF line endings and includes the CR as part of the script. =A0You
> can use the d2u utility to fix this.

Also, if this is the cause, you can use the Cygwin-specific igncr
option in bash to ignore CR characters:

$ bash -O igncr ...

Note that this has to be set at the time an instance of bash is
started (-O igncr), and AFAIK cannot be set afterward (e.g. via
shopt).

I've set this in Cygwin.bat and used it successfully to allow users to
run bash scripts that are in DOS text-file format. This turns out to
be really important when using git with core.autocrlf=3Dtrue...

-- 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

