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))
telnet and ssh login simaltaniously in expect

Posted by pgpatel (pgpatel), 16 August 2005
hi .....
i have one question.....
i want to remote login using telnet ans ssh in two different server....and want to do some things....
first i want to do tenet with one server.....then after i want to login with ssh to another server.....again i want to see some result in first server....again in second server...so how can i maintain two login simaltaneously.....
i can spawn two different processes and and using spawn_id i can do this...but i donot have much idea....can u suggest me please.....? please give me some example code....
thanks....


Posted by admin (Graham Ellis), 16 August 2005
There are examples under our "Expect Processes" resource at http://www.wellho.net/resources/T212.html

Posted by pgpatel (pgpatel), 19 August 2005
Thanks for reply....
I saw the example...i didnot get what exactly i want(may be i didnot understand)
I want to do first telnet login then ssh login...i want to continue some execution on ssh login in background and at the same time i again want to send some command to first telnet login....how can i do this ?
Thanking you

Posted by admin (Graham Ellis), 20 August 2005
The thing about teaching examples is that they never do exactly what you want - you need to learn from them and adapt them.

You want to:
a) spawn a process and save its spawn_id
b) spawn the second process and save its spawn_id

Then when you want to send or expect from the first process, you can restore its spawn_id, and when you want to send or expect from the second process you can restore its spawn_id.

as an ALTERNATIVE to this last step, you can use the -i option on expect to tell in which processes (in a list if you wish) to expect from.

Hope that clarifies it ... the examples show some of these things, and your course notes (if you or a colleague have been on one of our courses) will give you a lot better / fuller description.





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