This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Problems with line endings for shell scripts
On Tue, Feb 9, 2010 at 04:20, Jeremy Bopp <jeremy@bopp.net> wrote:
>
> On 2/8/2010 6:30 AM, Jurgen Defurne wrote:
> > Today I am having a problem with running a shell script (sh/bash)
> > which has CRLF endings.
>
> The problem is that Bash only supports Unix line endings
Indeed - the problem gets far worse when you start using git to manage
scripts - with "core.autocrlf = true" set, git converts all scripts to
DOS-endings on checkout, and bash won't run them.
We resolved this by putting SHELLOPTS=igncr into Cygwin.bat. This has
to be done before bash starts, so it won't work in .bashrc or
.bash_profile.
-- David.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple