i have a bash script like this:
#!/bin/bash
# ALL HTML FILES
FILES="*.html"
# for loop read each file
for f in $FILES
do
INF="$f"
OUTF="$f.out.tmp"
# replace javascript
sed '/<!--fff309/,/<!--\/fff309-->/d' $INF > $OUTF
/bin/cp $OUTF $INF
/bin/rm -f $OUTF
done
the html is look like this:
<html>
<body>
<div>some normal html code</div><!--fff309-->some javascript code goes here... <!--/fff309-->
<div>
some other html....
</div>
</body>
</html>
the bash script work, however it remove all the html part below the <!--/fff309-->
so it become:
<html>
<body>
<div>some normal html code</div>
is there anyway to do so that it only remove the part:
<!--fff309--> ... <!--/fff309-->
Thanks
sedscript works fine on my system (with GNU sed version 4.2.1). What doessed --versionreport on your system?-versionor--version-eaftersed?