#!/bin/sh #\ exec expect -- "$0" ${1+"$@"} eval spawn ssh $argv set timeout 1 expect { eof { } "(yes/no)? " { send "yes\n" exp_continue } assword: { send "rootpass\n" } timeout { interact -nobuffer } } expect { eof { } assword: { send "rootpass\n" } timeout { interact -nobuffer } }