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}'`

posted @ 2019-03-29 20:24  阿C  阅读(441)  评论(0编辑  收藏  举报