On Wed, 13 May 2026 01:39:13 +0200
dan <[email protected]> wrote:

> #!/bin/sh
> 
> while true; do

"while true;" can be dangerous if the inner loop doesnt do much - it can be 
hard to break (ctrl-c, etc.), especially over a remote condition

>   ret=`syspatch 2>/tmp/_coffeebreak; cat /tmp/_coffeebreak | wc -w`
>   if [ $ret = 0 ]; then
>     break
>   else
>     echo "zzz"
>   fi
>   sleep 1

and you have this fine sleep 1 right here thats supremely easy to break out of. 
 Normally a sleep up front isn't ideal, but for low values, it basically ends 
up looking like that same thing as a tailing sleep in the function.

To make it a little more remote safe, I suggest something like:

while sleep 1;do ... 
   the inner loop
done

granted, the likelyhood of syspatch and your /tmp filesystem horking things up 
are fairly low around boot time, but its not unheard of...


> done
> 
> rm /tmp/_coffeebreak
> 
> anyone tuned in ? :)
> 
> dan
> bsd.numode.eu
> 

Reply via email to