摘要:流程控制一般情况下,sed是将编辑命令从上到下依次应用到读入的行上,但是像d/n/D/N命令都能够在一定程度上改变默认的执行流程,甚至利用N/D/P三个命令可以形成一个强大的循环处理流程。除此之外,其实sed还提供了分支命令(b)和测试(test)两个命令来控制流程,这两个命令可以跳转到指定的标签(...
阅读全文
随笔分类 - sed
摘要:$cat textfind the Match statementConsult the Get statementusing the Read statement to retrieve data/the .* statement/{hs/.*the \(.*\) statement.*/\1/y...
阅读全文
摘要:cat text121122111222$sed '/1/{H;$!d};$p;$x' text222222111111$sed '/2/{H;$!d};$x' text111111222222$sed 'H;$!d;${x;s/^\n//;s/\n/,/g}' text1,2,11,22,111,...
阅读全文
浙公网安备 33010602011771号