DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(sed.info.gz) uniq -d

Info Catalog (sed.info.gz) uniq (sed.info.gz) Examples (sed.info.gz) uniq -u
 
 Print Duplicated Lines of Input
 ===============================
 
    This script prints only duplicated lines, like `uniq -d'.
 
      #!/usr/bin/sed -nf
      
      $b
      N
      /^\(.*\)\n\1$/ {
          # Print the first of the duplicated lines
          s/.*\n//
          p
      
          # Loop until we get a different line
          :b
          $b
          N
          /^\(.*\)\n\1$/ {
              s/.*\n//
              bb
          }
      }
      
      # The last line cannot be followed by duplicates
      $b
      
      # Found a different one.  Leave it alone in the pattern space
      # and go back to the top, hunting its duplicates
      D
 
Info Catalog (sed.info.gz) uniq (sed.info.gz) Examples (sed.info.gz) uniq -u
automatically generated byinfo2html