其他分享
首页 > 其他分享> > sed

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

标签:seu,ABC,sed,cn,123,edu
来源: https://www.cnblogs.com/tinaluo/p/15333616.html