摘要: 部分shell命令执行时可能需要获取终端用户的输入信息,导致脚本停止等待用户输入,如果输入值固定则自动进行输入则更方便找到了tcl/tk的工具expect安装 sudo apt-get install tcl8.5使用gpg进行加密解密文件时需要输入密钥,为了能够利用gpg全自动加密文件,写出如下脚本#!/usr/bin/expectspawn gpg -c -o file.enc file2encryptexpect "密码: "send "code\r"#密码确认、expect "密码: "send "code\r&qu 阅读全文
posted @ 2012-05-23 17:40 戈壁子规 阅读(873) 评论(0) 推荐(0)