Bash and CR/LF line-endings

Williams, Gerald S (Jerry) gsw@agere.com
Tue Oct 10 21:10:00 GMT 2006


Linda Walsh wrote:
>     Have been on linux for ~7-8 years, unix for 17+ and *nix
> utils ~19. The only time I've run into CR-LF issues on *nix,
> has been when transporting files to and from the Win or Mac
> worlds (MAC using "CR" only).

I guess you haven't been doing interesting enough things,
then. :-) Try poking at various TCP/IP frameworks a bit.
The first time I got a CR-LF from a pure Unix box (maybe
18 years ago) had me scratching my head. (Of course, that
was before I even knew what an RFC was.)

>     Seriously, keeping Linux "LF-only" is useful to filter out
> non-portable/non-native DOS files.

I can't say that I entirely support that position. Just
because I accidentally save my BASH script in DOS format
doesn't make the content any less portable. If Cygwin
BASH (on a binary mount) then accepts that script but
Linux BASH doesn't, it's the two BASHes that are being
non-interoperable.

>     I welcome the change to "LF"-only binary support -- makes CYGWIN
> more POSIX- (or linux-) source level compatible.

I also welcome "LF only" support in Cygwin BASH, as long
as that's the behavior of Linux BASH. I'm also perfectly
happy to add CRLF support to Linux tools, but that's an
entirely different issue.

gsw



More information about the Cygwin-talk mailing list