I have a new script to complete, which needs to be done using a menu.Once the option is selected on the menu the user should enter his email address,which will run a oracle SQL script and email the output to the user whose email was entered.
here is what I've done thus fur:
#!/usr/bin/ksh
WORKDIR=/u1/home/ops
SPOOLFILE=/u1/home/ops/menopt15.lst
LOGO="Users Takeon/Expired"
LIST="xxx@help.co.za xxxb@help.co.za xxxc@help.co.za graham.goliath@gmail.com"
#Option1=" Run User Takeon Report" ;
#Option2=" Run User Expired Report" ;
#Option3=" Exit Program" ;
Displaymenu () {
clear
echo `DATE`
echo
echo "\t\t\t\t" $LOGO
echo
echo "\t\Select Option:"
echo
echo "\t\t\t [1] Run User Takeon Report "
echo "\t\t\t [2] Run User Expired Report "
echo "\t\t\t [3] Exit Prgram "
echo -n "Enter option then ENTER to continue:;"
}
PressEnter () {
echo Press Enter
read x
}
# A function for each of the menu picks
Function Takeon()
{
echo " Executing Run Takeon Report "
echo " Enter email address then enter to continue: \c"
read email
sqlplus -s mac/mac789@${WORKDIR}/takeondate.sql
}
Function Expired()
{
echo "Executing Run Expired Report"
sqlplus -s mac/mac789@${WORKDIR}/expirydate.sql
}
Function Exit()
{
echo "Exit Program"
# ... perform certain actions
}
while true
do
displaymenu
read answer
case $answer in
1] Run User Takeon Report ;;
2] Run User Expired Report ;;
3] break ;;
esac
done
clear
here is what I've done thus fur:
#!/usr/bin/ksh
WORKDIR=/u1/home/ops
SPOOLFILE=/u1/home/ops/menopt15.lst
LOGO="Users Takeon/Expired"
LIST="xxx@help.co.za xxxb@help.co.za xxxc@help.co.za graham.goliath@gmail.com"
#Option1=" Run User Takeon Report" ;
#Option2=" Run User Expired Report" ;
#Option3=" Exit Program" ;
Displaymenu () {
clear
echo `DATE`
echo
echo "\t\t\t\t" $LOGO
echo
echo "\t\Select Option:"
echo
echo "\t\t\t [1] Run User Takeon Report "
echo "\t\t\t [2] Run User Expired Report "
echo "\t\t\t [3] Exit Prgram "
echo -n "Enter option then ENTER to continue:;"
}
PressEnter () {
echo Press Enter
read x
}
# A function for each of the menu picks
Function Takeon()
{
echo " Executing Run Takeon Report "
echo " Enter email address then enter to continue: \c"
read email
sqlplus -s mac/mac789@${WORKDIR}/takeondate.sql
}
Function Expired()
{
echo "Executing Run Expired Report"
sqlplus -s mac/mac789@${WORKDIR}/expirydate.sql
}
Function Exit()
{
echo "Exit Program"
# ... perform certain actions
}
while true
do
displaymenu
read answer
case $answer in
1] Run User Takeon Report ;;
2] Run User Expired Report ;;
3] break ;;
esac
done
clear