#!/bin/bash
#
/usr/bin/expect <<EOF
spawn sudo /usr/sbin/firmwarepasswd -delete
expect {
"password:" { send "aaaaa\r" }
}
expect eof
EOF
#切记上一行 EOF 后面不能有空格
(/usr/bin/osascript -e 'display dialog "已删除固件锁密码aaaaa,重启后生效!" buttons {"OK"} default button "OK"')