当前位置: 技术问答>请问如何编写DOS Extender的程序
iis7站长之家
请问我这个shell编写的菜单为什么不能正常运行。
来源: 互联网 发布时间:2016-05-01
本文导语: 代码如下: [code=BatchFile]#!/bin/sh POCESS(){ echo "n" echo "按回车键继续..." read w } while true do clear echo " " echo " ◆ ODS检查主菜单 ◆" echo " ========================...
代码如下:
[code=BatchFile]#!/bin/sh
POCESS(){
echo "n"
echo "按回车键继续..."
read w
}
while true
do
clear
echo " "
echo " ◆ ODS检查主菜单 ◆"
echo " ================================================"
echo " ┏━━━━━━━━━━━━━━━━━━━━━━━┓"
echo " ┃ ┃"
echo " ┃ 1. 核心信贷财务数据是否准备好(03:00) ┃"
echo " ┃ ┃"
echo " ┃ 2. 核心信贷财务完成标志检查(04:00 11:00) ┃"
echo " ┃ ┃"
echo " ┃ 3. 当前系统日期 ┃"
echo " ┃ ┃"
echo " ┃ 4. DATASTAGE服务器220磁盘空间查看 ┃"
echo " ┃ ┃"
echo " ┃ 5. 文件数量检查 ┃"
echo " ┃ ┃"
echo " ┃ 0. 退 出 readme.查看菜单项说明┃"
echo " ┃ ┃"
echo " ┗━━━━━━━━━━━━━━━━━━━━━━━┛"
echo " "
echo " 请 选 择(0~9):c"
read z
case $z in
readme) clear
cat /home/xxinfc/readme
PROCESS
;;
1) clear
echo "n"
echo "Please wait..."
echo "1. 核心信贷财务数据是否准备好(03:00)"
cd /dsdata/ods/Dataspace/ods_shell/
./query.sh
PROCESS
;;
2) clear
echo "n"
echo "2. 核心信贷财务完成标志检查(04:00 11:00)"
cd /dsdata/ods/Dataspace/ods_shell/
./query.sh
PROCESS
;;
3) clear
echo "n"
echo "n"
echo "3. 当前系统日期 "
date '+ 今天是: %Y 年 %m 月 %d 日,星期 %w '
date '+ 现在的时间是:%T'
PROCESS
;;
4) clear
echo "n"
echo "n"
echo "4. DATASTAGE服务器220磁盘空间查看 "
df -gv
PROCESS
;;
5) clear
echo "n"
echo "n"
echo "5.文件数量检查"
cd /dsdata/ods/Dataspace/ods_shell/
./query.sh
PROCESS
;;
0) clear
exit;;
*);;
esac
done
[/code]
运行时只有按0(退出)能正常运行,其它的为什么不能运行呢?
[code=BatchFile]#!/bin/sh
POCESS(){
echo "n"
echo "按回车键继续..."
read w
}
while true
do
clear
echo " "
echo " ◆ ODS检查主菜单 ◆"
echo " ================================================"
echo " ┏━━━━━━━━━━━━━━━━━━━━━━━┓"
echo " ┃ ┃"
echo " ┃ 1. 核心信贷财务数据是否准备好(03:00) ┃"
echo " ┃ ┃"
echo " ┃ 2. 核心信贷财务完成标志检查(04:00 11:00) ┃"
echo " ┃ ┃"
echo " ┃ 3. 当前系统日期 ┃"
echo " ┃ ┃"
echo " ┃ 4. DATASTAGE服务器220磁盘空间查看 ┃"
echo " ┃ ┃"
echo " ┃ 5. 文件数量检查 ┃"
echo " ┃ ┃"
echo " ┃ 0. 退 出 readme.查看菜单项说明┃"
echo " ┃ ┃"
echo " ┗━━━━━━━━━━━━━━━━━━━━━━━┛"
echo " "
echo " 请 选 择(0~9):c"
read z
case $z in
readme) clear
cat /home/xxinfc/readme
PROCESS
;;
1) clear
echo "n"
echo "Please wait..."
echo "1. 核心信贷财务数据是否准备好(03:00)"
cd /dsdata/ods/Dataspace/ods_shell/
./query.sh
PROCESS
;;
2) clear
echo "n"
echo "2. 核心信贷财务完成标志检查(04:00 11:00)"
cd /dsdata/ods/Dataspace/ods_shell/
./query.sh
PROCESS
;;
3) clear
echo "n"
echo "n"
echo "3. 当前系统日期 "
date '+ 今天是: %Y 年 %m 月 %d 日,星期 %w '
date '+ 现在的时间是:%T'
PROCESS
;;
4) clear
echo "n"
echo "n"
echo "4. DATASTAGE服务器220磁盘空间查看 "
df -gv
PROCESS
;;
5) clear
echo "n"
echo "n"
echo "5.文件数量检查"
cd /dsdata/ods/Dataspace/ods_shell/
./query.sh
PROCESS
;;
0) clear
exit;;
*);;
esac
done
[/code]
运行时只有按0(退出)能正常运行,其它的为什么不能运行呢?
|
POCESS(){
==>
PROCESS(){
拼写有误
==>
PROCESS(){
拼写有误
|
太不小心了。
|
上面的那么多echo,其实可以简化成:
cat
cat