I need to read FIFO file, because it’s arriving snmp traps in a FIFO file that I need to read and process them sequentially. So I’ve created a while (true) loop to begin to read lines of FIFO file and process the output. Problem is machine increase cpu up 100% with the use of the script. I don’t know if I insert a sleep 3s in script. Will read all lines of fifo file? Or could be that it doesn’t read all lines?
I need to decrease cpu performnace of script
My code is like these:
while true
do
if read linea; then
initialice
PintaInfo "$linea"
......
Thanks and sorry for my English!