public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: wilson <wilson@ds.net>
To: cygwin@cygwin.com
Subject: Re: Bash shell script issue
Date: Wed, 07 Sep 2016 17:54:00 -0000	[thread overview]
Message-ID: <e9f9ac1e0d6ded5f61d3ea784026e396@www.ds.net> (raw)
In-Reply-To: <039bcc69d005bf6db5aba99a90f51e36@www.ds.net>


> On 2016-09-06 18:36, Kipton Moravec wrote: I am relatively new to shell 
> scripts, but this works on linux and I do not know why it does not work 
> for me in cygwin. ... What am I doing wrong or is this an error? Where 
> do the carriage returns (^M) come from, and how do I get rid of them?

The (^M -Control M) characters are displayed because Windows is stupid 
and didn't do the sensible thing for End Of Line for plain text files. 
Linux/Unix uses a Carriage Return (CR) followed by a Line Feed (LF) to 
do an EOL. A Google search for "Control M Character" will bring up a lot 
of web sites dealing with explaining this.

  You need to run "dos2unix" or "unix2dos" on your script to convert the 
EOL to the proper OS formatting when transferring between real 
Linux/Unix machines and Windows machines. These utilities are available 
in the Cygwin utilities download (look for it), but I'm not sure they 
are included in the basic default packages.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2016-09-07 17:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <330568691.2384551.1473201409220.ref@mail.yahoo.com>
2016-09-06 22:39 ` Kipton Moravec
2016-09-07  1:21   ` Eric Blake
2016-09-07  1:41     ` Michel LaBarre
2016-09-07 15:35       ` Kipton Moravec
2016-09-07 15:49         ` Marco Atzeri
2016-09-07 17:41           ` Erik Soderquist
2016-09-07 16:05         ` Andrey Repin
2016-09-07 16:25           ` Kipton Moravec
2016-09-07 16:22     ` Kipton Moravec
2016-09-07 17:35       ` Andrey Repin
2016-09-07 18:09         ` Eliot Moss
2016-09-07 18:28         ` Eric Blake
2016-09-09 19:37           ` Gene Pavlovsky
2016-09-07 19:16       ` Brian Inglis
     [not found]   ` <32e004cb44addbaefde0839df5500d60@www.ds.net>
     [not found]     ` <039bcc69d005bf6db5aba99a90f51e36@www.ds.net>
2016-09-07 17:54       ` wilson [this message]
2016-09-07 18:13         ` Eliot Moss

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=e9f9ac1e0d6ded5f61d3ea784026e396@www.ds.net \
    --to=wilson@ds.net \
    --cc=cygwin@cygwin.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).