Capturing stdin

Hi all,

Consider the following situation:

  • you launch an compiled binary application from inside a unix shell which presents a text-based type user interface where you can input information ...
    # echo "I am the $SHELL shell"
    # I am the /bin/bash shell
    # ./input
    # ... imagine the binary application 'input' to present here and you type input ...

Now ... it would be straight forward to wrap the calling of the 'input' binary in a shell script which only does ./input. Everything would still work.
But ... is there a way to capture all the input that is going to the 'input' binary from inside this intermediary script, without of course influencing the correct working.
So as to actually log every character i'm typing into the binary ?

Greetz

I don't understand it.

  1. You wrote that this is a binary file - so comment lines #* are not allowed
  2. You wrote some text that seems like a scripts comment because every line starts with #
    What do you have as input?
    Where you want to have the output?

Yeah well,

Maybe it's a bit too advanced for you, but for those who do understand I actually found a way that does a bit too much but I got whay I needed.

Check out man pages for 'script'.

Greetz

You got the answer as clear as the question was. That's it.