# Parent sets up a trap for SIGUSR1catching_at_parent(){ echo.green "Caught at parent with PID: $$, BASHPID: $BASHPID"}trap catching_at_parent SIGUSR1# Function to act as subshell, sending signal back to parentsubshell_function() { echo "Subshell running with PID: $$, BASHPID: $BASHPID" echo "Subshell sending SIGUSR1 to parent PID: $$" kill -SIGUSR1 $$ || echo "Failed to send signal"}# Simulate a process where the subshell is triggered via a pipeecho "Parent waiting for signal with PID: $$"echo "" | subshell_function# Keep the parent running for a bit to catch the signalsleep 2