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


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.

> 
> C:\sw\bin>sh twg.sh
> ok

POSIX path.

> 
> C:\sw\bin>sh ./twg.sh
> ok

POSIX path.

> 
> C:\sw\bin>sh .\twg.sh
> .\twg.sh: line 2: syntax error near unexpected token `$'in\r''
> '\twg.sh: line 2: `  case "$funk" in

DOS path - don't do that if you don't want surprises.  And if you want
bash to ignore \r, then reread the bash release announcements for
several ideas for doing this (including 'set -o igncr' or setting the
SHELLOPTS environment variable before bash is started).

http://cygwin.com/ml/cygwin-announce/2011-02/msg00027.html

> 
> C:\sw\bin>sh c:\sw\bin\twg.sh
> c:\sw\bin\twg.sh: line 2: syntax error near unexpected token `$'in\r''
> ':\sw\bin\twg.sh: line 2: `  case "$funk" in

DOS path - don't do that if you don't want surprises.

> In the past I didn't have to pay attention to line endings. All programs
> (windows and cygwin) used CR LF. But now I have to look at each called program
> do find out wich line-endings are written.

If you are writing files for cygwin, then it is much preferred that you
omit CR, since cygwin emulates Linux which omits CR.  But if you must
interact with text mode files, then use a text mode mount or tell bash
that you plan on working with text mode and that bash should ignore CR.

> So is there a chance to get back the global setting of textmode, or is there a
> way to get textmode without changing all the scripts?

/etc/fstab and set textmode mount points on the directories where you
want it.  But you _don't_ want it globally - for example it's great for
data files elsewhere in windows, but a bad idea for cygwin's /bin.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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]