sed

测试文本内容:

This is a Certificate Request file:

It should be mailed to zawu@seu.edu.cn

=========================================================
Certificate Subject:

/O=Grid/OU=GlobusTest/OU=simpleCA-seugrid1.seu.edu.cn/OU=seu.edu.cn/CN=globus

The above string is known as your user certificate subject,and it uniquely identifies this user, $88
To install this user certificate,please save this e-mail into the following file.

/home/globus/.globus/usercert.pem

-n的使用

 

补充(与模式、或模式):

同时匹配ABC 和 123:

sed -n '/ABC/{/123/p}'        
awk '/ABC/&&/123/{ print $0 }'  
grep -E '(ABC.*123|123.*ABC)'    

匹配ABC 或 123:

sed -n '/\(ABC\|123\)/p'
awk '/ABC/||/123/{ print $0 }'
grep -E '(ABC|123)' 或 egrep 'ABC|123'

样式:

/(A|B|C|D|...)/p

上一篇:操作系统学习资料


下一篇:学习笔记之Ubuntu 20.04更换清华软件源