I have a program x which sometimes crashes on certain input files.
How do I write a bash script that returns the following?
- 0 if the program x terminates fine or runs for longer than 1/20th of a second
- 1 if the program x segfaults
Note that the program will segfault or run forever, so I need to stop it somehow with the script. can you show me please
Thank you for any ideas