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 = abc EOM ) &>>"$3" & sleep 1 grep -q DATA <(timeout 5 myclient http://url | tee -a "$3") && exit 0 sleep 5& wait %+ exit 1
I've tried to launch with gdb from the start (using
sleep as an example application):
gdb -ex run --args sleep 30 &
fg doesn't bring it back properly: can't type anything, SIGINT is strange, shell says that the job is stopped.
fg inside the script gives an error
fg: no job control.
Is there a way?