複数のメニュー方法を使用したデザインスクリプト

複数のメニュー方法を使用したデザインスクリプト

以下のメニュー方法に基づいてbashスクリプトを設計したいと思います。ここで問題は、Cオプションを選択した後、次のメニューが実行されないことです。このメニューを中断せずに、後続のすべてのメニューのすべてのオプションと連携させる代替方法はありますか?

   #!/bin/bash
echo "create_folder"
echo "Select the KPI to be analyse"
echo "A. EXTDB_KPI's"
echo "B. MAP_KPI's"
echo "C. LTE_IMS_SERVICES_KPI's"
read reply

if [ "$reply" != "A" -a "$reply" != "B" -a "$reply" != "C" ]; then
echo "Not valid option: for reply"
exit;
fi;

if [[ $reply == "A" ]]; then
echo "Select the ExtDb KPI to be analyse"
echo "Module:"
echo "A. LTE_Subs_ESM"
echo "B. IMS_Subs_ISM"
echo "C. MTAS_Subs_SDA"
read reply2


if [ "$reply2" != "A" -a "$reply2" != "B" -a "$reply2" != "C" ]; then
echo "Not valid option: for reply2"
fi;

if [[ $reply2 == "A" ]]; then
echo "Select the ExtDb KPI for LTE_Subs_ESM to be analyse"
elif [[ $reply2 == "B" ]]; then
echo "Select the ExtDb KPI for IMS_Subs_ISM to be analyse"
elif [[ $reply2 == "C" ]]; then
echo "Select the ExtDb KPI for MTAS_Subs_SDA to be analyse"
exit;
fi;

elif [[ $reply == "B" ]]; then
echo "Select the MAP_KPI's to be analyse"
echo "Module:"
echo "A. LTE_Subs_ESM"
echo "B. IMS_Subs_ISM"
echo "C. MTAS_Subs_SDA"
read reply3

if [ "$reply3" != "A" -a "$reply3" != "B" -a "$reply3" != "C" ]; then
echo "Not valid option: for reply3"
exit;
fi;

if [[ $reply3 == "A" ]]; then
echo "Select the MAP_KPI's for LTE_Subs_ESM to be analyse"
elif [[ $reply3 == "B" ]]; then
echo "Select the MAP_KPI's for IMS_Subs_ISM to be analyse"
elif [[ $reply3 == "C" ]]; then
echo "Select the MAP_KPI's for MTAS_Subs_SDA to be analyse"
exit;
fi;

elif [[ $reply == "C" ]]; then
echo "Select the LTE_IMS_SERVICES_KPI's  to be analyse"
echo "Module:"
echo "A. LTE_Subs_ESM"
echo "B. IMS_Subs_ISM"
echo "C. MTAS_Subs_SDA"
read reply4

if [ "$reply4" != "A" -a "$reply4" != "B" -a "$reply4" != "C" ]; then
echo "Not valid option: for reply4"
exit;
fi;

if [[ $reply4 == "A" ]]; then
echo "Select the LTE_IMS_SERVICES_KPI's for LTE_Subs_ESM to be analyse"
echo "A. S6a_Interface_KPI's"
echo "B. SWx_Interface_KPI's"
read reply5

if [ "$reply5" != "A" -a "$reply5" != "B" ]; then
echo "Not valid option: for reply5"
exit;
fi;

elif [[ $reply4 == "B" ]]; then
echo "Select the Cx_Interface_KPI's for IMS_Subs_ESM to be analyse"
echo "A. Cx_Multi_Auth_Req"
echo "B. Cx_Regis_Term_Req"
echo "C. Cx_Loc_Info_Req"
echo "D. Cx_Ser_Assign_Req"
echo "E. Cx_User_Auth_Req"
echo "F. Cx_Push_Profile_Req"
echo "G. Ism_Soap"
read reply8


if [ "$reply8" != "A" -a "$reply8" != "B" -a "$reply8" != "C" -a "$reply8" != "D" -a "$reply8" != "E" -a "$reply8" != "F" -a "$reply8" != "G" ]; then
echo "Not valid option: for reply8"
exit;
fi;

if [[ $reply8 == "A" ]]; then
echo "Here is the Cx_Multi_Auth_Req Counters for Cx_Interface_KPI's to be analyse"
elif [[ $reply8 == "B" ]]; then
echo "Here is the Cx_Regis_Term_Req Counters for Cx_Interface_KPI's to be analyse"
elif [[ $reply8 == "C" ]]; then
echo "Here is the Cx_Loc_Info_Req Counters for Cx_Interface_KPI's to be analyse"
elif [[ $reply8 == "D" ]]; then
echo "Here is the Cx_Ser_Assign_Req Counters for Cx_Interface_KPI's to be analyse"
elif [[ $reply8 == "E" ]]; then
echo "Here is the Cx_User_Auth_Req Counters for Cx_Interface_KPI's to be analyse"
elif [[ $reply8 == "F" ]]; then
echo "Here is the Cx_Push_Profile_Req Counters for Cx_Interface_KPI's to be analyse"
elif [[ $reply8 == "G" ]]; then
echo "Here is the Ism_Soap Counters for Cx_Interface_KPI's to be analyse"
exit;
fi;

elif [[ $reply4 == "C" ]]; then
echo "Select the Sh_Interface_KPI's for Subs_Data_Access to be analyse"
echo "A. Sh_Push_Notif_Req"
echo "B. Sh_Usr_Data_Req"
echo "C. Sh_Subs_Notif_Req"
echo "D. Sh_Prof_Upd_Req"
read reply9


if [ "$reply9" != "A" -a "$reply9" != "B" -a "$reply9" != "C" -a "$reply9" != "D" ]; then
echo "Not valid option: for reply9"
exit;
fi;

if [[ $reply9 == "A" ]]; then
echo "Here is the Sh_Push_Notif_Req Counters for Sh_Interface_KPI's to be analyse"
elif [[ $reply9 == "B" ]]; then
echo "Here is the Sh_Usr_Data_Req Counters for Sh_Interface_KPI's to be analyse"
elif [[ $reply9 == "C" ]]; then
echo "Here is the Sh_Subs_Notif_Req Counters for Sh_Interface_KPI's to be analyse"
elif [[ $reply9 == "D" ]]; then
echo "Here is the Sh_Prof_Upd_Req Counters for Sh_Interface_KPI's to be analyse"
exit;
fi;

if [[ $reply5 == "A" ]]; then
echo "Select the S6a_Interface_KPI's for LTE_Subs_ESM to be analyse"
echo "A. Esm_Soap_Notif"
echo "B. S6a_Auth_Info_Req"
echo "C. S6a_Cancel_Loc_Req"
echo "D. S6a_Del_Sub_Data_Req"
echo "E. S6a_Insert_Sub_Req"
echo "F. S6a_Notify_Req"
echo "G. S6a_PurgeUE_Req"
echo "H. S6a_Reset_Req"
echo "I. S6a_Upd_Loc_Req"
read reply6

if [ "$reply6" != "A" -a "$reply6" != "B" -a "$reply6" != "C" -a "$reply6" != "D" -a "$reply6" != "E" -a "$reply6" != "F" -a "$reply6" != "G" -a "$reply6" != "H" -a "$reply6" != "I" ]; then
echo "Not valid option: for reply6"
exit;
fi;

if [[ $reply6 == "A" ]]; then
echo "Here is the Esm_Soap_Notif Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "B" ]]; then
echo "Here is the S6a_Auth_Info_Req Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "C" ]]; then
echo "Here is the S6a_Cancel_Loc_Req Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "D" ]]; then
echo "Here is the S6a_Del_Sub_Data_Req Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "E" ]]; then
echo "Here is the S6a_Insert_Sub_Req Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "F" ]]; then
echo "Here is the S6a_Notify_Req Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "G" ]]; then
echo "Here is the S6a_PurgeUE_Req Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "H" ]]; then
echo "Here is the S6a_Reset_Req Counters for S6a_Interface_KPI's to be analyse"
elif [[ $reply6 == "I" ]]; then
echo "Here is the S6a_Upd_Loc_Req Counters for S6a_Interface_KPI's to be analyse"
exit;
fi;

elif [[ $reply5 == "B" ]]; then
echo "Select the SWx_Interface_KPI's for LTE_Subs_ESM to be analyse"
echo "A. SWx_Multi_Auth_Req"
echo "B. SWx_Push_Prof_Req"
echo "C. SWx_Regis_Term_Req"
echo "D. SWx_Server_Assignment_Req"
read reply7


if [ "$reply7" != "A" -a "$reply7" != "B" -a "$reply7" != "C" -a "$reply6" != "D" ]; then
echo "Not valid option: for reply7"
exit;
fi;

if [[ $reply7 == "A" ]]; then
echo "Here is the SWx_Multi_Auth_Req Counters for SWx_Interface_KPI's to be analyse"
elif [[ $reply7 == "B" ]]; then
echo "Here is the SWx_Push_Prof_Req Counters for SWx_Interface_KPI's to be analyse"
elif [[ $reply7 == "C" ]]; then
echo "Here is the SWx_Regis_Term_Req Counters for SWx_Interface_KPI's to be analyse"
elif [[ $reply7 == "D" ]]; then
echo "Here is the SWx_Server_Assignment_Req Counters for SWx_Interface_KPI's to be analyse"
exit;
fi;



exit;
fi;
exit;
fi;
exit;
fi;
echo "MSC BLADEWISE MAIN KPI REPORT,LOG AND SUMMARY ARE UNDER PATH://storage/hss_kpi/$date/"


    Select the KPI to be analyse
A. EXTDB_KPI's
B. MAP_KPI's
C. LTE_IMS_SERVICES_KPI's
C
Select the LTE_IMS_SERVICES_KPI's  to be analyse
Module:
A. LTE_Subs_ESM
B. IMS_Subs_ISM
C. MTAS_Subs_SDA
B
MSC BLADEWISE MAIN KPI REPORT,LOG AND SUMMARY ARE UNDER PATH://storage/hss_kpi/20200519/



ベストアンサー1

このような

echo "A. EXTDB_KPI's"
echo "B. MAP_KPI's"
echo "C. LTE_IMS_SERVICES_KPI's"
read -p "Select the KPI to be analyse" kpi_resp
case $kpi_resp in
   A) 
      read -p "Select the ExtDb KPI to be analyse" extdb_resp
      case $extdb_resp in
         A) ... ;;
         B) ... ;;
         C) ... ;;
         *) echo "Invalid"; exit ;;
      esac

   B)
      ;;
   C)
      ;;
   *) echo "invalid response"; exit ;;
esac

おすすめ記事