Running a script every second

Yan Seiner yan at seiner.com
Wed Mar 5 17:14:42 UTC 2014


I am trying to run a script every second.  I set up two scripts:

first script (the one that does the work)

#!/bin/ash

update() {
     ....
     }

trap 'update' HUP

mknod /tmp/dummyfifo p

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

and now the trigger script:

#!/bin/ash

/bin/watch -t -n 1 killall -HUP update > /dev/null 2>&1

The problem is that the 'read' generates a

/usr/bin/update: line 1: can't open /tmp/dummyfifo: Interrupted system call

every time watch triggers the script.  Other than that it works perfectly.

I've tried various other things but this works best, except for the 
system call clogging up the terminal and logfiles.



More information about the busybox mailing list