#!/bin/bash if [[ -z $1 ]]; then echo "usage: gdb-exec [ ...]" exit 1 fi prog=$1; shift args="$*" exec gdb -ex "set args $args" "$prog"