Path: csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail From: Linda Walsh Newsgroups: gnu.bash.bug Subject: Running procs in bg, +Ctl-C, then Ctl-C again after they complete + NL==? Date: Wed, 14 Oct 2015 22:05:48 -0700 Lines: 51 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1444885635 2281 208.118.235.17 (15 Oct 2015 05:07:15 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash Envelope-to: bug-bash@gnu.org User-Agent: Thunderbird X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 173.164.175.65 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11657 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