I learned that from an instruction:
Co-processing does two things at the same time. It spawns a subshell in background mode and executes a command within that subshell.
[root@iz2ze9wve43n2nyuvmsfx5z ~]# coproc ( sleep 10; sleep 2 )
[1] 32508
[root@iz2ze9wve43n2nyuvmsfx5z ~]# jobs
[1]+ Running coproc COPROC ( sleep 10; sleep 2 ) &
When I refer to its manual, get an error as feedback
root@iz2ze9wve43n2nyuvmsfx5z ~]# man coproc
No manual entry for coproc
[root@iz2ze9wve43n2nyuvmsfx5z ~]# coproc --info
[1] 32579
[root@iz2ze9wve43n2nyuvmsfx5z ~]# bash: line 25: --info: command not found
[1]+ Exit 127 coproc COPROC --info
help
works
[root@iz2ze9wve43n2nyuvmsfx5z ~]# help coproc
coproc: coproc [NAME] command [redirections]
Create a coprocess named NAME.
Execute COMMAND asynchronously, with the standard output and standard
input of the command connected via a pipe to file descriptors assigned
to indices 0 and 1 of an array variable NAME in the executing shell.
The default NAME is "COPROC".
Exit Status:
Returns the exit status of COMMAND.
This's very confusing,
How could I have a big picture of the commands on which manuals I can reach to? How to distinguish them?
type
to see what it is, and then pick the manpage to read. – muru Oct 25 '18 at 02:28coproc
is not a program, it's a built-in command. The manual page isman bash
; search forcoprocess
. – AlexP Oct 25 '18 at 04:04