I am using a utility called irexec, which is part of the lirc I wanted it
to run a program the first
time a specific button is pressed, but the second time will close it: for
power button will open xawtv and the second time I press it (while xawtv is
running), it will exit xawtv. For that I made a short shell-script called
run-kill: it takes 1 parameter and the second is optional. The first one is
the program to run (should be in path, just the program name no path) and
the second is the command for closing the program for example:
run-kill xawtv "xawtv-remote exit"
The script will use a "/tmp/$1.run.flag" to konw if that program is running,
and how to close it: if no command was given, the script is supposed to
write to that file: "kill `/sbin/pidof $1`". All this was implemented, but
when I use that script on irexec it does not echo to the temp file. But that
happens only when I system() it, when I execl() it, the redirecttion is OK
(but irexec exits, i wonder why...).
I attched the script also. the line which is bugy is #26:
echo $KILL_COMMAND >& /tmp/$MAIN_PROG.flag.run.
I dont think that it matters but, i copmiled using gcc 2.95 on a mandrake
7.2 with kernel 2.4.5 and lirc 0.6.3 configures for flyvideo.