该脚本需要与要修改的文件放在统一个目录下执行:
1 #!/bin/bash
23 # Change the file's name like “sdm_cristel_*" to "DB_recovery_plan_*"
4
5 for file in sdm_cristel_*
6 do
7 tails=`ls $file | awk -F "sdm_cristel_" '{print $2}'`
8 mv "${file}" "DB_recovery_plan_${tails}"
9 done