delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/03/13/05:37:10

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
X-Received: by 10.180.79.227 with SMTP id m3mr25419008wix.12.1363167403933; Wed, 13 Mar 2013 02:36:43 -0700 (PDT)
In-Reply-To: <514040CC.8040607@gmail.com>
References: <514040CC DOT 8040607 AT gmail DOT com>
Date: Wed, 13 Mar 2013 09:36:43 +0000
Message-ID: <CAHWeT-Z5yOYdDbmvkVTOQpfXhbfsrp+KvVJrLRLhHye6TEpMWA@mail.gmail.com>
Subject: Re: bash script under cygwin fails to recognize simple commands
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: bob DOT brusa AT gmail 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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r2D9b6kn020824

On 13 March 2013 09:03, Bob Brusa wrote:
> Hi,
> it seems I miss something. The primitive script t1.sh
>
> #!/bin/bash
> echo "script running"
> ls -l
> echo "script terminating"
> exit 0
>
> produces a rather unexpected result when running it from cygwin terminal:
>
> rwb AT w500 ~
> $ ./t1.sh
> script running
> ls: unknown option --
> „ls --help“ gibt weitere Informationen.
> script terminating
> : Ein numerischer Parameter ist erforderlich.
>
> rwb AT w500 ~
>
> Why is this?

Your script has DOS line endings in it. The dos2unix utility will fix
that for you.

Andy

--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019