exec > >(tee -i logfile.txt)
source: stackoverflow: redirect COPY of stdout to log file from within bash script itself