www.delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS |
X-Spam-Check-By: | sourceware.org |
MIME-Version: | 1.0 |
In-Reply-To: | <778889.64347.qm@web45203.mail.sp1.yahoo.com> |
References: | <778889 DOT 64347 DOT qm AT web45203 DOT mail DOT sp1 DOT yahoo DOT com> |
Date: | Sun, 1 Feb 2009 17:31:08 -0500 |
Message-ID: | <17393e3e0902011431n29c9a5e4na07af723fec80412@mail.gmail.com> |
Subject: | Re: Bash file not running correctly |
From: | Matt Wozniski <godlygeek AT gmail DOT com> |
To: | gsingh_2011 AT yahoo DOT com, cygwin AT cygwin DOT com |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
On Sun, Feb 1, 2009 at 5:12 PM, Gulshan Singh wrote: Ugh. http://www.cygwin.com/acronyms/#PCYMTWLL Reformatted. > Hi, I just joined this mailing list and I'm not sure if it's the right > place to post questions. If it's not, please direct me to the correct > place. I'm having a weird problem when running a bash script. Lets say > I make a script called list.sh. I open it in notepad and type ls. Then ^^^^^^^ > I go to the Cygwin bash shell and type ./list.sh. The list command > works fine. Now let's say the file looked like this > > ls > #This will list the files in the directory > > When I run this, the Cygwin shell will say "list.sh: line 1: $'ls\r': > command not found". I think the \r has to do with a new line when > I push enter. So basically I can't run anything longer than one line. > Anyone know how to fix this? Right. Notepad ends lines with \r\n, bash wants files with \n line endings. Either save your files with an editor that can save with unix-style \n line endings, or run the script through dos2unix before trying to execute it. ~Matt -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |