免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2124 | 回复: 7

错哪 了? [复制链接]

论坛徽章:
0
发表于 2003-01-19 16:25 |显示全部楼层
#this is my first shell program


##############***********this is function station****************

#*********this is displya menu & welcom message
men()
{
echo "★★★★★★★★★★★★★★★★★★★★★★★★★ "
echo "★           Welcome come back           ★"
echo "★           yahe cool station           ★"
echo "★   web:http://www.yuren.6to23.com      ★"
echo "★  version:1.23  copyright:2003-01-13   ★"
echo "★my name is hanliang plese contact to me★"
echo "★         Mail:yahe_yahe@163.net        ★"
echo "★               QQ:58311245             ★
echo "★★★★★★★★★★★★★★★★★★★★★★★★★"
echo ""
echo ""
echo "★★★★★★★【please select】★★★★★★★★"
echo "      1.display disk status"
echo "      2.display condition vars"
echo "      3.solaris start is CDE "
echo "      4.solaris start is commands line"
echo "      5.run openwindow"
echo "      6.format driver A is msdos mode"
echo "      7.format driver A is ufs mode"
echo "      8.user mannege system"
echo "      9.restart pc"
echo "     10.shutdown pc"
echo "     20.exit "
echo "★★★★★★★★★★★★★★★★★★★★★★★★"
echo ""
echo "";
}

#*********this is whether display or exit
wd()
{
echo "Are you return menu? Y or N:\c"
read wd_choose
if [ $wd_choose = Y -o $wd_choose = y ]
then
i=true
else
i=false
fi
}


#***********************************************





#***************this is main program

i=true
while $i
do
clear

men

echo "please input your choose:\c"
read yc
echo "your choose is $yc"
case "$yc" in
     1)
     echo "display disk status"
     df -k
     wd
     ;;
     2)
     echo "display condition vars"
     env
     wd
     ;;
     3)
     echo "solaris start is CDE"
     /usr/dt/bin/dtconfig -e
     wd
     ;;
     4)
     echo "solaris start is commands line"
     /usr/dt/bin/dtconfig -d
     wd
     ;;
     5)
     echo "solaris run openwindow now!please quit to command line"
     openwin
     wd
     ;;
     20)
     echo "thanks use! welcome come back!"
     exit
     ;;
     *)
     echo "please input your choose again!"
     ;;
esac

done

出错说:syntax error at line 103:'end of file' unexpected

论坛徽章:
0
发表于 2003-01-19 17:20 |显示全部楼层

错哪 了?

把你的小★★都注释了试试

论坛徽章:
0
发表于 2003-01-19 17:25 |显示全部楼层

错哪 了?

不会是那个的事,以前这个程序还可以运行的。为何现在不行了,再一个那个错误提示是怎么回事?我看了一下我程序的结尾也没什么错呀?

论坛徽章:
0
发表于 2003-01-19 17:42 |显示全部楼层

错哪 了?

我知道哪错了,少了一个引号,不好意思
echo "★ QQ:58311245 ★

我发现调试SHELL程序太累,请问有没有SOLARIS下的专用语法检查程序呀?

论坛徽章:
0
发表于 2003-01-19 18:04 |显示全部楼层

错哪 了?

...



Solaris下检查语法的东东不知道有没有。调试一般就是用 sh -x 来跟踪一下,不过象这样的缺半个引号它也查不出来。

另外,建议你以后这么多 echo 的可以并在一起写就不易出这样的错了。

echo "
★★★★★★★★★★★★★★★★★★★★★★★★★  
★ Welcome come back ★
★ yahe cool station ★
★ web:http://www.yuren.6to23.com ★
★ version:1.23 copyright:2003-01-13 ★
★my name is hanliang plese contact to me★
★ Mail:yahe_yahe@163.net ★
★ QQ:58311245 ★
★★★★★★★★★★★★★★★★★★★★★★★★★
  
  
★★★★★★★【please select】★★★★★★★★
  1.display disk status
  2.display condition vars
  3.solaris start is CDE  
  4.solaris start is commands line
  5.run openwindow
  6.format driver A is msdos mode
  7.format driver A is ufs mode
  8.user mannege system
  9.restart pc
  10.shutdown pc
  20.exit  
★★★★★★★★★★★★★★★★★★★★★★★★ "

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
发表于 2003-01-19 22:26 |显示全部楼层

错哪 了?

“men”是什么命令?

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
发表于 2003-01-19 22:28 |显示全部楼层

错哪 了?

SORRY,问个白痴问题,俺看到了

论坛徽章:
0
发表于 2003-01-20 08:20 |显示全部楼层

错哪 了?

[quote]原帖由 "laoxia"]SORRY,问个白痴问题,俺看到了[/quote 发表:

You smile, i smile with you      
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP