Do you know, how I can create Bourne Shell script, that kills every
child-process, that it has started as background processes. Now it is
done like this:
trap '
killall -15 xscreensaver-command 2> /dev/null
echo "0" > $WATCHER_FILE
exit 0
' 1 2 3 15 20
set +o noclobber
echo "0" > $WATCHER_FILE
xscreensaver-command -watch |
while read line
do
foo=$(echo $line | awk '{print $1}' - )
if test "$foo" = "BLANK"
then
my_debug "screen is blanked"
echo "1" > $WATCHER_FILE
elif test "$foo" = "LOCK"
then
my_debug "screen is locked"
echo "1" > $WATCHER_FILE
elif test "$foo" = "UNBLANK"
then
my_debug "screen is UNblanked"
echo "0" > $WATCHER_FILE
fi
done
That "killall -15 xscreensaver-command" is not very elegant. I want to
kill only that one xscreensaver-command -process and child-process,
that is created in that line saying "while read line".
--
http://www.cc.jyu.fi/~juhtolv/ * * "STRAIGHT BUT NOT NARROW !!"
---------------------------------------------------------------
"if i was twice the man i could be, i'd still be half of what
you need" Nine Inch Nails