原帖由 dreamone503 于 2008-11-13 13:45 发表
诸位大侠, 给解释下含义被?
没用过tb Tb阿, 而且另起一行的:b;d是什么意思阿?
sed -n '/aaa/{s//&/3;tb;s//&/2;Tb;p}
:b;d' urfile
: label
Label for b and t commands.
t label
If a s/// has done a successful substitution since the last input line was read and since the last t or T command, then branch to label; if
label is omitted, branch to end of script.
T label
If no s/// has done a successful substitution since the last input line was read and since the last t or T command, then branch to label;
if label is omitted, branch to end of script.
原帖由 dreamone503 于 2008-11-14 11:45 发表
领教领教,谢谢诸位
这样运行可以, sed -n '/aaa/{s//&/3;tb;s//&/2;Tb;p};:b;d' urfile
不知为何下边句子中 :b;d 要单起一行?
sed -n '/aaa/{s//&/3;tb;s//&/2;Tb;p}
:b;d' urfile
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |