Another confusing error from someone else's Cygwin setup

Dan Harkless cygwin-list21@harkless.org
Mon Jun 26 23:58:43 GMT 2023


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.

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



More information about the Cygwin mailing list