Category : Files from Magazines
Archive   : DDJ8706.ZIP
Filename : BBS.L9

 
Output of file : BBS.L9 contained in archive : DDJ8706.ZIP

Listing Nine

logs



# create a temporary file with a log on record for each remote user

1 who /etc/wtmp | grep ph >/u/user.log

# if an "a" was entered as an argument to the command, display the entire log files

2 if [ "$1" = a ]
3 then
4 echo
5 echo
6 echo "System Logins"
7 echo

# display all system use since /etc/wtmp was last purged

8 more /u/user.log
9 echo
10 echo "Next?"
11 read dummy
12 echo

# display all BBS use since /u/bbs/log.file was last purged

13 echo "BBS User Log"
14 echo
15 more /u/bbs/log.file
16 echo

# otherwise, show only the last ten entries in each log file

17 else
18 echo
19 echo
20 echo "Last System Logins"
21 echo
22 tail /u/user.log
23 echo
24 echo
25 echo "Last BBS Activity"
26 echo
27 tail /u/bbs/log.file
28 echo
29 fi

# remove the temporary file

29 rm /u/user.log