How to redirect output to a file and stdout

后端 未结 10 1573
借酒劲吻你
借酒劲吻你 2020-11-22 08:11

In bash, calling foo would display any output from that command on the stdout.

Calling foo > output would redirect any output from that

10条回答
  •  醉话见心
    2020-11-22 08:42

    Something to add ...

    The package unbuffer has support issues with some packages under fedora and redhat unix releases.

    Setting aside the troubles

    Following worked for me

    bash myscript.sh 2>&1 | tee output.log
    

    Thank you ScDF & matthew your inputs saved me lot of time..

提交回复
热议问题