代码拉取完成,页面将自动刷新
#!/bin/bash
function replacesplash(){
str=$1
newstr=""
for((i=0;i<`expr length $str`;i++));
do
ch=${str:i:1}
if [ $ch == '/' ];then
newstr+='\'
newstr+=$ch
else
newstr+=$ch
fi
done
echo $newstr
}
if [ $# != 2 ] ; then
echo -e "\e[1;31m 参数错误 \e[0m"
echo "USAGE: $0 原来的路径 新的路径"
echo "------------eg.$0 MediaStoreHouse MediaStoreHouse2"
exit 1;
fi
echo "参数确认"
old_path=$(replacesplash $1)
new_path=$(replacesplash $2)
echo "----------原来路径:$1--------->$old_path"
echo "----------新的路径:$2--------->$new_path"
echo -e "\e[1;31m 1@2 找出media_cdoe的jison文件 \e[0m"
echo -e "\e[1;31m ----------------find . -name ""*.json"" -exec ls -l ""{}"" \; \e[0m"
find . -name "*.json" -exec ls -l "{}" \;
echo -e "\e[1;31m 2@2 执行路径替换 $1---->$2 \e[0m"
echo -e "\e[1;31m ----------------find . -name ""*.json"" -exec sed -i ""s/$1/$2/g"" {} \; \e[0m"
find . -name "*.json" -exec sed -i "s/$old_path/$new_path/g" {} \;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。