- Make sure you have Rust installed on your machine
rustc --version
cargo --version
- From the root of this project, run
cargo run [text to search] [file to search in]
- Ex.
cargo run to poem.txt
- Search results will be shown in the terminal
- Set an environment variable named
CASE_INSENSITIVE
to any value- On a Mac,
export CASE_INSENSITIVE=1
- On a Mac,
- Unset this variable to go back to case sensitive search
- On a Mac,
unset CASE_INSENSITIVE
- On a Mac,
cargo run [text to search] [file to search in] > [file name]
- Ex.
cargo run to poem.txt > output.txt