Find the answer to your Linux question:
Results 1 to 4 of 4
Hi everyone, Im having a moslty 'common' issue I guess, but I cant seems to solve it. It seems to be a problem where u have to know the solution, ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    10

    Named pipe and python command line

    Hi everyone,
    Im having a moslty 'common' issue I guess, but I cant seems to solve it.
    It seems to be a problem where u have to know the solution, or you'll have to search like hell to find the solution.

    Basically, I would like to use 'scapy' in a c++ program.
    Scapy use the Python Prompt to process its stuff(just like a normal console prompt, taking command and printing stuff), so I need to be able to send command & receive the answer.
    To do this, I assume a good way would be to use Linux Named Pipe (FIFO).
    So I created my 2 pipes(one for stdout & the other one for stdin).
    1rst pipe : pipe_input
    2nd pipe : pipe_output
    To test them, i use the following:
    cat pipe_input | scapy > pipe_output

    Im only able to send 1 command to scapy & receive 1 answer, cause then both end of the pipe ends (EOF received I guess?).


    I there a way to tell the pipe to continue 'piping' until scappy exit?

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    try
    Code:
    cat pipe_input | scapy > pipe_output << "EOF"
    just a guess

  3. #3
    Just Joined!
    Join Date
    Jan 2009
    Posts
    10

    Re:

    Tks for reply,

    Tryed the code, didnt work.
    The sign ">" apperas on each line, as if the console was waiting for something...

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    well, what happens when you use my code and input "EOF" and press enter? it should exit then

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...