(OK) digui-dir-del-M.sh——递归
2016-04-17 21:46
567 查看
digui-dir-del-M.sh
#!/bin/sh eachd() { for chkfile in $1/* do if [[ -f "$chkfile" ]] then result=`file $chkfile |awk '{print $2}'` if [ "$result" == "ASCII" ] then sed 's/\r//g' $chkfile >temp.c mv temp.c $chkfile #echo $chkfile #>> result.txt 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
相关文章推荐
- (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)
- VMware共享文件夹编译出现“Value too large for defined data type”错误的解决办法
- build-essential: 依赖: g++ (>= 4:4.3.1) 但是它将不会被安装
- UIDynamic 基础
- leetcode——63—— Unique Paths II