How do I run a program with commandline arguments using GDB within a Bash script?
You can run gdb with –args parameter, If you want it to run automatically, place some commands in a file (e.g. ‘run’) and give it as argument: -x /tmp/cmds. Optionally you can run with -batch mode.