查找 /cygdrive/c/xampp/htdocs/news4u -type f -exec sed -i 's/document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' 类型='text/javascript'%3E%3C/script%3E"));/(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ?'https://ssl':'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();/g' {} \;
这导致错误sed: -e expression #1, char 93: unknown option to
s'`
我正在使用 Windows 并使用“cygwin”来运行 shell 脚本。
如何解决这个问题,并且应该转义单引号,因为它再次包含在单引号中?