It didn't work for me on macOS. I tried it on `yes` and `sleep 5` but it simply quit the program. No files were saved.
The linked article also explains how to change where core dumps are saved. Maybe your system is configured to save them in a specific folder (I have no clue what macOS' default settings for core dumps are!).