-1

嗨,我有如下文件示例。使用 perl 我需要从功能 A - 功能 B grep 行

FeatureA:Y
Suporrted devices
:
:
:
:Suported device
FeatureB:Y
Suporrted devices
:
:
:
:Suported device
FeatureC:Y
:
4

1 回答 1

3
perl -ne'print if /^FeatureA:/ .. /^FeatureB:/'

...再一次,你可能只想要排到FeatureB 线,所以

perl -ne'print if ( /^FeatureA:/ .. /^FeatureB:/ ) =~ /^\d+\z/;'
于 2013-05-30T06:49:57.223 回答