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


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/


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