I have searched and not found a solution so sorry if this has been answered before, I’m not great at shell.
I’m trying to do a recursive search and replace in all files via SSH.
So far I’ve got this:
find . -type f | xargs -d "\n" perl -pi -e 's/$this->helper('catalog/product')->getPriceHtml/$this->getPriceHtml/g'
I’m trying to replace this:
$this->helper('catalog/product')->getPriceHtml
with this:
$this->getPriceHtml
But I think its not working because of the slashes and single quotes. I have tried escaping these with \ but to no avail, any ideas?
An alternate delimiter for the
soperator could be used to avoid picket fences.$thiswill be considered to be a variable unless the$is escaped. The parentheses have to be escaped as well. Else they form a capture group. Since it is a one-liner and quotes have been exhausted, single-quotes have been encoded using hexadecimal escapes. The following should work:Or: