(OK) digui-gb18030-utf8.sh——递归
2016-04-17 22:11
246 查看
digui-gb18030-utf8.sh
#!/bin/sh eachd() { for chkfile in $1/* do if [[ -f "$chkfile" ]] then result=`file $chkfile |awk '{print $2}'` if [ "$result" == "PHP" ] then #do iconv -f GB18030 -t UTF-8 "$chkfile" > tmp 2>/dev/null if [ $? -eq 0 ];then mv tmp "$chkfile" else echo "$chkfile没有被转换" rm tmp fi #done fi fi if [[ -d $chkfile ]] then eachd $chkfile fi done } #eachd "." if test -d $1 then eachd $1 elif test -f $1 then echo "you input a file but not a directory,pls reinput and try again" exit 1 else echo "the Directory isn't exist which you input,pls input a new one!!" exit 1 fi
相关文章推荐
- Zookeeper安装配置及可视化ZKUI安装配置(zookeeper3.4.6)
- [Java拾遗四]JavaWeb基础之Servlet_Request&&Response
- 使用uiautomator做UI测试
- (OK) digui-dir-del-M.sh——递归
- (OK) digui-dir-indent.sh——递归
- web day10 request,response,编码,路径
- 关于UIView中相关坐标及改变的相关方法
- 关于UIView中相关坐标及改变的相关方法
- IOS上点击屏幕和return退出隐藏键盘和解决虚拟键盘挡住UITextField的方法
- warning : incompatible implicit declaration of built-in function 'exit' [enabled by default]
- HDU 5667 Sequence(矩阵快速幂+费马小定理)
- iOS开发 粗解UIDynamicAnimator
- 南京理工大学第八届程序设计大赛 sequence Dilworth定理
- Ipad UI 设计规范
- 在iOS8系统下,UITabbar上的item自定义背景色和图片问题
- LeetCode *** 63. Unique Paths II
- HDUOJ 5667 Sequence
- php中require,include,use区分
- POJ 1458 Common Subsequence(最长公共子序列LCS)
- HDU1503:Advanced Fruits(LCS)