https://github.com/mk-milly02/uniq
This is a lite version of the Unix tool `uniq`.
https://github.com/mk-milly02/uniq
cli flags unix-command
Last synced: 3 months ago
JSON representation
This is a lite version of the Unix tool `uniq`.
- Host: GitHub
- URL: https://github.com/mk-milly02/uniq
- Owner: mk-milly02
- Created: 2024-04-16T00:42:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-16T00:46:14.000Z (over 1 year ago)
- Last Synced: 2025-03-13T09:39:56.304Z (9 months ago)
- Topics: cli, flags, unix-command
- Language: Go
- Homepage: https://codingchallenges.fyi/challenges/challenge-uniq
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# uniq-tool
> This is a lite version of the Unix tool `uniq`.
> The uniq utility reads the specified input_file comparing adjacent lines, writes a copy of each unique input line to the output_file. If input_file is a single dash ('-') or absent, the standard input is read. If output_file is absent, standard output is used for output. The second and succeeding copies of identical adjacent input lines are not written. Repeated lines in the input will not be detected if they are not adjacent, so it may be necessary to sort the files first.
`go run main.go test.txt`
`go run main.go countries.txt | wc -l`
`cat test.txt | go run main.go -`
`cat test.txt | go run main.go - out.txt`
`go run main.go -c test.txt`
`go run main.go -d countries.txt`
`go run main.go -u test.txt`
`go run main.go -c -d countries.txt`