linux - is it possible to create a non-child process inside a shell script? -


i'm using shell process pool api @ github, script, below

    function foobar()     {        mytask($1);     }      job_pool_init 100 0     tcpdump -i eth0 -w tempcap &            #     in `seq 1 4`;do       mesg="hello"$i       job_pool_run foobar $mesg       sleep 5     done      job_pool_wait     pkill tcpdump                           #     echo 'all finish'     job_pool_shutdown 

if comment tcpdump line, works fine, expected, when tcpdump line there, there wait command in job_pool_wait, waits ending of children process, if there no such tcpdump line, expected. want capture until child processes finish, have use tcpdump. in script, tcpdump process child process, job_pool_wait wait ending of tcpdump process, not expected.

so solution make tcpdump not child process, how can it, or other solutions? thanks!

you should able run tcpdump in sub-shell in background:

(tcpdump -i eth0 -w tempcap &) 

this should prevent appearing direct descendant of script.


Comments