Exploring Solaris

By Paul Murphy, author of The Unix Guide to Defenestration

My first Sun machine was a Sun 160 - a 16.6Mhz McC68020 running pretty much the same Unix we had on the Vax - but there's always something new to learn in each new release or version of the OS.

It's a good idea, therefore, to browse the catalog after installing something new, like Solaris 9, and running catman to get your OS knowledge base set up. Take a look, for example, at the output from something like:
% man -k mail
% man -k files
and you'll likely discover a few things you didn't know about before - possibly including something new like the '-p" option to nohup.

For example do you know what "from" does on Solaris? I didn't. Turns out to be a better:
% sed -n '/From:/p' /var/mail/your_user_name

Hardly a big deal but perhaps useful if your file is getting big and you really want to empty it but not at the cost of having to extract and store all those easily clickable return addresses. Something like:
% cat awk.ml
END {for (i in A)
print A[i];
% from | awk -f awk.ml | sort | uniq | mail your_user_name

will let you delete all but the last message while keeping all those return addresses.

Okay, you may actually want to do this in perl and just keep the last message from each correspondent, but I wanted to show off the associative array and push the message that exploring the system can pay off in unexpected ways.