#!/bin/sh
#
convertCodeFilePath=$1
fromCode=$2
toCode=$3
for i in {1..1}
do
[ -f $convertCodeFilePath ]
if [ $? -eq 0 ]
then
iconv -f $fromCode -t $toCode -c -o $convertCodeFilePath $convertCodeFilePath
if [ $? -ne 0 ]
then
echo $convertCodeFilePath "=>" convert code failed.
else
echo $convertCodeFilePath "=>" convert code success.
fi
break;
fi
[ -d $convertCodeFilePath ]
if [ $? -ne 0 ]
then
break;
fi
dir=`ls $convertCodeFilePath | sort -d`
for fileName in $dir
do
fileFullPatch=$convertCodeFilePath/$fileName
fileType=`echo $fileName |awk -F. '{print $2}'`
[ -d $fileName ]
if [ $? -eq 0 ]
then
continue
fi
if [ $fileType != 'sh' ] && [ $fileType != 'py' ] && [ $fileType != 'xml' ] && [ $fileType != 'properties' ] \
&& [ $fileType != 'q' ] && [ $fileType != 'hql' ] && [ $fileType != 'txt' ]
then
continue
fi
iconv -f $fromCode -t $toCode -c -o $fileFullPatch $fileFullPatch
if [ $? -ne 0 ]
then
echo $fileName "=>" convert code failed.
continue
else
echo $fileName "=>" convert code success.
fi
done
done
sh convertCode.sh /home/sam/data gbk utf-8
cd ~/workspace/XXXProject ~/iconv_shell.sh ./ *java
#!/bin/bash if [ "$#" != "2" ]; then echo "Usage: `basename $0` dir filter" exit fi dir=$1 filter=$2 echo $1 for file in `find $dir -name "$2"`; do echo "$file" iconv -f gbk -t utf8 -o $file $file done
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有