this is the content of my sh file:
for file in *.html
do
aa=`grep -o "<div id\=\"vdl.*" $file `
bb=`grep -o "<a href\=\"inde.*<\/a>" $file `
sed -i "s/$aa/$bb/g" $file
done
execute: bash-x. / 1.sh
the result is as follows
+ for file in *.html
PP grep -o "<div id\=\"vdl.*" 10621997.html
+ aa="<div id="vdl"><script>show_vdl();</script> </div><div id="vfmt"><script>show_vfmt();</script> </div><div id="vf1"><script>show_vf1();</script></div><div id="vf2"><script>show_vf2();</script></div><div id="footlink"><a href="10621996.html"></a> <a href="/ "
PP grep -o "<a href\=\"inde.*<\/a>" 10621997.html
+ bb="<a href="index.html"></a></div><div id="linkright"><a href="10621996.html"></a> | | <a href="10621998.html"></a>"
+ sed -i "s <div id="vdl"><script>show_vdl();</script> </div><div id="vfmt"><script>show_vfmt();</script> </div><div id="vf1"><script>show_vf1();</script></div><div id="vf2"><script>show_vf2();</script></div><div id="footlink"><a href="10621996.html"></a> <a href="/ <a href="index.html"></a></div><div id="linkright"><a href="10621996.html"></a> | | <a href="10621998.html"></a> 10621997.html"
sed:-e -sharp1 46:"s"
+ for file in *.html
PP grep -o "<div id\=\"vdl.*" 10621998.html
+ aa="<div id="vdl"><script>show_vdl();</script> </div><div id="vfmt"><script>show_vfmt();</script> </div><div id="vf1"><script>show_vf1();</script></div><div id="vf2"><script>show_vf2();</script></div><div id="footlink"><a href="10621997.html"></a> <a href="/ "
PP grep -o "<a href\=\"inde.*<\/a>" 10621998.html
+ bb="<a href="index.html"></a></div><div id="linkright"><a href="10621997.html"></a> | | <a href="10621999.html"></a>"
+ sed -i "s <div id="vdl"><script>show_vdl();</script> </div><div id="vfmt"><script>show_vfmt();</script> </div><div id="vf1"><script>show_vf1();</script></div><div id="vf2"><script>show_vf2();</script></div><div id="footlink"><a href="10621997.html"></a> <a href="/ <a href="index.html"></a></div><div id="linkright"><a href="10621997.html"></a> | | <a href="10621999.html"></a> 10621998.html"
sed:-e -sharp1 46:"s"
ask for advice on how to change it, thank you.