Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 1
    It works, but sometimes I still get output when I already have my console prompt, resulting in a mixed output. Commented Oct 28, 2015 at 9:15
  • 1
    @Halfgaar - That is expected as exec replace the process including file descriptors for STDIN, STDOUT and STDERR - effectively detaching it from the terminal but tee continues to emit anything it receives. Commented Mar 29, 2016 at 9:55
  • 1
    On Mac this just simply hangs forever! Commented Jan 2, 2021 at 16:30
  • @PraveenPremaratne that may be something to ask another question about, but in general, no, it doesn't. Commented Jan 3, 2021 at 0:59
  • 1
    @xref This question is specifically about Bash, but the accepted answer in the duplicate question ought to work under POSIX sh at the cost of wrapping the body in braces, with more or less the same execution. Commented Nov 5, 2022 at 2:32