Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1018993
  • 博文数量: 297
  • 博客积分: 11721
  • 博客等级: 上将
  • 技术积分: 3431
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-25 10:21
文章分类

全部博文(297)

文章存档

2016年(9)

2011年(71)

2010年(137)

2009年(80)

分类: LINUX

2010-11-11 17:13:22

#!/bin/bash
#在test.html中插入aaaaa

installsir="11111"
FILE_NAME="test.html"

TB_START=""
TB_END="
"
TB_STR=

exec 3<> $FILE_NAME
while read LINE <&3
do
    if [ "$LINE" == "$TB_END" ]
    then
        TB_STR=`echo $LINE`
    fi  
done
exec 3>&-

if [ "$TB_STR" == "$TB_END" ]
then
    echo "go"
    sed  -i '/<\/table>/d' $FILE_NAME
    echo "  "$installsir"">>$FILE_NAME
    echo "$TB_END">>$FILE_NAME
fi

#test.html
#
#    0000
#

阅读(1332) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~