cargo run tests sample.text
cargo run the sample.txt # shows 2 matching lines
cargo run t sample.txt # shows 4 matching lines
cargo run \ sample.txt # match all lines with spaces, in this case all lines except the new line
cargo build --release
cd ~/code/rust/grepy/target/release
./grepy run t sample.txt # same as # cargo run t sample.txt
~/code/rust/grepy/target/release/grepy run t sample.txt # same as # cargo run t sample.txt
so.... just add rust to your path and you can then run from anywhere
these are fine and the same as chmod +x grepy
-rwxr-xr-x 2 whoami
staff 327K Aug 13 12:54 grepy
./grepy com some/path/to/some/file
it will create a binary file
./target/release/grepy
This binary is completely self-contained, so you can move or copy it to somewhere else on your computer.
This is my first rust lang answer on stack overflow
cargo publish