diff options
Diffstat (limited to '')
-rw-r--r-- | src/sed/testsuite/uniq.sed | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sed/testsuite/uniq.sed b/src/sed/testsuite/uniq.sed new file mode 100644 index 0000000..7ec66c4 --- /dev/null +++ b/src/sed/testsuite/uniq.sed @@ -0,0 +1,20 @@ +h + +:b +# On the last line, print and exit +$b +N +/^\(.*\)\n\1$/ { + # The two lines are identical. Undo the effect of + # the n command. + g + bb +} + +# If the @code{N} command had added the last line, print and exit +$b + +# The lines are different; print the first and go +# back working on the second. +P +D |