Solved Is it possible to disable coredumps on a per-command basis?

I have a program (not written by me) that works as expected, except that it segfaults and dumps core just before exiting. This problem will eventually be fixed, but for now, I would like to use this program without sprinkling `.core` files everywhere. Can I disable core dumps on a per-process basis? Ideally, it would look something like this:

Code:
$ COREDUMP=/dev/null ./bad_program

In particular, I do not want to globally disable core dumps, as I would like to have them around for other processes. I just want to disable them for this command.
 
You can use limit in tcsh/csh/zsh, but it will last for the session you're in.
If you can, why not wrap the program in a shell script and set limit in it?
 
Back
Top