X-Spam-Check-By: sourceware.org Message-ID: <860934040609282315i1f0a85ccua1c7a48848ae25e9@mail.gmail.com> Date: Thu, 28 Sep 2006 23:15:33 -0700 From: "Malcolm Nixon" To: cygwin AT cygwin DOT com Subject: Re: Bash 3.1.17(8) CR/LF problem MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Eric Blake wrote: >> #!/bin/sh >> IFS=' '' '' >> ' # Yes, that was a space, tab, and line ending > I retract this suggestion. On further investigation, bash currently does > not treat \r as an IFS whitespace character, and the hacks to the source > to make this happen are too invasive for my liking. Adding \r to IFS will > impact your script, but the impact is incomplete, and it does not ignore > \r at the end of all lines. I spent some time looking at this. It turns out that solution mostly works, however using comment characters for line ends also works. E.G: #!/bin/sh echo "This script works" # echo "without causing any" # echo "errors in Bash." # Considering this, I tried writing a top-level bash script of the form: #!/bin/sh mount -t "$(cygpath -aw .)" "$(cygpath -au .)" # ./crlf_scipt.sh # umount "$(cygpath -au .)" # The problem I'm finding now is that for the context of ./crlf_script.sh (when executed from /cygdrive/c/junk) my mount points are: 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:\junk on /cygdrive/c/junk type system (textmode) <---- c: on /cygdrive/c type system (binmode,noumount) d: on /cygdrive/d type system (binmode,noumount) So all looks good, my current directory is mounted as textmode. Unfortunately my crlf_script.sh is still executed with no textmode translation. I'm guessing it's hitting the /cygdrive/c mount and deducing binary before seeing /cygdrive/c/junk. Any ideas? -Malcolm -- 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/