"Parent" Bash script
bash Child &
wait
sleep 5; echo "Main end" >>log.txt
"Child" script :
trap 'echo "Child end" >>log.txt;' ABRT
sleep 100
echo "Child end" >>log.txt
Run: bash Parent &
How to modify these scripts so that "kill -ABRT" would make Child exit with a trace in log.txt ? As is, Child ignores such signals. It does if the first line (trap) is removed, but then, no trace is left in log.txt upon "kill -ABRT".