2015年9月24日

模式匹配

摘要: 1. 括号的分组标签,最多9组,依次为1...9sed -r 's/^(address)/#\1/' /etc/network/interfacessed -r s/^\(address\)/#\\1/ /etc/network/interfaces2. 用&代表匹配到的内容sed -r 's/^a... 阅读全文

posted @ 2015-09-24 16:09 eric.geoffrey 阅读(135) 评论(0) 推荐(0) 编辑

用sed或awk输出一段文字

摘要: AWK:在线文章http://www.grymoire.com/Unix/Awk.htmlPrint every line between lines containing thewords BEGIN and END. (No action defaults toprint).awk '/BEGI... 阅读全文

posted @ 2015-09-24 16:05 eric.geoffrey 阅读(365) 评论(0) 推荐(0) 编辑

导航