本文主要是介绍CTDP linux 程序员手册 (4.6) 一个循环脚本的例子,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<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>
这篇关于CTDP linux 程序员手册 (4.6) 一个循环脚本的例子的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!