public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Another confusing error from someone else's Cygwin setup
@ 2023-06-26 23:35 David Karr
  2023-06-26 23:58 ` Dan Harkless
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Karr @ 2023-06-26 23:35 UTC (permalink / raw)
  To: The Cygwin Mailing List

[-- Attachment #1: Type: text/plain, Size: 1339 bytes --]

I'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 is using a Bash script that I wrote, and he gets a seemingly nonsensical
error that I don't understand.

The script starts out pretty simply, just like this:
------------------
#! /bin/bash
#set -x
main() {
if [ "$1" == "" ]; then
usage;
exit;
fi
...
-----------------

He was getting a weird error on line 3, just saying this:
---------------------
...: line 3: syntax error near unexpected token `$'{\r''
...: line 3: `main() {
---------------

This was pretty perplexing, so I asked him to uncomment the "set -x" line
to see if that provided any useful information, and that fails with a
different error:
-------------------
: invalid option...: line 2: set: -
set: usage: set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [arg ...]
------------------

This also makes no sense to me.  I compared our "uname -a" outputs, and
they are almost identical. However, I then had him run "bash --version",
and I compared it to mine.  Ironically, I'm using an OLDER version of bash
than he is. I'm on v4.4.12(3)-release, and he's on v5.2.15(3)-release.  Is
there something in 5.x versions of Bash that could cause these issues?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-06 17:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26 23:35 Another confusing error from someone else's Cygwin setup David Karr
2023-06-26 23:58 ` Dan Harkless
2023-06-27  0:01   ` Dan Harkless
2023-06-27  2:08 ` Mike Gran
2023-06-27 17:52   ` David Karr
2023-07-05 19:25 ` Andrey Repin

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).