From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122161 invoked by alias); 7 Sep 2016 17:54:30 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 122135 invoked by uid 89); 7 Sep 2016 17:54:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:www, H*M:www X-HELO: s1.ds.net Received: from s1.ds.net (HELO s1.ds.net) (204.13.148.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Sep 2016 17:54:28 +0000 Received: from s1.ds.net (localhost [127.0.0.1]) by s1.ds.net (8.14.4/8.14.4) with ESMTP id u87ICCuq007690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 7 Sep 2016 14:12:12 -0400 Received: (from apache@localhost) by s1.ds.net (8.14.4/8.14.4/Submit) id u87ICCWs007689; Wed, 7 Sep 2016 14:12:12 -0400 To: cygwin@cygwin.com Subject: Re: Bash shell script issue X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 07 Sep 2016 17:54:00 -0000 From: wilson In-Reply-To: <039bcc69d005bf6db5aba99a90f51e36@www.ds.net> References: <330568691.2384551.1473201409220.ref@mail.yahoo.com> <330568691.2384551.1473201409220@mail.yahoo.com> <32e004cb44addbaefde0839df5500d60@www.ds.net> <039bcc69d005bf6db5aba99a90f51e36@www.ds.net> Message-ID: X-Sender: wilson@localhost User-Agent: Roundcube Webmail/1.0.2 X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00118.txt.bz2 > 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