in reply to inserting into html files
This works fine for me in bash, so if you think it's a shell problem, tell us which shell you use.
Also, I think you want a different replacement, since you don't want the parens to show up in the HTML document. Here's the same thing but cleansed a bit (including an alternate delimiter to get around escaping /)
perl -pi -e 's|<head>|<head>\n<meta http-equiv="Content-Type" content= +"text/html; charset=ISO-8859-1"/>|i' test.html
|
|---|