How to setup cygwin to use always textmode

Eric Blake eblake@redhat.com
Fri Mar 18 16:23:00 GMT 2011


On 03/18/2011 10:00 AM, ralf wrote:
> Eric Blake <eblake <at> redhat.com> 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   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110318/da5ea427/attachment.sig>


More information about the Cygwin mailing list