while true do
[calling a function]
{opening a case1 statement}
1)
[Calling another function]
{opening another case2 statement}
{closing case 2}
2)
Showing error for "2)" as Syntax error at line 59 : `)' is not expected.
*)
{closing case 1}
done
This is the structure of my script. I am not able to figure out it. Could anyone crack this ?
I didn't try it so maybe it would require some fix, but in the main loop maybe it could be better with something like :
while true
do
menu
case $choice in
1)
while :
do
chkout1
case $tgtser in
1|2|3|4|5|6|7|8|9|10|11)
echo "Checked out to test server ..."
break
;;
*) echo "Opps !!! please select a valid option"
sleep 2
;;
esac
done
;;
2)
echo "Checked in ..."
;;
3)
echo "Checked out to local machine ..."
;;
4)
echo "Exiting ... "
;;
*)
echo "Opps !!! please select a valid option (1/2/3/4)" ;;
sleep 2
;;
esac
done
You must not make duplicate calls of 'chkout1' or 'menu' you must use the while loop instead.