#!/bin/sh if [[ -z $1 ]]; then echo "usage: gcore " exit 1 fi exec gdb -batch -ex "attach $1" -ex "generate-core-file" -ex "detach"