<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Chan Chen Coding...

    Use Sed in Multi-Files Text Processing

    During the software development, developers always need to modify multi code files since some bugs or requirement change. All of this modification may be similar, such as and insert the following code into JavaScript(<script> /*JavaScript Section*/</scripte>) section in JSP page, let us say we have A.jsp, B.jsp, and C.jsp. 
    function insertMe(){
        alert(“Hello”);
    }
    To complete this task, normally, we can open all three jsp file one by one, and copy + paste the function insertMe() into code. But if we have more files, it is boring and annoy to open echo file and insert the code.
    There is other smarter way to achieve this task, sed utility in Linux. In Linux, the sed provides the developer an convinces way. Just one command:
    sed –i ‘/<script>/ a\function insertMe(){\talert(“Hello”);\n}\n ‘ [ABC].jsp
    This script means: append function insertMe(){…} after <script> in A.jsp, B.jsp and C.jsp.
    Sed also provide other powerful feature, for more, please dive into ‘man sed’. Below is an example of replace.
    sed –e ‘s/Hello/Hello World‘ [ABC].jsp
    This script means replace all Hello with Hello World in A.jsp, B.jsp, and C.jsp.
    Because sed is a line oriented program.



    -----------------------------------------------------
    Silence, the way to avoid many problems;
    Smile, the way to solve many problems;

    posted on 2012-02-18 15:49 Chan Chen 閱讀(237) 評論(0)  編輯  收藏 所屬分類: Linux

    主站蜘蛛池模板: 青娱乐在线视频免费观看| 亚洲一级毛片免费观看| 亚洲第一视频在线观看免费| 国产免费看插插插视频| 91制片厂制作传媒免费版樱花| 成年轻人网站色免费看| 亚洲videosbestsex日本| 中字幕视频在线永久在线观看免费| 亚洲美女视频一区二区三区| 啦啦啦完整版免费视频在线观看| 免费在线观看一级毛片| 亚洲成aⅴ人片在线观| 免费人成在线观看播放a| 亚洲免费在线视频播放| 国产又黄又爽又猛免费app| 在线观看免费a∨网站| 在线a亚洲老鸭窝天堂av高清| 日本一区二区三区免费高清| 亚洲乱码在线卡一卡二卡新区| 免费看美女午夜大片| 亚洲精品国产日韩无码AV永久免费网| 黄色免费网址在线观看| 亚洲色欲久久久综合网| 亚洲av纯肉无码精品动漫| 无码中文字幕av免费放dvd| 亚洲午夜日韩高清一区| 亚洲AV男人的天堂在线观看| 免费大学生国产在线观看p| j8又粗又长又硬又爽免费视频| 亚洲av午夜福利精品一区| 在线永久看片免费的视频| 亚洲综合精品香蕉久久网97| 无限动漫网在线观看免费| 成年免费大片黄在线观看com| 精品无码国产污污污免费| 九九视频高清视频免费观看 | 四虎影视永久免费观看| 99在线免费视频| 亚洲视频一区二区三区四区| 亚欧人成精品免费观看| 免费播放美女一级毛片|