#-h- usersym 112 asc 24-apr-81 17:55:33 [002,100] # symbol definitions used by: users # should be placed on a file named usersym # define(RIGHT_MARGIN,80) #-h- users.r 1036 asc 24-apr-81 17:55:35 [002,100] #-h- main 974 asc 24-apr-81 17:53:52 [002,100] include usersym DRIVER(users) character buf(MAXLINE), file(FILENAMESIZE), obuf(MAXLINE) integer getlin, open, length, isatty, getarg, equal integer nxtcol, packit, int, i call query("usage: users [-1].") packit = isatty(STDOUT) if (getarg(1, file, FILENAMESIZE) != EOF) if (file(1) == MINUS & file(2) == DIG1) packit = NO else call badarg(file) call adrfil(file) if (packit == YES) call inpack(nxtcol, RIGHT_MARGIN, obuf, STDOUT) int = open(file, READ) if (int != ERR) { while (getlin(buf, int) != EOF) { for (i=1; buf(i)!=BLANK & buf(i)!=TAB & buf(i) != ATSIGN; i=i+1) file(i) = buf(i) file(i) = EOS if (packit == YES) call dopack(file, nxtcol, RIGHT_MARGIN, obuf, STDOUT) else { call putlin(file, STDOUT) call putch(NEWLINE, STDOUT) } } if (packit == YES) call flpack(nxtcol, RIGHT_MARGIN, obuf, STDOUT) call close(int) } else call remark('Cannot open user file!') DRETURN end #-h- users.rof 1084 asc 11-may-81 12:22:16 [002,100] .in 5 .rm 75 .pl 60 .he 'USERS'8/25/80'USERS' .fo //-#-/ .bp 1 NAME .in +3 users - list valid mail users .ti -3 SYNOPSIS users [-1] .ti -3 DESCRIPTION users lists the valid user name to which mail may be sent on the standard output. If the standard output has been redirected to a file or pipeline, the names are listed one per line. If the standard output is to a terminal, then the names are listed in five columns across the terminal, sorted alphabetically from left to right. If single-column output is desired, the -1 switch will force a single column to the terminal. The output of users may be edited and used as a mailing list file for the utility sndmsg. .ti -3 FILES users uses the file "address" in the mail directory to obtain the names of valid users of the mail system. .ti -3 SEE ALSO .nf sndmsg - utility to send mail msg - utility for reading and filing mail postmn - utility to check for the existence of mail resolve - utility to query information concering mail users .fi .ti -3 AUTHOR users was written by Joe Sventek .ti -3 BUGS/DEFICIENCIES .br