Hi folks,
here's another scripting issue I'm having some problems with:
I have a script that's using the following lines:
until "Some condition that I'm waiting for"
do
sleep 10
done
Now I want that until to run only let's say 10 times and then send an email saying that something's wrong.
Generally I'd use something like this:
i=1
while [ $i -le 10 ]
do
... some actions
... some actions
i=`expr $i + 1`
done
But I have no idea how those two parts (First the "until" and Second the "while") have to be combined to work properly so that if the condition specified under "until" is not reach he sleeps 10 seconds and checks again for the condition ...
But only 10 times in total.
After 10 times he is to send an email saying something like
"Warning: Condition xyz couldn't be reached after 10 tries. Please check !"
Any ideas ?
Thanks in advance !
Regards
Thomas
here's another scripting issue I'm having some problems with:
I have a script that's using the following lines:
until "Some condition that I'm waiting for"
do
sleep 10
done
Now I want that until to run only let's say 10 times and then send an email saying that something's wrong.
Generally I'd use something like this:
i=1
while [ $i -le 10 ]
do
... some actions
... some actions
i=`expr $i + 1`
done
But I have no idea how those two parts (First the "until" and Second the "while") have to be combined to work properly so that if the condition specified under "until" is not reach he sleeps 10 seconds and checks again for the condition ...
But only 10 times in total.
After 10 times he is to send an email saying something like
"Warning: Condition xyz couldn't be reached after 10 tries. Please check !"
Any ideas ?
Thanks in advance !
Regards
Thomas