#!/bin/expect -f spawn "ssh -l my_user remote_host uname -a\r" expect -re "[Pp]assword: " send "my_passwd\r"