(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
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