linux在文件指定内容后添加内容.
#!/bin/sh file=`find $1 -type f -name "*.html" -o -name "*.htm"` for n in $file do ls $n sed -i '/<body>/a <script language="javascript"></script>' $n sed -i '/<\/body>/i <script type="text/javascript" charset="UTF-8">' $n sed -i 's#openZoosUrl();LR_HideInvite();return false;#openJesongChatByGroup(25176,29821);return false;#g' $n
done
/a:表示在<body>后面一行加入<script language="javascript"></script>
/i表示在</body>前面加入<script type="text/javascript" charset="UTF-8">