Hide Forgot
Created attachment 1117409 [details] kkk.sh Description of problem: $ cat kkk.sh #!/bin/bash trap 'echo Got sigint' SIGINT while :; do ps axf|grep -q xxx && echo $msg; done & #<--- generate a subshell #do some other things while read; do :; done Version-Release number of selected component (if applicable): all How reproducible: always Steps to Reproduce: 1. run script attached 2. ps check the anonymous sub shell 3. type Ctrl+c, check the anonymous sub shell Actual results: anonymous sub-shell was be killed, after Ctrl+c [yjh@dhcp-13-183 ~]$ ps axf| grep kkk 26302 pts/1 S+ 0:00 | | | \_ bash kkk.sh 26303 pts/1 S+ 0:00 | | | \_ bash kkk.sh 27332 pts/2 S+ 0:00 | | \_ grep --color=auto kkk [yjh@dhcp-13-183 ~]$ [yjh@dhcp-13-183 ~]$ ps axf| grep kkk 26302 pts/1 S+ 0:00 | | | \_ bash kkk.sh 30686 pts/2 S+ 0:00 | | \_ grep --color=auto kkk Expected results: anonymous sub-shell inheritance the trap set, or support a way to set trap for *anonymous* sub-shell Additional info:
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.