I have a script that I would like to fork at one point so two copies of the same script are running.
For example, I would like the following bash script to exist:
echo $$ do_fork() echo $$
If this bash script truly existed, the expected output would be:
<ProcessA PID> <ProcessB PID> <ProcessA PID>
<ProcessA PID> <ProcessA PID> <ProcessB PID>
Is there something that I can put in place of "do_fork()" to get this kind of output, or to cause the bash script to do a C-like fork?