Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
From: greg
To: bug-bash@gnu.org
Subject: Subshell process groups
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: cygwin
Compiler: i686-pc-cygwin-gcc
Machine Type: i686-pc-cygwin
Bash Version: 2.05b
Patch Level: 0
Release Status: release
Description:
#!/bin/bash
(
# sleep 1 # or whatever slower commmand!
set -m;
sleep 10 & # or whatever command that takes time to complete
set +m;
pid=$!
( sleep 1; kill -- -$pid ) &
wait $pid
)
# without the first line commented you get:
# ./bug.sh: line 8: kill: (-760) - No such process
# otherwise things work as expected
# ./bug.sh: line 10: 492 Terminated sleep 10
Repeat-By:
$ ./bug.sh