Quote:
Originally posted by MartinK
There is a problem with the code provided. For example.. if you have some users on "x" theme and some on x2 then you run..
replace RS=x RS=x2 -- /var/cpanel/users/*
It will replace all the x2 themes with x22 which will stop them from working.
In addition, if you have your own theme with x in there will be a problem. if you have resellers with an x in... etc..
But don't get me wrong, it will save a lot of time just have to be usre to use with care.
|
You are correct, my apologies for overlooking that. A better way of doing this (changing all on 'x' to 'x2') via command line is to run the following command:
perl -pi -e "s/RS=
x\n/RS=
x2\n/g" /var/cpanel/users/*
An addition can be made to backup all modified files by running this which will make a backup with the same filename plus .bak in the same directory:
perl -pi.bak -e "s/RS=
x\n/RS=
x2\n/g" /var/cpanel/users/*
Code:
[ james@admin ] ~$ cat test
RS=x2
RS=x
RS=letterxhere
[ james@admin ] ~$ perl -pi -e "s/RS=x\n/RS=x2\n/g" test
[ james@admin ] ~$ cat test
RS=x2
RS=x2
RS=letterxhere
[ james@admin ] ~$