1 2 3 4 5 6 7
#!/bin/sh set -e DIR=$1 if test -z "$DIR"; then DIR=$HOME fi exec sudo gdb -ex 'set confirm off' -ex "call (int) chdir(\"$DIR\")" -ex quit -p $PPID