This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CASE error in script file


8 Nov 2006 21:57:40 Doug wrote:
> I am using Cygwin  1.5.21(0.156/4/2)
> case $1 in
>     1)
>         echo '1'
>         ;;
>     2)
>         echo '2'
>         ;;
>     *)
>         echo 'Dunno'
>         exit 1
> esac
> ...
> '/ line 1: syntax error near unexpected token `in
> '/ line 1: `case $1 in
> ...

8 Nov 2006 22:17:08 Jason DePriest wrote:
> I am using Cygwin 1.5.21(0.156/4/2), too!
> ...
> It worked fine.
> If I convert the file to have DOS line endings instead of UNIX line
> endings, I recreate your problem exactly!

Interesting:  When I do that it works fine in both cases, even when I
force a <CR> at the end of the line.  It appears as though when bash
sees the <CR> at the end of line it automatically deletes it.  Mind
you I am using an earlier version of cygwin;

	CYGWIN_NT-5.1 1.5.19(0.150/4/2) 2006-01-20 13:28
and so presumably an earlier version of bash
	GNU bash, version 3.00.16(14)-release (i686-pc-cygwin)

Is there a bash variable that controls such behaviour (I can't find one)
or was there an upgrade in the interim?

If so I can't honestly say that it's an improvement.

	Jim Easton

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]