- 论坛徽章:
- 0
|
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.
最后一行被读入后,如果没有‘s///‘语句成功进行替换操作,则跳到label,如果label被省略,则跳到script结尾。 那么上面的语句中有label,循环岂不是一直继续。
我对上面脚本理解是:匹配空格行,然后进入{}结构。执行结构中n语句读入下一行纪录,然后s,.,@&,替换刚读入的纪录,最后跳到{}结构开始处反复执行?几点疑问:
1.一共读入两行语句(正则匹配的空行以及n读入的下面一行),那么"the last input line"指的是第二行还是整个文本的最后一行。
2.第一次正则匹配后,{}的语句中的loop其什么作用,按照语义理解,好像它一直{}体内循环。
[ 本帖最后由 shizhi21cn 于 2007-6-27 10:30 编辑 ] |
|