Redirecting bash stdout/stderr to two places?

前端 未结 3 423
误落风尘
误落风尘 2021-01-30 10:35

This one\'s been bugging me for a while now. Is it possible to redirect stdout and stderr to both the terminal output and to a program?

<
3条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 11:38

    Is it possible to redirect stdout and stderr to both the terminal output and to a program?

    I'm not sure how useful it is to combine stdout and stderr on the input to an editor, but does omething like this do what you need?

    input_prog 2>&1 | tee /dev/tty | my_editor
    

提交回复
热议问题