使用 rename 命令 ======================== NAME rename - Rename files SYNOPSIS rename from to file... ======
#! /bin/sh
INIFILE="./dirlist.ini"
CURPATH=$(pwd)
for SERVERPATH in $(cut -d: -f1 $INIFILE)
do
cd $SERVERPATH
cd ani
/usr/bin/rename .ANI .ani *
/usr/bin/rename .A?? .ani *
/usr/bin/rename .?N? .ani *
/usr/bin/rename .??I .ani *
cd ..
cd map
MAPPATH=$(pwd)
for maplist in $(ls -1)
do
cd ${MAPPATH}/${maplist}
/usr/bin/rename .yom .YOM *
/usr/bin/rename .y?? .YOM *
/usr/bin/rename .?o? .YOM *
/usr/bin/rename .??m .YOM *
done
cd $CURPATH
done
--结束END--
本文标题: linux中批量修改文件名的脚本代码
本文链接: https://lsjlt.com/news/18188.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0