%号开头的文件重命名-alpine

apk add perl perl-uri

 

#rename-url-to-chs.sh
#
for file in %*; do
    if [[ -f "$file" ]]; then
        # 使用 Perl 解码文件名
        newname=$(perl -MURI::Escape -e "print uri_unescape('$file');")
        mv "$file" "$newname"
        echo "Renamed: $file -> $newname"
    fi
done

 

Leave a Reply

Your email address will not be published. Required fields are marked *