1

Is there a practical and easy way to capture data going through a named pipe? I've tried wireshark, but it only accepts a specific data format. I've also tried cat, but I get mixed results.

Thank you

1
  • Have you thought of tee ?
    – X Tian
    Commented Mar 7, 2018 at 11:37

2 Answers 2

0

I would set up two named pipes and connect them with

tee -a pipe.log < pipe1 > pipe2

Then have the first app write to pipe1 and the second read from pipe2.

Alternatively you could connect them with

tee pipe2  < pipe1

To have the data piped to your stdout.

0

Nevermind, I found out how to read the data using shell scripts as described here:

http://www.linuxjournal.com/content/using-named-pipes-fifos-bash

while true
do
    if read line <$pipe; then
        if [[ "$line" == 'quit' ]]; then
            break
        fi
        echo $line
    fi
done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .