Wrapper around bash, control STDIN and STDOUT
Posted
by blinry
on Stack Overflow
See other posts from Stack Overflow
or by blinry
Published on 2010-04-28T15:02:51Z
Indexed on
2010/04/29
10:07 UTC
Read the original article
Hit count: 389
I would like to talk to a interactive bash process.
Here is an example, so you know what I want to archieve:
- Program starts a new bash process.
- User types "ls" into my program.
- Program sends this command to the bash process.
- Program reads all available output of the bash (including the prompt) and displays it back to the user.
- GOTO 1
As you can guess, there is much room for nifty manipulations here and there... ;-)
It would be wonderful if this also worked for subprocesses (started by the bash process) and curses-based programs.
I would like to implement this functionality in Ruby, and already have experimented with IO.popen, but strange things happen. You are also welcome to do this in other languages.
© Stack Overflow or respective owner