| This falls close to being a homework question, but I can give you a start and let you do the rest.
This command will show the tty's and their access date and time, this is what will show you the last active tty, to grab the right user it's a simple grep.
ls -lu /dev | grep tty | grep username
You may find there are several tty's listed, as a user could be using quite a few tty's at that point, so you'll need to find a way to grep the latest out of the list.
__________________
"The search for the MOT JUSTE is not a pedantic fad but a vital necessity. Words are our precision tools. Imprecision engenders ambiguity and hours are wasted in removing verbal misunderstandings before the argument of substance can begin."
Do the things you use not respect you, the user? Then it's defective by design, so make your voice heard.
|