I want to print by echo the following "still in process wait another 10 min" every 10 min
Please advice what condition needs to add before the echo command in order to print this line every 10 min?
Remark - counter increase by one every cycle (1 second) , I not want to add Additional delay ( sleep command ) to this script !!!!!
Until [ ]
do
Counter=1
sleep 1
let counter=$counter+1
[ .... ] && echo " still in process wait another 10 min …."
done
Use the modulo operator (bash specific syntax):
Or more portable:
Add another counter, and if that reaches 600, call echo and reset the counter. Repeat as needed.
So something like this should do:
What you want, is something like this:
I added some logic to check the time:
You probably want the sleepenh program, which allows for "accurate sleeping". There's also a blog post about how it was used to solve a problem which required no oversleeping