Hey guys, messing around with a snippet from a mailing list post,
#!/bin/bash
mkfifo -m 666 /var/spool/my_fifo exec 42<> /var/spool/my_fifo
while true do while read -t 5 data <&42 do echo "data is ($data)" done echo "read again" done
What happens to this to invalidate the initial 'true' condition, it only runs for a short while?
Thanks! jlc
On Thu, 2010-04-08 at 15:57 +0000, Joseph L. Casale wrote:
Hey guys, messing around with a snippet from a mailing list post,
#!/bin/bash
mkfifo -m 666 /var/spool/my_fifo exec 42<> /var/spool/my_fifo
while true do while read -t 5 data <&42 do echo "data is ($data)" done echo "read again" done
What happens to this to invalidate the initial 'true' condition, it only runs for a short while?
---
No exit 0 status for sucess. Your while syntax is diff compared to what should be used like "while; true". It's only repetitive on exit 0 status.
John
On 04/08/2010 10:57 AM, Joseph L. Casale wrote:
Hey guys, messing around with a snippet from a mailing list post,
#!/bin/bash
mkfifo -m 666 /var/spool/my_fifo exec 42<> /var/spool/my_fifo
while true do while read -t 5 data<&42 do echo "data is ($data)" done echo "read again" done
What happens to this to invalidate the initial 'true' condition, it only runs for a short while?
Works fine for me. Define "short while" (to a geologist, that could be a few millenia). What is the exit code when your script does terminate?
Works fine for me. Define "short while" (to a geologist, that could be a few millenia). What is the exit code when your script does terminate?
Lol, yeah that was a little weak on my part...
It ran for about a minute.
I am not sure what caused the non 0 exit, I made a new condition based on a more reliable/sensible test. I am just writing an init script now, we'll see how it fairs!
Thanks, jlc