FG(1CSH) COMMAND REFERENCE FG(1CSH) NAME fg, bg - foreground and background jobs (csh built-in) SYNOPSIS fg [ %job... ] or %job bg [ %job... ] or %job& DESCRIPTION The command fg brings a stopped or backgrounded job into the foreground, meaning that the job becomes attached to the terminal. The command bg puts a stopped job in the background, meaning that the job becomes detached from the terminal. The syntax for job is described in the manual page jobs(1csh). If no job argument is given, the current job is used (this job is marked by a `+' in the listing given by jobs .) The syntax %job is an alternate for fg, and %job& is an alternate for bg. EXAMPLES A common way to follow a make(1) command's progress is to redirect the output to a file and use the command tail -ffile to view the output. Usually, the tostop mode of the terminal is used (see stty(1)), so that the command stops is ready. To do this, the command: tail -f make_output & is executed. When it is ready to send output to the terminal, a message like: [2] + Stopped (tty output) tail -f make_output is printed. At this point, any of the following commands can be used to bring the command into the foreground for viewing of the output: fg fg %2 fg %tail %2 %tail When the output has stopped or slowed to the point that it would be best to wait for more output to be built up, the character ^Z (control-z) can be typed to stop the command. At this point, the command can be put back into the Printed 4/6/89 1
FG(1CSH) COMMAND REFERENCE FG(1CSH) background by using one of the following commands: bg bg %2 bg %tail %2 & %tail & DIAGNOSTICS command: No such job. The job named (either implicitly or explicitly) is not a job. command: Ambiguous. There is more than one job that matches the pattern given. CAVEATS When tostop mode is set and a lot of jobs are running, it can be very confusing, since the job that was last announced as being the current job may no longer be so. Backgrounding an already backgrounded job will cause the job to be marked so that it does not become the current job again automatically. SEE ALSO @(1csh), alias(1csh), break(1csh), cd(1csh), chdir(1csh), continue(1csh), csh(1csh), dirs(1csh), echo(1csh), eval(1csh), exec(1csh), exit(1csh), glob(1csh), goto(1csh), hashstat(1csh), history(1csh), jobs(1csh), kill(1csh), limit(1csh), logout(1csh), nice(1csh), nohup(1csh), notify(1csh), onintr(1csh), popd(1csh), pushd(1csh), rehash(1csh), repeat(1csh), set(1csh), setenv(1csh), sh(1sh), shift(1csh), source(1csh), stop(1csh), suspend(1csh), time(1csh), umask(1csh), unhash(1csh), unalias(1csh), unlimit(1csh), unset(1csh), unsetenv(1csh), wait(1csh), which(1csh), and signal(3c). Printed 4/6/89 2
%%index%% na:264,150; sy:414,283; de:697,889; ex:1586,1185;3107,140; di:3247,357; ca:3604,425; se:4029,1531; %%index%%000000000132