shell批量更新文件名

#!/bin/bash
for i in $(cat /Users/test/2.txt)
do
	temp=(${i//,/ })
	oldfile=7001_paipai_${temp[0]}_contract.paf
	newfile=7001_paipai_${temp[1]}_contract.paf
	eval $(mv $oldfile $newfile)
done

2.txt文件中存放的是<旧文件名,新文件名>键值对

aaa,12332356
bbb,1233235
ccc,123325
原文地址:https://www.cnblogs.com/-1007813544/p/14000389.html