This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 请教 bash script 高手: 如何用bash script 将当前目录下的所有.html文件改名为.htm? 可不可以只用一条语句?
-forte(forte);
2006-5-1
(#2940639@0)
-
for i in *.html; do mv $i ${i%%.html}.htm ; done
-canadiantire(轮胎(do ut des));
2006-5-1
(#2940661@0)
-
thx, but it does not on my machine.
my script file - test.scr:
#!/bin/sh
for i in *.html; do mv $i ${i%%.html}.htm; done
ran the test.scr, got error msg:
mv: cannot access *.html
-forte(forte);
2006-5-1
(#2940679@0)
-
try mv one or two file manually, see what is the error is...
-canadiantire(轮胎(do ut des));
2006-5-1
(#2940706@0)
-
Yes, it works.
Thx, man.
-forte(forte);
2006-5-1
(#2940765@0)
-
you can use find as well
-f001(高望川);
2006-5-1
(#2941603@0)