<script type="text/javascript">
</script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
一个循环脚本的例子
下面这个文件阐释了前面讲到得循环和控制语句:
#! /bin/bash
# Use the bash shell to run the script
# This is an example file to take entries from the user
# entries Version 1.0 May 22, 2000
DONE=no
ENTRIES="hello bye ls 1"
while [ $DONE = no ]
do
echo Valid entries are: $ENTRIES
read ENTRY # 用户输入变量 ENTRY 的值
case $ENTRY in
1)
pwd
;;
hello)
echo How are you?
;;
bye)
echo exiting...
DONE=yes
;;
ls)
ls -al |more
;;
*)
echo $ENTRY is an unrecognized command.
;;
esac
done
<script type="text/javascript">
</script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>