public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Matt Wozniski <godlygeek@gmail.com>
To: gsingh_2011@yahoo.com, cygwin@cygwin.com
Subject: Re: Bash file not running correctly
Date: Sun, 01 Feb 2009 22:31:00 -0000	[thread overview]
Message-ID: <17393e3e0902011431n29c9a5e4na07af723fec80412@mail.gmail.com> (raw)
In-Reply-To: <778889.64347.qm@web45203.mail.sp1.yahoo.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/

      reply	other threads:[~2009-02-01 22:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-01 22:12 Gulshan Singh
2009-02-01 22:31 ` Matt Wozniski [this message]

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=17393e3e0902011431n29c9a5e4na07af723fec80412@mail.gmail.com \
    --to=godlygeek@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=gsingh_2011@yahoo.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).