Also, I wrote this plog function (for pipe-log, or something):
plog() {
local msg=${1:-plog}
tee >(sed -e "s/^/[$msg] /" | cat 1>&2 )
}
That allows me to see what's happening in the middle steps of the pipeline.I ended up compiling a list of tricks like that in https://raimonster.com/scripting-field-guide/ , in case anyone is interested (and feedback is appreciated)