Step 1:Before u start application1. do "mkfifo /tmp/1.out.
Step 2:start application1.
Step 3: run the shell script:
$ wraper.sh < 1.out > 2.out
==================
#we assume the script name is wrapper.sh
while read x
do
echo $x
if [ $sentsign -ne 1 ] ; then
kill -<the signal number> <ur application2>
# for example: :)
# kill -9 $$
fi
sentsign=1
done
# end of script.
====================
Note: this script only send signal to application2 when the application1 write the first byte/line to output.
Note: it is wraper, the output of app1 is 1.out, the stream file (2.out) is from the wraper.
Note: once the app1 close its output file fd, the wraper exit automaticly.
Step 2:start application1.
Step 3: run the shell script:
$ wraper.sh < 1.out > 2.out
==================
#we assume the script name is wrapper.sh
while read x
do
echo $x
if [ $sentsign -ne 1 ] ; then
kill -<the signal number> <ur application2>
# for example: :)
# kill -9 $$
fi
sentsign=1
done
# end of script.
====================
Note: this script only send signal to application2 when the application1 write the first byte/line to output.
Note: it is wraper, the output of app1 is 1.out, the stream file (2.out) is from the wraper.
Note: once the app1 close its output file fd, the wraper exit automaticly.