I have read that
$coproc
is different from $ &
in that coproc
will execute command
in a sub-shell process.
But when I tested it, it worked just like $ &
. The test is as follow:
First: test the behavior of $ &
.
1. Run $nano &
on *tty1*
1. On another tty, output from $ps -t tty1 --forest
indicates nano process is child process of the -bash process (login bash shell process -> no sub-shell process was created)
Second: test the behavior of $coproc
1. Run $coproc nano
on *tty1*
1. On another tty, output from $ps -t tty1 --forest
is the same as above (no sub-shell process was created)
So is $coproc
simply the same as $ &
?
The shell used was a **bash shell**
Asked by Tran Triet
(715 rep)
Oct 1, 2018, 12:05 PM
Last activity: Oct 1, 2018, 01:46 PM
Last activity: Oct 1, 2018, 01:46 PM