Jump to content
  • Advertisement
Sign in to follow this  
Instigator

Simple Script help!

This topic is 4327 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm scripting in Unix for my first time today. Does anyone know why I get the error "on line 20: unexpected error near ')'
echo -e "what would you like to do?\n"
echo -n "A. List the contents of the capital.ca file, sorted in
alphabetical order by capital names, and all fields separated by
colons.?"
echo " "
echo "B. Display the names of the capital name, follwed by a comma,
followd by the province name, in alphabetical order by province name?"
echo -n
echo "C. List the provinces.ca file, sorted in numerical order by
population, the province with the largest population first and the
smallest population"

read choice; echo
clear;
case $choice in
        a|A)
echo "Here's the contents of the capital.ca file, sorted in"
echo "alphabetical order";

*)
echo "end"
esac
Any help on why I'm getting this error would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
case $choice in
a|A)


I must admit, I'm quite puzzled by the above syntax as well. Are you certain that your parenthesis should be unmatched?

Share this post


Link to post
Share on other sites
Try this:

echo -e "what would you like to do?\n"
echo -n "A. List the contents of the capital.ca file, sorted in
alphabetical order by capital names, and all fields separated by
colons.?"
echo " "
echo "B. Display the names of the capital name, follwed by a comma,
followd by the province name, in alphabetical order by province name?"
echo -n
echo "C. List the provinces.ca file, sorted in numerical order by
population, the province with the largest population first and the
smallest population"

read choice; echo
clear;
case $choice in
a|A)
echo "Here's the contents of the capital.ca file, sorted in"
echo "alphabetical order";
;;
*)
echo "end"
;;
esac



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!