The device-file 'debug_port' is an output of some port. I have three scripts:
The first script waits for some info from the port, and at the same time logs data in a log file, then performs its work, with some greps from log and echos to debug_port.
#first.sh
pkill cat
cat debug_port > $logfile1 &
running=$!
# perform its tasks...
kill $running
killall -s SIGPIPE cat
pkill -P $$
rm $logfile1
The second one waits for some other info and performs another work.
#second.sh
pkill cat
cat debug_port > $logfile2 &
running=$!
# <<< there is problem: no output from 'debug_port'
# perform its tasks...
kill $running
rm $logfile2
And caller calls both of them sequentially
#caller.sh
./first.sh
./second.sh
Problem is, I have no output from 'debug_port', in the second script. However I am sure there should be some.
pkills andkillalls will affect the other script, and other scripts being run by this user (all users if run by root).