首页 > 系统 > shell脚本批量替换文本文件内容

shell脚本批量替换文本文件内容

2008年8月7日 李悦 发表评论 阅读评论

将含有10.1.1.9/dv/sb的字符串,替换为www.micro.com.cn

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
for i in *
do
    if [ -f $i ]
     then
        sed s/10.1.1.9/dv/sb/www.micro.com.cn/g $i > .tttt
        mv .tttt $i
   elif [ -d $i ]
      then
        (cd $i;/home/wjl/ttt.sh)
  fi
done
分类: 系统 标签: ,
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.