Originally Posted by grail
hmmm ... so if it an infinite loop, how is the script stopping?
I really sorry because I missed something. I was calling the function with the "&" symbol. I had changed my script to test, and I forgot to undo the change. So, the correct script is:
cat /tmp/errorlogfifo |echo $(date "+[%Y-%m-%d %H:%m:%S]") Error: >/var/log/error.log
logErrors& #I missed the "&" I added.
It seems that in a call of a function in background, kernel keeps a process, with the same name of the script, running the function in memory. Am I correct?
I noticed I don't need the while loop. If I just have the "cat" call everything works fine.
I have another doubt, Is there some way to discover the ID of the function I called in background. I tried the $PPID variable, but the $PPID of the script is different from the PID of the process kept running.
Thank you and sorry for the trouble.