| | |
difference btw a process and a job
Thread Solved |
•
•
Join Date: Apr 2008
Posts: 88
Reputation:
Solved Threads: 0
I'm reading up on jobs and processes in UNIX and was a little confused. A processes is just something that executes and then dies right away, like a grep command issued from the shell, right? It started, did what it was supposed too, outputs the info and then dies so a total of one process was started. In the case of grep, no jobs had a chance to get started since I type in jobs and nothing comes up.
Now, if I go into VI, enter some text and hit control-Z and then jobs, there it is. A job is a process but is a process that is suspended in the background while in the middle of doing whatever it was supposed to do.
Am I on the right track?
thx
Now, if I go into VI, enter some text and hit control-Z and then jobs, there it is. A job is a process but is a process that is suspended in the background while in the middle of doing whatever it was supposed to do.
Am I on the right track?
thx
Last edited by Trekker182; Nov 28th, 2008 at 6:55 pm.
•
•
Join Date: Apr 2008
Posts: 58
Reputation:
Solved Threads: 9
A job is a process running in the background.
E.g.
./myscript.sh &
[1] myscript.sh 96243
A job relates to a command run from a terminal. It is attached to a terminal session. A command can be run in the background if it doesn't require any user input, and you want to continue running other commands in the foreground.
For instance, on an AIX/Informix system, I usually do something like
# nohup dbexport my_database &
The nohup redirects any output to a file (nohup.out) and the ampersand (&) puts the process in background mode. This allows me to continue working while my export completes.
The "job" is any process that is running in a background mode.
Crtl-Z also stops a process and puts it in the background - which is why "jobs" displays your vi session. You can recall your job with "fg", or you can tell a stopped process to continue in the background with "bg".
E.g.
./myscript.sh &
[1] myscript.sh 96243
A job relates to a command run from a terminal. It is attached to a terminal session. A command can be run in the background if it doesn't require any user input, and you want to continue running other commands in the foreground.
For instance, on an AIX/Informix system, I usually do something like
# nohup dbexport my_database &
The nohup redirects any output to a file (nohup.out) and the ampersand (&) puts the process in background mode. This allows me to continue working while my export completes.
The "job" is any process that is running in a background mode.
Crtl-Z also stops a process and puts it in the background - which is why "jobs" displays your vi session. You can recall your job with "fg", or you can tell a stopped process to continue in the background with "bg".
Last edited by omrsafetyo; Nov 28th, 2008 at 7:53 pm.
•
•
Join Date: Apr 2008
Posts: 88
Reputation:
Solved Threads: 0
Ok thanks.
So when I do commands like grep, awk, who, commands that display immediate results, they are not referred to as jobs but as a single processes that starts and ends with you getting the bash prompt again. There isn't any opportunity for me to hit CTRL-Z to push it to the background and then type jobs and see it come up.
So when I do commands like grep, awk, who, commands that display immediate results, they are not referred to as jobs but as a single processes that starts and ends with you getting the bash prompt again. There isn't any opportunity for me to hit CTRL-Z to push it to the background and then type jobs and see it come up.
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
Hey there,
process/job - terms are sometimes misused or mixed up in regular reference to them, in everything from regular conversation to official text books.
For awk, who, etc, you can run any process/job in the background without having to hit ctrl-Z by just starting them in the background, like:
awk &
As an oversimplified example
, Mike
process/job - terms are sometimes misused or mixed up in regular reference to them, in everything from regular conversation to official text books.
For awk, who, etc, you can run any process/job in the background without having to hit ctrl-Z by just starting them in the background, like:
awk &
As an oversimplified example
, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
Actually, either way it's just a normal process. I guess the distinction to be made is that "job control" manages processes and refers to them as jobs. Every job is a process (possibly more than one). Really, the term "job" is probably what's confusing for you.
Best wishes,
Mike
Best wishes,
Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
![]() |
Similar Threads
- Certification Poll (Geeks' Lounge)
Other Threads in the Shell Scripting Forum
- Previous Thread: DOS 6.22
- Next Thread: Beginner in UNIX/Shell Script - Please help
| Thread Tools | Search this Thread |





