Capture data going through named pipe

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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







share|improve this question




















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














up vote
1
down vote

favorite












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







share|improve this question




















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












up vote
1
down vote

favorite









up vote
1
down vote

favorite











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







share|improve this question












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









share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 11:34









yhu420

63




63











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
















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















Have you thought of tee ?
– X Tian
Mar 7 at 11:37




Have you thought of tee ?
– X Tian
Mar 7 at 11:37










2 Answers
2






active

oldest

votes

















up vote
0
down vote













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.






share|improve this answer



























    up vote
    0
    down vote



    accepted










    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





    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428724%2fcapture-data-going-through-named-pipe%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      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.






      share|improve this answer
























        up vote
        0
        down vote













        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.






        share|improve this answer






















          up vote
          0
          down vote










          up vote
          0
          down vote









          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 7 at 12:05









          couling

          228210




          228210






















              up vote
              0
              down vote



              accepted










              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





              share|improve this answer
























                up vote
                0
                down vote



                accepted










                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





                share|improve this answer






















                  up vote
                  0
                  down vote



                  accepted







                  up vote
                  0
                  down vote



                  accepted






                  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





                  share|improve this answer












                  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






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 7 at 12:07









                  yhu420

                  63




                  63






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428724%2fcapture-data-going-through-named-pipe%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      Peggy Mitchell

                      Palaiologos

                      The Forum (Inglewood, California)