在vim中實現批次加密(轉)

post0發表於2007-08-14
在vim中實現批次加密(轉)[@more@]

  如何實現透過VIM批次對檔案加密?

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

  #!/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]$

  


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-956787/,如需轉載,請註明出處,否則將追究法律責任。

相關文章