以下sed命令大部分时间都可以正常工作,除非我使用以下脚本进行尝试。我收到了错误
sed: -e expression #1, char 3495: unterminated address regex
它指向最后一个字符}但我无法弄清楚如何终止sed命令。通常它不是问题。赫普将不胜感激。
sed -i '/body *{/,/}/c \
body{\
z-index:1;\
margin:0;\
background-image: url("http://www.calmchess.com/images/frgrnd1366.png");\
background-repeat:repeat;\
}\
\
#header0{\
position:relative; \
width:1100px; \
height:114px; \
text-align:center; \
font-size:16px; \
color:000000; \
background-size:1100px 114px; \
background-image: url("http://www.calmchess.com/images/854x480/header854x480_114_0.png"); \
background-repeat: no-repeat; \
}\
\
#fullcontentcontainer0{ \
position:relative; \
z-index:0; \
text-align:center; \
font-size:16px; \
color:000000; \
width:1100px; \
height:135%; \
} \
\
#lrgcontentimgcontainer0{ \
position:relative; \
top:75px; \
margin:0 auto 0 auto; \
font-size:16px; \
color:000000; \
width:530px; \
height:575px; \
background-size:530px 575px; \
background-image: url("http://www.calmchess.com/images/lrgcontent0.png"); \
background-repeat: no-repeat; \
} \
\
#nav0{ \
width:1100px; \
height:60px; \
position:absolute; \
color:000000; \
z-index:6; \
font-size:16px; \
border-top:1px solid 000000; \
border-bottom:1px solid 000000; \
background-image:url("http://www.calmchess.com/images/mediumformbak0.png");\
background-repeat: no-repeat; \
} \
\
.btncon0{ \
position:relative; \
width:205px; \
height:60px; \
margin:0 auto 0 auto; \
} \
\
#footer0{ \
position:absolute; \
top:100%; \
width:100%; \
height:180px; \
font-size:16px; \
border-top:1px solid 000000; \
background-image: url("http://www.calmchess.com/images/mediumformbak0.png"); \
background-repeat: no-repeat; \
} \
\
.foliotop0{ \
position:absolute; \
width:100px; \
height:35px; \
top:5px; \
left:0px; \
font-size:16px; \
z-index:2; \
background-size:100px 35px; \
background-image: url("http://www.calmchess.com/images/port0.png"); \
background-repeat: no-repeat; \
} \
\
.foliobottom0{ \
position:absolute; \
width:100px; \
height:35px; \
top:5px; \
left:0px; \
font-size:16px; \
z-index:1; \
background-size:100px 35px; \
background-image: url("http://www.calmchess.com/images/buttonbottom0.png"); \
background-repeat: no-repeat; \
} \
\
.contacttop0{ \
position:absolute; \
width:100px; \
height:35px; \
top:5px; \
left:105px; \
font-size:16px; \
z-index:2; background-size:100px 35px; \
background-image: url("http://www.calmchess.com/images/contact0.png"); \
background-repeat: no-repeat; \
} \
\
.contactbottom0{ \
position:absolute; \
width:100px; \
height:35px; \
top:5px; \
left:105px; \
font-size:16px; \
z-index:1; \
background-size:100px 35px; \
background-image: url("http://www.calmchess.com/images/buttonbottom0.png"); \
background-repeat: no-repeat; \
} \
\
#paypal0{ \
position:absolute; \
left:460px; \
top:840px; \
font-size:21pt;\
} \
\
#paypal0 input{ \
width:300px; \
height:150px; \
} \
\
#para0{ \
font-size:21pt; \
position:absolute; \
width:500px; \
left:15px; \
top:10px; \
text-align:left; \
} \
\
#para1{ \
font-size:21pt; \
position:absolute; \
width:500px; \
left:15px; \
top:110px; \
text-align:left; \
} \
\
#para2{ \
font-size:21pt; \
position:absolute; \
width:500px; \
left:15px; \
top:350px; \
text-align:left; \
} \
\
#para3{ \
font-size:21pt; \
position:absolute; \
width:500px; \
left:15px; \
top:445px; \
text-align:left; \
} \
\
.businesscard0{ \
width:640px; \
height:480px; \
margin:0 auto 0 auto; \
font-size:16px; \
}' $file0
答案 0 :(得分:0)
如果您想要反斜杠来标记换行符,则不允许使用尾随空格。
...
<mirror>
<id>codehaus</id>
<mirrorOf>Codehaus repository</mirrorOf>
<name>Codehaus repository</name>
<url>http://central.maven.org/maven2/</url> <!-- Point to Maven central instead -->
</mirror>
...