show output on terminal and store output in two files