public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: The Cygwin Mailing List <cygwin@cygwin.com>,
	 David Karr <davidmichaelkarr@gmail.com>
Subject: Re: Another confusing error from someone else's Cygwin setup
Date: Tue, 27 Jun 2023 02:08:37 +0000 (UTC)	[thread overview]
Message-ID: <1229566577.3107156.1687831718000@mail.yahoo.com> (raw)
In-Reply-To: <CAA5t8VrR9yD3LS8AyRWD9O5J6gDbrfdbaWSUrjzwjYu30Umkiw@mail.gmail.com>

> 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

  parent reply	other threads:[~2023-06-27  2:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 23:35 David Karr
2023-06-26 23:58 ` Dan Harkless
2023-06-27  0:01   ` Dan Harkless
2023-06-27  2:08 ` Mike Gran [this message]
2023-06-27 17:52   ` David Karr
2023-07-05 19:25 ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229566577.3107156.1687831718000@mail.yahoo.com \
    --to=spk121@yahoo.com \
    --cc=cygwin@cygwin.com \
    --cc=davidmichaelkarr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).