Another confusing error from someone else's Cygwin setup

Dan Harkless cygwin-list21@harkless.org
Tue Jun 27 00:01:28 GMT 2023


On 6/26/2023 4:58 PM, Dan Harkless via Cygwin wrote:
> On 6/26/2023 4:35 PM, David Karr via Cygwin wrote:
>
> > > He was getting a weird error on line 3, just saying this:
> > > ---------------------
> > > ...: line 3: syntax error near unexpected token `$'{\r''
> > > ...: line 3: `main() {
> > > ---------------
>
> Apologies, I don't remember your other report, but this one kind of
> sounds like an end-of-line characters problem.  Try installing
> (Cygwin's) dos2unix, if you don't already have it, then try running
> dos2unix on the script.  If it still doesn't work, try then running
> unix2dos.  If you have binutils installed, you can also use the 'file'
> command for a quick report on whether files have lines terminated with
> CR (macOS), CRLF (Windows), or LF (UNIX/Linux).  'file' might not
> realize when you have files with inconsistent line-terminators, though.

And I forgot dos2unix also includes a 'mac2unix' command these days 
(though not a mac2dos), so maybe try that first.

--
Dan Harkless
http://harkless.org/dan/



More information about the Cygwin mailing list