To start debugging I need to do this steps:
screen -S gdb_program gdb /path/to/program
handle SIGPIPE nostop noprint pass - is gdb command
c - is gdb command
How to write a single shell script which I can run just:
./gdb.sh
Use a Here Document:
#!/bin/bash
screen -S gdb_program gdb /path/to/program <<EOF
handle SIGPIPE nostop noprint pass
EOF