1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#!/bin/bash

DIR=$1 # 转换编码文件目录
FT=$2  # 待转换文件的扩展名
SE=$3  # 原始编码
DE=$4  # 目标编码

for file in `find $DIR -type f -name *.$FT`; do
	echo "conversion $file encoding $SE to $DE"
    iconv -f $SE -t $DE "$file" > "$file".tmp
    mv -f "$file".tmp "$file"
done

HUGOMORE42