I've a application launched by bash script. I redirected stderr and stdout to different files:
./app >> /home/user/logs/debug.log 2>>/home/user/logs/debug.err &
And I need to add a timestamp for stderr lines. How I can do it?
I've a application launched by bash script. I redirected stderr and stdout to different files:
./app >> /home/user/logs/debug.log 2>>/home/user/logs/debug.err &
And I need to add a timestamp for stderr lines. How I can do it?
check this out
./app >> /home/user/logs/debug.log 2> >( while read line; do echo "$(date): ${line}"; done > /home/user/logs/debug.err )