diff --git a/subst.c b/subst.c index 1dbfb5e..049962e 100644 --- a/subst.c +++ b/subst.c @@ -5011,7 +5011,8 @@ process_substitute (string, open_for_read_in_child) #if defined (JOB_CONTROL) old_pipeline_pgrp = pipeline_pgrp; - pipeline_pgrp = shell_pgrp; + if (pipeline_pgrp == 0 || (subshell_environment & (SUBSHELL_PIPE|SUBSHELL_FORK|SUBSHELL_ASYNC)) == 0) + pipeline_pgrp = shell_pgrp; save_pipeline (1); #endif /* JOB_CONTROL */ -- 2.9.3