Was just playing around seeing how the sigint
being ignored in children acted. wrote short
function: This behavior seems limited to testing
this as a foregnd function, not a shell script.
I.e, sourcing the function, then
execute the function:
lnch
function lnch {
set -o monitor # fyi makes no difference if present
for((i=0;i++<3;)); do
declare -i l=1+i
(sleep $l ; echo "$l exiting")&
done
echo Waiting...
wait
echo wait finished with $?
}
====
If I let it finish, nothing interesting.
If I press control C after I see the "wait finished with 0", I get
another cmd prompt as normal, and pressing 'enter' does nothing special
If I press ^C after seeing "Waiting, ...",
but before "wait finished", then
I still see the "num exiting"... as previously mentioned
being normal behavior..., but then:
After the 3 sleepers exit, if I
either
press control-c again, then enter
or
enter, Ctl-c, enter
the shell will exit.
It seems the first control-c messes something up
such that entering another one after the children *really* finish
then enter (NL), exits the fg shell... Reproducible?
Normal behavior?
echo ${BASH_VERSION[@]}
4.3.39(1)-release