On Ubuntu, I have a bash script that runs an application.
When that app seg faults, I get some info in std err, e.g.
/usr/local/foo/script.sh: line 21: 494382 Segmentation fault (core dumped) appplication_name_and_arguments_here
Std err is being redirected to a file, which is then going into a log monitoring system.
What I'd like to do is augment the stderr content with more helpful info when this happens, e.g. some environment variables, and a timestamp.
How can I do this?
Thanks.