#!/usr/bin/expect set timeout 30 spawn ssh [lindex $argv 0] expect "# " send "cd ~/gobot/" expect "# " send "git fetch" expect "# " send "git checkout motor-ctrl-firmware" expect "# " send "cd motor-control/firmware/scripts/remote" expect "# " send "./run_openocd.sh"