go-common/app/common/openplatform/tool/replacer.sh

11 lines
292 B
Bash
Raw Normal View History

2019-04-22 10:49:16 +00:00
#!/usr/bin/env bash
#替换当前目录下文件中Id,Url这种不合规的字符
replacements="Id Url Sku Uid"
for i in $replacements; do
r=`echo $i|tr 'a-z' 'A-Z'`
find . -name "*.go"|xargs sed -ibak -E 's/'$i'(s?)([[:>:]]|[A-Z_])/'$r'\1\2/g'
done
find . -name "*.gobak"|xargs rm