Peng Yu
2018-11-15 15:04:14 UTC
Hi,
I don't understand the difference between the two <(). Why the first
one is not a child but the second one is a child? Where is this
documented? If I do want to wait for both to be finished, is there a
way to do so in bash? Thanks.
$ cat ./main.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
echo <(echo 1:$BASHPID>&2) <(echo 2:$BASHPID>&2)
echo "$!"
wait "$(($!-1))"
$ ./main.sh
1:38520
/dev/fd/63 /dev/fd/62
38521
2:38521
./main.sh: line 6: wait: pid 38520 is not a child of this shell
I don't understand the difference between the two <(). Why the first
one is not a child but the second one is a child? Where is this
documented? If I do want to wait for both to be finished, is there a
way to do so in bash? Thanks.
$ cat ./main.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
echo <(echo 1:$BASHPID>&2) <(echo 2:$BASHPID>&2)
echo "$!"
wait "$(($!-1))"
$ ./main.sh
1:38520
/dev/fd/63 /dev/fd/62
38521
2:38521
./main.sh: line 6: wait: pid 38520 is not a child of this shell
--
Regards,
Peng
Regards,
Peng