The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-14-2006
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
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
  #2 (permalink)  
Old 11-14-2006
kamitsin's Avatar
kamitsin kamitsin is offline
Registered User
  
 

Join Date: Nov 2006
Location: /dev/null
Posts: 177
Code:
case $1 in
1) Tapes_Offsite_Menu()
;;
2) Tapes_Return_Menu()
;;
q) exit
;;
}
You are missing something here !!!!!!!
  #3 (permalink)  
Old 11-14-2006
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
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
  #4 (permalink)  
Old 11-14-2006
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
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.
  #5 (permalink)  
Old 11-14-2006
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
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!
  #6 (permalink)  
Old 11-14-2006
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
duh!! me..I'm so blind. Thank-you..I thought it was there.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0