|
@@ -0,0 +1,44 @@
|
|
|
+# Recall
|
|
|
+
|
|
|
+* `capture` - Save stdout and stderr for every command
|
|
|
+* `recall` - Reuse stdout for pipeline or otherwise
|
|
|
+
|
|
|
+## Examples
|
|
|
+
|
|
|
+I do a find with copious output...
|
|
|
+
|
|
|
+```bash
|
|
|
+capture find . # stderr and stdout are saved to file and printed to console as usual
|
|
|
+```
|
|
|
+
|
|
|
+Forgot to pipe to less...
|
|
|
+
|
|
|
+```bash
|
|
|
+recall find | less # pipe last captured output from `find` command to `less`
|
|
|
+```
|
|
|
+
|
|
|
+Now I want to test my grep...
|
|
|
+
|
|
|
+```bash
|
|
|
+recall find | grep 'pattern' # no-need to run find again, only need the output
|
|
|
+```
|
|
|
+
|
|
|
+With aliases in `.zshrc` and `.shrc`...
|
|
|
+
|
|
|
+```bash
|
|
|
++ find .
|
|
|
+@ find | less
|
|
|
+@ find | grep 'pattern'
|
|
|
+```
|
|
|
+
|
|
|
+I want to build a complex pipeline with many long running commands...
|
|
|
+
|
|
|
+```bash
|
|
|
++ find | + grep 'pattern' | + cut -d '/' -f2 # initial attempt
|
|
|
+@ find | + grep 'pattern2' | + cut -d '/' -f2 # ok, grep pattern is right
|
|
|
+@ find | @ grep | + cut -d'/' -f2 # good to go
|
|
|
+
|
|
|
+# run full pipeline
|
|
|
+find . | grep 'pattern2' | cut -d '/' -f2
|
|
|
+```
|
|
|
+
|