#!/usr/bin/expect
#
spawn grub-md5-crypt
expect "Password:"
send "123123\r"
expect "Retype password:"
send "123123\r"
interact
或者
密码分两行echo
转载于:https://blog.51cto.com/jxwpx/1248821
#!/usr/bin/expect
#
spawn grub-md5-crypt
expect "Password:"
send "123123\r"
expect "Retype password:"
send "123123\r"
interact
或者
密码分两行echo
转载于:https://blog.51cto.com/jxwpx/1248821