From owner-freebsd-hackers Mon Dec 21 18:42:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA06017 for freebsd-hackers-outgoing; Mon, 21 Dec 1998 18:42:19 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA06011 for ; Mon, 21 Dec 1998 18:42:17 -0800 (PST) (envelope-from rivers@dignus.com) Received: from smtp1.vnet.net (smtp1.vnet.net [166.82.1.31]) by freefall.freebsd.org (8.8.8/8.8.5) with ESMTP id SAA16786 for ; Mon, 21 Dec 1998 18:42:16 -0800 (PST) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by smtp1.vnet.net (8.9.1a/8.9.1) with ESMTP id VAA19849 for ; Mon, 21 Dec 1998 21:42:18 -0500 (EST) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.9.1/8.8.5) with ESMTP id WAA26303 for ; Mon, 21 Dec 1998 22:29:33 -0500 (EST) Received: (from rivers@localhost) by lakes.dignus.com (8.9.1/8.6.9) id VAA21066 for freebsd-hackers@freefall.cdrom.com; Mon, 21 Dec 1998 21:43:24 -0500 (EST) Date: Mon, 21 Dec 1998 21:43:24 -0500 (EST) From: Thomas David Rivers Message-Id: <199812220243.VAA21066@lakes.dignus.com> To: freebsd-hackers@freefall.cdrom.com Subject: Interesting un-interruptible shell script on 3.0-RELEASE (possible sh bug?) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Try the following on a 3.0-RELEASE system, under the bourne shell: while true do sleep 2 done You'll quickly discover there's no way to interrupt it (i.e. control-C if that's your intr character.) But, individually, the two ideas (the while loop and the sleep) are quite interruptable. That is, you can interrupt this: while true do done And, you can interrupt this: sleep 10 But, I can't interrupt the combination; even when I hold down control-C (which, should eventually be in the 'right place at the right time' to interrupt the sleep followed by another control-C to interrupt the while loop. Even a ^\ (my quit character) won't stop the loop; it does get sleep to dump core.. but the loop quickly (too quickly apparently) starts up another sleep. I'd have to guess it to be a shell bug... seems like it could affect trap behaviour as well. This "interesting" phenomenon doesn't seem to be present on a 2.2.X system. Could some other people with 3.0 (RELEASE or later) try it out... if it's a consistent problem; I'll submit a pr on it. - Dave Rivers - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message