public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: <smith@cygwin.akamoz.jp>
To: cygwin@cygwin.com
Subject: Re: bash-4.3.33-1 fails to execute shell script with CR+LF EOL in text-mounted directory
Date: Fri, 27 Mar 2015 20:00:00 -0000	[thread overview]
Message-ID: <20150327190506.63383.qmail@mx.akamoz.jp> (raw)
In-Reply-To: <20150326153734.60517.qmail@mx.akamoz.jp>

[-- Attachment #1: Type: text/plain, Size: 1934 bytes --]

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 #2: test.sh --]
[-- Type: application/octet-stream, Size: 86 bytes --]

#!/bin/bash
echo hoge &
echo fuga &
echo piyo &
echo foo &
echo bar &
echo baz

[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

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

  parent reply	other threads:[~2015-03-27 19:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 15:38 smith
2015-03-26 19:05 ` Eric Blake
2015-03-27 20:00 ` smith [this message]
2015-09-24 21:09 ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150327190506.63383.qmail@mx.akamoz.jp \
    --to=smith@cygwin.akamoz.jp \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).