简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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