I am interested in executing a certain command every time any program I run outputs "segmentation fault". Basically I have a bash script that writes the timestamp in a log file and do some other stuff as well.
For my coursework, one module requests that we do this for each exercise. Sure I can make a script and run each program from within the script, but I was wondering if there is any way of generalizing this.
What I want is really for any program that is run by an user, if output contains "segmentation fault" execute command