zen cart -- 批量替换掉多个zen cart网站中的某个模板文件或语言文件

Linux 同时被 3 个专栏收录
43 篇文章 0 订阅
25 篇文章 0 订阅
13 篇文章 0 订阅

特定的需求是要对所有的zen cart网站中的同一个文件进行修改,删除掉掉某个字符串.因为涉及到多语言,也就可能是要替换多个文件了.比如将

includes/languages/****/modules/payment/abc.php

*** 可能是english,german,french ...

 

下面这个是经过测试,在linux下,通过一行命令可以实现的将不同语言的文件复制到对应语言的目录下.

 

 ls  -ald /home/*/ | awk -F/ '{print "ls -ald /" $2"/"$3"/public_html/includes/languages/*/"}'|bash|awk -F/ '{print "cp "$7"/ips.php /home/"$3"/public_html/includes/languages/"$7"/modules/payment/"}'

 

...

...

...

cp english/abc.php /home/abcschwc/public_html/includes/languages/english/modules/payment/
cp german/abc.php /home/abcschwc/public_html/includes/languages/german/modules/payment/
cp english/abc.php /home/abcshopo/public_html/includes/languages/english/modules/payment/
cp italian/abc.php /home/abcshopo/public_html/includes/languages/italian/modules/payment/
cp english/abc.php /home/abcsitai/public_html/includes/languages/english/modules/payment/
cp italian/abc.php /home/abcsitai/public_html/includes/languages/italian/modules/payment/
cp english/abc.php /home/abcsitou/public_html/includes/languages/english/modules/payment/
cp italian/abc.php /home/abcsitou/public_html/includes/languages/italian/modules/payment/
cp english/abc.php /home/abcsnorg/public_html/includes/languages/english/modules/payment/
cp norwegian/abc.php /home/abcsnorg/public_html/includes/languages/norwegian/modules/payment/
cp dutch/abc.php /home/abcsonli/public_html/includes/languages/dutch/modules/payment/
cp english/abc.php /home/abcsonli/public_html/includes/languages/english/modules/payment/
cp english/abc.php /home/abcsoutl/public_html/includes/languages/english/modules/payment/
cp german/abc.php /home/abcsoutl/public_html/includes/languages/german/modules/payment/
cp english/abc.php /home/abcspasc/public_html/includes/languages/english/modules/payment/
cp french/abc.php /home/abcspasc/public_html/includes/languages/french/modules/payment/
cp dutch/abc.php /home/abcsshok/public_html/includes/languages/dutch/modules/payment/
cp english/abc.php /home/abcsshok/public_html/includes/languages/english/modules/payment/
cp english/abc.php /home/abcssver/public_html/includes/languages/english/modules/payment/
cp swedish/abc.php /home/abcssver/public_html/includes/languages/swedish/modules/payment/
cp english/abc.php /home/abcsswis/public_html/includes/languages/english/modules/payment/
cp german/abc.php /home/abcsswis/public_html/includes/languages/german/modules/payment/
cp english/abc.php /home/abcstief/public_html/includes/languages/english/modules/payment/
cp german/abc.php /home/abcstief/public_html/includes/languages/german/modules/payment/
cp danish/abc.php /home/whsalole/public_html/includes/languages/danish/modules/payment/
cp english/abc.php /home/whsalole/public_html/includes/languages/english/modules/payment/
cp french/abc.php /home/whsalole/public_html/includes/languages/french/modules/payment/
cp german/abc.php /home/whsalole/public_html/includes/languages/german/modules/payment/
cp classic/abc.php /home/womenabc/public_html/includes/languages/classic/modules/payment/
cp danish/abc.php /home/womenabc/public_html/includes/languages/danish/modules/payment/
cp dutch/abc.php /home/womenabc/public_html/includes/languages/dutch/modules/payment/
cp english/abc.php /home/womenabc/public_html/includes/languages/english/modules/payment/
cp finnish/abc.php /home/womenabc/public_html/includes/languages/finnish/modules/payment/
cp french/abc.php /home/womenabc/public_html/includes/languages/french/modules/payment/
cp german/abc.php /home/womenabc/public_html/includes/languages/german/modules/payment/
cp italian/abc.php /home/womenabc/public_html/includes/languages/italian/modules/payment/
cp norwegian/abc.php /home/womenabc/public_html/includes/languages/norwegian/modules/payment/
cp schinese/abc.php /home/womenabc/public_html/includes/languages/schinese/modules/payment/
cp spanish/abc.php /home/womenabc/public_html/includes/languages/spanish/modules/payment/
cp swedish/abc.php /home/womenabc/public_html/includes/languages/swedish/modules/payment/

...

...

...

 

上面输出的是要批量执行的命令,在执行之前最好是检查,测试一下,再bash

 ls  -ald /home/*/ | awk -F/ '{print "ls -ald /" $2"/"$3"/public_html/includes/languages/*/"}'|bash|awk -F/ '{print "cp "$7"/ips.php /home/"$3"/public_html/includes/languages/"$7"/modules/payment/"}' | bash

 

 

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

打赏
文章很值,打赏犒劳作者一下
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页

打赏

xinhaozheng

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值