I am a scripting newbie. I have created a script to gether crash information for one of our programs. I would like to also gather the trace for the core within the bash script.
What I have done so far is this:
gdb $PATH/MyProgram $CORE
bt >> /tmp/trace.output
What happens is that this launches gdb and passes in the core file properly, but when it gets to the gdb prompt, it will not pass in the 'bt' command.
How would I pass the bt command into gdb and capture the output into the trace.output file?