shell寫的控制選單
寫了上面的自動倒入資料的指令碼後,
根據需要又寫了這個選單介面,方便使用者使用。
寫這個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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Shell:如何寫一個多選選單的指令碼指令碼
- 【shell 練習5】編寫簡單的多級選單
- VC++的選單控制和自繪選單。 (轉)C++
- 寫一個簡單的 Linux Shell (C++)LinuxC++
- 【Shell】使用shell列印選單,一鍵安裝Web應用Web
- Shell文字處理編寫單行指令的訣竅
- 將選中的下拉選單值寫入文字框
- 用下拉選單控制gridview的分頁View
- shell指令碼程式設計之選擇控制結構指令碼程式設計
- 用 C 語言寫一個簡單的 Unix Shell(1)
- 用 C 語言寫一個簡單的 Unix Shell(2)
- 自定義下拉選單控制元件控制元件
- shell流程控制
- shell if 寫法
- tkinter中menu選單控制元件(十二)控制元件
- Swift - 仿寫QQ側滑選單Swift
- TP 基於選單的許可權控制CMS框架框架
- 前端學習(2590):前端許可權的選單控制前端
- 用VB編寫簡單的程式來清空文件選單 (轉)
- Shell指令碼的基本流程控制指令碼
- 透過單選按鈕控制編輯框的狀態
- TC20寫的DOS底下文字選單 (轉)
- 寫了一個簡單的Linux Shell用來下載檔案Linux
- shell script的簡單使用
- 教你如何寫一個簡單的折線圖控制元件控制元件
- [Vue]寫一個簡單的檔案上傳控制元件Vue控制元件
- Shell學習【流程控制】
- Android UI控制元件系列:Spinner(下拉選單)AndroidUI控制元件
- 為ASP.NET控制元件加入快捷選單ASP.NET控制元件
- JS列表的下拉選單元件(仿美化控制元件select)JS控制元件
- WPF Menu控制元件 我也有個不能點菜的選單控制元件
- Shell 指令碼編寫指令碼
- shell 指令碼寫法:指令碼
- 手寫下拉選單,模糊查詢資料
- handsontable如何重寫右鍵選單(contextmenu)Context
- JSON無限摺疊選單編寫JSON
- 編寫shell指令碼的規範指令碼
- 如何編寫高效的 Shell 指令碼指令碼