I want a way to put a break point in gdb by runing a shell script.
Actualy I wanted to do certain automisation of a long manual process, which includes starting of a process in background and then taking the process ID of that process and then attach the gdb to that process ID. Then finaly put a break point at a specific location.
Option 1: start the program from within gdb using a script you passed along using -x
Option 2: start the program in the background, start gdb using the process id ($!) and -x gdbfile, where gdbfile contains "break <line number>"
Since both options use the -x switch, I suggest taking a look at the gdb man page on what it does exactly.