This is the mail archive of the
mailing list for the Cygwin project.
Bash 3.1.17(8): Scripts on textmode mount get problems with CR characters
- From: "Bruun, Peter Michael \(HP C&I CME OSS CoE\)" <peter-michael dot bruun at hp dot com>
- To: <cygwin at cygwin dot com>
- Date: Tue, 10 Oct 2006 17:02:19 +0200
- Subject: Bash 3.1.17(8): Scripts on textmode mount get problems with CR characters
For various reasons (like various revision control systems), as
described by others elsewhere, some of us prefer to follow the Windows
standard of text file lines ending in CRLF when working on windows.
It has been one of the main strengths of Cygwin tools, that all of them
With release 3.1.8 of Bash, however, it no longer understands Windows
In order to tell Bash to understand CRLF, instructions say, I should
"just" mount the drive as "textmode", and all will be fine and work as
However, I found that this instruction does not work, because textmode
makes ordinary scripts fail. I have mounted my /cygdrive and /home
directories as textmode:
C:\cygwin\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type
C:\cygwin\home on /home type system (textmode)
C:\cygwin\bin on /usr/bin type system (binmode)
C:\cygwin\lib on /usr/lib type system (binmode)
C:\cygwin on / type system (binmode)
c: on /cygdrive/c type system (textmode,noumount)
d: on /cygdrive/d type system (textmode,noumount)
e: on /cygdrive/e type system (textmode,noumount)
Now define this shell function:
( cd $1
echo "ABC" > f.txt
if [ "$F" != "ABC" ] ; then
echo "Bash is broken in $1"
echo "Bash works in $1"
Now execute these calls:
Bash is broken in /home/pmb
Bash is broken in C:/Temp
Bash works in /tmp
With the previous version of bash all of these worked correctly.
The reason is, that cat seems to pick up the \r character - it is not
treated as whitespace, and so the result string is no longer identical
I tried setting $IFS, but I could not make that change the behaviour -
maybe I just lack instructions on how to get these characters into IFS.
Since the above worked in previous versions, and since the above works
on Linux, etc. I would tend to regard it as a regression that scripts do
not work on textmode mounts, particularly since the new bash forces me
to use textmode mounts.
Or have I overlooked something?
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html