3 ms·
One-liner to trigger core dumping: $ sh -c 'kill -ABRT $$' Aborted (core dumped)
by jwilk 5y ago
One-liner to trigger core dumping:
$ sh -c 'kill -ABRT $$'
Aborted (core dumped)
- cuteboy19 5y ago$$ would give the pid of the inner sh command right? Because the single quote would disable interpolation in the outer shell. So why would this work?
- jwilk 5y agoIt works by killing the inner shell. The outer shell remains alive, so that it can print the "core dumped" message. If you don't mind losing your current shell and don't care about the message, you can use just: $ kill -ABRT $$
- deleted 5y ago[deleted]