(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 {$}...