[~]> prog1 () { local s; while read s; do echo "1: $s"; done; } # типа, первая прога
[~]> prog2 () { local s; while read s; do echo "2: $s"; done; } # типа, вторая прога
[~]> # Башизм:
[~]> echo text | tee >(prog1 >&2) | prog2
1: text
2: text
[~]> # Не башизм:
[~]> dup() { local s; while read -r s; do echo $s; echo $s >&2; done; }
[~]> { echo text | dup | prog1; } 3>&1 1>&2 2>&3 | prog2
1: text
2: text