X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Mon, 8 Feb 2010 13:30:09 +0100 Message-ID: Subject: Problems with line endings for shell scripts From: Jurgen Defurne To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Dear all, I have the following mounts on my test & verification system for Cygwin 1.7. C:/Documents and Settings on /home type ntfs (binary,exec) C:/cygwin/bin on /usr/bin type ntfs (binary,auto) C:/cygwin/lib on /usr/lib type ntfs (binary,auto) C:/cygwin on / type ntfs (binary,auto) C:/local on /usr/local type ntfs (binary,exec) B: on /cygdrive/b type cifs (binary,posix=0,user,noumount,auto) C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto) E: on /cygdrive/e type cifs (binary,posix=0,user,noumount,auto) H: on /cygdrive/h type netapp (binary,posix=0,user,noumount,auto) Z: on /cygdrive/z type ntfs (binary,posix=0,user,noumount,auto) Today I am having a problem with running a shell script (sh/bash) which has CRLF endings. This is already an old script and has been much used across Cygwin 1.3, 1.5. MontaVista 4.0 and Montavista 5.0. After testing (because Perl does not have a problem), I found out that there is a problem with empty lines in bash. Here is my test case : echo Line to echo echo Another line When running this, I get the output Line to echo run_echo: line 2: $'\r': command not found Another line I also tested it on my portable. There I do not have the problem. The main difference between the two systems is that the OS in the first case is 2003 Server and in the second case Windows XP. Regards, Jurgen -- 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