I'm writing bash scripts that launch a test scenarios: several programs that connect to each other.If something crashed, I'd like to have a GDB command line.Looks something like that:myprogram <(cat <<-EOM    [conf]    par = abcEOM) &>>$3 &sleep 1grep -q DATA <(timeout 5 myclient http://url | tee -a $3) && exit 0sleep 5&wait %+exit 1I've tried to launch with gdb from the start (using sleep as an example application):gdb -ex run --args sleep 30 &And then:fgThe fg doesn't bring it back properly: can't type anything, SIGINT is strange, shell says that the job is stopped.Writing fg inside the script gives an error fg: no job control.Is there a way?
How to run GDB in backround and bring it back?
bash;job control;gdb