|
发表于 2007-4-16 09:05:12
|
显示全部楼层
Post by huan
- [0 No.2046 huan@huan /tmp/a]$ cat RENAME.SH
- #! /bin/bash
- for f in $( find $1 -depth -type f ); do
- cd $( dirname $f )
- rename 'y/A-Z/a-z/' $( basename $f)
- cd -
- done
- [0 No.2047 huan@huan /tmp/a]$ tree
- .
- |-- RENAME.SH
- `-- a
- |-- AA
- `-- b
- |-- BB
- `-- c
- `-- CC
- 3 directories, 4 files
- [0 No.2048 huan@huan /tmp/a]$ bash ./RENAME.SH ./
- [0 No.2049 huan@huan /tmp/a]$ tree
- .
- |-- a
- | |-- aa
- | `-- b
- | |-- bb
- | `-- c
- | `-- cc
- `-- rename.sh
- 3 directories, 4 files
- [0 No.2050 huan@huan /tmp/a]$
复制代码
excellent! |
|