I have written a bash script, A, that is calling another script, B, over 1000 times in a loop.
Ctrl+C kills only script B, only one iteration. Script A keeps running and calling script B again.
Can I rewrite something in these scripts so that Ctrl+C will kill script A?
you can trap your killing signal and do whatever you want (killing A instead of B, for instance). See here how.
If you use it in B, try making it kill its parent…