发送反馈
13. 组合替换标志
最后更新时间 (CST):2023-07-20 06:21:49 +0800
您可以根据需要组合一个或多个替换标志。
示例
以下示例将所有出现的 "Manager"
或 "manager"
替换为 "Director"
。
这也将仅将替换命令更改的行打印到屏幕上,并将相同的信息写入到 output.txt
文件中。
$ sed -n 's/Manager/Director/gipw output.txt' employee.txt
102,Jason Smith,IT Director
105,Jane Miller,Sales Director
$ cat output.txt
102,Jason Smith,IT Director
105,Jane Miller,Sales Director
发送反馈
如未另行说明,那么本页面中的内容已根据 知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。内容随着时间推移,可能会过期,会定时更新或移除一些旧的内容。
最后更新时间 (CST):2023-07-20
[{
"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":"其他"
}]
需要向我们提供更多信息?