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

特定的需求是要对所有的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

 

 

你可能感兴趣的:(linux,测试,bash,语言)