linux批量更新多个ecshop补丁文件
更新时间:2019-01-24 点击量:1741
Tag关键词: 批量 ecshop模板 ecshop4.0模板 二次开发 ecshop3.6模板 ecshop小程序
(1) 查找所有 lib_insert.php 文件,导出路径到txt文件。
find -type f -name 'lib_insert.php'|xargs grep "static \$static_res = NULL;"
其实也可以不需要根据特殊字符查找文件。
(2)使用批量语句替换
如下图:
sed -i "s/static \$static_res = NULL;/static \$static_res = NULL;\n\$arr['num'] = intval(\$arr['num']);\n\$arr['id'] = intval(\$arr['id']);/g" /www/uuecs.com/ecshop/ecshop-kjt/includes/lib_insert.php sed -i "s/static \$static_res = NULL;/static \$static_res = NULL;\n\$arr['num'] = intval(\$arr['num']);\n\$arr['id'] = intval(\$arr['id']);/g" /www/uuecs.com/ecshop/ecshop-yougou/includes/lib_insert.php sed -i "s/static \$static_res = NULL;/static \$static_res = NULL;\n\$arr['num'] = intval(\$arr['num']);\n\$arr['id'] = intval(\$arr['id']);/g" /www/uuecs.com/ecshop/ecshop-91lai/includes/lib_insert.php sed -i "s/static \$static_res = NULL;/static \$static_res = NULL;\n\$arr['num'] = intval(\$arr['num']);\n\$arr['id'] = intval(\$arr['id']);/g" /www/uuecs.com/ecshop/ecshop-kaola/includes/lib_insert.php sed -i "s/static \$static_res = NULL;/static \$static_res = NULL;\n\$arr['num'] = intval(\$arr['num']);\n\$arr['id'] = intval(\$arr['id']);/g" /www/uuecs.com/ecshop/includes/lib_insert.php sed -i "s/static \$static_res = NULL;/static \$static_res = NULL;\n\$arr['num'] = intval(\$arr['num']);\n\$arr['id'] = intval(\$arr['id']);/g" /www/uuecs.com/ecshop/ecshop-huawei/includes/lib_insert.php
(3) 更新完毕。如下图。
如果文章对您有帮助,就打赏一个吧
«上一篇:ECSHOP4.0 H5端(vue框架)源码运行环境安装部署 下一篇:如何修改ecshop最新版4.0 的后台路径admin»