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 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
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 www.opentalk.org.uk 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., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho