Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssh via expect

Status
Not open for further replies.

rovf

Programmer
Sep 6, 2010
9
DE
(Crossposting note: I have already posted this article on comp.lang.tcl on the 3 days ago. This is posted here again, because I didn't get any response on my original article so far).

I use the following script on Solaris to log into a remote host:


spawn ssh other@[exec uname -n]
expect {$}
send ". xxx/s\r"
interact


This script works well. However, I don't quite understand the output
printed by this script on stdout:


spawn ssh other@rom38
xxx/s
xxx/s
Last login: Tue May 31 10:01:35 2011 from rom38.muc.infin
bash-2.03$ . xxx/s
[other] rom38@~>


The last line is the prompt after logging in. However, why do I see
the line

. xxx/s

three times? I would have expected it only once (the last occurance),
but why do I see it already before twice? My guess is that this is
some timing issue (that I send the command just a bit too early),
but even then, I should see only one extra occurance.

Ronald


 
It must seem like you're being ignored but at least for my part, that's not the case. I just don't know how to answer your question.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top