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.
Simple Script help!
I'm scripting in Unix for my first time today. Does anyone know why I get the error "on line 20: unexpected error near ')'
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?
Try this:
echo -e "what would you like to do?\n"echo -n "A. List the contents of the capital.ca file, sorted inalphabetical order by capital names, and all fields separated bycolons.?"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 -necho "C. List the provinces.ca file, sorted in numerical order bypopulation, the province with the largest population first and thesmallest population"read choice; echoclear;case $choice in a|A)echo "Here's the contents of the capital.ca file, sorted in"echo "alphabetical order"; ;; *)echo "end" ;;esac
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement