Append text to stderr redirects in bash

前端 未结 4 1222
青春惊慌失措
青春惊慌失措 2020-12-08 17:09

Right now I\'m using exec to redirect stderr to an error log with

exec 2>> ${errorLog}

The only downside is that I have to start each

4条回答
  •  無奈伤痛
    2020-12-08 17:45

    cat q23123  2> tmp_file ;cat tmp_file | sed -e "s/^/$(date '+[%F %T]'): /g" >> output.log; rm -f tmp_file 
    

提交回复
热议问题