Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2293155
  • 博文数量: 276
  • 博客积分: 5998
  • 博客等级: 大校
  • 技术积分: 5175
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-24 14:43
文章分类

全部博文(276)

文章存档

2014年(25)

2013年(11)

2012年(69)

2011年(167)

2010年(4)

分类: Python/Ruby

2011-07-28 20:20:18

#!/bin/bash
#将utf-8编码转换为gbk编码
#declare variables int
declare -i i
declare -i count

#statistic files to convert
count=`ls -l|wc -l|awk '{print $1}'`
#begin to convert
for ((i=2;num<=count;i++))
do
  file=`ls -l|awk '{print $8}'|sed -n "$num"p`
  iconv -f utf-8 -t gbk $file >/tmp/zancun
  mv  /tmp/zancun $file
done
阅读(2887) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~