bug-bash
[Top][All Lists]
Advanced

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

Loop within trap handling


From: werner
Subject: Loop within trap handling
Date: Wed, 28 Mar 2018 16:02:31 +0200

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-suse-linux-gnu' 
-DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -fmessage-length=0 
-grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong 
-funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g  
-D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g -Wuninitialized -Wextra -Wno-switch-enum 
-Wno-unused-variable -Wno-unused-parameter -Wno-parentheses -ftree-loop-linear 
-pipe -DBNC382214=0 -DIMPORT_FUNCTIONS_DEF=0 -fprofile-use -fprofile-correction
uname output: Linux noether 4.15.10-1.g5e4329c-default #1 SMP PREEMPT Thu Mar 
15 20:31:17 UTC 2018 (5e4329c) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 4.4
Patch Level: 19
Release Status: release

Description:
        A user reports a problem with example code included. By using the
        the code shown below and doing Ctrl-C twice the code hangs within
        a SIGINT loop if /bin/echo is used instead of builtin echo command.

Repeat-By:
        cat /tmp/trap.sh
        #!/bin/sh
        ## Works
        #trap 'echo "Type <CR> to exit" 1>&2; read xxx; exit 1' 1 2 3 15
        ## Does not work
        trap '/bin/echo "Type <CR> to exit" 1>&2; read xxx; exit 1' 1 2 3 15
        while :; do sleep 2; done

        /bin/bash /tmp/trap.sh
        ^CType <CR> to exit
        ^C




reply via email to

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