Test script for repeat output, with in time interval it will show the output of command which you given in script. This script is very useful when you are monitoring the CPU, Memory, Disk input and output and moving or copying files from one to other you will see the slight difference.
while true
do
<command>
sleep 10
done
Example 1 :
It will show "lsvg rootvg" command every 20 seconds.To stop the script run ctrl+d
while true
do
lsvg rootvg
sleep 20
done
Example 2 :
It will show "sar" command every 5 seconds.To stop the script run ctrl+d
while true
do
sar
sleep 5
done
while true
do
<command>
sleep 10
done
Example 1 :
It will show "lsvg rootvg" command every 20 seconds.To stop the script run ctrl+d
while true
do
lsvg rootvg
sleep 20
done
Example 2 :
It will show "sar" command every 5 seconds.To stop the script run ctrl+d
while true
do
sar
sleep 5
done