CS 279 - Week 14 Lecture 2 - 11-29-12
* you will get "mail" messages from the cron daemon
if there's a problem with you command in a crontab
entry;
you might get a message at some point saying
you have mail in something like:
/var/spool/mail/<username>
* you CAN emacs/vi/nano this to see these messages;
* you CAN delete them from within those editors;
(it LOOKS like you can't delete the FILE...)
* after class, Mr. Butler kindly pointed out that
the mail command is the better way to view and process
these messages -- it's command-line but reasonably friendly:
within the mail program,
h - lists your mail
p - reads the top message
d - deletes the top message
(there are numerous other commands, too)
...and you can leave the mail program using ctrl-d or q...
* uptime
* note that the load average is (approximately) the
average number of processes running or waiting
for the CPU... but that's not exact!
* this white paper by someone named Neil Gunther
digs into this in some detail, if you are interested;
http://www.teamquest.com/resources/gunther/display/5/
and this article is supposed to be more up-to-date:
http://www.linuxjournal.com/article/9001
...it does seem to be a rough-but-useful indicator,
and it does seem to be related to the run-queue length,
the average number of processes in the run-queue;
* I like how it was put in an answer at:
http://superuser.com/questions/23498/what-does-load-average-mean-in-unix-linux
* "Load average is a gauge of how many processes are,
on average, concurrently demanding CPU attention."
...I hope that's reasonably accurate.
* top
* displays and updates sorted information about
processes
* at, batch
* pp. 243-246 of the course text
* at lets you request the running of something
at a particular time -- a ONE-SHOT, not
repeated like crontab
* batch asks the system to run it when the
system chooses;
* at <time-indicator>
then type each command
and end with ctrl-d
at -l
...then lists the at-jobs
atrm <job-num>
...can be used to remove the job with number
<job-num>
* batch is similar, but you don't have to give
a time when to run, you can let the system choose
batch
<cmd>
<cmd>
^d to finish
* environment variable IFS - input field separator
* see text, p. 372 to read about it,
and p. 279 has an example using it
* this affects what is used to separate "things"
for the read command, and certain expansions
as command substitutions,
but NOT how direct shell command input is
parsed;
* its default is a string containing a space,
a tab, and a newline character;
* according to the course text, it's rarely
useful to change IFS except to modify the
behavior of a read command
* some additional read notes:
* read can take multiple variable names;
it tries to set each based on the value of
the input line
too little input for the number of variables?
the trailing variables will just be empty
too much input for the number of variables?
the last variable gets the rest of the input,
input field separator characters and all;