LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Terminology disambiguation (https://www.linuxquestions.org/questions/linux-newbie-8/terminology-disambiguation-892510/)

marcos egatz 07-19-2011 09:00 AM

Terminology disambiguation
 
Reading the man's page of bash's wait ("man 1 wait"), I've found myself with the problem of not being able to clarify the difference between the "process Id" and "job specification". So far I could have said that both terms are the same, but the man explicitly says (within the wait paragraph ): " n may be a process ID or a job specification". Could anyone give me an example of the difference between these two terms?
Regards

colucix 07-19-2011 09:17 AM

The job specification is related to job control. Suppose you launch a command in background:
Code:

$ sleep 10 &
[1] 14513

Here 1 is the job ID, whereas 14513 is the process ID. The job specification is %jobID:
Code:

$ wait %1
[1]+  Done                    sleep 10  it appears after 10 seconds


SL00b 07-19-2011 09:32 AM

The man page does give some definitions:

Quote:

The following operand shall be supported:

pid One of the following:

1. The unsigned decimal integer process ID of a command, for
which the utility is to wait for the termination.


2. A job control job ID (see the Base Definitions volume of
IEEE Std 1003.1-2001, Section 3.203, Job Control Job ID)
that identifies a background process group to be waited for.
The job control job ID notation is applicable only for invo-
cations of wait in the current shell execution environment;
see Shell Execution Environment . The exit status of wait
shall be determined by the last command in the pipeline.

Note:
The job control job ID type of pid is only available on
systems supporting the User Portability Utilities option.
So basically, it's looking for one or the other, process number or job ID. In Linux, we typically refer to that unsigned decimal process number as the pid. Since this is a POSIX man page, it's set up to be able to apply to a number of different operating systems (Linux is not 100% compliant), so the job ID probably doesn't apply to you. I'd quit worrying about it, and just understand that every time they say job ID, that means pid to you.

chrism01 07-19-2011 07:05 PM

Actually, colucix is correct and : jobid & pid are completely different entities.

Quote:

Note that this is different from the process id, which is a unique number assigned to all processes running on the system. The job id is a sequential number assigned to the processes associated with the current shell you are running. The first one you launch is 1, the second one is 2, and so forth.
http://people.ischool.berkeley.edu/~...section13.html


All times are GMT -5. The time now is 05:59 PM.