bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error when script uses CRLF line endings w/ if stmt


From: Pierre Gaston
Subject: Re: Error when script uses CRLF line endings w/ if stmt
Date: Fri, 5 Feb 2010 09:24:42 +0200

On Fri, Feb 5, 2010 at 7:54 AM, Evan Driscoll <address@hidden> wrote:
> Jan Schampera wrote:
>>
>> address@hidden schrieb:
>>
>>>        Some of the time, using CRLF line endings cause syntax errors
>>>        in Bash scripts ("unexpected end of file").
>>>
>>>        This problem shows up on Bash 4.1 on Linux, Bash 3.2 on Linux,
>>>        and Bash 3.2 on Cygwin (where I first noticed it).
>>
>> Normal. Though I don't know how to treat the Cygwin case, since the
>> underlying platform uses \r\n anyways. But the rest: Simply don't mix
>> UNIX and Windows text.
>
> Why not make Bash consider \r\n a legitimate line ending? What possible
> reason could there be for treating carriage return characters as it does
> now?

cygwin's bash is patched and provides a special igncr shopt option.
try shopt -s igncr




reply via email to

[Prev in Thread] Current Thread [Next in Thread]