I am making a simple coredump analyzer. I have a core file and symbols. Now I want to create a utility so these 2 files can be uploaded, and it shows the stacktrace (bt). I execute a shell script which does:
gzip -d coredump.gz
tar xvf symbols.tar.gz
gdb program
#Now at this point I want to send gdb commands one at a time. Like:
core-file corefile
echo bt
I want to save the output of "bt" to a file. How can I do that?