delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/10/28/06:59:53

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: Wed, 28 Oct 2009 12:59:37 +0100
Message-ID: <9fffda390910280459y2883a25ag5fbe175eb1552999@mail.gmail.com>
Subject: Howto set default text file type to DOS/Text under release 1.7 BETA
From: Niels Hallenberg <nhallenberg 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

Hi,

I have just installed release 1.7 under Windows 7, 64bit. The
setup.exe program seems to have changed and you can't any longer set
the Default Text File Type to DOS/Text. I have a lot of scripts that
won't run under bash as long as the extra CR's are not removed. I know
of the tool doc2unix, however there are other obstacles too so having
the auto-conversion is the best solution for me.

After installation, I have the following drives mounted.

$ mount
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: on /cygdrive/c type ntfs (binary,posix=3D0,user,noumount,auto)
F: on /cygdrive/f type ntfs (binary,posix=3D0,user,noumount,auto)
R: on /cygdrive/r type ntfs (binary,posix=3D0,user,noumount,auto)
U: on /cygdrive/u type ntfs (binary,posix=3D0,user,noumount,auto)

I can, using the mount-command

$ mount -f -o text,posix=3D0 c: /cygdrive/c

change the mode to text:

$ mount
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: on /cygdrive/c type ntfs (text,user)
F: on /cygdrive/f type ntfs (binary,posix=3D0,user,noumount,auto)
R: on /cygdrive/r type ntfs (binary,posix=3D0,user,noumount,auto)
U: on /cygdrive/u type ntfs (binary,posix=3D0,user,noumount,auto)

However, this does not fix the problem and I still get the error:

$ ./foo.sh
./foo.sh: line 1: $'\r': command not found
./foo.sh: line 13: syntax error: unexpected end of file

Here is the script foo.sh:

$ cat foo.sh

# Check that the user supplied one parameter
if [ "$#" !=3D 1 ]
then
=A0 echo "You must supply one parameter:"
=A0 exit 1
fi
# We're done now
exit 0

The error says that there is an extra \r on the first empty line of the scr=
ipt.

I have also tried to use the extra argument -nocr to bash, however
that doesn't work either.

Any ideas?

Best
Niels

--
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