summaryrefslogtreecommitdiff
path: root/testsuite/uniq.sed
blob: 7ec66c47719f5ab1a7455faef05f41ffcd416360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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