This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: CASE error in script file
Shankar Unni <shankarunni <at> netscape.net> writes:
>
> Doug wrote:
>
> > case $1 in
>
> If $1 is undefined (i.e. you pass in no arguments), this line becomes
>
> case in
>
> which is incorrect syntax, of course. Answer: quote the "$1".
>
>
I did put the "$1" in and it still gives me the same error
case "$1" in
"1")
echo '1'
;;
2)
echo '2'
;;
*)
echo 'Dunno'
exit 1;;
esac
'/test.sh: line 1: syntax error near unexpected token `in
'/test.sh: line 1: `case "$1" in
Thanks
--
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/