Better name for mega-sena files
[lcapit-junk-code.git] / scripts / getbt
blob61ce01ff19d4e22ab0bcbfd0729ed62ddc99ef0f
1 #!/bin/sh
3 # Print the stack backtrace of a crashed program
5 CORE=$2
6 BINARY=$1
8 usage()
10 echo -e "getbt: Print the stack backtrace of a crashed program"
11 echo -e "Usage: $(basename $0) < program > < core-file >"
14 if [ $# -eq 0 ]; then
15 usage
16 exit 1
19 if [ "$1" = "-h" -o "$1" = "--help" ]; then
20 usage
21 exit 0
24 # print only the trace
25 gdb -nx -silent $BINARY $CORE <<<bt | egrep '^#'
26 exit 0