Artificial intelligent assistant

If the shell is running a program, will the shell also receive a SIGINT signal when Ctrl+C is pressed? 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?

That question is about a bash script. You're running bash interactively. This makes a difference for process groups: that's the whole reason why process groups were invented. The intent of a process group is to capture all the processes that are involved in one interactively-started task. So an interactive shell starts each job in a separate process group, whereas a shell running a script doesn't create new process groups.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy accd0cc30b999092ab32481ee4c70455