Sign inSign up

tamada/uniq2

By tamada

•Updated over 6 years ago

Image
0

371

tamada/uniq2 repository overview

Build Status Coverage Status codebeat badge Go Report Card License Version

⁠uniq2

Delete duplicated lines.

GNU core utilities⁠ has uniq command for deleting duplicate lines. However, uniq command deletes only continuous duplicate lines. When deleting not continuous duplicate lines, we use sort command together, in that case, the order of the list was not kept.

We want to delete not continuous duplicated lines with remaining the order.

⁠Install

⁠Install by Homebrew

Simply type the following commands.

$ brew tap tamada/brew # only the first time.
$ brew install uniq2
⁠Install by Go

Simply type the following command.

$ go get github.com/tamada/uniq2

⁠Usage

uniq2 [OPTIONS] [INPUT [OUTPUT]]
OPTIONS
    -a, --adjacent        delete only adjacent duplicated lines.
    -d, --delete-lines    only prints deleted lines.
    -i, --ignore-case     case sensitive.
    -h, --help            print this message.

INPUT                     gives file name of input.  If argument is single dash ('-')
                          or absent, the program read strings from stdin.
OUTPUT                    represents the destination.

⁠:whale: Docker

docker run --rm -v $PWD:/home/uniq2 tamada/uniq2:latest [OPTIONS] [ARGUMENTS...]

The meaning of the options of above command are as follows.

  • --rm
    • remove container after running Docker.
  • -v $PWD:/home/uniq2
    • share volumen $PWD in the host OS to /home/uniq2 in the container OS.
    • Note that $PWD must be the absolute path.

Docker

⁠License

WTFPL⁠

Tag summary

Content type

Image

Digest

Size

4.9 MB

Last updated

over 6 years ago

docker pull tamada/uniq2