Igncr ineffective?

Eric Blake eblake@redhat.com
Fri Dec 16 00:54:00 GMT 2011


On 12/15/2011 05:43 PM, manu0507 wrote:
> 
> Hello,
> 
> I'm running Cygwin 1.7.9-1 on Win7-64, with "GNU bash, version
> 4.1.10(4)-release (i686-pc-cygwin)".
> 
> When executing a script (a gdb build script) with CR/LF line ends, bash
> reports errors on "unusual" lines of the script, even with igncr set. Here
> is an example with the script "configure":

How are you setting igncr?  Did you read the release announcement that
you now have to use 'set -o' and not 'shopt -s' to set it?  The full
details are here:

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

> I could manually convert all scripts to LFs only, 

And that would be my preferred solution, as that is the most Linux-like,

> but I'd really prefer to
> avoid that (could wreak havoc!),

which is why igncr exists, for people unwilling to use sane line endings
in the first place.

> so my question is: isn't setting igncr
> supposed to make bash ignore the CRs in CR/LFs? If not, is there something
> else I can do to make it do so? And if so (i.e. this a bug), is there a
> correction to be had?

No one else has reported that igncr is broken as implemented, so most
likely a bug in your usage and you didn't actually enable it like you
thought you had.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the Cygwin mailing list