This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bash-4.3.33-1 fails to execute shell script with CR+LF EOL in text-mounted directory


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.


Attachment: test.sh
Description: test.sh

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]