1、在某一行后面追加一行

RD=2000
sed -i '/ssi_types/ a\limit_req zone=lreq burst='$RD';' /opt/bee.location

2、替换字符正则

sed -i "s/owa_server_domain,.*\"http:\/\/.*\"/owa_server_domain,\t\"http:\/\/$OWA_IP\"/g" /opt/erlang_pangu/package/vortex/vtx_idt/etc/app.config

3、替换字符

sed -i "s/{VIDEO_PORT}/$VIDEO_PORT/g" /opt/srv/av_convert/param.properties

Sed替换行和字符shell的更多相关文章

  1. Shell脚本运行hive语句 | hive以日期建立分区表 | linux schedule程序 | sed替换文件字符串 | shell推断hdfs文件文件夹是否存在

    #!/bin/bash source /etc/profile; ################################################## # Author: ouyang ...

  2. Python3.5 day3作业一:实现简单的shell sed替换功能

    需求: 1.使python具有shell中sed替换功能. #!/usr/bin/env python #_*_conding:utf-8_*_ #sys模块用于传递参数,os模块用于与系统交互. i ...

  3. Python3学习之路~2.8 文件操作实现简单的shell sed替换功能

    程序:实现简单的shell sed替换功能 #实现简单的shell sed替换功能,保存为file_sed.py #打开命令行输入python file_sed.py 我 Alex,回车后会把文件中的 ...

  4. 3-1 实现简单的shell sed替换功能

    1.需求 程序1: 实现简单的shell sed替换功能 file1 的内容copy到file2 输入参数./sed.py  $1  $2 $1替换成$2 (把a替换成% ) 2.个人思路 open ...

  5. 4.实现简单的shell sed替换功能

    # -*- coding:utf-8 -*- # Author: JACK ZHAO # 程序1: 实现简单的shell sed替换功能 import sys #判断参数个数 if len(sys.a ...

  6. python 3.x 写 shell sed 替换功能

    shell sed 替换功能 f1 = open('yesterday','r',encoding='utf-8') f2 = open('yesterday2','w',encoding='utf- ...

  7. sed替换 - 含反斜杠(/)和Shell变量

    sed替换 - 含反斜杠(/)和Shell变量 摘自: https://blog.csdn.net/zhenyongyuan123/article/details/6616263 2011年07月19 ...

  8. shell中通过sed替换文件中路径

    通常sed指令修改行内容时使用:sed -i " 9 s/^.*/"type in what you want modified!"/" 其中"typ ...

  9. sed替换字符串中的某些字符

    test.txt原文内容 http://jsldfjaslfjsldfjasl/test?jlsdfjsalfjslfd 使用sed替换 sed -ri 's/(http:\/\/)[^\/]*(\/ ...

随机推荐

  1. IT行业工作6年回顾

    IT行业工作6年回顾 时间一晃,已经出来工作六七年了,当真岁月如梭,时光如箭,回首往昔,当真叹一句:“太多东西都失于路上”,今天偷得浮生半日闲,做个回顾,权当是给自己做个小结,也希望给他人一些可用的借 ...

  2. El Capitan 中 SIP 介绍

    http://havee.me/mac/2015-10/system-integrity-protection-on-el-capitan.html 这两天大家纷纷将 OS X 系统升级到了 El C ...

  3. Object C学习笔记15-协议(protocol)

    在.NET中有接口的概念,接口主要用于定义规范,定义一个接口关键字使用interface.而在Object C 中@interface是用于定义一个类的,这个和.NET中有点差别.在Object C中 ...

  4. ios开发怎么获取输入的日期得到星期

    + (NSString*)weekdayStringFromDate:(NSDate*)inputDate { NSArray *weekdays = [NSArray arrayWithObject ...

  5. WPF--调用线程必须为 STA,因为许多 UI 组件都需要(转载)

    自VS2005开始,UI元素在不同线程中访问就受到限制了,当然你也可以解除这种限制 以下提供Framework3.0的解决方案发: public partial class Window1 : Win ...

  6. 关闭浏览器后Session失效原因分析

    参考文章:http://www.tuicool.com/articles/VNbYjqm 首先需要理解一下几点: 1.Http是无状态的,即对于每一次请求都是一个全新的请求,服务器不保存上一次请求的信 ...

  7. hdu1358 KMP

    求循环节. #include<stdio.h> #include<string.h> #define maxn 1000010 int next[maxn]; char s[m ...

  8. 【Matplotlib】 移动spines

    相关文档: Spines Axis container Transformations tutorial Spines 是连接轴刻度标记的线,而且标明了数据区域的边界. 他们可以被放置在任意位置.直到 ...

  9. opencv笔记3:trackbar简单使用

    time:2015年 10月 03日 星期六 13:54:17 CST # opencv笔记3:trackbar简单使用 当需要测试某变量的一系列取值取值会产生什么结果时,适合用trackbar.看起 ...

  10. UVA116Unidirectional TSP(DP+逆推)

    http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18206 题意:M*N的数阵,从左边一列到右边一列走过的数的和的最小.并输出路 ...