https://github.com/schpet/diffwrite
print a diff while you write stdin to a file
https://github.com/schpet/diffwrite
cli shell
Last synced: 2 months ago
JSON representation
print a diff while you write stdin to a file
- Host: GitHub
- URL: https://github.com/schpet/diffwrite
- Owner: schpet
- Created: 2025-03-18T03:14:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-18T03:27:14.000Z (over 1 year ago)
- Last Synced: 2025-12-31T05:08:55.064Z (6 months ago)
- Topics: cli, shell
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# diffwrite
writes stdin to a file, while also printing a diff
```bash
# tired, dusty
echo "abc" > results.txt
# (no output)
# amazing, really good
echo "def" | diffwrite results.txt
# --- a/results.txt
# +++ b/results.txt
# @@ -1,1 +1,1 @@
# -abc
# +def
```
| redirection | diffwrite |
| --------------------------------- | --------------------------------- |
| prints nothing, how unixy | prints a diff |
| streams, wow, unix philosophy | reads the whole thing into memory |
| cant even pipe a file into itself | like a snake eating its tail |
| posix | live a little |