Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ccat

A simple command-line tool written in Go for processing text input and files, inspired by Unix utilities. It handles standard input, file concatenation, and line numbering.

Features

  • Standard Input:
    • Print input as-is (-).
    • Number non-empty lines (-b).
    • Number all lines (-n).
  • File Handling:
    • Read and print single file contents.
    • Concatenate and print multiple files.

Prerequisites

  • Go installed on your system.

Usage

Clone the project

    git clone https://github.com/TG199/ccat.git

Build the Program

make build

Testing

make test

Example commands

  1. Read from standard in
./bin/ccat
  1. Process files

    Single file

    ./bin/ccat test.txt

    Multiple files

    ./bin/ccat test.txt test2.txt ...
  2. Number lines

    Number lines as they are printed

    head -n3 test.txt | ./bin/ccat -n

    Number empty lines

    sed G test.txt | ./bin/ccat -n | head -n4

    Exclude empty lines

    sed G test.txt | ./bin/ccat -b | head -n5

Clean build artifacts

make clean

Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue.

License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages