#!/usr/bin/expect set timeout 5 set mysql_password [lindex $argv 0] spawn /var/www/seafile/seafile-server-4.3.1/upgrade/upgrade_4.0_4.1.sh expect "to contiune" send "\r"; expect "What is the root password for mysql?" send "$mysql_password\r"; interact