This project is a custom implementation of the classic Unix uniq
command. It was developed as part of a coding challenge here. The utility is designed to filter and manipulate duplicate lines from input data, providing detailed control over the output displayed.
- Filter out duplicate lines or exclusively show them.
- Count the occurrences of each line.
- Output results to standard output or a specified file.
- Handle input from both files and standard input (piping).
- Efficiently process large text data.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- You need to have Go installed on your machine (Go 1.15 or later is recommended).
- You can download and install Go from https://golang.org/dl/.
Clone the repository to your local machine:
git clone https://github.com/nullsploit01/cc-uniq.git
cd cc-uniq
Compile the project using:
go build -o ccuniq
To run the utility, you can either pass a file name as an argument or pipe text into it via standard input.
./ccuniq -u filename.txt
./ccuniq -d filename.txt
./ccuniq -c filename.txt
cat filename.txt | ./ccuniq -u
go test ./...