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*

4
  • I dont want to add to each command tee -a I have around 200 commands in my script , my target is to change the "exec > $LOG 2>&1" in order to support also printing on the console Commented Aug 3, 2017 at 11:10
  • Updated answer with bash process substitution example. Commented Aug 3, 2017 at 11:40
  • exec > >(tee $LOG) , in the bash - on the end of the script , script not return cursor Commented Aug 3, 2017 at 11:48
  • 1
    Works as expected, tested it with exec > >(tee output.txt) and cat command pastebin.com/M93MEzKe . Commented Aug 3, 2017 at 11:59