The line endings were the issue, thanks. They were that way because I didn't realize I should force those files in git to have eol=lf in a .gitattributes file. This is now all fixed. On Mon, Jun 26, 2023 at 7:08 PM Mike Gran wrote: > > On Monday, June 26, 2023 at 04:36:30 PM PDT, David Karr via Cygwin < > cygwin@cygwin.com> wrote: > > > m seeing a problem with someone else's Cygwin setup, sort of similar to a > > problem I asked about a couple of weeks ago, in that it's a problem with > > the same user, but seemingly a completely different problem. > > ... > > > He was getting a weird error on line 3, just saying this: > > --------------------- > > ...: line 3: syntax error near unexpected token `$'{\r'' > > ...: line 3: `main() { > > --------------- > > If you run bash with the "-o igncr" option, it will ignore extraneous > carriage return characters. > > But the characters are there in the first place because your > script has been converted into using Windows line endings: > carriage return + linefeed. > > You didn't say how the script was transferred, but lots > of programs could add returns when you transfer something > to windows: git or ftp just to name a few. > > You both could try running "bash --version". The first line should > say something like > "GNU bash, version 5.2.15(3)-release (x86_64-pc-cygwin)" > > Note the "pc-cygwin" at the end. > > HTH, > Mike Gran >