fixed a bug in handling QSE_SED_QUIET for the 'n' command
This commit is contained in:
8
qse/regress/awk/lang-036.awk
Normal file
8
qse/regress/awk/lang-036.awk
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
if ($0 ~ /^-+$/) {
|
||||
getline x; printf " %s\n", x; nobar=0;
|
||||
}
|
||||
else {
|
||||
if (nobar) printf "\n"; printf "%s", $0; nobar=1;
|
||||
}
|
||||
}
|
23
qse/regress/awk/lang-036.dat
Normal file
23
qse/regress/awk/lang-036.dat
Normal 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/awk/lang-037.awk
Normal file
9
qse/regress/awk/lang-037.awk
Normal file
@ -0,0 +1,9 @@
|
||||
BEGIN {
|
||||
RS="\n-+\n";
|
||||
first = 1;
|
||||
}
|
||||
{
|
||||
if (!first) printf " ";
|
||||
printf "%s", $0;
|
||||
first = 0;
|
||||
}
|
23
qse/regress/awk/lang-037.dat
Normal file
23
qse/regress/awk/lang-037.dat
Normal file
@ -0,0 +1,23 @@
|
||||
ab...c
|
||||
------
|
||||
AAA
|
||||
|
||||
de...f
|
||||
gh...i
|
||||
------
|
||||
AAA1
|
||||
|
||||
jk...l
|
||||
mn...o
|
||||
pq...r
|
||||
------
|
||||
AAA2
|
||||
|
||||
|
||||
|
||||
kbs
|
||||
------
|
||||
ddd
|
||||
dif
|
||||
------
|
||||
cccc
|
@ -1931,6 +1931,66 @@ lease 10.218.255.151 {
|
||||
uid "\001\000\033[\234\220\000";
|
||||
}
|
||||
--------------------------------------------------------------------------------
|
||||
../../cmd/awk/qseawk --newline=on -o- -f lang-036.awk lang-036.dat </dev/stdin 2>&1
|
||||
--------------------------------------------------------------------------------
|
||||
{
|
||||
if (($0 ~ /^-+$/))
|
||||
{
|
||||
(getline x);
|
||||
printf " %s\n",x;
|
||||
nobar = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nobar)
|
||||
printf "\n";
|
||||
printf "%s",$0;
|
||||
nobar = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ab...c AAA
|
||||
|
||||
de...f
|
||||
gh...i AAA1
|
||||
|
||||
jk...l
|
||||
mn...o
|
||||
pq...r AAA2
|
||||
|
||||
|
||||
|
||||
kbs ddd
|
||||
dif cccc
|
||||
--------------------------------------------------------------------------------
|
||||
../../cmd/awk/qseawk --newline=on -o- -f lang-037.awk lang-037.dat </dev/stdin 2>&1
|
||||
--------------------------------------------------------------------------------
|
||||
BEGIN {
|
||||
RS = "\n-+\n";
|
||||
first = 1;
|
||||
}
|
||||
|
||||
{
|
||||
if ((!(first)))
|
||||
printf " ";
|
||||
printf "%s",$0;
|
||||
first = 0;
|
||||
}
|
||||
|
||||
ab...c AAA
|
||||
|
||||
de...f
|
||||
gh...i AAA1
|
||||
|
||||
jk...l
|
||||
mn...o
|
||||
pq...r AAA2
|
||||
|
||||
|
||||
|
||||
kbs ddd
|
||||
dif cccc
|
||||
--------------------------------------------------------------------------------
|
||||
../../cmd/awk/qseawk -f quicksort.awk quicksort.dat </dev/stdin 2>&1
|
||||
--------------------------------------------------------------------------------
|
||||
0.0000000000
|
||||
|
@ -138,6 +138,8 @@ PROGS="
|
||||
lang-033.awk///--newline=on -o-
|
||||
lang-034.awk///--newline=on --rwpipe=on -o-
|
||||
lang-035.awk/lang-035.dat2//--newline=on -o- -vdatafile=lang-035.dat1 -vgroupname=lang-035
|
||||
lang-036.awk/lang-036.dat//--newline=on -o-
|
||||
lang-037.awk/lang-037.dat//--newline=on -o-
|
||||
|
||||
quicksort.awk/quicksort.dat//
|
||||
quicksort2.awk/quicksort2.dat//
|
||||
|
23
qse/regress/sed/001.dat
Normal file
23
qse/regress/sed/001.dat
Normal file
@ -0,0 +1,23 @@
|
||||
ab...c
|
||||
------
|
||||
AAA
|
||||
|
||||
de...f
|
||||
gh...i
|
||||
------
|
||||
AAA1
|
||||
|
||||
jk...l
|
||||
mn...o
|
||||
pq...r
|
||||
------
|
||||
AAA2
|
||||
|
||||
|
||||
|
||||
kbs
|
||||
------
|
||||
ddd
|
||||
dif
|
||||
------
|
||||
cccc
|
14
qse/regress/sed/001.sed
Normal file
14
qse/regress/sed/001.sed
Normal file
@ -0,0 +1,14 @@
|
||||
# require -n
|
||||
h
|
||||
:again n
|
||||
/^-+$/ {
|
||||
g
|
||||
N
|
||||
s/\n/ /
|
||||
p
|
||||
b skip
|
||||
}
|
||||
x
|
||||
p
|
||||
b again
|
||||
:skip
|
Reference in New Issue
Block a user