shell sed正则表达式
时间: 2023-10-19 19:28:13 浏览: 105
Shell中的sed是一种文本处理工具,它可以根据指定的正则表达式进行文本的删除、替换、添加等操作。通过使用sed命令,我们可以在每行的行尾插入字符串。例如,使用命令"sed 's/$/EOF/' test.txt"可以在每行的行尾插入字符串"EOF"。 sed命令依赖于正则表达式,可以实现相当复杂的文本处理操作,并广泛应用于Shell脚本中,以完成自动化处理任务。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Shell正则表达式之grep、sed、awk实操笔记](https://download.csdn.net/download/weixin_38660295/12846597)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Shell编程正则表达式sed](https://blog.csdn.net/weixin_49343462/article/details/109636744)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Shell正则表达式之sed](https://blog.csdn.net/LiuRzhi/article/details/117782094)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]