Temporary files don't bite, so just use them.
Archive of posts tagged pipeline
On pipes, subshells and descriptors
When small differences in implementation bite you.
On files and streams
Another reason to avoid UUOC