An open API service indexing awesome lists of open source software.

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

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 |