Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python, Lua, Tcl, C and C++ training - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, Ruby, MySQL and Linux / Tomcat systems
expect already running process

Posted by loayabdullah (loayabdullah), 30 June 2004
I am using expect, tcl under nt, i need to use expect with an already running process, i mean the process is already running all the time, how can I interact with it using expect? I dont want to spawn it, i guess i need to know its pid and use this pid in my tcl program, any help?

Posted by admin (Graham Ellis), 30 June 2004
I don't think you can break into the STDIN and STDOUT of an already existing process unfortunately, but if you can talk to it through a socket (i.e. if it's a server), you could spawn a telnet to talk to it.

Posted by loayabdullah (loayabdullah), 1 July 2004
I C,   will i have to find another way then,  what i am trying to do is to write a script which can passes command to gabriel flights system and take the output and send it back via sms gateway, the gabriel is always running and in the customer current version there is no interfaces facilitates this....

Posted by admin (Graham Ellis), 1 July 2004
It sounds like the 'problem' is with Gabriel, perhaps. What you need to ask yourself is "how do I instigate a new client request and get the answer out manually" - and if you can provide an answer to that question then you can do it with Expect.  You might also be able to use Expect to minic a client program if there isn't a manual way. If there's nothing that answers either question, then - yes - you have a problem.  

Posted by loayabdullah (loayabdullah), 6 July 2004
let me put it in more details, the expect spawns a program called liasion which starts the gabriel, there is no way to start the gabriel alone, how can i switch the control of the expect from the liaison to the gabriel, so i can interact with it directly.... I could manage to interact with the liaison but I need to switch the control to the gabriel, Do you have any idea of how can i do that?

Posted by admin (Graham Ellis), 6 July 2004
Ah ... If liaison initiates Garbriel, then that's the tool that you've been provide with to talk to it.   You have two options ... either talk to it through liaison, or find out how liaison talks to it, then mimic that in your Tcl or Expect script.   If you're very lucky, you may find technical manuals that describe the interface; if you're very unlucky it will be propritory, unpublished and deliberately obfurscated.

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2017: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho