Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!tarvydas From: tarvydas@utcsri.UUCP (Paul Tarvydas) Newsgroups: net.unix-wizards Subject: bourne shell "read" vs. hangup trap (1) Message-ID: <1681@utcsri.UUCP> Date: Sat, 23-Nov-85 18:13:44 EST Article-I.D.: utcsri.1681 Posted: Sat Nov 23 18:13:44 1985 Date-Received: Sat, 23-Nov-85 18:17:12 EST Distribution: net Organization: CSRI, University of Toronto Lines: 20 On the two machines which I've tried this, a "hangup" trap does not cause the (Bourne) shell's "read" command to abort. Instead, the shell script continues to execute and sucks up inordinate amounts of cpu time. What would be a more appropriate way to code up a "read" from the keyboard, while maintaining the ability to die gracefully when a hangup comes by? The problem can be summarized with the following test script. I would have expected the script to terminate after updating "hangup.LOG" when a hangup trap occurs - this does not appear to be the case. #!/bin/sh trap "date >>hangup.LOG; exit 1" 1 2 3 15 while true do read junk done Paul Tarvydas ...!utcsri!tarvydas