home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / unix / volume03 / swho < prev    next >
Encoding:
Text File  |  1988-09-11  |  16.2 KB  |  664 lines

  1. Subject: swho: screen based who (curses, continuous update)
  2. From: Paul Pomes <talcott!seismo!uiucdcs!uiucuxc.CSO.UIUC.EDU!paul>
  3. Newsgroups: mod.sources
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 3, Issue 74
  7. Submitted by: Paul Pomes (Univ of Illinois) <seismo!uiucdcs!uiucuxc!paul>
  8.  
  9.  
  10. #!/bin/sh
  11. # shar:    Shell Archiver
  12. #    Run the following text with /bin/sh to create:
  13. #    README
  14. #    Makefile
  15. #    swho.c
  16. #    swho.1
  17. sed 's/^X//' << 'SHAR_EOF' > README
  18. XSwho provides an enhanced who command using curses.  Besides displaying
  19. Xusercodes, ttys, and login times, swho also provides idle time indicators
  20. Xand tty types (dialup, switch, localnet, etc).  The program is easy on
  21. Xsystem resources as it stats the utmp file on every wakeup and reads it
  22. Xonly if it has changed.  The screen is cleared every ten minutes and
  23. Xre-drawn to eliminate screen confusion from messages, announcements, etc.
  24. XThis "feature" can be eliminated by undefining REDRAW.
  25. X
  26. X         Paul Pomes
  27. X
  28. XUUCP:     {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!paul
  29. XARPANET: paul%uiucuxc@a.cs.uiuc.edu     CSNET:     paul%uiucuxc@uiuc.csnet
  30. XICBM:     40 07 N / 88 13 W
  31. XUS Mail: Univ of Illinois, CSO, 1304 W Springfield Ave, Urbana, IL  61801
  32. SHAR_EOF
  33. sed 's/^X//' << 'SHAR_EOF' > Makefile
  34. X# Makefile for swho, a display utility for showing active users and ttys.
  35. X#
  36. X# Written by Paul Pomes, University of Illinois, Computing Services Office
  37. X# Copyright 1985 by Paul Pomes and University of Illinois Board of Trustees
  38. X#
  39. X# UUCP:        {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!paul
  40. X# ARPANET:    paul%uiucuxc@uiuc.arpa
  41. X# CSNET:    paul%uiucuxc@uiuc.csnet
  42. X# US Mail:    Univ of Illinois, CSO, 1304 W Springfield Ave, Urbana, IL  61801
  43. X#
  44. X# $Header$
  45. X
  46. XCFLAGS=  -O
  47. XLDFLAGS=
  48. XLIBS   = -lcurses -ltermlib
  49. XDESTBIN= /usr/local/bin
  50. XDESTLIB= /usr/local/lib
  51. XMAN    = l
  52. X
  53. X# make depend doesn't work with single file names as grep doesn't prepend
  54. X# the "file.c: " string in front of the match.  Quick and dirty kludge is
  55. X# to put the filename twice on the SRCS line.
  56. X
  57. XSRCS   = swho.c
  58. XOBJS   = swho.o
  59. X
  60. X.DEFAULT:
  61. X    co $<
  62. X
  63. Xall:    swho
  64. X
  65. X#
  66. X# RCS stuff
  67. X#
  68. Xci:        $(SRCS)
  69. X        -ci $?
  70. X        @touch ci
  71. X
  72. Xcoall:
  73. X        co -l $(SRCS)
  74. X
  75. Xupdate:
  76. X        ci -sDist -u -f$(VERS) $(SRCS)
  77. X        @touch ci
  78. X
  79. Xswho:    ${OBJS}
  80. X    cc -o swho ${LDFLAGS} ${OBJS} ${LIBS}
  81. X
  82. Xinstall:    swho
  83. X    install -s swho ${DESTBIN}
  84. X    cp swho.1 /usr/man/man${MAN}/swho.${MAN}
  85. X
  86. Xclean:
  87. X    rm -f swho *.o core a.out make.log lint.out
  88. X
  89. Xclobber:
  90. X    make clean
  91. X    rm -f ${SRCS}
  92. X
  93. Xlint:    ${SRCS}
  94. X    lint -habx ${SRCS}
  95. X
  96. Xcompress:
  97. X    make clean
  98. X    find . -size +2 \( -name \*.c -o -name \*.f -o -name \*.h \
  99. X        -o -name \*.l -o -name \*,v \) -exec compress {} \;
  100. X
  101. Xuncompress:
  102. X    uncompressdir .
  103. X
  104. Xdepend:
  105. X    grep '^#include' ${SRCS} \
  106. X        | sed -e '/"/s/:[^"]*"\([^"]*\)".*/: \1/' \
  107. X              -e '/</s/:[^<]*<\([^>]*\)>.*/: \/usr\/include\/\1/' \
  108. X        | sed 's/\.c/.o/' >makedep
  109. X    echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
  110. X    echo '$$r makedep' >>eddep
  111. X    echo 'w' >>eddep
  112. X    cp Makefile Makefile.bak
  113. X    ed - Makefile < eddep
  114. X    rm eddep makedep
  115. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  116. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  117. X    echo '# see make depend above' >> Makefile
  118. X
  119. X# DO NOT DELETE THIS LINE -- make depend uses it
  120. X
  121. Xswho.o: /usr/include/stdio.h
  122. Xswho.o: /usr/include/utmp.h
  123. Xswho.o: /usr/include/strings.h
  124. Xswho.o: /usr/include/sys/time.h
  125. Xswho.o: /usr/include/signal.h
  126. Xswho.o: /usr/include/curses.h
  127. Xswho.o: /usr/include/sys/types.h
  128. Xswho.o: /usr/include/sys/stat.h
  129. X# DEPENDENCIES MUST END AT END OF FILE
  130. X# IF YOU PUT STUFF HERE IT WILL GO AWAY
  131. X# see make depend above
  132. SHAR_EOF
  133. sed 's/^X//' << 'SHAR_EOF' > swho.c
  134. X/*
  135. X * swho -- display users, ttys, and login times using curses
  136. X *
  137. X * usage: swho [-v]
  138. X *
  139. X * -v    Disable use of standout mode (usually reverse video)
  140. X *
  141. X * Written by Paul Pomes, University of Illinois, Computing Services Office
  142. X * Copyright (C) 1985 by Paul Pomes and the University of Illinois Board
  143. X * of Trustees
  144. X *
  145. X * This program is distributed in the hope that it will be useful,
  146. X * but without any warranty.  No author or distributor accepts
  147. X * responsibility to anyone for the consequences of using it or for
  148. X * whether it serves any particular purpose or works at all, unless
  149. X * s/he says so in writing.
  150. X *
  151. X * Everyone is granted permission to copy, modify and redistribute
  152. X * this program under the following conditions:
  153. X *
  154. X *    Permission is granted to anyone to make or distribute copies
  155. X *    of program source code, either as received or modified, in any
  156. X *    medium, provided that all copyright notices, permission and
  157. X *    nonwarranty notices are preserved, and that the distributor
  158. X *    grants the recipient permission for further redistribution as
  159. X *    permitted by this document, and gives him and points out to
  160. X *    him an exact copy of this document to inform him of his rights.
  161. X *
  162. X *    Permission is granted to distribute this program in compiled
  163. X *    or executable form under the same conditions applying for
  164. X *    source code, provided that either
  165. X *    A. it is accompanied by the corresponding machine-readable
  166. X *       source code, or
  167. X *    B. it is accompanied by a written offer, with no time limit,
  168. X *       to give anyone a machine-readable copy of the corresponding
  169. X *       source code in return for reimbursement of the cost of
  170. X *       distribution.  This written offer must permit verbatim
  171. X *       duplication by anyone.
  172. X *    C. it is distributed by someone who received only the
  173. X *       executable form, and is accompanied by a copy of the
  174. X *       written offer of source code which he received along with it.
  175. X *
  176. X * In other words, you are welcome to use, share and improve this
  177. X * program.  You are forbidden to forbid anyone else to use, share
  178. X * and improve what you give them.   Help stamp out software-hoarding!
  179. X *
  180. X * UUCP:    {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!paul
  181. X * ARPANET:    paul@uiucuxc.cso.uiuc.edu
  182. X * CSNET:    paul%uiucuxc@uiuc.csnet
  183. X * ICBMS:    88 13 N / 40 07 W
  184. X * US Mail:    Univ of Illinois, CSO, 1304 W Springfield Ave, Urbana, IL  61801
  185. X *
  186. X * $Log:    swho.c,v $
  187. X * Revision 1.5  86/01/01  13:17:42  paul
  188. X * Made screen re-draw a #ifdef REDRAW option.
  189. X * 
  190. X * Revision 1.4  85/12/09  17:08:02  paul
  191. X * Added -v switch and test for termcap entry sg to disable standout mode.
  192. X * sg entry indicates standout mode needs a space before and after.  Not
  193. X * so good for a program that uses every one.
  194. X * 
  195. X * Revision 1.3  85/11/15  15:56:10  paul
  196. X * Added feature to clear and re-draw the screen every ten minutes.
  197. X * 
  198. X * Revision 1.2  85/10/30  13:18:17  paul
  199. X * Added code to denote ttys with no shell as "  ----  " in the name
  200. X * field.   -pbp
  201. X * 
  202. X * Revision 1.1  85/10/24  17:37:22  paul
  203. X * Initial revision
  204. X * 
  205. X */
  206. X
  207. X#ifndef lint
  208. Xstatic char    RcsId[] = "$Header: swho.c,v 1.5 86/01/01 13:17:42 paul Exp $";
  209. X#endif
  210. X
  211. X#include    <stdio.h>
  212. X#include    <utmp.h>
  213. X
  214. X#ifdef    SYS5
  215. X#include    <string.h>
  216. X#define        index        strchr
  217. X#else
  218. X#include    <strings.h>
  219. X#endif    SYS5
  220. X
  221. X#include    <sys/time.h>
  222. X#include    <signal.h>
  223. X#include    <curses.h>
  224. X#include    <sys/types.h>
  225. X#include    <sys/stat.h>
  226. X
  227. X#define        equal(s1, s2)    (strcmp(s1, s2) == 0)
  228. X
  229. X/* utmp sizes */
  230. X#define        NMAX        sizeof(utmp.ut_name)
  231. X#define        LMAX        sizeof(utmp.ut_line)
  232. X
  233. X/* width of 1 display column */
  234. X#define        COL_WIDTH    20
  235. X
  236. X/* update interval in seconds */
  237. X#define        INTERVAL    10
  238. X
  239. X/* count of how many INTERVALs before completely re-drawing the screen.
  240. X * comment this out to disable screen re-draws.
  241. X */
  242. X#define        REDRAW        60
  243. X
  244. X/* x/60 rounded */
  245. X#define        DIV60(t)    ((t+30)/60)
  246. X
  247. X/* number of COL_WIDTH columns on screen */
  248. Xint        ncols;
  249. X
  250. X/* special terminal types and their symbols */
  251. Xstruct special {
  252. X    char    *name;
  253. X    char    symbol;
  254. X} special[] = {
  255. X    "dialup",    'D',
  256. X    "lnet",        'L',
  257. X    "telenet",    'T',
  258. X    "wats",        'W',
  259. X    "switch",    'S',
  260. X    NULL,        '\0'
  261. X};
  262. X
  263. X/* set if terminal inserts blanks when standout mode is used */
  264. Xint        sg;
  265. X
  266. X/* current time for idle calculations and display */
  267. Xtime_t        clock;
  268. X
  269. X/* one line of utmp information */
  270. Xstruct utmp    utmp;
  271. X
  272. X/* copy of argv[0] for error messages */
  273. Xchar        *self;
  274. X
  275. X/* standout mode disabled if set */
  276. Xint        video_flag = 0;
  277. X
  278. X/* debug messages printed if set */
  279. Xint        debug_flag = 0;
  280. X
  281. X/* interrupt handler */
  282. Xint        quit();
  283. X
  284. Xmain(argc, argv)
  285. Xint    argc;
  286. Xchar    **argv;
  287. X{
  288. X    /* a useful counter */
  289. X    int        i;
  290. X
  291. X    /* line and column manipulation */
  292. X    int        line, col;
  293. X
  294. X#ifdef    REDRAW
  295. X    /* re-draw screen when equal to REDRAW */
  296. X    int        redo_timer = 0;
  297. X#endif    REDRAW
  298. X
  299. X    /* number of minutes user is idle */
  300. X    time_t        idle;
  301. X
  302. X    /* copy of utmp.ut_line */
  303. X    char        tty[LMAX+1];
  304. X
  305. X    /* copy of utmp.ut_name */
  306. X    char        name[NMAX+1];
  307. X
  308. X    /* stat /etc/utmp every INTERVAL seconds; read only when changed */
  309. X    struct stat    stb;
  310. X    time_t        *mtime = &stb.st_mtime;
  311. X    time_t        lasttime;
  312. X
  313. X    /* stream descriptor for /etc/ttys file */
  314. X    register FILE    *tfd;
  315. X
  316. X    /* set to '1' if tty line has a shell */
  317. X    int        ttyon;
  318. X
  319. X    /* stream descriptor for utmp file */
  320. X    register FILE    *ufd;
  321. X
  322. X    /* pointer to time struct */
  323. X    struct tm    *tm;
  324. X
  325. X    /* library routines */
  326. X    char        *malloc();
  327. X
  328. X    /*
  329. X     * squirrel a copy of *argv[0] away for use in error messages
  330. X     */
  331. X    self = malloc((unsigned) (strlen(*argv) + 1));
  332. X    (void) strcpy(self, *argv);
  333. X
  334. X    /* parse arguments */
  335. X    i = 1;
  336. X    while (i < argc && *argv[i] == '-') {
  337. X        if (equal(argv[i]+1, "d")) {
  338. X            /* d - set debug level */
  339. X            debug_flag++;
  340. X            i++;
  341. X            fprintf(stderr, "%s: debug option enabled\n", self);
  342. X        }
  343. X        if (equal(argv[i]+1, "v")) {
  344. X            /* v - disable use of standout mode */
  345. X            video_flag++;
  346. X            i++;
  347. X        }
  348. X        else {
  349. X            /* command line errors */
  350. X            fprintf(stderr, "%s: %s - bad flag\n", self, argv[i]+1);
  351. X            fprintf(stderr, "Usage: %s [-v]\n", self);
  352. X            exit(1);
  353. X        }
  354. X    }
  355. X    if ((tfd = fopen("/etc/ttys", "r")) == NULL) {
  356. X        fprintf(stderr, "%s: ", self);
  357. X        perror("/etc/ttys");
  358. X        exit(1);
  359. X    }
  360. X    if ((ufd = fopen("/etc/utmp", "r")) == NULL) {
  361. X        fprintf(stderr, "%s: ", self);
  362. X        perror("/etc/utmp");
  363. X        exit(1);
  364. X    }
  365. X    (void) signal(SIGINT, quit);
  366. X    (void) signal(SIGHUP, quit);
  367. X    so_chk();
  368. X    initscr();
  369. X    ncols = (COLS / COL_WIDTH) - 1;
  370. X    noecho();
  371. X    ttylist();
  372. X    *mtime = (time_t) 0;
  373. X    while (1) {
  374. X#ifdef    REDRAW
  375. X        if (redo_timer++ == REDRAW) {
  376. X            redo_timer = 0;
  377. X            *mtime = (time_t) 0;
  378. X            ttylist();
  379. X        }
  380. X#endif    REDRAW
  381. X        (void) time(&clock);
  382. X        tm = localtime(&clock);
  383. X        if (! video_flag)
  384. X            standout();
  385. X        mvprintw(0, 0, "%.19s", asctime(tm));
  386. X        if (! video_flag)
  387. X            standend();
  388. X        lasttime = *mtime;
  389. X        (void) fstat(fileno(ufd), &stb);
  390. X        if (*mtime > lasttime) {
  391. X            (void) fread((char *) &utmp, sizeof(utmp), 1, ufd);
  392. X            ttyon = fgetc(tfd);
  393. X            for (line = 1, col = 0; ;) {
  394. X                if (fread((char *) &utmp, sizeof(utmp), 1, ufd) != 1)
  395. X                    break;
  396. X                if (line == LINES) {
  397. X                    if (col == ncols)
  398. X                        break;
  399. X                    else {
  400. X                        line = 0;
  401. X                        col++;
  402. X                    }
  403. X                }
  404. X                if (ttyon == '0' && utmp.ut_name[0] == '\0')
  405. X                    mvprintw(line, col*20, "  ----  ");
  406. X                else if (utmp.ut_name[0] == '\0') {
  407. X                    mvprintw(line, col*20, "        ");
  408. X                    mvprintw(line, col*20+13, "     ");
  409. X                    if (! sg && ! video_flag)
  410. X                        standout();
  411. X                    mvprintw(line, col*20+8, " ");
  412. X                    if (! sg && ! video_flag)
  413. X                        standend();
  414. X                }
  415. X                else {
  416. X                    tm = localtime((time_t *) &utmp.ut_time);
  417. X
  418. X                    /* utmp strings may not have end null */
  419. X                    (void) strncpy(tty, utmp.ut_line, LMAX);
  420. X                    (void) strncpy(name, utmp.ut_name, NMAX);
  421. X                    mvprintw(line, col*20, "%8s", name);
  422. X                    mvprintw(line, col*20+13, "%2d:%02d", tm->tm_hour, tm->tm_min);
  423. X                    idle = findidle();
  424. X                    if (! sg && ! video_flag)
  425. X                        standout();
  426. X                    if (idle > (time_t) 60)
  427. X                        mvprintw(line, col*20+8, "+");
  428. X                    else if (idle > (time_t) 30)
  429. X                        mvprintw(line, col*20+8, "-");
  430. X                    else
  431. X                        mvprintw(line, col*20+8, " ");
  432. X                    if (! sg && ! video_flag)
  433. X                        standend();
  434. X                }
  435. X                /* advance the pointer in /etc/ttys */
  436. X                while ((ttyon = fgetc(tfd)) != EOF && ttyon != '\n')
  437. X                    ;
  438. X                if (ttyon == EOF || (ttyon = fgetc(tfd)) == EOF)
  439. X                    break;
  440. X                line++;
  441. X            }
  442. X            rewind(tfd);
  443. X            rewind(ufd);
  444. X        }
  445. X        refresh();
  446. X        sleep(INTERVAL);
  447. X    }
  448. X}
  449. X
  450. X/*
  451. X * quit -- cleanup after interrupt
  452. X *
  453. X *    parameters:
  454. X *        none
  455. X *    returns:
  456. X *        none
  457. X *    side effects:
  458. X *        none
  459. X *    deficiencies:
  460. X */
  461. Xquit()
  462. X{
  463. X    (void) signal(SIGINT, SIG_IGN);
  464. X    clear();
  465. X    refresh();
  466. X    endwin();
  467. X    exit(0);
  468. X}
  469. X
  470. X/*
  471. X * so_chk -- check whether terminal inserts blanks with standout mode
  472. X *
  473. X *    parameters:
  474. X *        none
  475. X *    returns:
  476. X *        none
  477. X *    side effects:
  478. X *        sets global variable sg
  479. X *    deficiencies:
  480. X */
  481. Xso_chk()
  482. X{
  483. X    char    tbuf[1024];
  484. X    int    ret_value;
  485. X
  486. X    char    *getenv();
  487. X
  488. X    if ((ret_value = tgetent(tbuf, getenv("TERM"))) != 1) {
  489. X        if (ret_value == 0)    /* no entry */
  490. X            sg = 0;
  491. X        else {
  492. X            fprintf(stderr, "%s: so_chk: can't open /etc/termcap\n", self);
  493. X            exit(1);
  494. X        }
  495. X        return;
  496. X    }
  497. X    if ((sg = tgetnum("sg")) == -1)
  498. X        sg = 0;
  499. X    return;
  500. X}
  501. X
  502. X/*
  503. X * ttylist -- display the ttys
  504. X *
  505. X *    parameters:
  506. X *        none
  507. X *    returns:
  508. X *        none
  509. X *    side effects:
  510. X *        updates the display
  511. X *    deficiencies:
  512. X */
  513. Xttylist()
  514. X{
  515. X
  516. X    register FILE    *fd0, *fd1;
  517. X    register struct special *ps;
  518. X    char        entry[25];
  519. X    register char    *pe;
  520. X    register    c;
  521. X    int        line, col;
  522. X
  523. X    /* open files ttys and ttytype.  die gracefully otherwise */
  524. X    if ((fd0 = fopen("/etc/ttys", "r")) == NULL) {
  525. X        fprintf(stderr, "%s: ttylist: ", self);
  526. X        perror("/etc/ttys");
  527. X        exit(1);
  528. X    }
  529. X    if ((fd1 = fopen("/etc/ttytype", "r")) == NULL) {
  530. X        fprintf(stderr, "%s: ttylist: ", self);
  531. X        perror("/etc/ttytype");
  532. X        exit(1);
  533. X    }
  534. X
  535. X    clear();
  536. X    /* first line is the console and is a special case */
  537. X    pe = entry;
  538. X    while ((c = getc(fd0)) != '\n')
  539. X        *pe++ = c;
  540. X    *pe = '\0';
  541. X    pe = entry;
  542. X    mvprintw(1, 9, "%.3s", pe+2);
  543. X
  544. X    /* first line of ttytype we don't care about */
  545. X    while ((c = getc(fd1)) != '\n')
  546. X        ;
  547. X
  548. X    /* now continue with the rest of the files */
  549. X    for (col = 0, line = 2; ; ) {
  550. X        if (line == LINES) {
  551. X            if (col == ncols)
  552. X                break;
  553. X            else {
  554. X                line = 0;
  555. X                col++;
  556. X            }
  557. X        }
  558. X        while ((c = getc(fd0)) != '\n' && c != EOF)
  559. X            *pe++ = c;
  560. X        if (c == EOF)
  561. X            break;
  562. X        *pe = '\0';
  563. X        pe = entry;
  564. X        mvprintw(line, col*20+10, "%2s", pe + (strlen(pe)-2));
  565. X
  566. X        /* read the tty type and mark the special ones */
  567. X        while ((c = getc(fd1)) != '\n' && c != EOF)
  568. X            *pe++ = c;
  569. X        if (c == EOF)
  570. X            break;
  571. X        *pe = '\0';
  572. X        pe = entry;
  573. X        if (index(pe, '\t'))
  574. X            *(index(pe, '\t')) = '\0';
  575. X        else if (index(pe, ' '))
  576. X            *(index(pe, ' ')) = '\0';
  577. X        if (! sg && ! video_flag)
  578. X            standout();
  579. X        mvprintw(line, col*20+8, "  ");
  580. X        for (ps = special; ps->name != NULL; ps++)
  581. X            if (equal(ps->name, pe))
  582. X                mvprintw(line, col*20+8, " %c", ps->symbol);
  583. X        if (! sg && ! video_flag)
  584. X            standend();
  585. X        line++;
  586. X    }
  587. X    (void) fclose(fd0);
  588. X    (void) fclose(fd1);
  589. X
  590. X    /* clean up and go back */
  591. X    refresh();
  592. X}
  593. X
  594. X/*
  595. X * findidle -- find & return number of minutes current tty has been idle
  596. X *
  597. X *    parameters:
  598. X *        none
  599. X *    returns:
  600. X *        idle time in (time_t) minutes
  601. X *    side effects:
  602. X *        none
  603. X *    deficiencies:
  604. X *        idle time is a slippery idea, this routine checks only the
  605. X *        access timestamp on the utmp.ut_line tty.
  606. X */
  607. Xtime_t
  608. Xfindidle()
  609. X{
  610. X    struct stat stbuf;
  611. X    time_t lastaction, diff;
  612. X    char ttyname[20];
  613. X
  614. X    (void) strcpy(ttyname, "/dev/");
  615. X    (void) strcatn(ttyname, utmp.ut_line, LMAX);
  616. X    (void) stat(ttyname, &stbuf);
  617. X    lastaction = stbuf.st_atime;
  618. X    diff = clock - lastaction;
  619. X    diff = DIV60(diff);
  620. X    if (diff < 0)
  621. X        diff = 0;
  622. X    return(diff);
  623. X}
  624. SHAR_EOF
  625. sed 's/^X//' << 'SHAR_EOF' > swho.1
  626. X.TH SWHO 1 "UofI CSO"
  627. X.SH NAME
  628. Xswho \- screen based who
  629. X.SH SYNOPSIS
  630. X.B swho
  631. X[
  632. X.B \-v
  633. X]
  634. X.SH DESCRIPTION
  635. X.I Swho
  636. Xis a screen based utility that displays
  637. X.IR who (1)
  638. Xinformation using the
  639. X.IR curses (3)
  640. Xpackage.
  641. XSpecifying the
  642. X.B \-v
  643. Xflag inhibits the use of standout mode (usually reverse video).
  644. X.PP
  645. XEach column displays, in order, the user name, an idle time character,
  646. Xa tty type character, the last two letters of the tty name, and the
  647. Xlogin time.
  648. X.PP
  649. XIf the tty line is turned off in /etc/ttys, a "  \-\-\-\-  " is printed
  650. Xin the user name field.
  651. X.PP
  652. XThe idle time character is a '\-' for idle times greater than 30 minutes
  653. Xbut less than an hour, and a '+' for idle times over an hour.
  654. X.PP
  655. XThe tty type character indicates a general class of tty: D for dialup,
  656. XS for Gandalf Switch, L for LocalNet, T for Telenet, and W for WATS.
  657. X.SH FILES
  658. X/etc/utmp, /etc/ttys, /etc/ttytype
  659. X.SH "SEE ALSO"
  660. Xwho(1), w(1)
  661. SHAR_EOF
  662. exit 0
  663.  
  664.