#!/bin/bash
START_SLEEP_TIME=2
LOOP_SLEEP_TIME=2
OK="false"
#need to wait for another proc first
sleep $START_SLEEP_TIME
RET=
check () {
echo "---1--"
echo "---2--"
return 1
}
# isn't even called but just making sure it's not a syntax issue
finalize () {
OK="true"
}
for i in {0..100}
do
echo "check"
VAL=check
sleep $LOOP_SLEEP_TIME
done
echo "Checks terminated. $OK"
The script is supposed to do more stuff, but I am trying to strip it down to the essential to see why it is not working.
The above for me just always prints
check
check
check
after sleeping but it never prints --1--
or --2--
.
The function is supposed to be doing more stuff but if I can't even get this to work there's no point.