openocd shell脚本
openocd.sh
#! /usr/bin/expect
set timeout 30
spawn su
expect "密码:"
send "123456\r"
send "./killopenocd.sh\r"
send "openocd --file ./board/ek-lm3s8962.cfg\r"
interact
killopenocd.sh
#! /bin/bash
kill -9 `ps -ef|grep 'openocd --file'|grep -v grep|awk '{print $2}'`