#!/bin/sh
# file name : rename_suffix.sh
echo "input what suffix will be replaced :"
read SUFFIX_SRC
echo "input what suffix of file to rename to:"
read SUFFIX_DST
for i in *.$SUFFIX_SRC
do
if [ -e $i ]; then
echo "mv $i to `basename $i .$SUFFIX_SRC`.$SUFFIX_DST"
mv $i `basename $i .$SUFFIX_SRC`.$SUFFIX_DST
else
echo "file does not exist."
exit -1
fi
done
批量修改后缀名的bash 脚本
最新推荐文章于 2025-01-13 07:54:30 发布