Question
Please assist with this question, The code I am using is not giving me the correct error message for the incorrect language entered request in
Please assist with this question, The code I am using is not giving me the correct error message for the incorrect language entered request in run 3 below. Here is the code I have so far:
echo "===============================" echo "Developer: Put Your Name Here" echo "===============================" shopt -s nocasematch #for case insensitive comparison
echo -e "Which is first language? " read fLang choice=" " a="--" cLang=( -- english spanish chinese italian hindi -- )
for i in ${cLang[@]} do if [[ "$i" == "$fLang" ]]; then choice=$i fi done
if [[ "${choice}" == " " ]]; then echo -e " ERROR:Failed to find first language: Your first language is not in the list " else echo "Choose any two of them " for i in ${cLang[@]} do if [[ "$i" == "$a" ]]; then echo elif [[ "$i" != "$fLang" ]]; then printf '%s ' "$i" fi done fi
Thank you
Here is the full question below.
Write a bash script to tell a student, what language courses he/she is eligible to take based on his/her First Language. Limit the languages only to English, Spanish, Chinese, Italian, Hindi. Ask the user to enter his/her First Language. If any one of the above languages is entered as the first language, the stude not listed in the 5 laStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started