Chinaunix首页 | 论坛 | 博客
  • 博客访问: 837816
  • 博文数量: 182
  • 博客积分: 1992
  • 博客等级: 上尉
  • 技术积分: 1766
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-18 11:49
文章分类

全部博文(182)

文章存档

2019年(1)

2016年(5)

2015年(29)

2014年(38)

2013年(21)

2012年(36)

2011年(52)

我的朋友

分类: 其他平台

2014-08-11 14:43:53


点击(此处)折叠或打开

  1. #!/usr/bin/expect
  2. set _pwd [lindex $argv 1]
  3. set _gpg_file [lindex $argv 0]
  4. set _text_file "gpg.txt";

  5. spawn gpg -o "$_text_file" "$_gpg_file"
  6. expect {
  7. "Enter passphrase:" {
  8. #send_user "enter pwd\n"
  9. send "$_pwd\n"
  10. }
  11. }
  12. spawn cat "$_text_file"
  13. send_user "============================================================================\n"
  14. interact
  15. send_user "============================================================================\n"
  16. spawn rm "$_text_file"
  17. interact

阅读(1014) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~