-3
基本上我想要做的就是使用SED(linux版本)在HTML文件中进行更改。当我执行该代码时,我得到一个“未知命令”错误,因为sed无法明确显示空白或换行符。SED空格/换行符匹配 - Linux
sed 's|<a href="es/map-button.html">
<div class="map-button">|<div id="confirmation" onclick="confirmation()" class="map-button">
<script type="text/javascript">
<!--
function confirmation() {
var answer = confirm("Access map? (uses internet)")
if (answer){
window.location = "google.maps.com";;
}
else{
//alert("Returning to current content")
}
}
//-->
</script>|g' *.html
我的分隔符是“|”你在这里看到的。
有什么问题?你面临的问题是什么? – Fazlin
抱歉应该指定更多。基本上,当我执行该代码时,我得到一个“未知命令”错误,因为sed无法分辨明显是什么空白或换行符。 –
奇怪的是,我得到错误“未终止的'命令”,这是由于's'命令的参数不能包含字面换行符。 –