Hello a couple of quick and hopefully simple questions.
1. Is there any way to use the sleep command for less than one second time interval? i.e.
while :
do
echo “1”
sleep .5
done
2. What might be an easy way to figure out a percentage in a script.
For example I know how to capture a number for a specific count and this will rise and fall all day, I am only concerned if it jumps by say 20%.
So an example might be
MQ=`netstat –n |grep 59100|wc –l
A=`cat fileone`
B=`cat filetwo`
while :
do
$MQ >fileone
sleep 600
$MQ>filetwo
# Ok this is where I am guessing.
let C=$B-$A
let D=$C/$A
if [ $D –gt 20 ]
then
beep me
else
sleep 3600
fi
done
As Alway we thank you for your support.
1. Is there any way to use the sleep command for less than one second time interval? i.e.
while :
do
echo “1”
sleep .5
done
2. What might be an easy way to figure out a percentage in a script.
For example I know how to capture a number for a specific count and this will rise and fall all day, I am only concerned if it jumps by say 20%.
So an example might be
MQ=`netstat –n |grep 59100|wc –l
A=`cat fileone`
B=`cat filetwo`
while :
do
$MQ >fileone
sleep 600
$MQ>filetwo
# Ok this is where I am guessing.
let C=$B-$A
let D=$C/$A
if [ $D –gt 20 ]
then
beep me
else
sleep 3600
fi
done
As Alway we thank you for your support.