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
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
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., 2022: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho