![]() |
How can I send keystrokes to a terminal program?
Exactly, I'd like to make an ftp connection using the ftp program which can by launch by typing ftp into the terminal. I can write a code in C++ which will connect to the ftp server, but afterwards I should send me keystrokes to the ftp program, not to the terminal itself, if I write system("peter") for example (that's my username) the terminal will write: no such command, after ftp quitted. So I guess I can't use the system function to solve this problem.
Are there any solution to this? |
expect does exactly that: it spawns a process, and connect stdin and stdout to your terminal.
http://www.tcl.tk/man/expect5.31/ jlinkels |
thank you
|
| All times are GMT -5. The time now is 12:23 AM. |