Hi Yan !

On 05-03-2014 09:14 Yan Seiner <y...@seiner.com> wrote:
>I am trying to run a script every second.

Beside what Laurent told about using sleep, etc.

>first script (the one that does the work)
>
>trap 'update' HUP
>mknod /tmp/dummyfifo p
>while true; do
>     read < /tmp/dummyfifo > /dev/null 2>&1
>done

>The problem is that the 'read' generates a
>/usr/bin/update: line 1: can't open /tmp/dummyfifo: Interrupted
>system call

The reason for this is you create your pipe once, but open it
again at every iteration of the loop.

Try the following:

mknod /tmp/dummyfifo p
exec 0</tmp/dummyfifo 1>/dev/null 2>&1
while true; do
   read
done

This opens the fifo once and assigns it for stdin. After that it
stays open until the first script is terminated in any way.

In addition stdout *AND* stderr are redirected to /dev/null for
all following commands in the script, so you need to redirect to
any file or tty when you want do display something.

--
Harald
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to