I have a bunch, but one that I rarely see mentioned but use all the time is memo(1) ( https://github.com/aktau/dotfiles/blob/master/bin/memo ). It memoizes the command passed to it. $ memo curl https://some-expensive.com/api/call | jq . | awk '...' Manually clearing it (for example if I know the underlying data has changed: $ memo -c curl https://some-expensive.com/api/call In-pipeline memoization (includes the input…
. #!/usr/bin/env bash # # memo(1), memoizes the output of your command-line, so you can do: # # $ memo | ... # # Instead of # # $ > tmpfile # $ cat tmpfile | ... # $ rm tmpfile to save output, sed can be used in the pipeline instead of tee for example, x=$(mktemp -u); test -p $x||mkfifo $x; zstd -19 tmpfile.zst & |sed w$x| ; # You can even use it in the middle of a pipe if you know that the input is not # extremely l…
Can you give a more complete example of how you would use this to speed up developing a pipeline?