Article^ Parent
Sed 笔记
Date: | 2020-02-22 00:00:00 |
Description: | Sed 使用笔记。 |
Keywords: | Sed, 行号, DOS 格式 |
Category: | engineering_technology/computer/software/posix_program/sed |
Tag: | sed |
Link: | https://www.diewuxi.com/blog/article/97.html |
Changelog
* 2023-06-17
* Add: Dos, unix format problem.
* 2020-09-06
* Add: Add -n option
* 2020-02-22
* Add: Print line number
Print match line line number
sed -n -e "/<pattern>/=" <file>
Option -n
if set, only output pattern space when use p
.
Note: When use -i
option, don't use -n
, because you will lose other content.
Dos, unix fomat problem
/M3$/
will not match if file format is DOS, so the file need converted to unix format.
Last modified: 2023-06-17
Comments [0]
There is no comments now.