简体   繁体   English

Unix shell脚本“如何重复任务”

[英]Unix shell scripting “How to repeat the tasks ”

I want to repeat the same tasks that were done. 我想重复执行相同的任务。

For example: 例如:

#!/bin/ksh
HOST=`hostname`
#-----------------------------------------
if [ $HOST = "     " ]
cd $path 
ls -lrt
#----------------------------------
read JVM
echo "please opt the JVM "

echo "Do u want to check logs ?.........."
select opt in Yes No
        do
        case $opt in
        "Yes")
commands;
;;

"No")
break
exit 1;
;;
esac
done

Here I want to repeat the things by taking the another JVM at the top and I want check logs for different JVM without exiting from the server. 在这里,我想通过在顶部放置另一个JVM来重复这些事情,并且希望在不退出服务器的情况下检查其他JVM的日志。

Not at all clear what you are really asking, but I think you are just looking for the following loop: 根本不清楚您真正要问的是什么,但我认为您正在寻找以下循环:

while read JVM; do
...
done

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM