2. sed 执行流程
最后更新时间 (CST):2023-07-19 20:05:15 +0800
Sed 脚本遵循易于记忆的序列,依次为读取,执行,打印,重复…
步骤
我们看看这个序列中的步骤:
- 在模式空间中读取一行(一个内部临时的sed缓冲区,缓存从文件中读取的行)
- 在模式空间中的行上执行sed命令,如果有多个sed命令无论是来自脚本,
-e
选项 或者{}
,都将按顺序依次执行所有的sed命令
- 打印模式空间中的行(处理后的结果),打印完这一行后,sed模式空间将被清空
- 再次重复上述操作,直到到达文件的末尾
执行流程如图所示:
如未另行说明,那么本页面中的内容已根据 知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。内容随着时间推移,可能会过期,会定时更新或移除一些旧的内容。
最后更新时间 (CST):2023-07-19
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"很难理解"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"信息或示例代码不正确"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"没有我需要的信息/示例"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]