This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to setup cygwin to use always textmode

On 03/18/2011 10:00 AM, ralf wrote:
> Eric Blake <eblake <at>> writes:
>> On 03/18/2011 09:11 AM, ralf wrote:
>>> I can  not understand why this feature has been dropped.
>> What feature?  Cygwin was designed with POSIX pathnames in mind.  If DOS
>> pathnames work, it is a fortunate side-effect, but not the primary
>> design goal, and not subject to stay the same in future releases.  The
>> only way to guarantee sane behavior from cygwin is to always use POSIX
>> pathnames.
> During setup of cygwin you could choose between UNIX ending und DOS ending.

Which was a bug in the GUI for offering it in the first place, because
it basically set the text-mode mount flag on every single directory,
including /bin, which is counterproductive.

But you didn't need the setup.exe radio button to get the same effect,
instead, just change your mounts manually (/etc/fstab) to set the
text-mode mount flag on the subset of directories where it matters to you.

> I choosed DOS (CR LF) endings and so I was able to mix cywin (my shell scripts)
> batch-files and windows executables and the naming of files didn't matter.
> After updating to the current release most of my scripts failed!!! Windows
> programs can't read the output of my scrips and my scripts can't read most of
> my text-files successfully.

Then tell bash that you want it to ignore CR (set -o igncr, or set
SHELLOPTS in the environment before invoking bash).

> And how can I get bash to write always CR? Adding \r to each echo,cat,awk ... ?
> Only finding the places where this is necessary will take weeks.

That's why we don't recommend text-mode mounts for cygwin-owned
directories.  dos2unix can also do some smart conversions (it has smarts
to avoid corrupting binary files while still converting text files).

Eric Blake    +1-801-349-2682
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]