全部博文(470)
分类:
2009-04-18 16:08:29
各位,接触shell不久.目前需要把下面文件名称中的copyfile去除.保留数字.php的格式,
我使用shell如下: #!/bin/bash a=`ls *.php | awk -F"e" '{print $2}'` for i in *.php do mv $i $a done 但是提示: mv: 目标 “9.php” 不是目录 .............................. mv: 目标 “9.php” 不是目录~ ~ copyfile10.php copyfile11.php copyfile12.php copyfile13.php copyfile14.php copyfile15.php copyfile16.php copyfile17.php copyfile18.php copyfile19.php copyfile1.php copyfile20.php copyfile21.php copyfile22.php copyfile23.php copyfile24.php copyfile25.php copyfile26.php copyfile27.php copyfile28.php copyfile29.php copyfile2.php copyfile30.php copyfile31.php copyfile32.php copyfile33.php copyfile34.php copyfile35.php copyfile36.php copyfile37.php copyfile38.php copyfile39.php copyfile3.php copyfile40.php copyfile41.php copyfile4.php copyfile5.php copyfile6.php copyfile7.php copyfile8.php copyfile9.php 尝试了find | xargs 还是不能成功的修改文件名称 谢谢各位出手帮助,谢谢 |
您对本贴的看法: |
|
|
|
风云使者
CU编号: 273510 注册:2005-5-28 最后登录: 2009-04-18 帖子: 精华:0 状态:...在线... [] [] [博客] |
|
大天使
CU编号: 762165 注册:2008-9-14 最后登录: 2009-04-17 帖子: 精华:0 状态:...离线... [] [] [博客] |
|
(狼烟)
精灵
CU编号: 547805 注册:2007-4-5 最后登录: 2009-04-17 帖子: 精华:0 状态:...离线... [] [] [博客] |
|
天使
CU编号: 347943 注册:2005-12-11 最后登录: 2009-04-18 帖子: 精华:0 状态:...离线... [] [] [博客] |
|
骑士
CU编号: 563437 注册:2007-5-14 最后登录: 2009-04-18 帖子: 精华:0 状态:...离线... [] [] [博客] |
|