home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
ddjmag
/
ddj8706.arc
/
BBS.L10
< prev
next >
Wrap
Text File
|
1987-05-05
|
1KB
|
59 lines
Listing Ten
usage
# print headings to report file
1 echo "User Date Login Logout" >usage.temp
2 echo "---------------------------------------------" >>usage.temp
3 echo " " >>usage.temp
# get a log in record from /etc/wtmp for remote users on device ph1
4 who /etc/wtmp | grep ph1 >temp1
# get the user name
5 cut -f1 -d" " temp1 >temp2
# get the log in date and time
6 cut -c25-36 temp1 >temp3
# get log out record from /etc/wtmp and extract the log out time
7 who -d /etc/wtmp | grep ph1 | grep -v LOGIN | grep -v rc | cut -c32-36 >temp4
# paste together for the report
8 paste temp2 temp3 temp4 >>usage.temp
# print the report
9 pr usage.temp >usage.summary
# remove temporary files
10 rm temp1
11 rm temp2
12 rm temp3
13 rm temp4
14 rm usage.temp
# format the BBS command use log for output and purge the log file
15 pr /u/bbs/log.file >log.summary
16 > /u/bbs/log.file
# clean out /etc/wtmp
17 > /etc/wtmp
# send both reports to the printer
18 lp usage.summary
19 lp log.summary