0

The answer(s) to this question explains how to print stdout and stderr to the terminal, while also redirecting them to a file:

program [arguments...] 2>&1 | tee outfile

How could this be extended if stdout and stderr should be redirected in 2 different files ?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Vince
  • 3,979
  • 10
  • 41
  • 69

1 Answers1

1

With process substitution:

program >(tee stdout.log) 2>(tee stderr.log >&2)
John Kugelman
  • 349,597
  • 67
  • 533
  • 578