delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/12/15/19:44:10

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <32983438.post@talk.nabble.com>
Date: Thu, 15 Dec 2011 16:43:44 -0800 (PST)
From: manu0507 <E DOT Falkenauer AT optimaldesign DOT com>
To: cygwin AT cygwin DOT com
Subject: Igncr ineffective?
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

Hello,

I'm running Cygwin 1.7.9-1 on Win7-64, with "GNU bash, version
4.1.10(4)-release (i686-pc-cygwin)".

When executing a script (a gdb build script) with CR/LF line ends, bash
reports errors on "unusual" lines of the script, even with igncr set. Here
is an example with the script "configure":

Manu AT Holland /cygdrive/d/Installs/gdb_7_3_1/gdb-7.3.1
$ ./configure
./configure: line 14: $'\r': command not found
./configure: line 29: syntax error near unexpected token `newline'
'/configure: line 29: `     ;;

... where all lines end with CR/LF, but
line 14 is the first empty line in the script
line 29 is the first one ending with ";;CR/LF".

This clearly smacks of line-end problems and, indeed, when all CR/LFs are
replaced by LFs only, the script runs ok... until it tries to call another
script with the same problem.

I could manually convert all scripts to LFs only, but I'd really prefer to
avoid that (could wreak havoc!), so my question is: isn't setting igncr
supposed to make bash ignore the CRs in CR/LFs? If not, is there something
else I can do to make it do so? And if so (i.e. this a bug), is there a
correction to be had?


Many thanks,

Emanuel

-- 
View this message in context: http://old.nabble.com/Igncr-ineffective--tp32983438p32983438.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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