I've created a few named pipes for a few client programs such as cec so I only need to make the connection once in the background and just pipe in commands. Most of the time I don't need to read the output but I need to sometimes and would like to find some way. What I have setup
sudo mkfifo /dev/cecIn
sudo chmod 666 /dev/cecIn
tailf /dev/null > /dev/cecIn #keep pipe open
sudo mkfifo /dev/cecOut
sudo chmod 666 /dev/cecOut
cat /dev/cecIn | cec-client -s > /dev/cecOut
Sending cec commands in is great and really fast since I keep the connection open. Right now I use echo as > /dev/cecIn
for example, but if I want the output from echo tx 40:8f > /dev/cecIn #power status
to return I can't find a clean way. I can cat
the out pipe in another window and see it works and I understand where it's not coming to stdout normally and that the processes are separate, but is there a way to run a command/script to process the cecOut pipe that was generated from a cecIn input?
I'm in Debian Jessie if it matters