The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

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 12:33 AM
what is problem with this small shell script.. case statement related johnray31 Shell Programming and Scripting 2 12-10-2007 11:05 AM
case statement bkan77 Shell Programming and Scripting 5 09-11-2007 02:54 PM
Case Statement Zeta_Acosta Shell Programming and Scripting 19 04-06-2004 01:16 PM
case statement Bab00shka Shell Programming and Scripting 1 07-15-2002 02:31 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-14-2006
Supporter
 

Join Date: Oct 2006
Posts: 39
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-14-2006
kamitsin's Avatar
Registered User
 

Join Date: Nov 2006
Location: /dev/null
Posts: 174
Code:
case $1 in
1) Tapes_Offsite_Menu()
;;
2) Tapes_Return_Menu()
;;
q) exit
;;
}
You are missing something here !!!!!!!
Reply With Quote
  #3 (permalink)  
Old 11-14-2006
Supporter
 

Join Date: Oct 2006
Posts: 39
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
Reply With Quote
  #4 (permalink)  
Old 11-14-2006
Supporter
 

Join Date: Oct 2006
Posts: 39
Quote:
Originally Posted by gzs553
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
Thank-you for your response. I am trying to get option input from the menu, and then go to the function for that option. The problem is that I cannot get the menu to display to select the option and the function.
Reply With Quote
  #5 (permalink)  
Old 11-14-2006
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 627
kamitsin said you're missing something in the section here ... see "man ksh" or "man sh" and then search for case ...
Code:
case $1 in
1) Tapes_Offsite_Menu()
;;
2) Tapes_Return_Menu()
;;
q) exit
;;
esac

... have fun!
Reply With Quote
  #6 (permalink)  
Old 11-14-2006
Supporter
 

Join Date: Oct 2006
Posts: 39
duh!! me..I'm so blind. Thank-you..I thought it was there.
Reply With Quote
  #7 (permalink)  
Old 11-14-2006
kamitsin's Avatar
Registered User
 

Join Date: Nov 2006
Location: /dev/null
Posts: 174
I said that you are missing something because your other two case statements were perfectly ok so i thought you will find it out
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0