Posted to tcl by funa at Sun Dec 10 16:56:46 GMT 2017view pretty

#!/bin/bash
read -s PWD
/usr/bin/expect - <<EOF
spawn ssh funabashi@localhost
expect "password"
send -- "$PWDr"
send -- "r"
expect "$ "
send "ps -ef r" >> test.txt
expect "$ "
interact
EOF