|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I am trying to implement background process(bg command) in my unix shell. Could anybody please tell me how I can proceed to implement it in my shell? Thanks. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
2007-10-29, 18:34(-00), Payel:
[...] > I am trying to implement background process(bg command) in my unix > shell. Could anybody please tell me how I can proceed to implement it > in my shell? [...] bg only sends a SIGCONT to the process group of the stopped process. It's upon the <Ctrl-Z> that you need to do something: set the terminal's foreground process group (tcsetpgrp(3)) back to the shell. -- Stéphane |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
2007-10-29, 18:49(+00), Stephane CHAZELAS:
> 2007-10-29, 18:34(-00), Payel: > [...] >> I am trying to implement background process(bg command) in my unix >> shell. Could anybody please tell me how I can proceed to implement it >> in my shell? > [...] > > bg only sends a SIGCONT to the process group of the stopped > process. Let me rephrase that a bit more sanely: bg sends a SIGCONT to the stopped process group. When you start a job, you create a new process group with setpgid(3). If you start it in foreground (without &), you also need to make that process group the foreground process group (tcsetpgrp(3)). > It's upon the <Ctrl-Z> that you need to do something: set the > terminal's foreground process group (tcsetpgrp(3)) back to the > shell. > -- Stéphane |
|
![]() |
| Outils de la discussion | |
|
|