clxrity_lilgrep

Crates.ioclxrity_lilgrep
lib.rsclxrity_lilgrep
version0.1.0
sourcesrc
created_at2024-11-15 21:52:26.991808
updated_at2024-11-15 21:52:26.991808
descriptionA simple grep-like utility written in Rust.
homepage
repository
max_upload_size
id1449646
size6,573
MJ Anglin (clxrityy)

documentation

README

lilgrep

A miniature version of the grep command line tool built with Rust.

Search for a specific word within a file, and the entire line(s) containing that word will be returned to you.

Requirements:
  • Must have Rust installed on your OS
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Basic usage

  • Search for the word what within the file poem.txt:
cargo run what poem.txt

Case sensitivity

By default, the search is case sensitive.

If "What" exists but not the search query "what", nothing will be returned.

This is dependant upon this environment variable:
CASE_INSENSITIVE=
  • To change this, all you need to do is run:
export CASE_INSENSITIVE=true
  • To remove:
unset CASE_INSENSITIVE

Directing the output to a file

  • Search for every case of "what" within poem.txt, and direct the result to output.txt
cargo run what poem.txt > output.txt
Commit count: 0

cargo fmt