• 欢迎访问MACD实战投资网站,推荐使用最新版谷歌Chrome浏览器访问本网站,关注公众号 丁火甲木庚金 www.macd11.com/subscriptions

Shell:在vim中实现批量加密的方法

未分类 丁火 14年前 (2011-05-08) 1134次浏览 0个评论

密码中还是不能带空格,不管了,能加密就好,先这么用着。

=====================================================

#!/bin/bash
# Encrypt file with vim

if (test $# -lt 2) then
echo Usage: decrypt password filename
else
vim -e -s -c ":set key=$1" -c ':wq' $2
echo "$2 encrypted."
fi

============================================================
[weeder@SMTH weeder]$ for file in *.txt ; do encrypt test $file ; done
test2.txt encrypted.
test4.txt encrypted.
test9.txt encrypted.
kick.txt encrypted.
echo “$2 encrypted.”
fi
[weeder@SMTH weeder]$ for file in *.txt ; do encrypt test $file ; done
test2.txt encrypted.
test4.txt encrypted.
test9.txt encrypted.
kick.txt encrypted.
too_old.txt encrypted.
too_old_again.txt encrypted.
bg5.txt encrypted.
[weeder@SMTH weeder]$


macd11.com 和 丁火甲木庚金 公众号版权所有丨如未注明 , 均为原创丨转载请注明原文链接。
喜欢 (0)
[sp91@qq.com]
分享 (0)

您必须 登录 才能发表评论!