第一种方法:
[[email protected] localhost shell]# vim s8.sh #!/bin/bash for i in `ls *.$1` do mv $i ${i%.*}.$2 done
第二种方法:
[[email protected] localhost shell]# vim s81.sh #!/bin/bash for i in `ls *.$1` do echo $1 name=`echo $i |awk -F ‘.‘ ‘{print $1}‘` mv $i $name.$2 done
原文地址:https://www.cnblogs.com/Zrecret/p/12161972.html
时间: 2024-11-05 14:54:20