suspendre un processus

polopo43

Membre actif
8 Février 2001
162
1
Bonjour !
J'aimerais savoir si il est possible de suspendre pour un moment un processus et pouvoir le reprendre après.

J'ai essayé avec sleep mais comment je spécifie le processus ?

Merci de votre aide.
 
C'est le shell qui peut gérer tout ça :
CTRL-Z pour suspendre le processus en cours dans le shell
bg et fg ensuite pour le relancer en arrière ou au premier plan.

man tcsh pour savoir tout le reste. :
<font class="small">Code:</font><hr /><pre>Jobs
The shell associates a job with each pipeline. It keeps a
table of current jobs, printed by the jobs command, and
assigns them small integer numbers. When a job is started
asynchronously with `&amp;', the shell prints a line which
looks like

[1] 1234

indicating that the job which was started asynchronously
was job number 1 and had one (top-level) process, whose
process id was 1234.

If you are running a job and wish to do something else you
may hit the suspend key (usually `^Z'), which sends a STOP
signal to the current job. The shell will then normally
indicate that the job has been `Suspended' and print
another prompt. If the listjobs shell variable is set,
all jobs will be listed like the jobs builtin command; if
it is set to `long' the listing will be in long format,
like `jobs -l'. You can then manipulate the state of the
suspended job. You can put it in the ``background'' with
the bg command or run some other commands and eventually
bring the job back into the ``foreground'' with fg. (See
also the run-fg-editor editor command.) A `^Z' takes
effect immediately and is like an interrupt in that pend-
ing output and unread input are discarded when it is
typed. The wait builtin command causes the shell to wait
for all background jobs to complete.......... </pre><hr />

Bob
 
Merci bcp !
Polopo
smile.gif