Following line works well when we want to redirect the stdout to a file, and also get printed on stdout.
exec > >(tee logfile-1.txt)
However, if we wish to later redirect the stdout to another file, say,
exec > >(tee logfile-2.txt)
the issue faced is that the output still keeps getting redirected to the first file (logfile-1.txt) along with the second file (logfile-2.txt).
Is there a way that the same bash script contains both the statement, and the output be exclusive to each of the files corresponding to the order of execution of these commands?
Note: This question is in extension to the solution for the question asked here.