Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#!/bin/sh
# the next line restarts using expect \
exec expect "$0" "$@"

# ssh-xterm -
# an attempt to automate giving passowrds to "ssh -X".
# (Experimental - big mess)

# (find-man "1 tclsh" "#!")
# (find-es "ssh" "expect-ssh-xterm")
# (find-man "3tcl lrange")
# (find-man "3tcl llength")
# (find-man "3tcl if")
# (find-man "1 tclsh")
# (find-man "Tcl")
# (find-man "1 tclsh" "argv")


if {$argc<3} {
  # (find-man "1 tclsh" "argv0")
  puts "Typical usage:
    ssh-xterm aleph@localhost aleph xterm
  See: (find-angg \"bin/ssh-xterm\")
       (find-efunction 'eexterm)
       (find-efunction 'eexterm-args-ne)"
  exit
  }

set user_at_machine [lindex $argv 0]; # first argument
set password        [lindex $argv 1]; # second argument
set command         [lrange $argv 2 end]; # rest
puts "$user_at_machine $password [list $command]"

eval spawn ssh -X $user_at_machine $command
     spawn ssh -X $user_at_machine $command
proc answer {str} { sleep 0.5; send $str\n }
interact {
  -o "password: " { send_user "p4ssword: "; answer $password }
     "(yes/no)? " { send_user "(yes/n0)? "; answer yes }
}



set ignore {
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
ssh-xterm
ssh-xterm aleph@localhost aleph xterm

ssh-xterm aleph@localhost aleph \
  xterm -T channel_A -e /home/edrx/eev-current/eegchannel A /usr/bin/zsh

ssh-xterm aleph@localhost aleph \
  xterm -T channel_A -e /usr/bin/zsh


ssh-xterm aleph@localhost al5ph xterm

# (find-efunction 'eexterm-args-ne)

# (eexterm-args-ne "A" nil nil)
(ee-concat (eexterm-args-ne "A" nil nil) " ")

(concat "a" "b")

}


# Local Variables:
# coding:           raw-text-unix
# mode:             tcl
# ee-anchor-format: "«%s»"
# End: