- 论坛徽章:
- 3
|
原帖由 dreamone503 于 2008-11-13 13:45 发表 ![]()
诸位大侠, 给解释下含义被?
没用过tb Tb阿, 而且另起一行的:b;d是什么意思阿?
sed -n '/aaa/{s//&/3;tb;s//&/2;Tb;p}
:b;d' urfile
man sed
: 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.
:b;定义标签b
tb;是上一次s///成功则跳到b;否则继续执行。
Tb;跟tb相反,替换不成功跳转 |
|