I am finding it difficult to understand how the processes are launched in such a shell script
mainscript.sh
exec command1 &
sleep 10
exec command2 &
sleep 10
I understand that exec command does not create a new process it just replaces the bash with the command to be executed, in that case, what happens when it runs with an &
Currently I see this is the ps output something like this
UID PID PPID C STIME TTY TIME CMD
user+ 1 0 0 16:43 ? 00:00:00 bash mainscript.sh
user+ 48 1 9 16:43 ? 00:00:04 command1
user+ 133 1 0 16:43 ? 00:00:00 command2