标签:timeout bsp boa file open expect kill usr grep
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}‘`
标签:timeout bsp boa file open expect kill usr grep
原文地址:https://www.cnblogs.com/arci/p/10623729.html