Restoring stdout and stderr to default value

后端 未结 2 459
名媛妹妹
名媛妹妹 2021-01-12 00:19

In shell script, We can change the default input to a File using the exec command as follow :

  exec 1>outputfile

However, if in the sa

2条回答
  •  执笔经年
    2021-01-12 00:45

    Try the "tee" command:

    exec | tee outputfile
    

    Look at the tee manpage for more explainations:

    tee - read from standard input and write to standard output and files

提交回复
热议问题