![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help needed in using case statement | jisha | Shell Programming and Scripting | 0 | 01-16-2008 04:33 AM |
| what is problem with this small shell script.. case statement related | johnray31 | Shell Programming and Scripting | 2 | 12-10-2007 03:05 PM |
| case statement | bkan77 | Shell Programming and Scripting | 5 | 09-11-2007 05:54 PM |
| Case Statement | Zeta_Acosta | Shell Programming and Scripting | 19 | 04-06-2004 04:16 PM |
| case statement | Bab00shka | Shell Programming and Scripting | 1 | 07-15-2002 05:31 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Case statement problem
I need to display this menu and accept variables. Can someone tell me why i am having a problem with this case statement, please
# TAPE MANAGER MAIN MENU tapemgr_Main_Menu() { echo "Legato Tape Management System Menu" echo " This system is used to report Legato ERV Offsite and Tapes Returned" echo " 1. BUR IPS Tape Offsite Report" echo " 2. BUR IPS TAPE Returns from ERV" echo " q. Quit or Ctrl-C" echo "Select an option 1,2,q"; read $1 case $1 in 1) Tapes_Offsite_Menu() ;; 2) Tapes_Return_Menu() ;; q) exit ;; } Tapes_Offsite_Menu() { echo "1. Weekly or Monthly or Both Offsite Reporting (w,m,b)" echo " (W)Weekly (M) for Monthly or (B) for Both x-exit" read SEL case $SEL in w) Weekly_Offsite();; m) Monthly_Offsite();; b) Both_Offsite();; x) tapemgr_Main_Menu();; esac } Tapes_Return_Menu() { echo "Tapes Return Menu" echo " 1. Enter IPS tape (V)olumes or (D)ates to be returned" echo " r) Return to Main Menu" case $SEL in V) Volume_Returns();; D) Volume_Date_Returns();; r) tapemgr_Main_menu();; esac |
|
||||
|
I am assuming the user is inputing one of the menu options from the menu screen displayed within the case statement.
# TAPE MANAGER MAIN MENU tapemgr_Main_Menu() { echo "Legato Tape Management System Menu" echo " This system is used to report Legato ERV Offsite and Tapes Returned" echo " 1. BUR IPS Tape Offsite Report" echo " 2. BUR IPS TAPE Returns from ERV" echo " q. Quit or Ctrl-C" echo "Select an option 1,2,q"; read $1 case $1 in 1) Tapes_Offsite_Menu() ;; 2) Tapes_Return_Menu() ;; q) exit ;; } Tapes_Offsite_Menu() { echo "1. Weekly or Monthly or Both Offsite Reporting (w,m,b)" echo " (W)Weekly (M) for Monthly or (B) for Both x-exit" read SEL case $SEL in w) Weekly_Offsite();; m) Monthly_Offsite();; b) Both_Offsite();; x) tapemgr_Main_Menu();; esac } Tapes_Return_Menu() { echo "Tapes Return Menu" echo " 1. Enter IPS tape (V)olumes or (D)ates to be returned" echo " r) Return to Main Menu" case $SEL in V) Volume_Returns();; D) Volume_Date_Returns();; r) tapemgr_Main_menu();; esac |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|