This needs to be run as bash

"exec > >(tee ..)" isn't in /bin/sh