home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume5 / help < prev    next >
Internet Message Format  |  1989-02-03  |  63KB

  1. Path: xanth!nic.MR.NET!hal!ncoast!allbery
  2. From: rjs@a.cs.okstate.edu (Roland Stolfa)
  3. Newsgroups: comp.sources.misc
  4. Subject: v05i054: Help system
  5. Message-ID: <4146@okstate.UUCP>
  6. Date: 16 Nov 88 03:55:22 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: rjs@a.cs.okstate.edu (Roland Stolfa)
  9. Organization: Oklahoma State Univ., Stillwater
  10. Lines: 2174
  11. Approved: allbery@ncoast.UUCP
  12.  
  13. Posting-number: Volume 5, Issue 54
  14. Submitted-by: "Roland Stolfa" <rjs@a.cs.okstate.edu>
  15. Archive-name: help
  16.  
  17. echo x - README
  18. sed '1,$s/^X//' <<\!FUNKY!STUFF! > README
  19. XHello,
  20. X
  21. XThis is the first distribution of any sort out of me.  This program,
  22. XI believe, will find genuine use on almost all machines, versions of
  23. XUN*X, and environments.  This system implements a VMS-like help facility
  24. Xfor any and all commands, procedures, etc.
  25. X
  26. XI hereby release this code into the public domain.  Please don't remove
  27. Xthe file headers that have my name in them, and don't make profit with
  28. Xthis system.  Rather, customize it to your own local uses and
  29. X
  30. X        TEACH PEOPLE UN*X WITH THIS SYSTEM!!!
  31. X
  32. XThis later goal is by FAR more important to me than some stupid copyright
  33. Xnotice that could be deleted by anyone anyway.  Also, I will not be libel
  34. Xfor any damages done to your system, period.  AS IS WHERE IS is the motto.
  35. X
  36. XThis system is NOT intended to replace "man(1)" but rather to supplement
  37. Xthe information in the manual pages to first time users.  For instance,
  38. Xhere at OSU, we use this system on the undergraduate machine to try and
  39. Xguide the freshman through the gore of printing, editors, etc. rather
  40. Xthan having a professor do it.  Also, most of the more often used
  41. Xcommands have their manual pages ripped up and stuffed into this format
  42. Xto aid the student (you must admit that "help" is a more natural thing
  43. Xto type when in need as a first time UN*X user than is "man").
  44. X
  45. XBecause we have 43 hosts here in the Computer and Information Sciences
  46. Xdepartment, all running some flavor of UN*X, a LARGE amount of time
  47. Xwas taken to make this as simple and portable as possible.  Therefore,
  48. X"curses(3)" was not used (not all systems support it in the same way
  49. Xor even have it in a few cases).  Also things like ISAM were not used
  50. X(portability problems).  This implies that this package does not have
  51. Xthe 'spiffyness' that some of you may be looking for.
  52. X
  53. XIn short, this is not going to impress the boss, code-wise.  Rather, the
  54. Xcontent of the help directorys (the actual text of the various help
  55. Xmessages) are what should be devoted a fair amount of time.  This is also
  56. Xwhere this system shines.  True flexibility is achieved by the "DIR" files
  57. Xwithin this system.  They allow you to setup acronyms for traversing the
  58. Xdirectory tree of "TEXT" files.  This allows you to have help topics like
  59. X"printing a file" or "using the printer in the basement" both point to
  60. Xthe help screen on using the "lp" command.  This file also allows SYS5
  61. Xsites to use any length 'help file' name and still map it into the small
  62. Xfile name SYS5 allows you (14 characters?).
  63. X
  64. XHidden aliases can also be used.  This allows you to also have such things
  65. Xas "lp" be a 'help topic' as in the previous paragraph.  This makes the
  66. Xsystem less painful for those who really do know UN*X, but have forgotten
  67. Xone simple flag on "_XXXX_".
  68. X
  69. XThese are the instructions to compile "help(L)":
  70. X
  71. X1.    Edit the file "help.h" and change the #define's
  72. X    for ROOTDIR, HELPFILE, and DIRFILE to be locally
  73. X    acceptable.
  74. X
  75. X2.    Edit the file "Makefile" and fix the definitions of BIN, HELPDIR,
  76. X    HELPOWN, and HELPGRP so that "make install" will work.
  77. X
  78. X3.    Type "make all".
  79. X
  80. X4.    IF the make completes, play around with it for a while
  81. X    and make sure it works...
  82. X
  83. X5.    Type "make install".  This will install a copy of our help
  84. X    files, complete with typo's & bad grammar.  Most of the
  85. X    files were typed in by various volunteers here within
  86. X    the university.  You may want to look at them as an
  87. X    example, you may want to delete them, who knows...
  88. X
  89. XI bet you think you are done...  HA!  HA!  HA!  That's a computer joke!
  90. XYou are just barely beginning.  Now comes the fun part. :-)
  91. X
  92. X6.    Type "cd <ROOTDIR>".
  93. X
  94. X7.    Start making your "./TEXT" and "./DIR" files.  The examples
  95. X    in this shell archive should prove adequate for examples.
  96. X    For a subtopic, type "mkdir <subtopic>" and then
  97. X    "cd <subtopic>" and goto step 7.
  98. X
  99. XIf you have any questions or further enhancements (or help subtrees :-),
  100. Xplease e-mail them to me.  I really would like to hear how this thing
  101. Xfairs in the big wide world...
  102. X
  103. XRoland Stolfa
  104. XComputing and Information Sciences Department
  105. XOklahoma State University
  106. X219 Math Sciences Building
  107. XStillwater OK 74078
  108. X
  109. Xrjs@a.cs.okstate.edu
  110. !FUNKY!STUFF!
  111. echo x - Makefile
  112. sed '1,$s/^X//' <<\!FUNKY!STUFF! > Makefile
  113. X#
  114. X# HELP - Ver. 1.0
  115. X#
  116. X#        by R. Stolfa
  117. X#
  118. X# Modification History
  119. X#  08/26/87    Created
  120. X#  08/31/87    Added initialize and catch functions
  121. X#  09/02/87    Added all .h dependencies
  122. X#  07/13/88    Packaged to ship out of OSU
  123. X#        Added insert to fix problem with uniqueness
  124. X#
  125. X
  126. XBIN    = /usr/local
  127. XHELPDIR    = /usr/help
  128. XCFLAGS    = -O
  129. XHELPOWN = help
  130. XHELPGRP = root
  131. X
  132. XOFILES    =\
  133. X    main.o append.o catch.o format_help.o free_list.o help.o insert.o \
  134. X    initialize.o input_choice.o pchar.o present.o scan_topics.o
  135. X
  136. Xhelp:    $(OFILES)
  137. X    cc $(CFLAGS) $(OFILES) -o help
  138. X
  139. Xall:    help manual
  140. X
  141. Xinstall:
  142. X    cp help $(BIN)
  143. X    chmod 711 $(BIN)/help
  144. X    chown $(HELPOWN) $(BIN)/help
  145. X    chgrp $(HELPGRP) $(BIN)/help
  146. X    mkdir $(HELPDIR)
  147. X    cp files $(HELPDIR)
  148. X    cd $(HELPDIR) ; shar files
  149. X    @echo "Remember to fix the ownership & permissions"
  150. X
  151. Xmanual:
  152. X    nroff -man man.form > help.man
  153. X
  154. Xclean:
  155. X    rm -f *.o help a.out core help.man Help.shar
  156. X
  157. Xshar:
  158. X    shar README Makefile *.h *.c man.form files > Help.shar
  159. X
  160. X#
  161. X# Dependencies
  162. X#
  163. X
  164. Xmain.o append.o catch.o format_help.o free_list.o help.o \
  165. Xinitialize.o input_choice.o insert.o pchar.o present.o scan_topics.o \
  166. X    : global.h
  167. X
  168. Xmain.o catch.o format_help.o free_list.o help.o \
  169. Xinput_choice.o insert.o pchar.o scan_topics.c \
  170. X    : /usr/include/stdio.h
  171. X
  172. Xinitialize.o \
  173. X    : /usr/include/signal.h
  174. X
  175. Xinput_choice.o \
  176. X    : /usr/include/ctype.h
  177. !FUNKY!STUFF!
  178. echo x - global.h
  179. sed '1,$s/^X//' <<\!FUNKY!STUFF! > global.h
  180. X/*
  181. X * Program    : help
  182. X * Module    : global.h
  183. X * Programmer    : R. Stolfa
  184. X *
  185. X * Modification History:
  186. X *   08/27/87    Created
  187. X *   07/13/88    Cleaned up for distribution
  188. X */
  189. X
  190. X#include    <stdio.h>
  191. X#include    <signal.h>
  192. X#include    <ctype.h>
  193. X#undef        toupper            /* to get the non-macro version */
  194. X
  195. X#define        TRUE        1
  196. X#define        FALSE        0
  197. X#define        UP        2
  198. X
  199. X#define        BSIZE        80
  200. X
  201. X#define        PRINT        0
  202. X#define        ACRON        1
  203. X#define        TOPIC        2
  204. X
  205. X/*
  206. X * ROOTDIR is the anchor point for the help tree.  It should be a
  207. X * publically accessable directory, with all it's submembers being
  208. X * readable and executable by all.
  209. X */
  210. X#define        ROOTDIR        "//magma/usr/help"
  211. X
  212. X/*
  213. X * HELPFILE is the basename of the file that will contain the
  214. X * text of the actual help information.  It should have
  215. X * permissions 444.
  216. X */
  217. X#define        HELPFILE    "/TEXT"
  218. X
  219. X/*
  220. X * DIRFILE is the basename of a file that contains the help
  221. X * index to file name mappings for the current level of the
  222. X * help tree.  The format of the data contained in this file
  223. X * is as follows....
  224. X *
  225. X * <basename><print_flag><help_index_string>
  226. X *
  227. X * where:
  228. X *    <basename>    relative directory name for help
  229. X *    <print_flag>    is a:
  230. X *                * for printable
  231. X *                : for acronym
  232. X *    <help_index_string>
  233. X *            text to present as a choice (or use as an
  234. X *            acronym) at any level in the help tree
  235. X */
  236. X#define        DIRFILE        "/DIR"
  237. X
  238. X/*
  239. X * LIST structure.
  240. X *
  241. X * This is the standard format of help file lists.
  242. X */
  243. Xstruct    LIST {
  244. X    char    base[BSIZE];
  245. X    char    topic[BSIZE];
  246. X    struct    LIST    *prev;
  247. X};
  248. X#define        prt_list    (_list[PRINT])
  249. X#define        acr_list    (_list[ACRON])
  250. X#define        top_list    (_list[TOPIC])
  251. X
  252. X/*------------------------------------------------------------*/
  253. X
  254. X/*
  255. X * MACROS
  256. X */
  257. X
  258. X#define    gen_path(x)    sprintf (Path, "%s%s%s", ROOTDIR, cur_path, (x))
  259. X
  260. X/*------------------------------------------------------------*/
  261. X
  262. X/*
  263. X * Variables
  264. X */
  265. X
  266. X#ifdef    MAIN
  267. X#define    extern    /* global */
  268. X#endif
  269. X
  270. Xextern    struct    LIST    *_list[3];    /* list of printable topics */
  271. Xextern    char        Path[BSIZE],    /* true path to help file */
  272. X            cur_path[BSIZE];/* curent help path */
  273. Xextern    int        lines,        /* number of lines on the screen */
  274. X            catch();    /* interrupt handler */
  275. !FUNKY!STUFF!
  276. echo x - append.c
  277. sed '1,$s/^X//' <<\!FUNKY!STUFF! > append.c
  278. X/*
  279. X * Program    : help
  280. X * Module    : append.c
  281. X * Programmer    : R. Stolfa
  282. X *
  283. X * Purpose :    To append a basename and help topic to the
  284. X *        specified list
  285. X *
  286. X * Modification History:
  287. X *   08/27/87    Created
  288. X *   08/31/87    Changed exit on default to be a call to "catch()"
  289. X *    -    Streamlined the building of nodes
  290. X */
  291. X
  292. X#include    "global.h"
  293. X
  294. Xappend (cmd, basename, subject)
  295. Xint    cmd;
  296. Xchar    *basename,
  297. X    *subject;
  298. X{
  299. X    struct    LIST    *new;
  300. X
  301. X    if ((strlen (basename) == 0) ||
  302. X        (strlen (subject) == 0) ||
  303. X        (cmd < 0) || (cmd >= 3))
  304. X        /*
  305. X         * Bad invocation of "append()"
  306. X         */
  307. X        return;
  308. X
  309. X    /*
  310. X     * Build the basic LIST structure for the new
  311. X     * entry
  312. X     */
  313. X    new = (struct LIST *)
  314. X        malloc (sizeof (struct LIST));
  315. X    strcpy (new->base, basename);
  316. X    strcpy (new->topic, subject);
  317. X
  318. X    /*
  319. X     * Append the new element onto the correct list
  320. X     */
  321. X    new->prev = _list[cmd];
  322. X    _list[cmd] = new;
  323. X}
  324. !FUNKY!STUFF!
  325. echo x - catch.c
  326. sed '1,$s/^X//' <<\!FUNKY!STUFF! > catch.c
  327. X/*
  328. X * Program    : help
  329. X * Module    : catch.c
  330. X * Programmer    : R. Stolfa
  331. X *
  332. X * Purpose :    To handle all user signals.
  333. X *
  334. X * Modification History:
  335. X *   08/31/87    Created
  336. X */
  337. X
  338. X#include    "global.h"
  339. X
  340. Xint    catch()
  341. X{
  342. X    /*
  343. X     * Free the in memory lists to keep user memory from
  344. X     * growing.
  345. X     */
  346. X    free_list (PRINT);
  347. X    free_list (ACRON);
  348. X    free_list (TOPIC);
  349. X
  350. X    /*
  351. X     * ...Neat up the screen and exit
  352. X     */
  353. X    putchar ('\n');
  354. X    exit (0);
  355. X}
  356. !FUNKY!STUFF!
  357. echo x - format_help.c
  358. sed '1,$s/^X//' <<\!FUNKY!STUFF! > format_help.c
  359. X/*
  360. X * Program    : help
  361. X * Module    : format_help.c
  362. X * Programmer    : R. Stolfa
  363. X *
  364. X * Purpose :    To format the list of available help topics in a
  365. X *        neat and readable format
  366. X *
  367. X * Modification History:
  368. X *   08/26/87    Created
  369. X *   09/02/87    Fixed for more than one line of text (oops!),
  370. X *        streamlined.
  371. X */
  372. X
  373. X#include    "global.h"
  374. X
  375. Xformat_help ()
  376. X{
  377. X    struct    LIST    *p;        /* temporary LIST pointer */
  378. X    register    int    cur_col;
  379. X
  380. X    /*
  381. X     * Screen columns go from 0 to 79
  382. X     */
  383. X    cur_col = 0;
  384. X
  385. X    for (p = prt_list; p != NULL; p = p->prev) {
  386. X        /*
  387. X         * If the addition of the current topic to the screen
  388. X         * will cause there to be wraparound, skip to the next
  389. X         * line.
  390. X         */
  391. X        cur_col = (cur_col + 8) -
  392. X              ((cur_col + 8) % 8) +
  393. X              strlen(p->topic);
  394. X        if (cur_col > 79)  {
  395. X            cur_col = strlen(p->topic) + 8;
  396. X            pchar ('\n');
  397. X        }
  398. X        printf ("\t%s", p->topic);
  399. X    }
  400. X    pchar ('\n');
  401. X    pchar ('\n');
  402. X}
  403. !FUNKY!STUFF!
  404. echo x - free_list.c
  405. sed '1,$s/^X//' <<\!FUNKY!STUFF! > free_list.c
  406. X/*
  407. X * Program    : help
  408. X * Module    : free_list.c
  409. X * Programmer    : R. Stolfa
  410. X *
  411. X * Purpose :    To return to system memory a list of LIST structures
  412. X *
  413. X * Modification History:
  414. X *   08/27/87    Created
  415. X *   08/31/87    Changed default exit to be a call to "catch()"
  416. X */
  417. X
  418. X#include    "global.h"
  419. X
  420. Xfree_list (type)
  421. Xint    type;
  422. X{
  423. X    struct    LIST    *q;
  424. X
  425. X    /*
  426. X     * Check for valid type
  427. X     */
  428. X    if ((type < 0) || (type >= 3)) {
  429. X        printf ("free_list:  error in type parameter %d\n", type);
  430. X        catch ();
  431. X        /* NOT REACHED */
  432. X    }
  433. X
  434. X    /*
  435. X     * Clear the header
  436. X     */
  437. X    q = _list[type];
  438. X    _list[type] = NULL;
  439. X
  440. X    /*
  441. X     * Clear the list
  442. X     */
  443. X    for ( ; q != NULL; q = q->prev)
  444. X        free (q);
  445. X}
  446. !FUNKY!STUFF!
  447. echo x - help.c
  448. sed '1,$s/^X//' <<\!FUNKY!STUFF! > help.c
  449. X/*
  450. X * Program    : help
  451. X * Module    : help.c
  452. X * Programmer    : R. Stolfa
  453. X *
  454. X * Purpose :    To more the current "HELPFILE" to the screen.
  455. X *
  456. X * Modification History:
  457. X *   08/27/87    Created
  458. X *   09/02/87    Added ("Q"|"q") commands
  459. X */
  460. X
  461. X#include    "global.h"
  462. X
  463. Xhelp ()
  464. X{
  465. X    FILE    *fd;        /* help text file */
  466. X    int    c;        /* temp */
  467. X
  468. X    gen_path (HELPFILE);
  469. X
  470. X    if ((fd = fopen (Path, "r")) == NULL) {
  471. X        printf ("There is no help text on this subject\n");
  472. X        return;
  473. X    }
  474. X
  475. X    /*
  476. X     * Note what help subject we are looking at
  477. X     */
  478. X    if (strlen (cur_path) != 0) {
  479. X        present ("TOPIC: ", " ");
  480. X        pchar ('\n');
  481. X    }
  482. X
  483. X    /*
  484. X     * Reset the number of lines displayed, and output
  485. X     * the new help file text.
  486. X     */
  487. X    while ((c = getc (fd)) != EOF)
  488. X        pchar(c);
  489. X
  490. X    fclose (fd);
  491. X
  492. X    pchar ('\n');
  493. X    lines ++;
  494. X}
  495. !FUNKY!STUFF!
  496. echo x - initialize.c
  497. sed '1,$s/^X//' <<\!FUNKY!STUFF! > initialize.c
  498. X/*
  499. X * Program    : help
  500. X * Module    : initialize.c
  501. X * Programmer    : R. Stolfa
  502. X *
  503. X * Purpose :    To initialize all global data structures
  504. X *
  505. X * Modification History:
  506. X *   08/31/87    Created
  507. X */
  508. X
  509. X#include    "global.h"
  510. X
  511. Xinitialize()
  512. X{
  513. X    int    i;
  514. X
  515. X    /*
  516. X     * Catch all signals that might not free up memory....
  517. X     */
  518. X    signal (SIGINT, catch);
  519. X    signal (SIGTERM, catch);
  520. X
  521. X    Path[0] = '\0';
  522. X    cur_path[0] = '\0';
  523. X
  524. X    for (i = 0; i < 3 ; i ++)
  525. X        _list[i] = NULL;
  526. X}
  527. !FUNKY!STUFF!
  528. echo x - input_choice.c
  529. sed '1,$s/^X//' <<\!FUNKY!STUFF! > input_choice.c
  530. X/*
  531. X * Program    : help
  532. X * Module    : input_choice.c
  533. X * Programmer    : R. Stolfa
  534. X *
  535. X * Purpose :    To selectively change the current help subject
  536. X *        based on what topic the user chooses to learn
  537. X *        about next.
  538. X *
  539. X * Modification History:
  540. X *   08/26/87    Created
  541. X */
  542. X
  543. X#include    "global.h"
  544. X
  545. Xinput_choice ()
  546. X{
  547. X    int    done,            /* need to parse DIRFILE again */
  548. X        i,            /* temp */
  549. X        j,            /* temp */
  550. X        count,            /* num. of acronym topics that mached */
  551. X        topics;            /* num. of topics at this level */
  552. X    char    buff[BSIZE],        /* input buffer */
  553. X        tmp_path[BSIZE];    /* holding place for cur_path */
  554. X    struct    LIST    *p;        /* temp */
  555. X
  556. X    done = FALSE;
  557. X    do {
  558. X        present ("HELP ", " > ");
  559. X
  560. X        if (fgets (buff, BSIZE, stdin) == NULL)
  561. X            /*
  562. X             * End help on EOF
  563. X             */
  564. X            return (TRUE);
  565. X
  566. X        /*
  567. X         * Strip junk out of line
  568. X         */
  569. X        for (i = 0, j = 0; i < strlen(buff); i ++) {
  570. X            if (buff[i] == '\n')
  571. X                buff[i] = '\0';
  572. X            if (!isspace(buff[i]))
  573. X                buff[j++] = toupper(buff[i]);
  574. X        }
  575. X
  576. X        if (strlen(buff) == 0) {
  577. X            /*
  578. X             * At this point, we have a request to recurse
  579. X             * back out of the help tree by one level.
  580. X             */
  581. X            for (i = strlen (cur_path); cur_path[i] != '/'; --i)
  582. X                ;
  583. X            cur_path[i] = '\0';
  584. X            return (UP);
  585. X            /* NOT REACHED */
  586. X        }
  587. X
  588. X        /*
  589. X         * OK.  We have the topic that the user has requested.
  590. X         * Now let's try to find some reference to it
  591. X         */
  592. X        count = 0;
  593. X        topics = 0;
  594. X        free_list (TOPIC);
  595. X        for (p = acr_list; p != NULL ; p = p->prev) {
  596. X            if (strncmp (buff, p->topic, strlen(buff)) == 0) {
  597. X                insert (TOPIC, p->base, p->topic);
  598. X                count ++;
  599. X            }
  600. X            topics ++;
  601. X        }
  602. X
  603. X        if (count == 0) {
  604. X            if (strcmp (buff, "?") != 0) {
  605. X                present ("Sorry, no documentation on ", " ");
  606. X                printf ("%s\n", buff);
  607. X            }
  608. X            if (topics > 0) {
  609. X                printf ("Additional information available:\n");
  610. X                lines = 2;
  611. X                format_help();
  612. X            }
  613. X            done = FALSE;
  614. X        } else if (count == 1) {
  615. X            /*
  616. X             * We have only one help subtopic, so traverse
  617. X             * the tree down that link.
  618. X             */
  619. X            sprintf (cur_path, "%s/%s", cur_path,
  620. X                top_list->base);
  621. X            done = TRUE;
  622. X        } else {
  623. X            /*
  624. X             * We have several matches.  Therefore, page the
  625. X             * HELPFILE for each to the screen and stay where
  626. X             * we are.
  627. X             */
  628. X            lines = 0;
  629. X            strcpy (tmp_path, cur_path);
  630. X            for (p = top_list; p != NULL ; p = p->prev) {
  631. X                sprintf (cur_path, "%s/%s", tmp_path,
  632. X                    p->base);
  633. X                gen_path(HELPFILE);
  634. X                help();
  635. X                strcpy (cur_path, tmp_path);
  636. X            }
  637. X        }
  638. X
  639. X    } while (done != TRUE);
  640. X    return (FALSE);
  641. X}
  642. !FUNKY!STUFF!
  643. echo x - insert.c
  644. sed '1,$s/^X//' <<\!FUNKY!STUFF! > insert.c
  645. X/*
  646. X * Program    : help
  647. X * Module    : insert.c
  648. X * Programmer    : R. Stolfa
  649. X *
  650. X * Purpose :    To uniquely insert a basename and help topic to the
  651. X *        specified list
  652. X *
  653. X * Modification History:
  654. X *   07/13/88    Created
  655. X */
  656. X
  657. X#include    "global.h"
  658. X
  659. Xinsert (cmd, basename, subject)
  660. Xint    cmd;
  661. Xchar    *basename,
  662. X    *subject;
  663. X{
  664. X    struct    LIST    *new, *p;
  665. X
  666. X    if ((strlen (basename) == 0) ||
  667. X        (strlen (subject) == 0) ||
  668. X        (cmd < 0) || (cmd >= 3))
  669. X        /*
  670. X         * Bad invocation of "insert()"
  671. X         */
  672. X        return;
  673. X
  674. X    /*
  675. X     * Build the basic LIST structure for the new
  676. X     * entry
  677. X     */
  678. X    new = (struct LIST *)
  679. X        malloc (sizeof (struct LIST));
  680. X    strcpy (new->base, basename);
  681. X    strcpy (new->topic, subject);
  682. X
  683. X    /*
  684. X     * Prepend the new element onto the correct list
  685. X     */
  686. X    p = _list[cmd];
  687. X    new->prev = _list[cmd];
  688. X
  689. X    /*
  690. X     * Check for uniqueness
  691. X     */
  692. X    for (; p != NULL; p = p->prev) {
  693. X        if (strcmp (new->base, p->base) == 0) {
  694. X            free (new);
  695. X            return;
  696. X            /* NOT REACHED */
  697. X        }
  698. X    }
  699. X
  700. X    /*
  701. X     * If we get to here, we have a new item.  Fix the master
  702. X     * pointer & go on.
  703. X     */
  704. X    _list[cmd] = new;
  705. X}
  706. !FUNKY!STUFF!
  707. echo x - main.c
  708. sed '1,$s/^X//' <<\!FUNKY!STUFF! > main.c
  709. X/*
  710. X * Program    : help
  711. X * Module    : main.c
  712. X * Programmer    : R. Stolfa
  713. X *
  714. X * Purpose :    To support a VMS-like help facility
  715. X *
  716. X * Modification History:
  717. X *   08/26/87    Created
  718. X *   07/13/88    Fixed end-of-program detection to work correctly
  719. X */
  720. X
  721. X#define        MAIN
  722. X#include    "global.h"
  723. X
  724. Xmain (argc, argv)
  725. Xint    argc;
  726. Xchar    *argv[];
  727. X{
  728. X    int    done;
  729. X
  730. X    initialize();
  731. X    done = FALSE;
  732. X
  733. X    while (done != TRUE) {
  734. X        /*
  735. X         * Free memory to keep user memory from growing
  736. X         */
  737. X        free_list (PRINT);
  738. X        free_list (ACRON);
  739. X        free_list (TOPIC);
  740. X
  741. X        /*
  742. X         * If we are recursing out of the help tree,
  743. X         * do not print the help stuff...
  744. X         */
  745. X        lines = 0;
  746. X        if (done != UP)
  747. X            help();
  748. X        scan_topics ();
  749. X        if (done != UP)
  750. X            format_help ();
  751. X        done = input_choice ();
  752. X
  753. X        if ((done == UP) && (strcmp (Path, ROOTDIR) == 0))
  754. X            done = TRUE;
  755. X    }
  756. X    printf ("\n");
  757. X}
  758. !FUNKY!STUFF!
  759. echo x - pchar.c
  760. sed '1,$s/^X//' <<\!FUNKY!STUFF! > pchar.c
  761. X/*
  762. X * Program    : help
  763. X * Module    : pchar.c
  764. X * Programmer    : R. Stolfa
  765. X *
  766. X * Purpose :    To provide a very simple "more" like output stream for
  767. X *        looking at the text in "HELPFILE" and all the topics
  768. X *        listed in "DIRFILE".
  769. X *
  770. X * Modification History:
  771. X *   08/27/87    Created
  772. X */
  773. X
  774. X#include    "global.h"
  775. X
  776. Xpchar (c)
  777. Xint    c;
  778. X{
  779. X    char    in_buff[BSIZE];        /* input buffer */
  780. X
  781. X    /*
  782. X     * If this is the recursive call, do not
  783. X     * output anything
  784. X     */
  785. X    if (c != '\0')
  786. X        putchar (c);
  787. X
  788. X    /*
  789. X     * If this is the newline, then increment the
  790. X     * line count
  791. X     */
  792. X    if (c == '\n')
  793. X        lines ++;
  794. X
  795. X    /*
  796. X     * If this is the one to pause on, then do so
  797. X     */
  798. X    if (lines == 21) {
  799. X        printf ("Press RETURN to continue");
  800. X        (void) fgets (in_buff, BSIZE, stdin);
  801. X        lines = 0;
  802. X    }
  803. X}
  804. !FUNKY!STUFF!
  805. echo x - present.c
  806. sed '1,$s/^X//' <<\!FUNKY!STUFF! > present.c
  807. X/*
  808. X * Program    : help
  809. X * Module    : present.c
  810. X * Programmer    : R. Stolfa
  811. X *
  812. X * Purpose :    To generate a topics line without '/'s in it.
  813. X *
  814. X * Modification History:
  815. X *   08/31/87    Created
  816. X */
  817. X
  818. X#include    "global.h"
  819. X
  820. Xpresent (str1, str2)
  821. Xchar    *str1,
  822. X    *str2;
  823. X{
  824. X    int    i;        /* temp */
  825. X
  826. X    /*
  827. X     * Make a line like "/vi/join/lines" more readable as
  828. X     * " vi join lines"
  829. X     */
  830. X    printf ("%s", str1);
  831. X    for (i = 0; i < strlen (cur_path); i ++)
  832. X        if (cur_path[i] == '/')
  833. X            putchar (' ');
  834. X        else
  835. X            putchar (cur_path[i]);
  836. X    printf ("%s", str2);
  837. X}
  838. !FUNKY!STUFF!
  839. echo x - scan_topics.c
  840. sed '1,$s/^X//' <<\!FUNKY!STUFF! > scan_topics.c
  841. X/*
  842. X * Program    : help
  843. X * Module    : scan_topics.c
  844. X * Programmer    : R. Stolfa
  845. X *
  846. X * Purpose :    To scan the current directory for all "topic"
  847. X *        directories in the DIRFILE file.
  848. X *
  849. X * Modification History:
  850. X *   08/26/87    Created
  851. X *   08/31/87    Changed input routine to change spaces in the topic
  852. X *        field to be underscores.
  853. X */
  854. X
  855. X#include    "global.h"
  856. X
  857. Xscan_topics ()
  858. X{
  859. X    FILE    *fd;            /* DIRFILE descriptor */
  860. X    int    i,            /* temp */
  861. X        count;            /* is there any help? */
  862. X    char    buff[BSIZE],        /* for reading DIRFILE */
  863. X        help_topic[BSIZE],    /* used to parse DIRFILE lines */
  864. X        base_path[BSIZE],    /* used to parse DIRFILE lines */
  865. X        prt_flag;        /* used to parse DIRFILE lines */
  866. X
  867. X    count = 0;
  868. X    gen_path(DIRFILE);
  869. X
  870. X    if ((fd = fopen (Path, "r")) == NULL) {
  871. X        printf ("There are no subtopics for this area.\n");
  872. X        return;
  873. X    }
  874. X
  875. X    /*
  876. X     * Here we need to read in the lines in DIRFILE
  877. X     * that are of the format
  878. X     * <basename><print_flag><help_topic_string>
  879. X     * and capitalize the <help_topic_string>.
  880. X     *
  881. X     * if <print_flag> is a "*" then the <help_topic_string> is
  882. X     * for viewing.
  883. X     *
  884. X     * if <print_flag> is a ":" then it is an acronym for lookups.
  885. X     */
  886. X
  887. X    while (fgets (buff, BSIZE, fd) != NULL) {
  888. X
  889. X        for (i = 0;
  890. X             i < strlen(buff) && buff[i] != ':' && buff[i] != '*';
  891. X             i ++)
  892. X            base_path[i] = buff[i];
  893. X        base_path[i] = '\0';
  894. X
  895. X        if (i < strlen (buff))
  896. X            prt_flag = buff[i];
  897. X        else
  898. X            /* Bad input line */
  899. X            continue;
  900. X
  901. X        strcpy (help_topic, &buff[i+1]);
  902. X        for (i = 0; i < strlen (help_topic); i ++) {
  903. X            help_topic[i] = toupper (help_topic[i]);
  904. X            if (help_topic[i] == ' ')
  905. X                help_topic[i] = '_';
  906. X            if (help_topic[i] == '\n')
  907. X                help_topic[i] = '\0';
  908. X        }
  909. X
  910. X        /*
  911. X         * At this point, we have a fairly legal line,
  912. X         * so, let's finish it off...
  913. X         */
  914. X
  915. X        if ((strlen (base_path) == 0) || (strlen (help_topic) == 0))
  916. X            continue;
  917. X        count ++;
  918. X
  919. X        if (prt_flag == '*')
  920. X            /*
  921. X             * Append this line to the list of things to
  922. X             * output as topics
  923. X             */
  924. X            append (PRINT, base_path, help_topic);
  925. X
  926. X        /*
  927. X         * Append this line to the list of acronymns
  928. X         * for reference later...
  929. X         */
  930. X        append (ACRON, base_path, help_topic);
  931. X    }
  932. X
  933. X    fclose (fd);
  934. X
  935. X    if (count == 0) {
  936. X        printf ("There are no subtopics for this area.\n");
  937. X        return;
  938. X    }
  939. X}
  940. !FUNKY!STUFF!
  941. echo x - man.form
  942. sed '1,$s/^X//' <<\!FUNKY!STUFF! > man.form
  943. X.TH HELP L
  944. X.SH NAME
  945. Xhelp - a VMS-like help facility for XENIX
  946. X.SH SYNOPSIS
  947. X.B help
  948. X.br
  949. X.SH DESCRIPTION
  950. X.I help
  951. Xis intended to be a more useful system than the native
  952. X.I man(1)
  953. Xsupplied with
  954. X.I XENIX.
  955. XIt is styled after the very popular and useful VMS HELP facility, in that
  956. Xit is tree structured and interactive.
  957. X.PP
  958. X.I help
  959. Xis very configurable.  In essence, you decide what help "topics" map
  960. Xto what files.  I.E. you can have more than one topic, or acronym, map
  961. Xto the same help subtopic.  An example would be having the words "lp"
  962. Xand "printing" both map to the 
  963. X.I help
  964. Xsubtopic "lp-command".  Also, you need not have the subtopic "lp" even
  965. Xshow up in the help screen.  If you wish to have acronyms, as described
  966. Xabove, it is site taylorable using the DIRFILE (as described below in
  967. XINTERNALS).
  968. X.PP
  969. XAll of the files and directories contained in the system are all plain
  970. Xtext files, with an easy format that can be used to your advantage.
  971. X.sp 1
  972. X.SH "INTERNALS"
  973. X.I help
  974. Xuses a tree structured file data-base to store all help.  Each node (or
  975. Xdirectory) has at least one file.  This file, called
  976. X.I ./TEXT
  977. Xcontains the actual text of the help message for this subtopic.  If there
  978. Xare any subtopics below this one, their
  979. X.I ./TEXT
  980. Xfiles are held in subdirectories of this one, and then there is a file
  981. X.I ./DIR
  982. Xthat maps the directory name to the subtopic to display.  This will allow
  983. X.I SYSV
  984. Xsystems with limited directory name lengths map much longer descriptions
  985. Xto shorter file names.
  986. X.PP
  987. XAlso contained in the
  988. X.I ./DIR
  989. Xfile is a similar mapping for acronyms of the subsequent subtopics.  In the
  990. Xexample above with lp, a sample portion of a help file would be
  991. X.sp 1
  992. X    lp-command*lp
  993. X.br
  994. X    lp-command:printing
  995. X.br
  996. X    lp-command:getting output
  997. X.sp 1
  998. XWhere the "*" in the first line implies that the "topic" name "lp" is to
  999. Xbe printed as a possible topic for help, and the subtopics "printing" and
  1000. X"getting output" are acronyms for traversing the to the "lp-command"
  1001. Xsubdirectory to get at the next
  1002. X.I ./TEXT
  1003. Xfile.
  1004. X.sp 1
  1005. X.SH "FILES"
  1006. X"/usr/help/...."    - Root directory for help
  1007. X.br
  1008. X"./TEXT"            - Help text
  1009. X.br
  1010. X"./DIR"            - Directory files for next subtopic
  1011. X.PP
  1012. X.SH DIAGNOSTICS
  1013. XThere are no real diagnostics.  However, if you reach a point in the
  1014. Xhelp system where you know you have a "subtopic" but cannot reach it,
  1015. Xsearch for correct premissions (0444 for
  1016. X.I ./TEXT
  1017. Xfiles, and (0555 for
  1018. X.I ./DIR
  1019. Xfiles).
  1020. X.sp 1
  1021. X.SH AUTHOR
  1022. XRoland J. Stolfa
  1023. X.br
  1024. XDepartment of Computing and Information Sciences
  1025. X.br
  1026. XOklahoma State University
  1027. X
  1028. !FUNKY!STUFF!
  1029. echo x - files
  1030. sed '1,$s/^X//' <<\!FUNKY!STUFF! > files
  1031. Xecho x - DIR
  1032. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  1033. XXcancel*stop a print job
  1034. XXcancel:cancel
  1035. XXcat*look at a file
  1036. XXcat:cat
  1037. XXcd*change directory
  1038. XXcd:cd
  1039. XXfiles*xenix file struture
  1040. XXfiles:files
  1041. XXhelp*help
  1042. XXkermit*kermit
  1043. XXkermit:upload
  1044. XXkermit:download
  1045. XXless*viewing a stream
  1046. XXless:less
  1047. XXlp*printing
  1048. XXlp:lp
  1049. XXlpstat*show queue
  1050. XXlpstat:lpstat
  1051. XXls*directory
  1052. XXls:ls
  1053. XXmail*sending mail
  1054. XXmail:mail
  1055. XXmkdir*making a subdirectory
  1056. XXmkdir:mkdir
  1057. XXmore*scan a file
  1058. XXmore:more
  1059. XXod*looking at a non-text file
  1060. XXod:od
  1061. XXpassword*changing your password
  1062. XXpassword:password
  1063. XXpassword:passwd
  1064. XXrm*deleting a file
  1065. XXrm:rm
  1066. XXrmdir*removing a directory
  1067. XXrmdir:rmdir
  1068. XXusers*who is logged on to which machine
  1069. XXusers:users
  1070. XXwho*who is logged on to what port
  1071. XXwho:who
  1072. XXwrite*talking with other users
  1073. XXwrite:write
  1074. X!FUNKY!STUFF!
  1075. Xecho x - TEXT
  1076. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1077. XX
  1078. XXThis is the help facility for the Computer Science Undergraduate
  1079. XXComputing Facility (running on Intel 286/310's).  In response to
  1080. XXthe "HELP >" prompt, you can:
  1081. XX
  1082. XX    + Type any help topic that you see listed for further
  1083. XX      help on that subject.
  1084. XX
  1085. XX    + Press return to back out of the help facility by
  1086. XX      one level (or back to the shell).
  1087. XX
  1088. XX    + Press <DEL> or <ctrl-D> to get back to the shell.
  1089. X!FUNKY!STUFF!
  1090. Xmkdir cancel
  1091. Xcd cancel
  1092. Xecho x - TEXT
  1093. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1094. XX"cancel" cancels line printer requests that were made by the "lp(1)"
  1095. XXcommand.  The command line arguments may be either request ids (as
  1096. XXreturned by "lp(1)") or printer names (as given by "lpstat(1)").
  1097. XX
  1098. XXSpecifying a request id cancels the associated request even if it
  1099. XXis currently printing.  Specifying a printer cancels the request
  1100. XXwhich is currently printing on that printer.
  1101. XX
  1102. XXThe general syntax is:
  1103. XX
  1104. XX    cancel [ids] [printers]
  1105. X!FUNKY!STUFF!
  1106. Xcd ..
  1107. Xmkdir cat
  1108. Xcd cat
  1109. Xecho x - DIR
  1110. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  1111. XXcopying*copying files
  1112. XXpiping*piping files
  1113. X!FUNKY!STUFF!
  1114. Xecho x - TEXT
  1115. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1116. XX
  1117. XXThis XENIX facility allows you to look at the contents of a file.
  1118. XXYou do this by typing:
  1119. XX
  1120. XX    % cat <filename>
  1121. XX
  1122. XXThis will display to your screen the entire contents of the file <filename>.
  1123. XX
  1124. XXNOTE:    You will probably want to use "more(1)" or "less(l)" to view
  1125. XX    the contents of a file.  These commands page the data to your
  1126. XX    screen rather than just list it like "cat(1)".
  1127. X!FUNKY!STUFF!
  1128. Xmkdir copying
  1129. Xcd copying
  1130. Xecho x - TEXT
  1131. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1132. XX
  1133. XXYou can use "cat (1)" to copy any file that you have read access to.
  1134. XXThis is done using the file redirection capabilities of UNIX in the following
  1135. XXmanor...
  1136. XX
  1137. XX    If you want to copy the file "//magma/usr/joe/a.out" to
  1138. XX    a new file "//magma/usr/joe/prog1", you can type the following...
  1139. XX
  1140. XX    $ cat <//magma/usr/joe/a.out >//magma/usr/joe/prog1
  1141. XX    $
  1142. XX
  1143. XX    OR if you are already in the directory
  1144. XX    "//magma/usr/joe", you can type
  1145. XX
  1146. XX    $ cat <a.out >prog1
  1147. XX    $
  1148. XX
  1149. XXNOTE:    Several better methods exist.  See Also "mv(1)" and "cp(1)".
  1150. X!FUNKY!STUFF!
  1151. Xcd ..
  1152. Xmkdir piping
  1153. Xcd piping
  1154. Xecho x - TEXT
  1155. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1156. XX
  1157. XXAnother use for "cat (1)" is to be the source of a file for a pipe.
  1158. XXUsing "cat (1)" in this way works, but is not necessary the best way to
  1159. XXget the job done.
  1160. XX
  1161. XX    Lets say that the file "//magma/usr/joe/prog1.dat" is the
  1162. XX    source input file for the program "//magma/usr/joe/prog1".
  1163. XX    Also, let's assume you are already in the directory
  1164. XX    "//magma/usr/joe".  To use the data file as input to the
  1165. XX    program you COULD do the following...
  1166. XX
  1167. XX    $ cat prog1.dat | prog1
  1168. XX    $
  1169. XX
  1170. XXNOTE:    A better way of doing this is the following
  1171. XX
  1172. XX    $ prog1 < prog1.dat
  1173. XX    $
  1174. X!FUNKY!STUFF!
  1175. Xcd ..
  1176. Xcd ..
  1177. Xmkdir cd
  1178. Xcd cd
  1179. Xecho x - DIR
  1180. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  1181. XXdot*Going nowhere
  1182. XXdot-dot*going up
  1183. XXdown*moving down
  1184. XXsideways*moving sideways
  1185. XXup*moving up
  1186. X!FUNKY!STUFF!
  1187. Xecho x - TEXT
  1188. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1189. XX
  1190. XXUnder UNIX, the entire  directory structure is an inverted tree.  This
  1191. XXstructure is shown in the file names that are used to access everything
  1192. XXin the system.  For example
  1193. XX
  1194. XX    //magma/usr/joe/foo/a.out
  1195. XX
  1196. XXdescribes a file on machine "magma",  under the first level directory
  1197. XXheading "usr", under the second level directory heading "joe", under
  1198. XXthe third level directory heading "foo", NAMED "a.out". I.E.
  1199. XX
  1200. XX    //<Machine>/<Directory 1>/.../<Directory N>/<File name>
  1201. XX
  1202. XXTo traverse this type of directory structure, the standard UNIX command
  1203. XX"cd (1)" is used.  This command allows you to 'walk' a directory from point
  1204. XX'a' to point 'b' easily.
  1205. XX
  1206. XXIt will also allow you to go from machine to machine.
  1207. XX
  1208. XXAbsolute paths may also be used to get from a place in sub-sub-directory
  1209. XX'a' to a place in sub-directory 'b' (for example) without having to
  1210. XXtraverse the entire path between these two directories.
  1211. X!FUNKY!STUFF!
  1212. Xmkdir dot
  1213. Xcd dot
  1214. Xecho x - TEXT
  1215. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1216. XX
  1217. XXThere are several unique names in the XENIX file structure.  One of these
  1218. XXare "."  This file name refers to the current directory file.  Therefore
  1219. XX"file1" refers to the same file as "./file1"
  1220. X!FUNKY!STUFF!
  1221. Xcd ..
  1222. Xmkdir dot-dot
  1223. Xcd dot-dot
  1224. Xecho x - TEXT
  1225. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1226. XX
  1227. XXThere are several unique names in the XENIX file structure.  One of these
  1228. XXis ".."  This file name refers to the current directory's parent directory
  1229. XXfile.  Therefore if "foo" is the parent directory of "bar" (i.e.
  1230. XX"/usr/foo/bar" say), then the directories "/usr/foo" and "/usr/foo/bar/.."
  1231. XXboth refer to the same directory.
  1232. X!FUNKY!STUFF!
  1233. Xcd ..
  1234. Xmkdir down
  1235. Xcd down
  1236. Xecho x - TEXT
  1237. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1238. XX
  1239. XXIf you were in the _directory_ "//magma/usr/joe/foo" looking
  1240. XXat the file "a.out", and you wanted to descend to the subdirectory
  1241. XX"bar" you have to type
  1242. XX
  1243. XX    $ cd bar
  1244. XX    $
  1245. XX
  1246. XXThis will move you down the directory link to the subdirectory specified
  1247. XXby the complete path
  1248. XX
  1249. XX    "//magma/usr/joe/foo/bar"
  1250. XX
  1251. XXSimilarly, if you know that the directory path
  1252. XX
  1253. XX    "//magma/usr/joe/foo/bar/sue/ann/bob"
  1254. XX
  1255. XXexists, and you are at the directory
  1256. XX
  1257. XX    "//magma/usr/joe"
  1258. XX
  1259. XXand you wish to get to the before mentioned directory, you can type
  1260. XX
  1261. XX    $ cd foo/bar/sue/ann/bob
  1262. XX    $
  1263. XX
  1264. XXThis is called a "relative path" to the file
  1265. XX"//magma/usr/joe/foo/bar/sue/ann/bob" and this will put you in the
  1266. XXdescribed directory just as if you had typed
  1267. XX
  1268. XX    $ cd //magma/usr/joe/foo/bar/sue/ann/bob
  1269. X!FUNKY!STUFF!
  1270. Xcd ..
  1271. Xmkdir sideways
  1272. Xcd sideways
  1273. Xecho x - TEXT
  1274. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1275. XX
  1276. XXIn this example, if you want to jump from the directory
  1277. XX
  1278. XX    "//magma/usr/joe/foo"
  1279. XX
  1280. XXto a directory 
  1281. XX
  1282. XX    "//earth/usr/sue/ann/bob"
  1283. XX
  1284. XXYou can type the following to get you there
  1285. XX
  1286. XX    $ cd //earth/usr/sue/ann/bob
  1287. XX    $
  1288. XX
  1289. XXPlease note that you do not even have to be on the same physical machine
  1290. XXto descend to a subdirectory of that machine.  All that is required is that
  1291. XXyou know the path to the subdirectory that you want AND that you have the
  1292. XXaccess permission of who ever owns that file/directory.
  1293. X!FUNKY!STUFF!
  1294. Xcd ..
  1295. Xmkdir up
  1296. Xcd up
  1297. Xecho x - TEXT
  1298. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1299. XX
  1300. XXIf you were in the _directory_ "//magma/usr/joe/foo" looking
  1301. XXat the file "a.out", and you wanted to return to the directory
  1302. XX"//magma/usr/joe", all you have to type
  1303. XX
  1304. XX$ cd ..
  1305. XX$
  1306. XX
  1307. XXThis will move you up the return link to the directory above you.
  1308. X!FUNKY!STUFF!
  1309. Xcd ..
  1310. Xcd ..
  1311. Xmkdir files
  1312. Xcd files
  1313. Xecho x - TEXT
  1314. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1315. XXThere are several unique problems that are related to Open-Net,
  1316. XXthe software package that gives the Intel's their collective identity.
  1317. XXThese relate to the fact that if you have a program that tries to open
  1318. XXa file "foo" in your current working directory, the "open(2)" call will
  1319. XXwork.  However, if you try to open a file "/usr/joe/foo", this will FAIL.
  1320. XXThe reason is that the local machine that you have logged onto will try
  1321. XXto find a file "/usr/joe/foo" on IT'S file system, rooted from the top,
  1322. XXand will FAIL.  To get the above example to function, you should have your
  1323. XXopen call try to open "//machine/usr/joe/foo".
  1324. X!FUNKY!STUFF!
  1325. Xcd ..
  1326. Xmkdir help
  1327. Xcd help
  1328. Xecho x - TEXT
  1329. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1330. XXThis is a VMS style help facility.  It is intended to be more helpful
  1331. XXfor first time users of the XENIX (or UNIX) operating system than is the
  1332. XXnative "man (1)" help system that normally comes with this operating system.
  1333. XXIn addition to being more helpful, we don't have the "man (1)" system
  1334. XXon XENIX, so I had to come up with something...
  1335. XX
  1336. XXIn any case, this system is a tree-like help facility.  For each entry
  1337. XXin the help tree, there can be many children below each entry.
  1338. XXTo move around in the tree, you go to each point in the tree and then
  1339. XXgo down one level.  To go back up, you travel the link from the child
  1340. XXto the parent.  I.E.
  1341. XX
  1342. XX            ------- Main Subject --------- ...
  1343. XX            /      \            \...\
  1344. XX               /       \
  1345. XX        Child Subject      Other Child Subjects      ...
  1346. XX             / | \        / | \
  1347. XX    Grand Children Subjects      Grand Children Subjects    ...
  1348. XX
  1349. XXTo exit the help facility, just type <CR> enough times to move up the
  1350. XXchildren links to exit the "Main Subject" node, type <CTRL-D>, or <DEL>.
  1351. XX
  1352. XXIn addition, this help system runs over Open-Net, an Intel software package
  1353. XXthat gives the Intel 310's their collective identity.  This allows there to
  1354. XXbe only one copy of the help system on the collective six machines of the
  1355. XXIntel system.
  1356. X!FUNKY!STUFF!
  1357. Xcd ..
  1358. Xmkdir kermit
  1359. Xcd kermit
  1360. Xecho x - TEXT
  1361. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1362. XX                       THE KERMIT FILE TRANSFER PROTOCOL
  1363. XX
  1364. XX                                 November 1986
  1365. XX
  1366. XX
  1367. XX
  1368. XXKermit  is  an  error-correcting protocol for transferring sequential files be-
  1369. XXtween computers of  all  sizes  over  ordinary  asynchronous  telecommunication
  1370. XXlines.  Kermit is non-proprietary, thoroughly documented, and in wide use.  The
  1371. XXprotocol and the original implementations were developed at Columbia University
  1372. XXand  have  been shared with thousands of other institutions all over the world,
  1373. XXmany of which have made significant contributions of  their  own.    Kermit  is
  1374. XXpresently available for more than 200 different machines and operating systems,
  1375. XXand additional versions are always under development.
  1376. XX
  1377. XXAll Kermit programs perform  file  transfer  using  the  Kermit  file  transfer
  1378. XXprotocol.    In  addition,  Kermit programs for personal computers also provide
  1379. XXterminal emulation, usually of the DEC VT52, VT100, or  similar  terminal,  and
  1380. XXsome  of  the  mainframe Kermit programs are capable of initiating connections,
  1381. XXacting as dumb terminals to remote systems.  Kermit  programs  work  only  over
  1382. XXasynchronous  RS-232 direct or dialup connections, or connections that simulate
  1383. XXthem.  For file transfer to take place, there must be a Kermit program  running
  1384. XXon each end of the connection, one on each computer.
  1385. XX
  1386. XXThere are Kermit programs for most popular "generic" operating systems, includ-
  1387. XXing UNIX, MS-DOS, and CP/M, and for  mainframes  and  minicomputers  from  Bur-
  1388. XXroughs,   Cray,  CDC,  Data  General,  DEC,  Gould  (SEL),  Harris,  Honeywell,
  1389. XXHewlett-Packard, IBM, Perkin-Elmer (Concurrent), Prime, Sperry/Univac, and Tan-
  1390. XXdem,  and  for  particular  microcomputers and workstations from Apple, Apollo,
  1391. XXAtari, Commodore, IBM, Tandy, and many others, written in  a  wide  variety  of
  1392. XXlanguages  including  many different assemblers, plus high-level languages like
  1393. XXAlgol, Basic, Bliss, C, Forth, Fortran, Lisp, Mumps, Pascal, PL/I, and  Ratfor.
  1394. XXA complete list of currently available Kermit programs accompanies this flyer.
  1395. XX
  1396. XXHere  are some details about the several most popular Kermit programs.  Most of
  1397. XXthe following implementations are capable of both local and  remote  operation,
  1398. XXserver  and  client  modes,  text  and binary file transfer, and support a full
  1399. XXrange of communications options -- speed, parity, duplex, flow  control,  hand-
  1400. XXshake  --  to  allow  adaptation  to  a  wide  variety  of hosts (including IBM
  1401. XXmainframes) and communication media.
  1402. XX
  1403. XX   - IBM PC Kermit Version 2.29 runs under PC-DOS version 2.0 and later on
  1404. XX     the entire IBM PC family, as well as on IBM "clones" and compatibles.
  1405. XX     It provides nearly complete DEC VT102 terminal emulation at speeds up
  1406. XX     to  38.4K  baud  fully  buffered and interrupt driven -- and includes
  1407. XX     support for  color  displays,  compatibility  with  various  "desktop
  1408. XX     organizers,"  and selectable emulation of other terminals.  There are
  1409. XX     also versions of Kermit specifically tailored for a variety of  other
  1410. XX     MS-DOS  systems,  including the DEC Rainbow, Zenith-100, Victor 9000,
  1411. XX     and many others, and there is a "generic" MS-DOS Kermit  for  systems
  1412. XX     not explicitly covered.
  1413. XX
  1414. XX   - Macintosh  Kermit  Version 0.8(34) runs on the entire Apple Macintosh
  1415. XX     family, from the original 128K Mac to the Mac/XL, to the  fully  con-
  1416. XX     figured  Macintosh-Plus.  It provides fairly complete VT102 emulation
  1417. XX     at speeds up to 9600 baud, and file transfer speeds up to 56Kb.
  1418. XX
  1419. XX   - UNIX Kermit is distributed only in C-language source form.  It may be
  1420. XX     built  for  nearly any machine running practically any post-V6 varia-
  1421. XX     tion of UNIX, including V7, Berkeley 2.x and 4.x, AT&T System III and
  1422. XX     System  V, Xenix, Venix, and so on.  The same source also serves as a
  1423. XX     basis for Macintosh, Amiga, and other Kermit programs.
  1424. XX
  1425. XX   - VAX/VMS Kermit is written in Bliss, but it  is  also  distributed  in
  1426. XX     Macro-32  and  hex  form,  so  that a Bliss compiler is not required.
  1427. XX     Other versions exist in C and Pascal.
  1428. XX
  1429. XX   - IBM mainframe Kermit  programs  for  VM/CMS  and  MVS/TSO  work  with
  1430. XX     asynchronous  ASCII  TTY connections through 3705 or equivalent front
  1431. XX     ends, or through Series/1, 7171, or similar protocol converters  that
  1432. XX     support  the Yale ASCII Communications System; beyond this exception,
  1433. XX     Kermit cannot be  used  to  transfer  files  in  the  IBM  3270-style
  1434. XX     full-screen  terminal  environment.  There are no Kermit programs for
  1435. XX     DOS/VSE, or IBM minis like the System/34 and System/38, because these
  1436. XX     systems do not support asynchronous ASCII communications.  Currently,
  1437. XX     IBM mainframe Kermits run only in remote mode.
  1438. XX
  1439. XXThe Kermit software -- including source code -- is furnished free  and  without
  1440. XXlicense, and without warranty of any kind, and neither Columbia University, nor
  1441. XXthe individual  authors,  nor  any  institution  that  has  contributed  Kermit
  1442. XXmaterial, acknowledge any liability for any claims arising from the use of Ker-
  1443. XXmit.  Furthermore, it must be stated that the quality of  the  Kermit  programs
  1444. XXvaries  --  some are polished, well-documented professional products and others
  1445. XXare not.  Kermit programs are contributed by  public-spirited  volunteers,  and
  1446. XXColumbia  University does not wish to discourage such contributions by subject-
  1447. XXing them to a rating system.  Since source code is provided for  all  implemen-
  1448. XXtations, users may make improvements or write documentation where it is lacking
  1449. XXand are encouraged to contribute their work back to Columbia for  further  dis-
  1450. XXtribution.    Under  certain  conditions  (described  in  a  separate document)
  1451. XXsoftware producers may include Kermit protocol in their products.
  1452. XX
  1453. XXAlthough the Kermit software is free and unlicensed, Columbia University cannot
  1454. XXafford  to  distribute  it for free because the demand is too great.  To defray
  1455. XXour costs for media, printing, postage, labor, and computing resources, we  re-
  1456. XXquire  moderate  distribution  fees from those who request Kermit directly from
  1457. XXus.  The schedule is given on the accompanying Kermit Order Form.  You may also
  1458. XXobtain  Kermit  programs  from  many other sources, including user groups, net-
  1459. XXworks, dialup bulletin boards, and you may copy them from  friends,  neighbors,
  1460. XXand  colleagues.    In  fact, you may obtain Kermit programs from anyone who is
  1461. XXwilling to share them with you, just as you may share them yourself.
  1462. XX
  1463. XXKermit is distributed by Columbia  University  primarily  on  9-track  magnetic
  1464. XXtape,  suitable for reading on most mainframe and minicomputers.  It is assumed
  1465. XXthat Kermit will be ordered in this form  by  institutional  computer  centers,
  1466. XXwhose  professional  staff will take the responsibility for "bootstrapping" the
  1467. XXmicrocomputer versions from the tape to diskettes for their users.   The  tapes
  1468. XXinclude  source  code and any available documentation for each Kermit implemen-
  1469. XXtation, and in some cases also binaries (usually encoded in hex or other print-
  1470. XXable format).  Selected microcomputer versions are also available from Columbia
  1471. XXon diskette, and from diskette services, user  groups,  and  individual  volun-
  1472. XXteers, some of whom are listed on a separate flyer.
  1473. XX
  1474. XXDocumentation  includes  the  Kermit  User  Guide  (about 250pp) and the Kermit
  1475. XXProtocol Manual (90pp); one printed copy of each is included free with any tape
  1476. XXorder.  Other documents may be ordered separately, including addition copies of
  1477. XXthe manuals, the manuscript from the Kermit article that appeared in  the  June
  1478. XXand  July  1984 issues of BYTE Magazine (36pp), and the new book Kermit, A File
  1479. XXTransfer Protocol by Frank da Cruz, 400pp, Digital Press (1987).
  1480. XX
  1481. XXThe Kermit book is a comprehensive introduction and guide  to  Kermit;  it  in-
  1482. XXcludes  an  overview  of what Kermit is for and how it works, with tutorials in
  1483. XXcomputer file systems and data communications, a generalized command reference,
  1484. XXa  troubleshooting  guide,  a  complete protocol specification with program ex-
  1485. XXamples, a glossary, an index, and numerous tables, figures, and  illustrations.
  1486. XXThe User Guide contains detailed, specific instructions for the use of the most
  1487. XXpopular Kermit programs (MS-DOS, VMS, UNIX, Apple, etc).  The  Protocol  Manual
  1488. XXis  an  older  description of the Kermit protocol, which lacks the organization
  1489. XXand program examples from the book.  If you have the book, you don't  need  the
  1490. XXProtocol Manual but you will still need the User Guide.
  1491. XX
  1492. XXOnce  you  receive Kermit, you are encouraged to copy and redistribute it, with
  1493. XXthe following stipulations: Kermit should not be sold for profit; credit should
  1494. XXbe  given  where  it  is  due; and new material should be sent back to Columbia
  1495. XXUniversity so that we can maintain a definitive and comprehensive set of Kermit
  1496. XXimplementations  for further distribution.  And finally, please use Kermit only
  1497. XXfor peaceful and humane purposes.
  1498. XX
  1499. XXORDERING INFORMATION:
  1500. XX
  1501. XXAll Kermit material is available on magnetic tape as described below.  Selected
  1502. XXKermit programs may also be ordered on diskette; see the order form.  Tapes in-
  1503. XXclude program source code, diskettes generally do not have room for source.
  1504. XX
  1505. XXThere are 3 separate Kermit tapes: A, B, and C. There are too many Kermit files
  1506. XXto  fit  on fewer tapes.  All tapes are half-inch, 2400-foot, 9-track, 1600bpi,
  1507. XXodd parity.  They are available ONLY in the following formats:
  1508. XX
  1509. XX  ANSI:   ANSI labeled ASCII, format D (variable length records, VMS COPY)
  1510. XX  TAR:    UNIX TAR format (written on a VAX with 4.2BSD or Ultrix-32)
  1511. XX  OS:     IBM OS standard labeled EBCDIC, format VB (variable length records)
  1512. XX  CMS:    IBM VM/CMS VMFPLC2 format (unlabeled)
  1513. XX  DEC-10: DECsystem-10 Backup/Interchange format (unlabeled)
  1514. XX  DEC-20: DECSYSTEM-20 DUMPER format (unlabeled)
  1515. XX
  1516. XXTape blocksizes, when applicable, are our choice and in the range  8K-10K  (use
  1517. XXof  smaller  blocksizes could overflow the tapes).  NO OTHER FORMATS ARE AVAIL-
  1518. XXABLE.  We can NOT make 800bpi or 6250bpi  tapes,  unlabeled  tapes  (except  as
  1519. XXnoted  above),  fixed-block tapes, or custom tapes of any kind.  If none of the
  1520. XXabove formats looks familiar to you, then specify ANSI -- this is  an  industry
  1521. XXstandard format that should be readable by any computer system (ANSI specifica-
  1522. XXtions are provided on paper).  VAX/VMS sites should specify ANSI.
  1523. XX
  1524. XXTAPE "A" CONTAINS:
  1525. XX   - The more popular microcomputer  (PC,  workstation)  Kermit  implemen-
  1526. XX     tations.
  1527. XX
  1528. XXTAPE "B" CONTAINS:
  1529. XX   - The more popular mainframe and minicomputer Kermit implementations.
  1530. XX
  1531. XXTAPE "C" CONTAINS:
  1532. XX   - Esoteric, less popular, or redundant Kermit implementations.
  1533. XX   - Text formatter source for the Kermit User Guide and Protocol Manual.
  1534. XX   - Archives of old mail, other large documents.
  1535. XX
  1536. XXEXCEPTIONS:
  1537. XX   - C-Kermit  is  the basis of all Unix Kermit implementations, mainframe
  1538. XX     and micro, and also for Commodore Amiga and Apple Macintosh  Kermits.
  1539. XX     It is on tape B.
  1540. XX
  1541. XX
  1542. XX
  1543. XX
  1544. XX         TO ORDER KERMIT, fill out the Kermit Order Form and send it to:
  1545. XX               __________________________________________________
  1546. XX
  1547. XX                               Kermit Distribution
  1548. XX               Columbia University Center for Computing Activities
  1549. XX                              612 West 115th Street
  1550. XX                            New York, NY 10025 (USA)
  1551. XX               __________________________________________________
  1552. XX
  1553. XX
  1554. XXPrepayment  by  check  is encouraged; an additional order processing fee is re-
  1555. XXquired if we must issue an invoice.   North  American  orders  are  shipped  by
  1556. XXdelivery  service  or first class US mail, with shipping costs included.  Over-
  1557. XXseas orders are shipped first class US (air) mail, with an additional  shipping
  1558. XXcharge  required.    Orders are normally processed within 2-4 weeks of receipt,
  1559. XXbut firm delivery schedules or methods cannot be guaranteed.  USA rush  service
  1560. XXis available for an extra fee (see order form *).
  1561. X!FUNKY!STUFF!
  1562. Xcd ..
  1563. Xmkdir less
  1564. Xcd less
  1565. Xecho x - TEXT
  1566. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1567. XX
  1568. XXTyping less <filename> at the command prompt will cause the computer to
  1569. XXdisplay the file one screen at a time.  The computer will not go to the
  1570. XXnext page of text until you press the spacebar.  You may also scroll
  1571. XXtext one line at a time with the return key, but you must press the
  1572. XXreturn key for each new line of text.  To get out of "less" you must
  1573. XXpress "q" to quit.
  1574. XX
  1575. XX"less(L)" is different from "more(1)" in that you may scroll backwards
  1576. XXwith "less(L)".  The 'help' key in "less(L)" is 'h'.
  1577. XX
  1578. XXFor example, the command
  1579. XX
  1580. XX% less foo
  1581. XX
  1582. XXwould display the file named foo one screen at a time, or until you
  1583. XXtype 'q'.
  1584. X!FUNKY!STUFF!
  1585. Xcd ..
  1586. Xmkdir lp
  1587. Xcd lp
  1588. Xecho x - TEXT
  1589. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1590. XX"lp(1)" is the command to print a file.  Currently there are several
  1591. XXdifferent printer queue's supported.  A current list of the available
  1592. XXprinters can be seen by giving the "lpstat -p" command.
  1593. XX
  1594. XXTypical printers that are usually available for CSUG users are:
  1595. XX    ag    - Ag Hall 241 printer
  1596. XX    parker    - The basement of the Parker Residence hall
  1597. XX    ms222    - The CIS cluster of AT&T Unix PC's in Math Sciences 222
  1598. XX          (ms222 is available 8am-5pm M-F only).
  1599. XX    ms214    - The CIS graduate cluster of AT&T PC's in Math Sciences
  1600. XX          214
  1601. XX    bus    - Business Building 009
  1602. XX    es1    - Engineering South 113
  1603. XX    es3    - Engineering South 413
  1604. XX    iba    - Iba Hall 111-A
  1605. XX    ps    - Physical Sciences 102
  1606. XX    stout    - Stout Hall 043
  1607. XX    ucat    - University Center - Tulsa
  1608. XX    ucc2    - Math Sciences Basement cluster MS-013
  1609. XX    
  1610. XX
  1611. XXThese printers are designated by the following syntax
  1612. XX
  1613. XX    lp -d<queue>
  1614. XX
  1615. XXWhere <queue> is one of the printers shown to be available by the
  1616. XX"lpstat -p" command.
  1617. XX
  1618. XXFor example, to print a file named foo on the 'parker' printer, you type 
  1619. XXthe following command:
  1620. XX
  1621. XX    lp -dparker < foo
  1622. X!FUNKY!STUFF!
  1623. Xcd ..
  1624. Xmkdir lpstat
  1625. Xcd lpstat
  1626. Xmkdir -r
  1627. Xcd -r
  1628. Xecho x - TEXT
  1629. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1630. XXThe "-r" option to "lpstat(1)" gives the current status of the
  1631. XXline printer scheduler.  If "lpstat(1)" returns with 
  1632. XX
  1633. XX    scheduler is not running
  1634. XX
  1635. XXYou should contact the secretaries in MS-218 and report the
  1636. XXname of the machine you are logged into, as well as the fact
  1637. XXthat the scheduler is not running
  1638. X!FUNKY!STUFF!
  1639. Xcd ..
  1640. Xmkdir -t
  1641. Xcd -t
  1642. Xecho x - TEXT
  1643. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1644. XXThe "-t" option to the "lpstat(1)" command will give you the
  1645. XXstatistics for the entire "lp(1)" family of commands as well
  1646. XXas the current status of the print queue, which jobs are currently
  1647. XXbeing serviced, and which printer queue's are accepting jobs
  1648. XXcurrently.
  1649. X!FUNKY!STUFF!
  1650. Xcd ..
  1651. Xmkdir -u
  1652. Xcd -u
  1653. Xecho x - TEXT
  1654. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1655. XXThe "-u" option of the "lpstat(1)" allows you to cut down the
  1656. XXlist of queue'ed jobs to those belonging to a particular user.
  1657. XX
  1658. XXAn example is in order...
  1659. XX
  1660. XX    lpstat -uroot
  1661. XX
  1662. XXWould give a complete list of all jobs owned by the user "root"
  1663. XXto any destination on the current machine.
  1664. X!FUNKY!STUFF!
  1665. Xcd ..
  1666. Xecho x - DIR
  1667. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  1668. XX-r*scheduler
  1669. XX-t*everything
  1670. XX-u*by user
  1671. XX-r:-r
  1672. XX-t:-t
  1673. XX-u:-u
  1674. X!FUNKY!STUFF!
  1675. Xecho x - TEXT
  1676. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1677. XX"lpstat(1)" is the command that will check on the printer system.
  1678. XXIt reports the overall list of jobs in the print queue (for each
  1679. XXprinter), the status of the scheduler, and several other statistics.
  1680. X!FUNKY!STUFF!
  1681. Xcd ..
  1682. Xmkdir ls
  1683. Xcd ls
  1684. Xecho x - TEXT
  1685. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1686. XX
  1687. XX"ls" stands for "list directory".  For you VMS users, this is "DIRECTORY".
  1688. XXThe several options listed below are useful mostly in shell scripts
  1689. XX(NOTE: see the help page on your shell for further details).  There are
  1690. XXseveral that are of prime help during the usual running.  They are
  1691. XXthe "-a" and "-l" options.
  1692. X!FUNKY!STUFF!
  1693. Xcd ..
  1694. Xmkdir mail
  1695. Xcd mail
  1696. Xecho x - DIR
  1697. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  1698. XXreading*reading
  1699. XXwriting*writing
  1700. X!FUNKY!STUFF!
  1701. Xecho x - TEXT
  1702. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1703. XXThe "mail(L)" command is used to transfer messages from one user to
  1704. XXanother.  There are two command line invocations of mail that
  1705. XXdo vastly different things.  They are for reading and writing mail.
  1706. X!FUNKY!STUFF!
  1707. Xmkdir reading
  1708. Xcd reading
  1709. Xecho x - TEXT
  1710. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1711. XXTo read your mail, you should use the following command line...
  1712. XX
  1713. XX    % mail
  1714. XX
  1715. XXWhat this will present you with is either the list of mail message
  1716. XXheaders that you have not read (or have saved) or the message
  1717. XX
  1718. XX    No mail
  1719. XX
  1720. XXif you have no new mail.
  1721. XX
  1722. XX
  1723. XXThe commands that are in effect during this mode of operation are
  1724. XXvery well covered in the internal help facility of mail as accessed
  1725. XXby the "?" command.
  1726. X!FUNKY!STUFF!
  1727. Xcd ..
  1728. Xmkdir writing
  1729. Xcd writing
  1730. Xecho x - TEXT
  1731. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1732. XXTo write mail to a user, you must have their address.  Once you have
  1733. XXthat, you can send them mail by the following command line
  1734. XX
  1735. XX    % mail bob
  1736. XX    <your message here>
  1737. XX        .
  1738. XX        .
  1739. XX        .
  1740. XX    <control-D as the first character of a line>
  1741. XX        <A SHORT PAUSE>
  1742. XX    %
  1743. XX
  1744. XXThis will send some message to the user "bob" on the Intel system.
  1745. X!FUNKY!STUFF!
  1746. Xcd ..
  1747. Xcd ..
  1748. Xmkdir mkdir
  1749. Xcd mkdir
  1750. Xecho x - TEXT
  1751. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1752. XX
  1753. XX
  1754. XX
  1755. XX
  1756. XX          Name
  1757. XX
  1758. XX            mkdir - Make Directory
  1759. XX
  1760. XX          Format
  1761. XX
  1762. XX            mkdir directory-name
  1763. XX
  1764. XX          Description
  1765. XX
  1766. XX              The mkdir command will create a directory in the current
  1767. XX            directory that the user is in if the user has write and
  1768. XX            execute access permission to the parent directory of the
  1769. XX            directory that the user is creating.
  1770. XX              The mkdir command can also create the subdirectories at the
  1771. XX            same time that it creates the main directory.  For example
  1772. XX
  1773. XX                          mkdir foo/foo1/foo2
  1774. XX
  1775. XX            would create a directory named foo with subdirectories named
  1776. XX            foo1 and foo2.
  1777. XX
  1778. XX
  1779. X!FUNKY!STUFF!
  1780. Xcd ..
  1781. Xmkdir more
  1782. Xcd more
  1783. Xecho x - TEXT
  1784. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1785. XX
  1786. XX
  1787. XX
  1788. XX
  1789. XX
  1790. XX
  1791. XX             Name 
  1792. XX
  1793. XX               more - Views files one page at a time.
  1794. XX
  1795. XX             Description:
  1796. XX
  1797. XX                 Typing more <filename> at the command prompt
  1798. XX              will cause the computer to display the file one
  1799. XX              screen at a time.  The computer will not go to
  1800. XX              the next page of text until you press the spacebar.
  1801. XX              You may also scroll text one line at a time with    
  1802. XX              the return key, but you must press the return key
  1803. XX              for each new line of text.
  1804. XX                 To get out of "more" you can either view the 
  1805. XX              whole file or press the delete key.
  1806. XX
  1807. XX              For example, the command
  1808. XX
  1809. XX                   % more foo
  1810. XX           
  1811. XX              would display the file named foo one screen at a
  1812. XX              time.
  1813. XX
  1814. X!FUNKY!STUFF!
  1815. Xcd ..
  1816. Xmkdir od
  1817. Xcd od
  1818. Xmkdir -c
  1819. Xcd -c
  1820. Xecho x - TEXT
  1821. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1822. XX
  1823. XX
  1824. XX
  1825. XX             Utility
  1826. XX
  1827. XX                od - octal dump
  1828. XX
  1829. XX             Option
  1830. XX
  1831. XX                -c
  1832. XX
  1833. XX             Description
  1834. XX
  1835. XX                The -c option of the od utility will produce
  1836. XX               a character dump.  od will display certain 
  1837. XX               nonprintable characters as characters preceded
  1838. XX               by a backslash.  Any nonprinting characters that
  1839. XX               are not in the following list will appear as
  1840. XX               3-digit octal numbers.
  1841. XX
  1842. XX                   symbol      character
  1843. XX                   ------      ---------
  1844. XX                     \O         null
  1845. XX                     \b         backspace
  1846. XX                     \f         formfeed
  1847. XX                     \n         newline
  1848. XX                     \r         return
  1849. XX                     \t         tab
  1850. XX
  1851. X!FUNKY!STUFF!
  1852. Xcd ..
  1853. Xmkdir -d
  1854. Xcd -d
  1855. Xecho x - TEXT
  1856. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1857. XX
  1858. XX
  1859. XX
  1860. XX            Utility
  1861. XX
  1862. XX               od - octal dump
  1863. XX
  1864. XX            Option
  1865. XX
  1866. XX               -d
  1867. XX
  1868. XX            Description
  1869. XX
  1870. XX                The -d option used with the od utility will 
  1871. XX              produce a decimal dump of your file.
  1872. XX  
  1873. X!FUNKY!STUFF!
  1874. Xcd ..
  1875. Xmkdir -x
  1876. Xcd -x
  1877. Xecho x - TEXT
  1878. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1879. XX
  1880. XX
  1881. XX
  1882. XX
  1883. XX             Utility
  1884. XX
  1885. XX                od - octal dump
  1886. XX
  1887. XX             Option
  1888. XX
  1889. XX                -x
  1890. XX
  1891. XX             Description
  1892. XX
  1893. XX                 The -x option used with the od utility will
  1894. XX               produce a hexidecimal dump of your file.
  1895. XX
  1896. X!FUNKY!STUFF!
  1897. Xcd ..
  1898. Xecho x - DIR
  1899. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  1900. XX-c*ascii
  1901. XX-d*decimal
  1902. XX-x*hex
  1903. XX-c:-c
  1904. XX-d:-d
  1905. XX-x:-x
  1906. X!FUNKY!STUFF!
  1907. Xecho x - TEXT
  1908. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1909. XX
  1910. XX
  1911. XX
  1912. XX            Name
  1913. XX
  1914. XX              od - Short for octal dump
  1915. XX
  1916. XX            Description:
  1917. XX
  1918. XX               The od utility will dump the contents of an
  1919. XX              executable or object file into a file so that 
  1920. XX              you may view the contents.  The syntax for the
  1921. XX              od utility is
  1922. XX
  1923. XX                      od <-option> file
  1924. XX  
  1925. XX              where file is the pathname of the file that od
  1926. XX              dumps.  If you do not specify an option, the        
  1927. XX              utility will default to  an octal dump.  
  1928. X!FUNKY!STUFF!
  1929. Xcd ..
  1930. Xmkdir password
  1931. Xcd password
  1932. Xecho x - TEXT
  1933. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1934. XX
  1935. XX
  1936. XX
  1937. XX          Name
  1938. XX     
  1939. XX            passwd - Change Password
  1940. XX
  1941. XX          Description
  1942. XX
  1943. XX            The command passwd will allow the user to change his/her
  1944. XX           password into the computer.  The format for the command passwd
  1945. XX           is as follows:
  1946. XX
  1947. XX
  1948. XX               1) Type "passwd" at the command prompt.
  1949. XX
  1950. XX               2) The computer will respond with "Old Password:" 
  1951. XX                  You should then type in your old password and hit
  1952. XX                  return.
  1953. XX
  1954. XX               3) The computer will respond with "New Password:".  
  1955. XX                  You should then type in your new password and hit
  1956. XX                  return.
  1957. XX
  1958. XX               4) The computer will respond with "Re-enter new password:".
  1959. XX                  You should then re-enter your password and hit return.
  1960. XX                  If the new password and the re-entered password do not
  1961. XX                  match, then the computer will prompt you again for the
  1962. XX                  new password.
  1963. XX
  1964. X!FUNKY!STUFF!
  1965. Xcd ..
  1966. Xmkdir rm
  1967. Xcd rm
  1968. Xmkdir -f
  1969. Xcd -f
  1970. Xecho x - TEXT
  1971. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1972. XXUsing the -f option with the rm command will remove a file
  1973. XXthat you don't have write permission to without asking for
  1974. XXyour consent.
  1975. X!FUNKY!STUFF!
  1976. Xcd ..
  1977. Xmkdir -i
  1978. Xcd -i
  1979. Xecho x - TEXT
  1980. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1981. XXUsing the -i option with the rm command will make the rm
  1982. XXcommand prompt you before the file is removed.  If you
  1983. XXuse the -r option with the -i option, rm will prompt you
  1984. XXbefore examining each directory.
  1985. X!FUNKY!STUFF!
  1986. Xcd ..
  1987. Xmkdir -r
  1988. Xcd -r
  1989. Xecho x - TEXT
  1990. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  1991. XXUsing the -r option with the rm command will delete all files
  1992. XXin a directory as well as the directory itself.  Be careful
  1993. XXusing the -r option.
  1994. X!FUNKY!STUFF!
  1995. Xcd ..
  1996. Xecho x - DIR
  1997. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  1998. XX-f*force
  1999. XX-i*inquire
  2000. XX-r*recursively
  2001. XX-f:-f
  2002. XX-i:-i
  2003. XX-r:-r
  2004. X!FUNKY!STUFF!
  2005. Xecho x - TEXT
  2006. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  2007. XX
  2008. XX
  2009. XX
  2010. XX         Name
  2011. XX
  2012. XX           rm - Remove File
  2013. XX
  2014. XX         Use
  2015. XX
  2016. XX           rm (option) filename
  2017. XX
  2018. XX         Description 
  2019. XX
  2020. XX               Using the rm command you can remove unnecessary files from
  2021. XX            a directory.  The command itself is easy to use, for 
  2022. XX            example 
  2023. XX
  2024. XX                         rm foo
  2025. XX        
  2026. XX             would remove the file foo from the directory you are in if
  2027. XX             you have write permission in the directory.
  2028. XX                With the right option you can remove all files in a 
  2029. XX             directory that have certain attributes.  For example
  2030. XX
  2031. XX                         rm *.c
  2032. XX 
  2033. XX             would remove all files that end in .c in the directory
  2034. XX             which you are in.
  2035. XX
  2036. XX
  2037. XX
  2038. XX
  2039. X!FUNKY!STUFF!
  2040. Xcd ..
  2041. Xmkdir rmdir
  2042. Xcd rmdir
  2043. Xecho x - TEXT
  2044. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  2045. XX
  2046. XX
  2047. XX
  2048. XX             Name
  2049. XX 
  2050. XX               rmdir
  2051. XX
  2052. XX             Format
  2053. XX
  2054. XX               rmdir directory-name
  2055. XX
  2056. XX             Description
  2057. XX
  2058. XX                  The command rmdir removes directories by removing the
  2059. XX                links that connect the directories to the tree.  A
  2060. XX                directory, however, must first be empty before it can be
  2061. XX                removed from the tree. Please consult the help facility
  2062. XX                for more information on the rm command.
  2063. XX                   The following examples will show common use of the
  2064. XX                rmdir command.
  2065. XX
  2066. XX                             rmdir foo
  2067. XX
  2068. XX                                or
  2069. XX
  2070. XX                           rmdir foo/foo1
  2071. XX
  2072. XX                   The first example will remove the directory called
  2073. XX                 foo and the second will remove the subdirectory called
  2074. XX                 foo1.
  2075. XX
  2076. XX
  2077. X!FUNKY!STUFF!
  2078. Xcd ..
  2079. Xmkdir users
  2080. Xcd users
  2081. Xecho x - TEXT
  2082. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  2083. XXWhen you type "users" at the command prompt, the computer will respond
  2084. XXwith a list of users on the system and the computer that they are loged
  2085. XXonto.  For example:
  2086. XX
  2087. XX    % users    
  2088. XX    //magma:  root
  2089. XX    //earth:
  2090. XX    //sand:
  2091. XX    //soil:
  2092. XX    //mud:
  2093. XX    //dirt:
  2094. XX    %
  2095. XX
  2096. X!FUNKY!STUFF!
  2097. Xcd ..
  2098. Xmkdir who
  2099. Xcd who
  2100. Xecho x - TEXT
  2101. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  2102. XX"who(1)" is the command to find out who is logged on, when they
  2103. XXlogged on, and onto which machine they logged on.
  2104. XX
  2105. XX    % who
  2106. XX    sue      magma    ttym0   Sep 24 11:08
  2107. XX    bob      earth    ttym0   Sep 24 11:37
  2108. XX    root     magma    ttym6   Sep 24 11:13
  2109. XX    %
  2110. X!FUNKY!STUFF!
  2111. Xcd ..
  2112. Xmkdir write
  2113. Xcd write
  2114. Xecho x - DIR
  2115. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > DIR
  2116. XXusers*finding someone to talk to
  2117. XXusers:users
  2118. XXwho*check for locked up
  2119. XXwho:who
  2120. X!FUNKY!STUFF!
  2121. Xecho x - TEXT
  2122. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  2123. XX"write(1)" is a command to allow two simultaneously logged on users
  2124. XXto communicate directly from their terminals (without having to "mail(1)"
  2125. XXthings back and forth).  This facility is of great use between team
  2126. XXmembers for talking over ideas.  However, it can get abusive.
  2127. XX
  2128. XXA short example is in order...
  2129. XX
  2130. XX    % write root            <------ This happens at bobs terminal
  2131. XX
  2132. XX    <while at "root"'s terminal, the following message INTERRUPTS
  2133. XX    whatever was currently on the screen>
  2134. XX
  2135. XX    <bel><bel> Message from bob on magma ttym0... Thu Sept 24 11:48:15 1987
  2136. XX
  2137. XX    <at this point, "root" must get out of whatever facility, job, vi
  2138. XX    session, etc. to get back to a shell prompt to answer the write.>
  2139. XX
  2140. XX    $ write bob            <------ Note the reverse of users
  2141. XX
  2142. XX    <back at "bob"'s terminal, a similar message is displayed>
  2143. XX
  2144. XX    <bel><bel>Message from root on dirt ttym6... Thu Sept 24 11:52:15 1987
  2145. XX
  2146. XXAt this point, both parties can type messages to each other's screen.
  2147. XXIt is suggested that you follow some sort of protocol so that you don't
  2148. XXinterrupt each other's typing.  I.E....
  2149. XX
  2150. XX    <after having received a message that "root" was online, bob
  2151. XX    SHOULD type first as the first party to interrupt>
  2152. XX
  2153. XX    Hi there root.  What's up?
  2154. XX    cts                <------ Note this stands for
  2155. XX                        clear to send
  2156. XX    <"root" now can type back to "bob">
  2157. XX
  2158. XX    Not too much...
  2159. XX    cts                <------ "root" is saying it
  2160. XX                        is ok for "bob" to
  2161. XX                        write now.
  2162. XX
  2163. XXAt the end of the conversation, both parties must type <control-D>
  2164. XXto exit this facility.  That is the "end of file" character for XENIX
  2165. X!FUNKY!STUFF!
  2166. Xmkdir users
  2167. Xcd users
  2168. Xecho x - TEXT
  2169. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  2170. XXThe "users(L)" command is one way to find out which users
  2171. XXare logged on were.  This can be used with "write" to have
  2172. XXa conversation.
  2173. X!FUNKY!STUFF!
  2174. Xcd ..
  2175. Xmkdir who
  2176. Xcd who
  2177. Xecho x - TEXT
  2178. Xsed '1,$s/^X//' <<\!FUNKY!STUFF! > TEXT
  2179. XXThe "who(1)" command is used to find out when a person logged on.
  2180. XX
  2181. XXIF A PERSON HAS BEEN LOGGED ON FOR MORE THAN ONE DAY, DO NOT "write(1)"
  2182. XXTO THAT PERSON!
  2183. X!FUNKY!STUFF!
  2184. Xcd ..
  2185. Xcd ..
  2186. !FUNKY!STUFF!
  2187.