I have read that when you press Ctrl+C, then a SIGINT signal will be sent to the foreground process group.
Now the accepted answer in this question says:
Basically, your signal is received by all foreground processes, ie the shell and the program,
I have executed cat within bash, and noticed that the PGID for bash and cat are different, so they do not belong to the same process group.
So when you press Ctrl+C, only cat will receive the SIGINT signal (and so the answer I quoted is wrong), am I correct?
echo $$returned432, would432be the identifier for the process group also? – the_velour_fog May 18 '17 at 01:21$$since it's the original shell process and different processes must have different PIDs. – Gilles 'SO- stop being evil' May 18 '17 at 01:24