Loop Forever Script Strangely Exiting

Hi,

I have a really simple script which I want to run forever, inside the loop it runs a C application which if it exits should restart.

#!/bin/sh
 
while true
do
  ./SCF scf.conf >> scf.log
  sleep 2
done

For some reason the SCF C application coredumps and the script is exiting.
I'm not a shell script expert by any means but my understanding was that it should loop forever regardless of what happens in the SCF app ?

Do you know any reason why the script would jump out the loop and exit.

Thanks

Marvin

I suppose that it's the parent shell that core dumps (and thus exists), not (only?) the C program ...
Did you expect the core file to see which process generated the core dump:

file core

Hi,

Yes I inspected the core file and it was the child process SCF that had coredumped.

Core was generated by `./SCF scf.conf'.
Program terminated with signal 11, Segmentation fault.

I dont understand how it can make the parent shell program exit too ?

Marvin

Nope, perhaps tracing system calls and signals (truss/strace/etc?) could help in this case.