This is the mail archive of the
cygwin
mailing list for the Cygwin project.
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
- Date: Wed, 28 Oct 2009 12:59:37 +0100
- Subject: Howto set default text file type to DOS/Text under release 1.7 BETA
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=0,user,noumount,auto)
F: on /cygdrive/f type ntfs (binary,posix=0,user,noumount,auto)
R: on /cygdrive/r type ntfs (binary,posix=0,user,noumount,auto)
U: on /cygdrive/u type ntfs (binary,posix=0,user,noumount,auto)
I can, using the mount-command
$ mount -f -o text,posix=0 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=0,user,noumount,auto)
R: on /cygdrive/r type ntfs (binary,posix=0,user,noumount,auto)
U: on /cygdrive/u type ntfs (binary,posix=0,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 [ "$#" != 1 ]
then
? echo "You must supply one parameter:"
? 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 script.
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