Link to home
Start Free TrialLog in
Avatar of Triskelion
TriskelionFlag for United States of America

asked on

(Expect OR Tcl/Tk) AND ( C or C++)

Does anyone have an example of working code using the 'Expect' library (under Unix) that actually does something?

I know about:   http://src.openresources.com/debian/src/interpreters/HTML/R/Expect_Init.html

I also know about the MAN pages the show how to initialize the process.  I'm looking for something that performs a 'wait'-type function in Expect (waiting to respond to a system prompt such as a login process or remote command prompt).

I will also entertain suggestions to use something OTHER than Expect to do the same job.

A copy and paste solution will work if you already have code.

I will not accept answers in Perl (I'm attempting to avoid it).   Answers must be in C or C++.

Please post all as comments and I will choose an answer from comments.
Avatar of Triskelion
Triskelion
Flag of United States of America image

ASKER

Points increased.
Any comments?
Points increased.
Any comments?
Yawn!
Avatar of Axter
What exactly does Expect do?

If you explain what it does, and what you want exactly, maybe we can offer an alternate solution.
Expect emulates user actions at a command prompt.
If you're making a script that will log in to another system, perform some actions that require, use Expect.
It will wait for the prompts you tell it to and you can set timeout values.

It's mainly Unix based and can be run from shell.
It also has a Perl module and a C/C++ library.

I like its functionality stand-alone and under Perl.  I just want to use it in a familiar language.

http://src.openresources.com/debian/src/interpreters/HTML/S/expect_5.25.0.orig%20expect-5.25%20exp_main_exp.c.html#28

http://www.scriptics.com/man/expect5.31/libexpect.3.html
Gettin closer...
http://expect.nist.gov/
ASKER CERTIFIED SOLUTION
Avatar of modder
modder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial