ITPub博客

首页 > 应用开发 > IT综合 > shell写的控制菜单

shell写的控制菜单

原创 IT综合 作者:zhyuh 时间:2004-09-10 11:44:52 0 删除 编辑
写了上面的自动倒入数据的脚本后,
根据需要又写了这个菜单界面,方便用户使用。
写这个shell的时候参照了一个高人的例子,
放在这里只为了方便自己日后用到时可以参考一下
[@more@]
#!/bin/ksh
pop_profile()
{
sqlplus -s zjenn/zjenn>>/dev/null<  execute p_analytic.con2profile;
  exit;
EOF
}
pop_behavior()
{
sqlplus -s zjenn/zjenn>>/dev/null<  execute p_analytic.con2behavior;
  exit;
EOF
}
pop_putch()
{
sqlplus -s zjenn/zjenn>>/dev/null<  execute p_analytic.con2putch;
  exit;
EOF
}
pop_ecomm()
{
sqlplus -s zjenn/zjenn>>/dev/null<  execute p_analytic.con2ecommerce;
  exit;
EOF
}
pop_src()
{
sqlplus -s zjenn/zjenn>>/dev/null<  execute p_analytic.con2src;
  exit;
EOF
}
pop_rfm()
{
sqlplus -s zjenn/zjenn>>/dev/null<  execute p_analytic.con2rfm;
  exit;
EOF
}
join_ana()
{
sqlplus -s zjenn/zjenn>>/dev/null<  execute analytic2txt;
  exit
EOF
}
pop_ana_menu()
{
CHOICE='1'
while [ $CHOICE != '0' ]
do
  clear
  echo "  Populate Analytical File   "
  echo "---------------------------------------------------------"
  echo " 1. Profile "
  echo " 2. Purchase "
  echo " 3. Ecommerce "
  echo " 4. Source Count "
  echo " 5. Behavioral "
  echo " 6. RFM "
  echo " 7. Join Analytical Tables "
  echo " 8. Back to Main Menu "
  echo " 0. Exit "
  echo "----------------------------------------------------------"
  echo
  echo "Your choice: c"
  read CHOICE
if [ "x$CHOICE" == "x" ]; then
  CHOICE='x'
fi
case $CHOICE in
  1) pop_profile
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  2) pop_putch
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  3) pop_ecomm
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  4) pop_src
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  5) pop_behavior
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  6) pop_rfm
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  7) join_ana
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  8) main_menu
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
esac
done
}
main_menu()
{
CHOICE='1'
while [ $CHOICE != '0' ]
do
clear
echo "            NAD Control Menu                      "
echo "----------------------------------------------------------------"
echo "1. Net.com/Promotional Registration Data Loading"
echo "2. Net.com/Production Registration Data Loading"
echo "3. Rebate Data Loading"
echo "4. Siebel Order Loading"
echo "5. Messaging Event Contact List Data Loading--DartMail"
echo "6. Messaging Event Contact List Data Loading--Xpedite"
echo "7. Messaging Event Response Data Loading"
echo "8. Data Conversion"
echo "9. Extract Contact De-dupefile to DataCo"
echo "a. DataCo contact De-deup Data Loading"
echo "b. Merge/Purge"
echo "c. Populate Analytical File"
echo "d. Extract Analytical File"
echo "e. Append demographic Data"
echo "f. Append Model Decile Values"
echo "0. Exit"
echo "-----------------------------------------------------------------"
echo
echo "Your choice: c"
read CHOICE
if [ "x$CHOICE" == "x" ]; then
  CHOICE='X'
fi
case $CHOICE in
  1) nad_load PROMOREG
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  2) nad_load PRODREG
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  3) nad_load REBATE
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  4) nad_load ORDER
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  5) nad_load DARTMAIL
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  6) nad_load XPEDITE
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  7) nad_load  EMAILRESP
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  8) pop_conv_menu
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  9) nad_dedup_con
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  a) nad_load DEDUP
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  b) 
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  c) pop_ana_menu
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  d)  nad_ana_spool
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  e) nad_load DEMO
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
  f) nad_load MODEL
     echo "nnnPress RETURN to continue..."; read DUMMY
     ;;
esac
done
}
##################
# main
##################
main_menu

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/207/viewspace-778463/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    233
  • 访问量
    2009583