The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 11-16-2006
BOFH BOFH is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 406
Ok, the first thing is you need to post the complete script. You're missing the top of the script since I don't see the #!/bin/bash line.

Next is use the code tags to enclose your script to make it easier to read. Hard to say if an error is due to transcription or just because the software is deleting spaces and brackets.

Next is the Main_Menu function is not right. You have the while, do and clear outside of the function instead of inside.

Next is you aren't echoing the menu options.

The Volume_Date_Returns function has some bogus if statement constructs. They're commented out but they should be corrected if you're going to use them.

The rest looks basically ok. I'm not 100% sure on how you're using if statements. I'm pretty sure you need to use brackets to enclose the test. I always do and like to verify it before saying it for sure. Can't hurt to actually enclose in brackets though.

Fixed Main_Menu:

Code:
tapemgr_Main_Menu()
{
  while : do
  clear
    echo " 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 option
    case $option in
      1) Tapes_Offsite_Menu();;
      2) Tapes_Return_Menu();;
      q) exit;;
    esac
  done
}
Carl