delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/11/08/17:17:41

X-Spam-Check-By: sourceware.org
Message-ID: <31b7d2790611081417u467a3ecdx4468fec7797c0cb1@mail.gmail.com>
Date: Wed, 8 Nov 2006 22:17:08 +0000
From: "DePriest, Jason R." <jrdepriest AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: CASE error in script file
In-Reply-To: <loom.20061108T225533-24@post.gmane.org>
MIME-Version: 1.0
References: <loom DOT 20061108T225533-24 AT post DOT gmane DOT org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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 11/8/06, Doug  wrote:
> Hello,
> I am using Cygwin  1.5.21(0.156/4/2).I try to run the shell script called test.sh
> but i always get the following error
>
> '/test.sh: line 1: syntax error near unexpected token `in
> '/test.sh: line 1: `case $1 in

I am using Cygwin 1.5.21(0.156/4/2), too!

I just opened up vim from a bash prompt in an rxvt window, manually
typed in your script, saved it as test.sh and ran ./test.sh.

It printed out 'Dunno' because I didn't give it any options.

It worked fine.

If I convert the file to have DOS line endings instead of UNIX line
endings, I recreate your problem exactly!

I am too lazy to search the (recent) archives about the bash
controversy surrounding line endings, but that is your problem.

Run d2u on your script, and it should work fine.

Also, what editor did you use to create the script?  If it was
notepad, please slap yourself in the forehead and exclaim, "d'oh!"

-Jason

-- 
+ + + NO CARRIER

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

- Raw text -


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