public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: Markus Becker <markusbecker985@gmail.com>, cygwin@cygwin.com
Subject: Re: General scripting issues vs. Linux
Date: Fri, 10 Mar 2023 08:59:36 -0500	[thread overview]
Message-ID: <63cccff3-9487-3588-5dd8-e49499882280@cornell.edu> (raw)
In-Reply-To: <CABojj+7dMPO547kVL6C4vW6c1VWZHB2x4EAHDROQ1AuUOEH8LQ@mail.gmail.com>

On 3/10/2023 8:47 AM, Markus Becker via Cygwin wrote:
> Dear Guys,
> 
> I am quite an newby in Cygwin scripting and encountered several execution
> issues with bash scripts. For example, when i try to execute the following
> simple scriptfile "skript1.sh":
> 
> # This is a testscript
> Statement="This is the testscript number 3"
> FILE="home/mbecker/Secure_Copy_Beispiel.txt"
> ls -l $FILE
> echo $Statement
> echo The file is $FILE
> 
> i got these results:
> 
> $ ./skript1.sh
> ls: cannot access 'home/mbecker/Secure_Copy_Beispiel.txt'$'\r\r': No such
> file or directory
> This is the testscript number 3
> The file is home/mbecker/Secure_Copy_Beispiel.txt
> 
> or another results from a different script:
> 
> $ ./skript7.sh
> ./skript7.sh: line 3: $'clear\r': command not found
> Dr▒cken sie beliebige Tasten und dann return
> ': not a valid identifierd: `TASTE
> 
> These are just two of several issues coming up with bash scripting in
> Cygwin. Maybe this is merely a corse problem with my platform
> understanding. But why is Cygwin calling errors when performing standard
> Linux bash commands? Is it due to a different syntax? Or is it even simpler?

It looks like your scripts have CRLF line endings.

Ken

  reply	other threads:[~2023-03-10 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 13:47 Markus Becker
2023-03-10 13:59 ` Ken Brown [this message]
2023-03-10 16:15   ` Brian Inglis
2023-03-10 18:42     ` Backwoods BC

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=63cccff3-9487-3588-5dd8-e49499882280@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    --cc=markusbecker985@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).