目录

运维实例-更改扩展名脚本

3
#!/bin/bash
## 更改运行目录下的全部.txt文件为.doc文件

for i in $(ls *.txt)
do
        n=${i%.*}
        mv $i  ${n}.doc
done