#!/bin/bash
if [ ! -n "$1" ]; then
echo "please input file type [f: file d: directory]"
exit
fi
find . -type $1 -name "*" -print |
while read name; do
na=`echo ${name// /-}`
na=`echo ${na//【/[}`
na=`echo ${na//】/]}`
na=`echo ${na//(/()}`
na=`echo ${na//)/)}`
na=`echo ${na//、/_}`
na=`echo ${na//?/?}`
if [[ "$name" != "$na" ]]; then
mv "$name" "$na"
echo "$name ===> $na"
fi
done
shell中文特殊字符替换
最新推荐文章于 2024-06-13 12:55:11 发布