Very simple utility to replace(r)/delete(d) strings in text files
cargo install rdrd "replace" "with" -f file.txtby default, it uses regex, for string literals
rd -s "replace" "with" -f file.txtrd "replace" "with" -f file.txt -ird "to_add" -f file.txt -a 1 # line number to addrd "to_delete" -f file.txt -drd "replace" "with" -f *.txtwith fd
rd "replace" "with" -f $(fd '.*\.txt')Much faster than GNU sed (2x), but slower than sd (2x) for large files. Similar to sd for small files
- Do not touch the file unless there is a change. This is useful when modifying a long list of files and do not want to leave a trail in every files pass on the command line