On Friday, 14 July 2023 00:02:05 BST Frank Steinmetzger wrote:
> Am Sat, Jul 08, 2023 at 12:42:13PM -0300 schrieb David M. Fellows:
> > while [ true ] ; do cat /proc/loadavg |logger; sleep 60; done
> 
> A spec more elegant:
> 
> while sleep 60; do ... ; done

I tried this in a bash script:

merging=true
echo "" > /var/log/local0.log
while [ $merging ] ; do cat /proc/loadavg | logger -p local0.info; sleep 10; 
done &
/usr/bin/emerge "$@"; merging=false

... But the emerge command is never executed. I thought the '&' would detach
the logging command to run in the background.

Shellcheck only complains about the 'cat' being useless; nothing about the
logic, as I suppose I should have expected.

My programming days are long behind me, as you can see.  :(

-- 
Regards,
Peter.




Reply via email to