批量转码

2013/12/0515:36:21批量转码已关闭评论浏览:49
SPATH="/root/chin"
#/bin/bash
#Auth: Mo
#Desc:
#
DIR=/var/www/html
DPATH="/newweb"
find {DIR}   -type d  -exec mkdir -pv{DPATH}/{}  \;
find {DIR}  -type f -exec  iconv -f GBK -t UTF-8  {} -o  {DPATH}/{}  \;
echo "The file Next Listed is not a common file or directory ,please check."
find  ${DIR}  ! -type f  -a  ! -type d -exec  ls -l {} \;
find  $DPATH -type f -exec sed  -i  -e  's/gb2312/UTF-8/g'  -e 's/GB2312/UTF-8/g' -e 's/GBK/UTF-8/g' -e 's/gbk/UTF-8/g' {} \;
echo ' '
echo "All Done."
  • 微信扫码赞助
  • weinxin
  • 支付宝赞助
  • weinxin