用shell脚本批量修改当前目录下的文件名

2009-05-13 01:27:35来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

批量修改当前目录下的文件名
#!/bin/sh
for fname in *;do
tmp=`echo $fname|tr [a-z] [A-Z]`                   #note ,tr can't act like this: tr fname [a-z] [A-Z]'因为它只从标准输入读取数据
                   # it must run as this'tr
#the above code cost me lots of time!^-^


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/289/showart_45630.html

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:删除文件中多于两个以上的换行

下一篇:在特定的时间做特定的事