#!/bin/bash
#the script is made by Jim
THIS_HELP() {
echo "EX:"
echo "${0} START_INDEX END_INDEX NEW_NAME"
}
echo " input $# $1 $2 $3"
if [ $# -ne 3 ]
then
THIS_HELP
exit 1
fi
PREFIX=ALIM0
SUFFIX=.JPG
//OK , here we go
for((i=${1};i<=${2};i++))
do
LENGTH=${#i}
if [ ${LENGTH} -eq 2 ]
then
ZERO=0
#II=${ZERO}${i}
else
ZERO=
fi
II=${ZERO}${i}
ORG_NAME=${PREFIX}${II}${SUFFIX}
echo "orgname is ${ORG_NAME}"
NEW_NAME=${3}${II}${SUFFIX}
echo "new name is ${NEW_NAME}"
mv ${ORG_NAME} ${NEW_NAME}
done
###############################
ALIM0636.JPG ===> NEW_NAME636.JPG
阅读(652) | 评论(0) | 转发(0) |