#!/usr/bin/expect set timeout 30 spawn ssh [lindex $argv 0] expect "$ " send "cd ~/gobot/\n" expect "$ " send "git fetch\n" expect "$ " send "git checkout motor-ctrl-firmware\n" expect "$ " send "cd motor-control/firmware/scripts/remote\n" expect "$ " send "./run_openocd.sh\n" expect "Kill Me Please, this is should not be triggered!"