Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fransan6/ruby-wc

Ruby version of *nix command `wc`
https://github.com/fransan6/ruby-wc

rspec ruby unix

Last synced: about 1 month ago
JSON representation

Ruby version of *nix command `wc`

Awesome Lists containing this project

README

        

### Usage

Ruby version of \*nix command `wc` with options `-c`, `-l`, `-m` and `-w` to analyse a file:

- `-c` prints the byte count
- `-l` prints the line count
- `-m` prints the character count
- `-w` prints the word count

Leaving out the option gives you `-l`, `-w` and `-c`.

**How to run**

`./rwc [option] [filename]`, for example: `./rwc -c myfile.txt`

It also supports reading from the standard input when pipe is used:

`cat myfile.txt | ./rwc -m`

### Instruction

To run this from your local environment, make sure Ruby 3.3.0 is installed. Clone the repository, run `bundle install` and you are good to go.