Closed greymd closed 2 years ago
sed, awk and perl support the range selection with regex.
sed
awk
perl
$ seq 10 | sed -n '/4/,/8/p' 4 5 6 7 8 $ seq 10 | awk '/4/,/8/{ print $0}' 4 5 6 7 8 $ seq 10 | perl -nle 'print $_ if /4/../8/' 4 5 6 7 8
teip should have same feature. such as..
teip
$ teip -B 'AAA' -E 'BBB'
Came from begin and end. But in that situation, -s option have to be enabled.
begin
end
-s
This is also good.
$ teip -R <begin_pat> <end_pat>
Just idea
teip -bg AAA -eg BBB
teip -b 0 -e 3
teip -b 0 -e +3
teip -b 0 -e '~3'
teip -b 0 -e '$'
This idea is no longer helpful. From v2.0.0, -e option can achieve it.
-e
i.e
teip -e 'sed -n /AAA/,/BBB/='
sed
,awk
andperl
support the range selection with regex.teip
should have same feature. such as..Came from
begin
andend
. But in that situation,-s
option have to be enabled.