Subject: RE: [ANNOUNCEMENT] Testversion uploaded: bash-2.05b-10
From: "Yanghui Bian" <[email-masked]>
To: <[email-masked]>
Cc: <[email-masked]>
Date: Wed, 18 Jun 2003 09:42:22 +0200

Hello David,
Sorry, it's not directly related to this topic. Please allow
me to ask the question below.
It's about the CRLF<->LF conversion.
I have tried to do the same conversion in Perl/C but failed.
Cygwin always return me the result that the file is in unix format.
However I could know that it is in pc format by opening it in emacs and 
convert it to unix format sucessfully using emacs elisp.
The cygwin is mounted in bin&unix mode.
But from you description above, you don't have the problem.
Could you let me know which tool you use for conversion, please?
Thanks.

-----Original Message-----
From: David Rothenberger [mailto:[email-masked]]
Sent: 17. juni 2003 19:30
To: [email-masked]
Subject: [ANNOUNCEMENT] Testversion uploaded: bash-2.05b-10

Corinna Vinschen writes:
 > Please give it a try, especially if you're using textmode mounts.  If
 > nobody complains about problems which result from that patch within,
 > say, two or three weeks, I'll make this the standard version of bash.

I don't have any problems running scripts from textmode mounts, but
I did notice a change in behavior while sourcing DOS files from
binmode mounts.

With the prior version of bash, I had no problems sourcing a
DOS-formatted file from a binmode mount, but with the latest
version, I get parsing errors.  Here's a simple test:

I created two files, "dos" and "unix", each with the following
content (without the dash lines, of course):

----------------------------------------------------------------------
if [ 1 -eq 1 ]; then echo true; else echo false; fi
----------------------------------------------------------------------

I then used dos2unix and unix2dos to ensure that "dos" used DOS line
endings and "unix" used the other kind.  This was all done on a
binmode mount, by the way.

Sourcing the two files yielded the following results:

----------------------------------------------------------------------
$ . dos
bash: dos: line 2: syntax error: unexpected end of file

$ . unix
true
----------------------------------------------------------------------

When I copied these two files to a textmode mount, reran the
dos2unix and unix2dos commands, and repeated the above statements,
both commands returned true.

I don't regard this as a bug, since everything works fine with
textmode mounts and it's perfectly reasonable, IMHO, for the parse
errors to occur when trying to source a file with DOS endings on a
binmode mount.  It's what would happen under Linux, after all.

But I wanted to mention it because it is a change in behavior, and
might cause a bunch of "bash isn't working" postings when this
version of bash is made official.

cygcheck output is attached, in case it matters.

-Dave

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/