#!/bin/sh root_src=$(dirname $(PWD)) echo ${root_src} image_path=${root_src}/images echo ${image_path} # find ${image_path} -name *.png -exec echo {} \; # find ${image_path} -name "*.png" -o -name "*.hhh" -exec echo {} \; # find ${image_path} -regex ‘*.png\|*.jpg‘ -exec echo {} \; pngfiles=`find ${image_path} -name *.png ` suffix2x=‘@3x.png‘ suffix3x=‘@2x.png‘ for file in $pngfiles do if [[ ${file} =~ ${suffix2x} || ${file} =~ ${suffix3x} ]] then echo "${file}不变" else echo "${file}需要添加@3x" mv ${file} "${file%.png}@3x.png" fi done
时间: 2024-10-10 12:50:23