Last active
September 7, 2017 01:35
-
-
Save liuxd/f66e98ba3b08c335c3ac4bf7ee0309a3 to your computer and use it in GitHub Desktop.
[convert.sh] 将一个目录下所有文本文档转换为utf8编码。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=$1 | |
find $DIR | while read f;do | |
if [ -d $f ];then | |
continue | |
fi | |
cat "$f" > "$f.txt" | |
iconv -f GB18030 -t UTF-8 "$f.txt" > "$f" | |
rm -f "$f.txt" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment