delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/03/27/15:05:33

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:subject:from:references:date:mime-version
:content-type:message-id; q=dns; s=default; b=rkSR2AhKdy0dIwYb19
Dvq9Z7ZfNcHP154ZNW8aoFVJCHOcR3057s3WqgEq6vmQz7eHDK0zYbDe6JBpASMB
gUpdnxliecJsdAxwLTIShkGm0cd2DQfDiDqYNZPKvtU6yRzAf/VHPqQrzUArTx3n
1+5BliFhszfkFtLaO/4igIgIw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:subject:from:references:date:mime-version
:content-type:message-id; s=default; bh=UDCUrshi4Hk7fuyiYbpEH1fH
Tfo=; b=oNwZXG7sejWwR8h2i22i81o4yKihBy5a9wTLUNiovtjBUWLHIGmVpdBr
leu9r6OMMjEaTvAmoNXPNXZ8P8uUMBHLe0HGTy5eNRIWJ+OZCjiWDWzidyhWS7VM
MNcuUqesEO+cMefAIsVkYW+uFukClVrDmqN0lWqwE+ku0FoWnTo=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2
X-HELO: akamoz.jp
To: cygwin AT cygwin DOT com
Subject: Re: bash-4.3.33-1 fails to execute shell script with CR+LF EOL in text-mounted directory
From: <smith AT cygwin DOT akamoz DOT jp>
References: <20150326153734 DOT 60517 DOT qmail AT mx DOT akamoz DOT jp>
Date: Sat, 28 Mar 2015 04:03:10 +0900
Mime-Version: 1.0
X-Attachments: test.sh;
Message-ID: <20150327190506.63383.qmail@mx.akamoz.jp>
X-IsSubscribed: yes

-----------1427482990-24341990
Content-Type: text/plain; charset=us-ascii

Dear Eric and the other developers:

> >  It seems that bash-4.3.33(1) handles CR+LF end-of-line in 
> > the shell-script incorrectly, all of the following conditions are met:
> > b. end-of-line style of the file is CR+LF, and
> Are you absolutely sure that you don't have excess CR in your file?
> text mounts only treats the CRLF as a single newline, but does not eat
> lone CR elsewhere in the file.

 The script under test is created on the editor working on Windows 
(Hidemaru), so that no additional CR is found in the script. 
I checked it by using od.

> > It works:
> > d. it is on the binary-mounted directory, and with igncr shell-option,
> Does igncr make a difference in the text mount directory situation?

 No difference is made on the text mount directory, igncr is applied 
or not, which means the script doesn't work on text mount directory 
regardeless of whether igncr is specified or not, like that:

--- 8< ------ 8< ------ 8< ------ 8< ------ 8< ---
$ LANG=C bash -o igncr test.sh
hoge
test.sh: line 3: fuga: command not found
test.sh: line 4: piyo: command not found
test.sh: line 5: o: command not found
test.sh: line 6: ho: command not found
test.sh: line 7: cho: command not found
--- 8< ------ 8< ------ 8< ------ 8< ------ 8< ---

 On binary mount directory without igncr, CRs are recognized as 
a part of a command name by bash, as usual.

> > shell-script to test: (WITH CR+LF END-OF-LINE STYLE)
> > --- 8< ------ 8< ------ 8< ------ 8< ------ 8< ---
> Please ATTACH the script as a binary file, rather than pasting it inline
> in your email; or at a bare minimum, show 'od -tx1z yourscript' to make

 I've attached the script.

 I'm sorry that I lost your original message, I'm writing this 
from the message which is gotten from cygwin mailing list 
web interface. This does not have the message ID to use threading 
the messages, so I reply to my own message to continue the thread.

Best Regards.



-----------1427482990-24341990
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream;name="test.sh"
Content-Description: test.sh

IyEvYmluL2Jhc2gNCmVjaG8gaG9nZSAmDQplY2hvIGZ1Z2EgJg0KZWNobyBw
aXlvICYNCmVjaG8gZm9vICYNCmVjaG8gYmFyICYNCmVjaG8gYmF6DQo=


-----------1427482990-24341990
Content-Type: text/plain; charset=us-ascii

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

- Raw text -


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