Guides
Using the watch variable
You mightn't have noticed, but matrix always used to tell you when anyone logged on or off. When we started off offering accounts on matrix, there weren't too many people using the machine, so we set it up that anytime you pressed <Enter> at a prompt, matrix would tell you who had logged on or off since you last pressed <Enter>. It did that by printing a line that looked something like this:
12:00pm fred logged on pts/1 from apollo.netsoc.tcd.ie
This was fine for a long time, but now that we've moved to the new machine for matrix and we regularly have more than 40 users connected on weekdays, it was getting a bit ridiculous, particularly since it told you about everyone who was logged on as soon as you connected. So we have changed the default for everyone to not tell you when people log on or off. The aim of this guide is to tell you how to turn it back on if you want, or even better to make it just tell you when people you know log on or off.
What we're going to do is to get tcsh to tell you when users that you know log on or off. You can do this by creating a file called .friends in your home directory, telling tcsh which users you know.
pico ~/.friends
(See a Pico tutorial for information on how to use pico.) In this file you can put the usernames of people who you want to know when they log on or off. The format is to put one username per line, with no blank lines at all in the file. Nothing bad will happen if you mess up the format though, it's just that your watch variable won't be set properly if you don't do it this way. For example, you could have a file that looks like this:
fred barney wilma
Now you'll just get told when these three people log on or off. Remember that you've got to log off and back on again for the changes to take effect. Now if you want to find out which of your friends are logged on at the moment, you can run the command log. This is different from w because it only tells you about your friends, whereas w tells you about everyone.
If you don't want to do this, you can change things back to the way they were before. Just run this simple command. (Make sure you type it exactly!)
echo "set watch=(1 any any)" >>~/.tcshrc
Now log off and back on again for it to take effect.
Using a .friends file will only work on matrix, not on any other machine. (We use a Perl one-liner in /etc/csh.cshrc.) If you want to get tcsh to work the same on another machine, you'll have to put a line like the following into your ~/.tcshrc.
set watch=(1 fred any barney any wilma any)
You can also do it this way on matrix if you prefer that to using a .friends file. Also have a look for information about the who variable, which controls the format of the string you get that tells you when someone has logged on or off.