delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/08/07:30:23

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: <d37e30051002080430n76b5556u60335e7415289f0a@mail.gmail.com>
Subject: Problems with line endings for shell scripts
From: Jurgen Defurne <jurgen DOT defurne AT gmail DOT com>
To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019