touched up sed

This commit is contained in:
2009-09-08 07:34:49 +00:00
parent f9d4ccc50a
commit faf8d996db
11 changed files with 189 additions and 72 deletions

23
qse/regress/sed/002.dat Normal file
View File

@ -0,0 +1,23 @@
ab...c
------
AAA
de...f
gh...i
------
AAA1
jk...l
mn...o
pq...r
------
AAA2
kbs
------
ddd
dif
------
cccc

9
qse/regress/sed/002.sed Normal file
View File

@ -0,0 +1,9 @@
#
# author: bushi @ kldp
#
:a $!N
/\n------/N
s/\n------\n/ /
ta
P
D

23
qse/regress/sed/003.dat Normal file
View File

@ -0,0 +1,23 @@
ab...c
------
AAA
de...f
gh...i
------
AAA1
jk...l
mn...o
pq...r
------
AAA2
kbs
------
ddd
dif
------
cccc

13
qse/regress/sed/003.sed Normal file
View File

@ -0,0 +1,13 @@
#
# author: APRIL1024 @ kldp
#
/^[^ ][^ ]*/{
N
/--*/!{
P
D
}
N
s/\n.*\n/ /
}

9
qse/regress/sed/004.dat Normal file
View File

@ -0,0 +1,9 @@
linux {
Host: hellow.com
Address: 3.32.22.22
}
linux {
Host: ip.com
Address: 99.32.22.22
}

14
qse/regress/sed/004.sed Normal file
View File

@ -0,0 +1,14 @@
#
# author: pynoos @ kldp
#
/^linux/ {
:grab
/^}/ b end
s/^Host:.*$/HOST: com.com/
s/^Address:.*$/ADDRESS: 45.34.34.33/
n
b grab
:end
n
p
}