Use trap to capture signals like this:

i=-1;while((++i<33));
do
    trap "echo $i >> log.txt" $i;
done

And close the terminal by force.

The content in log.txt is then (under redhat linux):

1

18

1

17

0

Where these signals from?

Edit
Report