Listing 3: "controlz" template
Subject:Control-Z
Eval:
@psout = grep(/^$whoto /, `ps -axuww`);
@stopped = grep(substr($_, 38, 1) eq 'T', @psout);
$howmany = @stopped;
$suff = ($howmany == 1) ? "" : "es";
for (@stopped) {
chop($_);
$cmdlist = $cmdlist . "\t". substr($_, 50) . "\n";
}
Text:
While monitoring the system status, I noticed that you
had $howmany stopped process${suff}, (apparently)
invoked as follows:
$cmdlist
Usually stopping a process is accomplished by pressing
control-Z; this keeps the process in in memory in case
you want to return to it later. (This is different
from VMS and DOS systems, which sometimes use
control-Z to signify the end of input.)
This feature is occasionally useful, but unless you
mean to start the process up again, leaving it in
memory is a waste of system resources.
I suggest that you avoid using control-Z to exit from
a program. Although details differ from program to
program, UNIX often uses control-D to signify the end
of input, and control-C is usually the "emergency
exit" key.
Please let me know if you have any questions or
problems.
|