help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exiting the "read" builtin with trapped ^C


From: Chet Ramey
Subject: Re: Exiting the "read" builtin with trapped ^C
Date: Fri, 26 Jun 2026 17:31:14 -0400
User-agent: Mozilla Thunderbird

On 6/26/26 5:23 PM, Stan Marsh wrote:

     2) Note (just for the record) that the trap *does* execute
     immediately, when ^C is hit (which you can see from the displayed
     message).  It is just that the 'read' doesn't exit (and thus the
     'continue' doesn't execute) until the 'read' sees a line-terminator.

Yes, plus the way `continue' is implemented means that subsequent SIGINTs
will invoke the trap but not actually execute any commands.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]