Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11657

Running procs in bg, +Ctl-C, then Ctl-C again after they complete + NL==?

From Linda Walsh <bash@tlinx.org>
Newsgroups gnu.bash.bug
Subject Running procs in bg, +Ctl-C, then Ctl-C again after they complete + NL==?
Date 2015-10-14 22:05 -0700
Message-ID <mailman.354.1444885635.7904.bug-bash@gnu.org> (permalink)

Show all headers | View raw





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




Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Running procs in bg, +Ctl-C, then Ctl-C again after they complete + NL==? Linda Walsh <bash@tlinx.org> - 2015-10-14 22:05 -0700

csiph-web