Skip to main content
added 84 characters in body
Source Link
ilkkachu
  • 148.2k
  • 16
  • 268
  • 441

Are the terms session and process totally synonymous in shell-scripting or at least in Bash?

No, they're not the same at all.

A process is a running instance of a program. It has a process id (PID), a set of virtual memory, a user id, a set of open file descriptors, and a number of other things.

The Unix concept of a session is a kernel construct related to grouping processes mostly in the context of a terminal-based login.

A session is a group of processes, itself divided to one or more process groups. The following diagram from APUEAdvanced Programming in the Unix Environment shows the relations quite well:

enter image description hereenter image description here

It should be mentioned that the session as a whole can have a controlling terminal, but the processes within it are otherwise distinct.

See:


Notes:

  • Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

  • Then again, "process" has other less technical meanings too.

Are the terms session and process totally synonymous in shell-scripting or at least in Bash?

No, they're not the same at all.

A process is a running instance of a program. It has a process id (PID), a set of virtual memory, a user id, a set of open file descriptors, and a number of other things.

The Unix concept of a session is a kernel construct related to grouping processes mostly in the context of a terminal-based login.

A session is a group of processes, itself divided to one or more process groups. The following diagram from APUE shows the relations quite well:

enter image description here

It should be mentioned that the session as a whole can have a controlling terminal, but the processes within it are otherwise distinct.

See:


Notes:

  • Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

  • Then again, "process" has other less technical meanings too.

Are the terms session and process totally synonymous in shell-scripting or at least in Bash?

No, they're not the same at all.

A process is a running instance of a program. It has a process id (PID), a set of virtual memory, a user id, a set of open file descriptors, and a number of other things.

The Unix concept of a session is a kernel construct related to grouping processes mostly in the context of a terminal-based login.

A session is a group of processes, itself divided to one or more process groups. The following diagram from Advanced Programming in the Unix Environment shows the relations quite well:

enter image description here

It should be mentioned that the session as a whole can have a controlling terminal, but the processes within it are otherwise distinct.

See:


Notes:

  • Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

  • Then again, "process" has other less technical meanings too.

Minor edit; formatting, adding a good image for clarification, adding a link.
Source Link

Are the terms session and process totally synonymous in shell-scripting or at least in Bash?

No, they're not the same at all.

A process is a running instance of a program. It has a process id (PID), a set of virtual memory, a user id, a set of open file descriptors, and a number of other things.

The Unix concept of a session is a kernel construct related to grouping processes mostly in the context of a terminal-based login. 

A session is a group of processes, itself divided to one or more process groups. The following diagram from APUE shows the relations quite well:

enter image description here

It should be mentioned that the session as a whole can havecan have a controlling terminal, but the processes within it are otherwise distinct.

See:


Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

Notes:

Then again, "process" has other less technical meanings too.

  • Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

  • Then again, "process" has other less technical meanings too.

Are the terms session and process totally synonymous in shell-scripting or at least in Bash?

No, they're not the same at all.

A process is a running instance of a program. It has a process id (PID), a set of virtual memory, a user id, a set of open file descriptors, and a number of other things.

The Unix concept of a session is a kernel construct related to grouping processes mostly in the context of a terminal-based login. A session is a group of processes, itself divided to one or more process groups. The session as a whole can have a controlling terminal, but the processes within it are otherwise distinct.

See:


Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

Then again, "process" has other less technical meanings too.

Are the terms session and process totally synonymous in shell-scripting or at least in Bash?

No, they're not the same at all.

A process is a running instance of a program. It has a process id (PID), a set of virtual memory, a user id, a set of open file descriptors, and a number of other things.

The Unix concept of a session is a kernel construct related to grouping processes mostly in the context of a terminal-based login. 

A session is a group of processes, itself divided to one or more process groups. The following diagram from APUE shows the relations quite well:

enter image description here

It should be mentioned that the session as a whole can have a controlling terminal, but the processes within it are otherwise distinct.

See:


Notes:

  • Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

  • Then again, "process" has other less technical meanings too.

Source Link
ilkkachu
  • 148.2k
  • 16
  • 268
  • 441

Are the terms session and process totally synonymous in shell-scripting or at least in Bash?

No, they're not the same at all.

A process is a running instance of a program. It has a process id (PID), a set of virtual memory, a user id, a set of open file descriptors, and a number of other things.

The Unix concept of a session is a kernel construct related to grouping processes mostly in the context of a terminal-based login. A session is a group of processes, itself divided to one or more process groups. The session as a whole can have a controlling terminal, but the processes within it are otherwise distinct.

See:


Of course, "session" can have other meanings not related to terminals. The concept of a login session can make sense in a GUI system or e.g. a Web-based program too, even if they didn't use terminals and process groups in the same way as a terminal-based session.

Then again, "process" has other less technical meanings too.