301 905 UNIX System V Release 1 Users Manual Jan83
301-905_UNIX_System_V_Release_1_Users_Manual_Jan83 301-905_UNIX_System_V_Release_1_Users_Manual_Jan83
301-905_UNIX_System_V_Release_1_Users_Manual_Jan83 301-905_UNIX_System_V_Release_1_Users_Manual_Jan83
User Manual: manual pdf -FilePursuit
Open the PDF directly: View PDF .
Page Count: 744
Download | |
Open PDF In Browser | View PDF |
UNIX* System User's Manual System V January 1983 Pursuant to Judge Greene's Order of August 5, 1983, beginning on January 1, 1984, AT&T will cease to u~.; "BELL" and the Bell symbol, with the exceptions asset forth in that Order. Pursuant thereto, any reference to "BELL" and I or the BELL symbol in this document is hereby deleted and "expunged". *UNIX is a trademark of Bell Telephone Laboratories, Incorporated. Copyright © 1983 Western Electric Company, Incorporated. Portions of this document were copyrighted 1979 Bell Telephone Laboratories, Incorporated. 1980 Western Electric Company, Incorporated. This document includes specific reference to the use of the UNIX System on a particular processor, the Western Electric Company 3B20S, which is not presently available except for internal use within the Bell System; however, the information contained herein is generally applicable to the use of the UNIX System on various processors which are available in the general trade. PDP, VAX, DEC, UNIBUS, MASSBUS, and SBI are trademarks of Digital Equipment Corporation. This manual was set on an AUTOLOGIC, Inc. APS-5 phototypesetter driven by the TROFF formatter operating under the UNIX system. INTRODUCfION This manual describes the features of the UNIX System. It provides neither a general overview of the UNIX System (for that, see "The UNIX Time-Sharing System," BSTJ, Vol. 57, No.6, Part 2, pp. 1905-29, by D. M. Ritchie and K. Thompson), nor details of the implementation of the system (see "UNIX Implementation," BSTJ, same issue, pp. 1931-46). Not all commands, features, and facilities described in this manual are available in every UNIX System. The entries not applicable for a particular hardware line will have an appropriate caveat stamped in the center of the mast of an entry. Also, programs or facilities being phased out will be marked as "Obsolescent" on the top of the entry. When in doubt, consult your system's administrator. This manual is divided into six sections, some containing inter-filed sub-classes: 1. Commands and Application Programs: 1. General-Purpose Commands. 2. 3. 4. 5. 6. 1C. Communications Commands. IG. Graphics Commands. System Calls. Subroutines: 3C. C and Assembler Library Routines. 3F. FORTRAN Library Routines. 3M. Mathematical Library Routines. 3S. Standard 1/0 Library Routines. 3X. Miscellaneous Routines. File Formats. Miscellaneous Facilities. Games. Section 1 (Commands and Application Programs) describes programs intended to be invoked directly by the user or by command language procedures, as opposed to subroutines, which are intended to be called by the user's programs. Commands generally reside in the directory Ibin (for binary programs). Some programs also reside in /usrlbin, to save space in Ibin. These directories are searched automatically by the command interpreter called the shell. Sub-class IC contains communication programs such as CU, send, uucp, etc. These entries may not apply from system to system depending upon the hardware included on your processor. Some UNIX Systems may have a directory called /usr/lbin, containing local commands. Section 2 (System Calls) describes the entries into the UNIX System kernel, including the C language interface. Section 3 (Subroutines) describes the available subroutines. Their binary versions reside in various system libraries in the directories /lib and /usr /lib. See intro (3) for descriptions of these libraries and the files in which they are stored. Section 4 (File Formats) documents the structure of particular kinds of files; for example, the format of the output of the link editor is given in a.out (4). Excluded are files used by only one command (for example, the assembler's intermediate files). In general, the C language struct declarations corresponding to these formats can be found in the directories /usr/include and /usrlinclude/sys. Section 5 (Miscellaneous Facilities) contains a variety of things. Included are descriptions of character sets, macro packages, etc. Section 6 (Games) describes the games and educational programs that, as a rule, reside in the directory /usr /games. - 3- Introduction Each section consists of a number of independent entries of a page or so each. The name of the entry appears in the upper corners of its pages. Entries within each section are alphabetized, with the exception of the introductory entry that begins each section. The page numbers of each entry start at 1. Some entries may describe several routines, commands, etc. In such cases, the entry appears only once, alphabetized under its "major" name. All entries are based on a common format, not all of whose parts always appear: The NAME part gives the name(s) of the entry and briefly states its purpose. The SYNOPSIS part summarizes the use of the program being described. A few conventions are used, particularly in Section 1 (Commands): Boldface strings are literals and are to be typed just as they appear. Italic strings usually represent substitutable argument prototypes and program names found elsewhere in the manual (they are underlined in the typed versionof the entries). Square brackets [I around an argument prototype indicate that the argument is optional. When an argument prototype is given as "name" or "file", it always refers to a file name. Ellipses repeated. 000 are used to show that the previous argument prototype may be A final convention is used by the commands themselves. An argument beginning with a minus -, plus +, or equal sign - is often taken to be some sort of flag argument, even if it appears in a position where a file name could appear. Therefore, it is unwise to have files whose names begin with -, +, or -. The DESCRIPTION part discusses the subject at hand. The EXAMPLE(S) part gives example(s) of usage, where appropriate. The FILES part gives the file names that are built into the program. The SEE ALSO part gives pointers to related information. The DIAGNOSTICS part discusses the diagnostic indications that may be produced. Messages that are intended to be self-explanatory are not listed. The WARNINGS part points out potential pitfalls. The BUGS part gives known bugs and sometimes deficiencies. Occasionally, the suggested fix is also described. A table of contents and a permuted index derived from that table precede Section 1. On each index line, the title of the entry to which that line refers is followed by the appropriate section number in parentheses. This is important because there is considerable duplication of names among the sections, arising principally from commands that exist only to exercise a particular system call. On most systems, all entries are available on-line via the man (1) command, q.v. -4 - HOW TO GET STARTED This discussion provides the basic information you need to get started on the UNIX System: how to log in and log out, how to communicate through your terminal, and how to run a program. (See the UNIX System User's Guide for a more complete introduction to the system.) Logging in. You must dial up the UNIX System from an appropriate terminal. The UNIX System supports full-duplex ASCII terminals. You must also have a valid user name, which may be obtained (together with the telephone number(s) of your UNIX System) from the administrator of your system. Common terminal speeds are 10, 15, 30, and 120 characters per second (II0, 150,300, and 1,200 baud); occasionally, speeds of 240, 480, and 960 characters per second (2,400, 4,800, and 9,600 baud) are also available. On some UNIX Systems, there are separate telephone numbers for each available terminal speed, while on other systems several speeds may be served by a single telephone number. In the latter case, there is one "preferred" speed; if you dial in from a terminal set to a different speed, you will be greeted by a string of meaningless characters (the login: message at the wrong speed). Keep hitting the "break" or "attention" key until the login: message appears. Hard-wired terminals usually are set to the correct speed. Most terminals have a speed switch that should be set to the appropriate speed and a half-/full-duplex switch that should be set to full-duplex. When a connection (at the speed of the terminal) has been established, the system types login: and you then type your user name followed by the "return" key. If you have a password (and you should!), the system asks for it, but does not print ("echo") it on the terminal. After you have logged in, the "return", "new-line", and "line-feed" keys will give exactly the same result. It is important that you type your login name in lower case if possible; if you type upper-case letters, the UNIX System will assume that your terminal cannot generate lower-case letters and that you mean all subsequent upper-case input to be treated as lower case. When you have logged in successfully, the shell will type a $ to you. (The shell is described below under How to run a program.) For more information, consult login(I), which discuss the login sequence in more detail, and stty (1), which tells you how to describe the characteristics of your terminal to the system (profile (4) explains how to accomplish this last task automatically every time you log in). Logging out. There are two ways to log out: 1. You can simply hang up the phone. 2. You can log out by typing an end-of-file indication (ASCII EOT character, usually typed as "control-d") to the shell. The shell will terminate and the login: message will appear again. How to communicate through your terminal. When you type to the UNIX System, a gnome deep in the system is gathering your characters and saving them. These characters will not be given to a program until you type a "return" (or "new-line"), as described above in Logging in. The UNIX System terminal input/output is full-duplex. It has full read-ahead, which means that you can type at any time, even while a program is typing at you. Of course, if you type during output, the output will have interspersed in it the input characters. However, whatever you type will be saved and interpreted in the correct sequence. There is a limit to the amount of read-ahead, but it is generous and not likely to be exceeded unless the system is in trouble. When the read-ahead limit is exceeded, the system throws away all the saved characters. -5- How To Get Started On an input line from a terminal, the character @ "kills" all the characters typed before it. The character # erases the last character typed. Successive uses of # will erase characters back to, but not beyond, the beginning of the line; @ and # can be typed as themselves by preceding them with \ (thus, to erase a \, you need two #s). These default erase and kill characters can be changed; see stty(l). The ASCII DC3 (control-s) character can be used to temporarily stop output. It is useful with CRT terminals to prevent output from disappearing before it can be read. Output is resumed when a DCI (control-q) or a second DC3 (or any other character, for that matter) is typed. The DCI and DC3 characters are not passed to any other program when used in this manner. The ASCII DEL (a.k.a. "rubouC') character is not passed to programs, but instead generates an interrupt signal, just like the "break", "interrupt", or "attention" signal. This signal generally causes whatever program you are running to terminate. It is typically used to stop a long printout that you don't want. However, programs can arrange either to ignore this signal altogether, or to be notified when it happens (instead of being terminated). The editor ed(l), for example, catches interrupts and stops what it is doing, instead of terminating, so that an interrupt can be used to halt an editor printout without losing the file being edited. The quit signal is generated by typing the ASCII FS character. It not only causes a running program to terminate, but also generates a file with the "core image" of the terminated process. Quit is useful for debugging. Besides adapting to the speed of the terminal, the UNIX System tries to be intelligent as to whether you have a terminal with the "new-line" function, or whether it must be simulated with a "carriage-return" and "line-feed" pair. In the latter case, all input "carriage-return" characters are changed to "line-feed" characters (the standard line delimiter), and a "carriage-return" and "line-feed" pair is echoed to the terminal. If you get into the wrong mode, the stty (1) command will rescue you. Tab characters are used freely in the UNIX System source programs. If your terminal does not have the tab function, you can arrange to have tab characters changed into spaces during output, and echoed as spaces during input. Again, the stty(1) command will set or reset this mode. The system assumes that tabs are set every eight character positions. The tabs (I) command will set tab stops on your terminal, if that is possible. How to run a program. When you have successfully logged into the UNIX System, a program called the shell is listening to your terminal. The shell reads the lines you type, splits them into a command name and its arguments, and executes the command. A command is simply an executable program. Normally, the shell looks first in your current directory (see The current directory below) for a program with the given name, and if none is there, then in system directories. There is nothing special about systemprovided commands except that they are kept in directories where the shell can find them. You can also keep commands in your own directories and arrange for the shell to find them there. The command name is the first word on an input line to the shell; the command and its arguments are separated from one another by space and/or tab characters. When a program terminates, the shell will ordinarily regain control and type a $ at you to indicate that it is ready for another command. The shell has many other capabilities, which are described in detail in sh (1). The current directory. The UNIX file system is arranged in a hierarchy of directories. When the system administrator gave you a user name, he or she also created a directory for you (ordinarily with the same name as your user name, and known as your login or home directory). When you log in, that directory becomes your current or working directory, and any file name you type is by default assumed to be in that directory. Because you are the owner of this directory, you have full permissions to read, -6- How To Get Started write, alter, or destroy its contents. Permissions to have your will with other directories and files will have been granted or denied to you by their respective owners, or by the system administrator. To change the current directory use cd(t). Path names. To refer to files not in the current directory, you must use a path name. Full path names begin with I, which is the name of the root directory of the whole file system. After the slash comes the name of each directory containing the next subdirectory (followed by a f), until finally the file name is reached (e.g., lusr/ae/filex refers to file filex in directory ae, while ae is itself a subdirectory of usr; usr springs directly from the root directory). See intro(2) for a formal definition of path name. If your current directory contains subdirectories, the path names of files therein begin with the name of the corresponding subdirectory (without a prefixed f). Without important exception, a path name may be used anywhere a file name is required. Important commands that modify the contents of files are cp(t), mY, and rm(I), which respectively copy, move (i.e., rename), and remove files. To find out the status of files or directories, use Is(I). Use mkdir(I) for making directories and rmdir(I) for destroying them. For a fuller discussion of the file system, see the references cited at the beginning of the It may also be useful to glance through Section 2 of this manual, which discusses system calls, even if you don't intend to deal with the system at that level. INTRODUCTION above. Writing a program. To enter the text of a source program into a UNIX System file, use ed(I). The principal languages available under the UNIX System are C (see cc(1», Fortran (see j77(I», and assembly language (see as(I». After the program text has been entered with the editor and written into a file (whose name has the appropriate suffix), you can give the name of that file to the a ppropria te language processor as an argument. Normally, the output of the language processor will be left in a file in the current directory named a.out (if that output is precious, use mv(I) to give it a less vulnerable name). If the program is written in assembly language, you will probably need to load with it library subroutines (see /d(I». Fortran and C call the loader automatically. When you have finally gone through this entire process without provoking any diagnostics, the resulting program can be run by giving its name to the shell in response to the $ prompt. If any execution (run-time) errors occur, you will need sdb(I) to examine the remains of your program. Your programs can receive arguments from the command line just as system programs do; see exec (2) . Text processing. Almost all text is entered through the editor ed(1). The commands most often used to write text on a terminal are cadI), pr(I), and nroff. The cat(I) command simply dumps ASCII text on the terminal, with no processing at all. The pr(t) command paginates the text, supplies headings, and has a facility for multicolumn output. Nroff is an elaborate text formatting program, and requires careful forethought in entering both the text and the formatting commands into the input file; it produces output on a typewriter-like terminal. Troff(t) is very similar to nroff, but produces its output on a phototypesetter {it was used to typeset this manual}. There are several "macro" packages (especially the so-called mm package) that significantly ease the effort required to use nroff and troff(l); Section 5 entries for these packages indicate where you can find their detailed descriptions. Surprises. Certain commands provide inter-user communication. Even if you do not plan to use them, it would be well to learn something about them, because someone else may aim them at you. To communicate with another user currently logged in, write (I) is used; mai/(I) will leave a message whose presence will be announced to another user -7- How To Get Started when he or she next logs in. The corresponding entries in this manual also suggest how to respond to these two commands if you are their target. When you log in, a message-of-the-day may greet you before the first $. -8- TABLE OF CONTENTS 1. Commands and Application Programs intro . . . . . . . . • • • introduction to commands and application programs 300 . . . • . . . • . handle special functions of DASI 300 and 300s terminals 4014 . . . . . . . . . . . . . . . paginator for the Tektronix 4014 terminal 450 . . . . . . . . . . . . handle special functions of the DASI 450 terminal acctcom . . . . . . . . . . . . . . search and print process accounting file(s) adb . • . . . • . • • . . . . . . . . . . . . . . • . . absolute debugger admin . . . . . . . . . . create and administer sees files ar . . . . . archive and library maintainer for portable archives . . . . . . . . . • . . . . archive and library maintainer ar. pdp arcv. . . . . convert archive files from PDP-II to common archive format as . . . . . . . . . . . . . • . . . . . . . • . common assembler as.pdp . . . . . • . . . . . . • . . • . . . . . . . assembler for PDp·ll asa . . . . . . • . . . . . • . . . interpret ASA carriage control characters awk . . . . . . . . . . . . . . . . pattern scanning and processing language banner . . . • . . . . . . . . . . . • . . . . . . . . . . • make posters basename . . . . . . . . . . deliver portions of path names be . . . . . . • . . . . . . . . . . . arbitrary-precision arithmetic language bdiff. . . . . . . . . . . . . . . . . . . • . . . . . . . . . . . big diff bfs . • . . . • . • . . . . . . . . . . . . . . . . • . . • big file scanner bs. • . . . a compilerlinterpreter for modest-sized programs cal . . . • . . . . . . . . . . . . . . . . . . . . . • . . print calendar calendar . • . • . . reminder service cat • . . . . . . . . . . . . . • . . . . . . . . concatenate and print files cb . . . . . . . . . . . . . . . . . • . . C program beautifier cc . . . . . . . . . . • . . . . . . . • e compiler cd . . • . • . . . • . . . . . . . . . change working directory cdc . . change the delta commentary of an sees delta cflow . . generate e flow graph chmod . . • . . . . . . . . . . . . . • . change mode chown . . . . . . . . . . . . . change owner or group cmp . . . . . . . . . . . . . • . . • . . . . . . . . . compare two files col . . • . . . . . • . . • . . • . . . . . . . . . . filter reverse line-feeds comb . . . . . . . . . • . . . . . . • • . . . . . . combine sees deltas comm . . . . . . . . . . . . . select or reject lines common to two sorted files convert . . • convert object and archive files to common formats cp . . . . • . . . . . • . . . . • • . . • . . • copy, link or move files cpio . . copy file archives in and out cpp . the e language preprocessor cprs . . . . . . . . . compress an IS25 object file crypt . . . . . . . . encode/decode csplit . . . • . . . . . . . . . • . context split ct . . . . . . • . spawn getty to a remote terminal cu . . . . . . . . . . call another UNIX system cut • . . •. . . . cut out selected fields of each line of a file cw . . . •. . . prepare constant-width text for troff cxref . . . • . . generate C program cross reference date. . . . . . • • • print and set the date dc . . • . • . . . . . . . . . . . • . desk calculator dd . . . . . • . . . • . • . . . . . • . . • • . . . convert and copy a file delta . . . . . • . • . . . . . . . . • make a delta (change) to an sees file deroff • . • . . . . . . . . . • . . remove nroff/troff, tbl, and eqn constructs diff • . . . . . . . . . . . . . . . • . . . . . . differential file comparator diff3 . . . • . . . . . . • • • . . • . . • 3-way differential file comparison . . . . . mark differences between files diffmk . . • . . . . . . . . . - 1- Table of Contents dircmp • • . . • . • . • • • • . . • • . • • . . . . . directory comparison dis . . . . • . • . • • • . • • . . . • • . • . . . • . 3B20S disassembler . . . • . HONEYWELL sending daemon, line printer daemon dpd • dpr . • . . • • . . . . . • . . off-line print du . • • • . • • • • . • . . • . . . • summarize disk usage • dump selected parts of an object file dump • • echo • . . . • • • . • • • . • • • . • . • . . . • . • . . echo arguments ed . . • . . . • . • . . . • . . . • . • . . . • . . . . • . . text editor eft . . . . . • Extended Fortran Language enable. . • . • . . . . • . . • . . enable/disable LP printers . • • . . set environment for command execution env . • • . . . . format mathematical text for nroff or troff eqn • . . expr . . . • • . . . . . • . . . . . . • evaluate arguments as an expression f77 . . . . . . . . . . . . . . . . . . . . . . . . . • Fortran 77 compiler • . . . . . . . . . . • . factor a number factor fget . . . . . . . . . • . . • • . retrieve files from the HONEYWELL 6000 file . . . . • • . • . . . • . . . . . . . • . . . . . . determine file type find . . . . . . . . . • . . • . . find files fsend . . . • . • . • . . . send files to the HONEYWELL 6000 fsplit . • • . . . • . . • . . . . split f77, ratfor, or efl files . • • send phototypesetter output to the HONEYWELL 6000 gcat gcosmail . . • . . . . . . • . • . . . . • . send mail to HIS user gdev . . . • . . • • . . • . graphical device routines and filters ged • . . . . • . . • • . . . • . . . . . . . . . . . . . graphical editor get • . • • . . . . . . • • . . . . . . . . . . get a version of an sees file getopt . . . . . . . . • . • . . . . . • . • . . . • parse command options graph . • . . . • . • . . . . . . • . . • . . . • . • . . . draw a graph graphics . . • • • . • . . • . . • • access graphical and numerical commands greek • . . . • . . . . . . • . . . . . . . . . . . . . select terminal filter grep . . . . . • • . . • . • . • . • • . . . . . . search a file for a pattern gutil . . . . . • • • • . . . • . . . • • . . • . . . . . graphical utilities . . • . • • • . . . . . . . . . • . . . . . • • . • ask for help help . hp . . . . . . • • handle special functions of HP 2640 and 2621-series terminals hpio . . . . • . • • . . • . • . . . . . HP 2645A terminal tape file archiver hyphen . • • . • . . . • . . • . . • . . . . . find hyphenated words id . . . . . • . • . • . • . • . • . . • print user and group IDs and names ipcrm . • • . . . • remove a message queue, semaph"ore set or shared memory id ipcs . . • • . . • . . • . • report inter-process communication facilities status join • • . • • . . • . . • • . . • . . • . • . • relational database operator kasb • . . . . . . • . assembler/un-assembler for the KMe 11 B microprocessor kill • . • . • . . . • . • • . . • • • . • . • . . . . . term ina te a process Id . . . • • . . . • . • . • • • . • . . . link editor for common object files Id.pdp . . • . . • . • • . . . • . . • . • . . . . • . . . • . . link editor lex . . . . . . . . . . . ' . . • • . generate programs for simple lexical tasks line. . • • . • . • • . . • . . . • . . • . . • • • . • . • . read one line lint • . • • • . . . • . . • . . . . . • . . . . . . . a e program checker list . • . • . • . • • . . . . . produce e source listing from 3B20S object file login. . . • • . • . . • . . • • . . . . . • . . . • . • . . • . • sign on logname • • . . • • • • • . . • • . • . • . • . . • . . • • get login name lorder . . find ordering relation for an object library Ip . . . . . • . . • • • • . . • • . send/cancel requests to an LP line printer Ipr • . . • • . • . • • . • . • • . • . . . . . . • • • line printer spooler . print LP status information Ipstat . . • • . Is • . • • • • • . • • • • • • . • • . • . . • • . list contents of directories m4 . • . • • . • • . • • • • • . . . • • . • . . • • . . macro processor machid . . provide truth value about your processor type mail • • • • . . . • • . • • . . • . . • • . send mail to users or read mail - 2- Table of Contents make . • • . . . . . . • maintain, update, and regenerate groups of programs makekey . . . . . . . . . . . . . . • . . . . . • . generate encryption key man . . . . . . . . • . . . . • . . • . . . • . print entries in this manual mesg • . . . . . • • . . . • . . . . . . . . . . . permit or deny messages mkdir . . . • . . • . • • • . . • • . . . • . . . . . . . make a directory mm . . . • . . . . . • print/check documents formatted with the MM macros mmt . . . . • . • . . • . • • • . typeset documents, view graphs, and slides net . • . . . . . . • . . . . • . . . execute a command on the peL network newform . . . . . . . . . . . . . . • • . • change the format of a text file newgrp . . . . • log in to a new group news. • . • • . • • . . . . . . . • . • . • . . . . . . . print news items nice . . . . . . . . . . . . . . . . . . . . . run a command at low priority nl . • . . . • • . . . . . . • . . . . . • . . . . . . line numbering filter nm . • • . . . . . . . . . . . . . . . print name list of common object file nm.pdp . . . . . . . . . . . . . . . . . . . . . . . • . . print name list nohup • . . . . • . . . • . • . run a command immune to hangups and quits nroff • . . . • • • . . . • . . . . . . . . . . . . . . . . . . format text nscstat . . query the operation status of the Nse network nsctorje . • . . . • . . . • . • . re-route jobs from the NSe network to RJE nusend . • . . . . . . . . • . send files to another UNIX on the NSe network od . • . . . . . . . . . . . . . • . . . . . . . . . . • . . . octal dump pack. . . . . . . . . . . • . . . . . . . . . • . compress and expand files passwd . . . . • . . . • • . . . . . . . . • . • . . change login password paste. . . . . • • merge same lines of several files or subsequent lines of one file pr • . • . . . • print files prof . • . • . . . . . . . . . • . . . . . . . . . . . . display profile data prs . . . . . . • . . . . . . . . . . . . . . . . . . • print an sees file ps . • . . . . . . . . . . . . . . . . . . . . . . . . report process status ptx . . . . . . . . . . . . . . . . . . . . . . . . . . . . permuted index pwd . • . • . . • . . . . . . . . . . . . . . • . . working directory name ratfor . . . • . . . . . . . . . . . . . . . . . . . rational Fortran dialect regcmp . . . . . • . • . • . • . . . . . . . • . regular expression compile rjestat . . . • . . . . • . . . RJE status report and interactive status console rm . . . • • . . . . . • . . . . . . . . . . . . remove files or directories rmdel . . . . . . . . . . • . • . . . . . remove a delta from an sees file sact . . . . print current sees file editing activity . . . . . disk access profiler sadp . . . • . . sag . . . . . . . . . • system activity graph sar . . . . . • . . . system activity reporter scat . . . . • . . . . . . . concatenate and print files on synchronous printer scc. . . . . . . . . . . . . . . . . • . e compiler for stand-alone programs sccsdiff • • . . . • . . . • . • . . . . compare two versions of an sees file sdb . . . . . . . . • . • . • . . . • . . . . . . . . . symbolic debugger sdiff . . . . . . . . . • . . • . . . . . . . side-by-side difference program se • . . . . . • . • . • . • . • . . . . . . screen editor for video terminals sed. . . . . . . . . . . . . . . . . . . . . . . . . . . • . stream editor send . • . . . . . . . . . . • . . • . . gather files and/or submit RJE jobs sh. . . . . . . . shell, the standard/restricted command programming language size. . . . . • . • . . . . . • . . . print section sizes of common object files size. pdp . . . . • . . print sizes of object files sleep • . • . . • . . • • • . • • . . . . . suspend execution for an interval sno . . . . • . . . • . . . . . . • . . . . . . . . . SNOBOL interpreter sort . • . • . . . . . . . . . . . • • • . • . • . . sort and/or merge files spell • . . . . . • • . . . . • . • • . . . . . . . . • . find spelling errors spline. . . . . . . . . . . . . . • • . . . . . . . interpolate smooth curve split . . . • • • • . . . . . . . . • . . • • split a file into pieces stat • . • . . . . . • . • . statistical network useful with graphical commands -3- Table of Contents stlogin . . . • • . . • . • . • . . . . sign on to synchronous terminal strip ••• strip symbol and line number information from a common object file strip. pdp . . • . . • • . • . • • • . • . . remove symbols and relocation bits ststat . . • • report synchronous terminal facilities status stty. . . . . • • • . • . • • . • • . . • • . . set the options for a terminal su . . • . • . . . • . • . . • . . • . . . become super-user or another user sum. • . • . • . • . • . • . • . • . print checksum and block count of a file sync . • . • • . . • . . . . • . . • . . • . . . . • update the super block tabs. • • • . . • • . • . . • • . • . . • . . • . set tabs on a terminal tail . . . deliver the last part of a file tar . • • • . . . • • • • • . . . . . • . • • tape file archiver tbl • . . • • . • . . . . . • . . format tables for nroff or troff tc . . . . . • . . • • . • . . . . • . . • . . . . phototypesetter simulator tee . . • . • . • . . . . . • . • . . . . . • . . . • . . . . . pipe fitting test . . • . . . • • . . . . • . . . . . . • . condition evaluation command time. • . • . • . . . • . • . . . • . . . . . . . . . . . time a command timex . • . . . . . • . time a command; report process data and system activity toc . • . • . • . • • • • • . . . . . • . graphical table of contents routines touch . . update access and modification times of a file tplot • . • . . . . . . . . . • . • . . . . . . . . . • . . graphics filters tr . . . . . . . • • • . . . . . • • . . . . . . . . . translate characters troff • . . . • . . . • . • . • . • . . . . . • . . . • . . . . typeset text trouble . . . • log a trouble report true . • . • . • . • • . . • . . . . . . . . . . . . . provide truth values tsort . • . • . . . • . . . • . . . • . . . • . . . . . • . topological sort tty . • . • . • . • . . . • . • . • • . . . . . . . get the terminal's name umask . . . . . . set file-creation mode mask uname . . . • . . . print name of current UNIX system unget . . . . • • . . undo a previous get of an sees file uniq . report repeated lines in a file units • . . . . . . • . • conversion program uucp . . . . . . . . • unix to unix copy uustat . . uucp status inquiry and job control uuto • ..•.•. . . . . public UNIX-to-UNIX file copy uux . . unix to unix command execution val . . . . validate sees file vc . . . . . . . . . . • version control vpr . . . • . . . . Versatec printer spooler wait . . • . • . • • • • • . • • . . • . . . . . await completion of process wc . . . . . • . . . • . . . • . . . . . . . . . . . • . . . . word count what . . . . • . . . • . . . • . . • . . . . . . • . • identify sees files who . . . . . . • . . . . . . . . . . . • who is on the system write • . . . • . • . . . . . . • write to another user xargs . construct argument list(s) and execute command yacc • • • . . • . . . . . yet another compiler-compiler 2. System Calls intro. . . • . • . . . • • . . • introduction to system calls and error numbers access . • . . . . determine accessibility of a file acct • • • . • • . • • . . • . . • . . . enable or disable process accounting alarm . • . • . . . . . . . . . . • . . . . . . . set a process's alarm clock brk • • . • . • . • . . . . . • . . • . change data segment space allocation chdir. • . . . . . . . • . . . • • • • . . . . . . change working directory chmod . . . . . . . . change mode of file chown . . • • •. . change owner and group of a file chroot • . . . change root directory close. • . . . . . . . . close a file descriptor -4- Table of Contents creat . . . . . • . . . • • . . . . create a new file or rewrite an existing one dup . duplicate an open file descriptor exec • . . . execute a file exit. . . . • . • . . . . . . . . terminate process fcntl . . . . . . . . . . • . . . • . . . . . . . . file control fork . . . . . . . . . . . . . . . . . . . . . . . . . create a new process getpid . . . . . . . • • . . get process, process group, and parent process IDs getuid . • . . . . get real user, effective user, real group, and effective group IDs ioctl . . . . . . . . • . . . . . . . . control device kill . . . . . • . . send a signal to a process or a group of processes . . . . . . . . . . . . . . . . . . . • . . link to a file link • lseek. . • . . . • . • . • . . move read/write file pointer rna us . . . . . . • . • . multiple-access-user-space (shared memory) operations mknod . . . make a directory, or a special or ordinary file mount. • • . . . . . . • . • . . . . . • . . . . . . . mount a file system msgctl . . • . . . • . . . . . . . . . . . . . . message control operations msgget . . . . . . . get message queue msgop . . . . . . . . • . . . . . . . • . . . . . . . . message operations nice . . . . . . . change priority of a process open . . . . . . . . • . • . . . . . . . . . . . open for reading or writing pause . . . . . . . . . • . . . suspend process until signal pipe . . . . . . . . . . . create an interprocess channel plock . . . . . . . . . . . . lock process, text, or data in memory profil . . . . . . . . . . . . . . execution time profile ptrace . . . . . . . . • . . . . . . . • . . . . . . . . . . process trace read . . . . . . • . . . . . . . . . . . . . . . . . • . . . read from file semctl . semaphore control operations semget . . . . . • . . . . . . . . . . . . . . . . . get set of semaphores semop • . . . • . . . • . . . . . . . • . . . . . . . semaphore operations setpgrp . . • . • . . . . set process group ID setuid . . . . . . . . . . . . . . . . . . . • . . . set user and group IDs shmctl . . . . • . . . • . • • . . . . . . shared memory control operations shmget. • . . . . . • . get shared memory segment shmop . . . . • . . . • . . . . . • . . . . . . . shared memory operations signal . . • . . . • . • . . . . . . specify what to do upon receipt of a signal stat • . . . . . . . . . . . . . . . . . . . . . . . . . . . get file status stime . . • . . . . . . . . . . . . . . . . . . . . . . . . . . . set time sync . . . . . . . . . . . . . . . . . . . . . . . . . . update super-block sys3b . . . • . • . . . . . . . . . . . . . . . . 3B20S specific system calls time . . . . . . . . . . . . . . . . . . . . . . . . . • . . . . get time times . • . . . . . . . . . . . . . . . . get process and child process times ulimit . . . . . . get and set user limits umask . . • . . . . . . . . . . . . . • . . . set and get file creation mask umount • . . . . . . . . . . • . . . . . . . . . . . unmount a file system uname . . . • . . • • . . . . . . . . . . get name of current UNIX system unlink . . . . • . . . • • . • . . . . . . • . . . . remove directory entry ustat . . . • • . . . . . . . . get file system statistics utime • • . • . . . . . set file access and modification times wait . • . . . . wait for child process to stop or terminate write. • . . . . . • . . . . . . . write on a file 3. Subroutines intro . . . . • . . . . . . . . • introduction to subroutines and libraries a641 . . . . . • . . . . convert between long integer and base-64 ASCII string . . . . . generate an lOT fault abort . . • abort . • • . . . . . . . . • . . terminate Fortran program abs . • . . . return integer absolute value -5- Table of Contents abs. . . . • . • . . . . . . . . . . . . . • . . . • Fortran absolute value acos . . . • . • . Fortran arccosine intrinsic function aimag . . Fortran imaginary part of complex argument aint . . . . • .. . . . . Fortran integer part intrinsic function asin . . . . . . . . Fortran arcsine intrinsic function assert . . . . . . . . . . . . . . . . verify program assertion atan . . • . • . . . . . . . . . Fortran arctangent intrinsic function atan2 . . . .. • . . . . Fortran arctangent intrinsic function atof •. •.... . . . convert ASCII string to floating-point number bessel . • . . . • . . . . . . . . Bessel functions bool. . . . . . • . . . . . . . . . . . . . Fortran bitwise boolean functions bsearch . . . . . . . • . . . . . . . . . . . . . . . . . . . binary search clock . . . . . . . • . . . . . . . . report CPU time used conjg . . . . • . . . . . . • . . Fortran complex conjugate intrinsic function conv . . . . . • . . . . . . . . . . . . . . . . . . . translate characters cos . . . . . • . Fortran cosine intrinsic function cosh . . . • . . . . . . . . . . . Fortran hyperbolic cosine intrinsic function crypt. . . . • . • . . . . . . . . . . . . . . . . generate DES encryption ctermid . . • . . . . . . . . . . . . . . . . generate file name for terminal ctime . . . . . . . . . . . . . . . . . . . . convert date and time to string ctype. . • . • . . . . . . . . . . . . . . . . . . . . . classify characters cuserid . . . . . . . . . . . . • . . . . get character login name of the user dial . . . . . • . . . . . . . . establish an out-going terminal line connection drand48 . . . . . . generate uniformly distributed pseudo-random numbers ecvt . . . . . . . . • . . . . . . . . convert floating-point number to string end . . . • . . . . . . . . . . . . . . . . . . . last locations in program erf . . . . . • . . . . . • . error function and complementary error function exp . . . . . . . . . . . . . . . • . . Fortran exponential intrinsic function exp • . . . • . . . • . . . exponential, logarithm, power, square root functions fclose. . • . . . . . . • . . . . . . . . . . . . . . close or flush a stream ferror. . . . . . • . • . . . . . . . . . . . . . . . stream status inquiries floor . . . . . • . . . . . . . floor, ceiling, remainder, absolute value functions fopen . . . . • . . . . . . . . . . . . . • . . . . . . . . open a stream fread . . • . . • . . . . . . . . . . . . . . . . . . . binary input/output frexp . . . • . . . . . . . . . . . manipulate parts of floating-point numbers fseek • . • . • . . . . . . . . . • . . . reposition a file pointer in a stream ftw • . . . . . . . . . walk a file tree ftype . . . . . . • . • . . . . . • . . . • . explicit Fortran type conversion gamma . . . . . • . . . • . . . . . . . . . . . . . . log gamma function getarg • . . . • . . . . . . . . . • . return Fortran command-line argument getc . . . . . . get character or word from stream getcwd . . . • . • . . . . . • . . get path-name of current working directory getenv . • • . • . • . . . . . . . . . . . return value for environment name getenv . . . . . • . . . . . . . . . . . return Fortran environment variable getgrent . . • . . . . . . . . . . . . . . . . . . . . . get group file entry getlogin • . • . . . . . • . . . . . . . . . . . • . . . . . get login name getopt . • • . • . .. . get option letter from argument vector getpass . . . . . . read a password getpw . . . . . .. . . • . . . . . . get name from UID getpwent • . • . . • .. . . . . . . . . get password file entry gets • . . . get a string from a stream getut . • . • . • • • . • . • . . . . . . . . . . . . access utmp file entry hsearch • . • . • . . . . • . • • . • . . . . . . manage hash search tables hypot . . • • . . . . . . • . . • . . . . . . • Euclidean distance function index . • . . . • . . . • . . return location of Fortran substring 13tol . • . • convert between 3-byte integers and long integers Idahread • • read the archive header of a member of an archive file -6- Table of Contents ldclose . . . . . . . . . . . • . . . • . . . . . close a common object file ldfhread • . . . . . . . . . . • . read the file header of a common object file ldlread . . . . . manipulate line number entries of a common object file function ldlseek . . . . . seek to line number entries of a section of a common object file ldohseek . . . . . . . . seek to the optional file header of a common object file ldopen • . . . . . . . • . . . . open a common object file for reading Idrseek . . . . . . seek to relocation entries of a section of a common object file ldshread . . . . . read an indexed/named section header of a common object file ldsseek . . . . . • . . seek to an indexed/named section of a common object file ldtbindex . compute the index of a symbol table entry of a common object file ldtbread . . . . . . read an indexed symbol table entry of a common object file ldtbseek • . . . . . . . . . . seek to the symbol table of a common object file len . • . • . • . . . . . . . . . . . . • return length of Fortran string log. . . . . . . . . . . . . . • • Fortran natural logarithm intrinsic function 10giO • . . . . . . . . . . . . . Fortran common logarithm intrinsic function logname . . . . . . . . . . . . . . . . . . . . . return login name of user lsearch . . . . . . . . . . . . • . • . . . . . . . linear search and update malloc . . . . . . . . . . . . . . . . . main memory allocator matherr . . . . . . . . • . . . . . . . . . . . . . error-handling function max . . . • . . . . . . . • . • . . . . . Fortran maximum-value functions mclock . . . . . . . . . . . . . . . . . . . return Fortran time accounting memory . . . . . . . . . . . . . . . . . . . . . . . . memory operations min. . . . • . . . Fortran minimum-value functions mktemp. . . . . • . . . . . . . make a unique file name mod. • . . . . • . Fortran remaindering intrinsic functions monitor . . . . . . . . . . . . . prepare execution profile nlist . . . . . . . . . . . . . . . • . . . . . . . get entries from name list perror. . . . . • . . . . . . . . . . . . . . . . . . system error messages plot . . . .. . . graphics interface subroutines popen . . • . . . . . . . . initiate pipe to/from a process printf . . . . . . . . print formatted output putc . . . put character or word on a stream putpwent . . . . . . write password file entry puts . . . . . . . . • . • . . . . . . . . . . . . put a string on a stream qsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . quicker sort rand . . . . • . . . . . • . . . . . . . . simple random-number generator rand . . . • . . . . . . . . . . . Fortran uniform random-number generator regcmp . . . . . . . . . . • . • • • . compile and execute regular expression round . . . Fortran nearest integer functions scanf . . . . . • . . . . . . convert formatted input setbuf . . • . • . . . . . . assign buffering to a stream setjmp . . . . . . . . . . . . • . . . non-local goto sign . Fortran transfer-of-sign intrinsic function signal . specify Fortran action on receipt of a system signal sin. . . . . . . . Fortran sine intrinsic function sinh . Fortran hyperbolic sine intrinsic function sinh • . . . . . . . . . hyperbolic functions sleep . . • . • . . . . suspend execution for interval sputl . access long numeric data in a machine independent fashion. sqrt . . . . . • • . . • • • • . Fortran square root intrinsic function ssignal • . . • • . . . • . . . . . . . . . • . software signals stdio . • • • . . . • • . . . • • • . standard buffered input/output package stdipc • . . . . . . . • • • . • standard interprocess communication package string • • . . . • • • • . . . . • • . . . . . . . . . . . string operations . . • . . . convert string to integer strtol . . . • . . swab . . • . . . . . . . . . . swap bytes system . . . . . • . issue a shell command from Fortran -7- Table of Contents system . • • . . . • • • • . . • • . . • . . • issue a shell command tan . • . . . . • . • . • • • • • . • Fortran tangent intrinsic function tanh . . • . . • . . . • • . . • Fortran hyperbolic tangent intrinsic function tmpfile • . • . . . . . . create a temporary file tmpnam . create a name for a temporary file trig . . . . • . trigonometric functions tsearch . . • . . manage binary search trees ttyname . . • . . . • . . . • . find name of a terminal ttyslot . . find the slot in the utmp file of the current user ungetc • • . . . . push character back into input stream x25alnk . . attach or install a BX.25 link x25clnk . . . . . . . . . . . . • . . . . . . . . change over a BX.25 link x25hlnk • . . . . . . . . . . . . . . . . . . . halt or detach a BX.25 link x25ipvc . . . . • . . . . . . . . . . . install or remove a PVC on a link 4. File Formats intro . . . . . . . . . . introduction to file formats a.out . . . . . common assembler and link editor output a.out.pdp . • . . PDP-II assembler and link editor output acct . . . . . . per-process accounting file format ar . . . . . . . . . . . . common archive file format ar.pdp . . . . . . . . . . . • . . . . . . . . . . . • . archive file format checklist . . . . list of file systems processed by fsck core . format of core image file cpio . . . . . . • . . . • format of cpio archive dir . . . . • format of directories errfile . . . . error-log file format filehdr . file header for common object files fs . . . . . format of system volume fspec . . . format specification in text files gettydefs . speed and terminal settings used by getty gps . graphical primitive string, format of graphical files group . . . . • . . . • . • . . . . . . . . . . . group file inittab . . . . . . . . . . . . . . • . • . . . . . script for the init process inode . . . . . . • . . . . . . • . . . • . . . • . . . format of an inode issue • . . . . . . . . • . • issue identification file Idfcn • . . . . . . • . common object file access routines linenum . . . line number entries in a common object file master.dec . . . . . . . . master device information table master.u3b . . . . . . . . . . . . . master device information table mnttab. . . . . • . • . • . . . . . . . . . . . . mounted file system table passwd . . . .. . . • . • . . password file plot . . . . . . . . . . . . . • • . . • . . . • . . . . graphics interface pnch . • . . . . . . • • . • . • . . . . . . . . file format for card images profile . . . . . • . . . • . . . . . . setting up an environment at login time reloc . . . . . . . . • . • . . relocation information for a common object file sccsfile . . . . . . . . . . • . . . . . • . . . . . . . format of SCCS file scnhdr ..... . section header for a common object file syms . . common object file symbol table format system • . . format of 3B20S system description file utmp . . • . • . • . . utmp and wtmp entry formats 5. Miscellaneous Facilities intro ascii •. environ . . introduction to miscellany . map of ASCII character set . . • . . . user environment -8- I I Table of Contents eqnchar . . . . . • . . special character definitions for eqn and neqn fcntl . . . . . . . . . . . . . . . . file control options greek. . . ... • .. . . graphics for the extended TTY-37 type-box man . . . . . • . . . • . • . . . macros for formatting entries in this manual mm . . . . . . • . • • • . the MM macro package for formatting documents mosd • . . . • . . the OSDD adapter macro package for formatting documents mptx . . . . . . . . . . . the macro package for formatting a permuted index mv . a troff macro package for typesetting view graphs and slides regexp . regular expression compile and match routines stat . . . . . . . . • . . . . . . data returned by stat system call term . . . . . . . . . . . . . . conventional names for terminals types . . . . . . . . . . . . . . . . . . . . . . primitive system data types 6. Games intro . . . . introduction to games arithmetic . . . . . provide drill in number facts back. . . . . . . . . . . • . . the game of backgammon bj . . . . the game of black jack chess . . . . . . . . . . . . . . . . . . . . . . . . . . the game of chess craps . . . . . . . . • . . . • . . . . . . . . . . . • . the game of craps hangman . . . . . • . . . • . . . . . . . . . . . . . . . guess the word jotto . . . • . . . • . . . . . . . . . . . . . . . . secret word game maze _ . . . . . . . . . . . . . . . . . . . . . . . . . generate a maze moo . . . . . . . . . . . . . . . . . . . . . . . . . . . . guessing game quiz . . . . . test your knowledge reversi . . . . . . a game of dramatic reversals sky . . . . . . . obtain ephemerides ttt . . . . . . . . . . . . . . tic-tac-toe wump . . . . . . . . . . • . . . . . . . . . the game of hunt-the-wumpus -9- PERMUTED INDEX /functions of HP 2640 and handle special functions of HP archiver. hpio: HP functions of DASI 300 and/ /special functions of DASI of DASI 300 and 300s/ 300, functions of DASI 300 and dis: produce e source listing from sys3b: system: format of 13tol, !to13: convert between comparison. diff3: Tektronix 4014 terminal. paginator for the Tektronix of the DASI 450 terminal. special functions of the DASI files from the HONEYWELL send files to the HONEYWELL output to the HONEYWELL f77: Fortran long integer and base-64/ program. Fortran absolute value. value. adb: abs: return integer dabs, cabs, zabs: Fortran /floor, ceiling, remainder, of a file. touch: update utime: set file accessibility of a file. commands. graphics: machine/ sput!, sget!: sadp: disk Idfcn: common object file /setutent, endutent, utmpname: access: determine enable or disable process acct: per-process search and print process mclock: return Fortran time process accounting. file format. process accounting file(s). sin, cos, tan, asin, intrinsic function. sag: system sar: system current sees file editing report process data and system formatting/ mosd: the OSDD sees files. admin: create and imaginary part of complex/ part intrinsic function. alarm: set a process's clock. change data segment space 2621-series terminals. 2640 and 2621-series/ hp: 2645A terminal tape file 300, 300s: handle special . 300 and 300s terminals. 300s: handle special functions 300s terminals. /special 3B20S disassembler. . . . 3B20S object file. list: 3B20S specific system calls. 3B20S system description file. 3-byte integers and long/ 3-way differential file 4014: paginator for the 4014 terminal. 4014: 450: handle special functions 450 terminal. 450: handle 6000. /fget.demon: retrieve 6000. fsend: . . . . . . 6000. /send phototypesetter 77 compiler. . . . . . . a64l, 164a: convert between abort: generate an lOT fault. abort: terminate Fortran abs, iabs, dabs, cabs, zabs: abs: return integer absolute absolute debugger. absolute value. absolute value. abs, iabs, absolute value functions. access and modification times access and modification times. access: determine . . . . . access graphical and numerical access long numeric data in a access profiler. access routines. access utmp file entry. accessibility of a file. accounting. acct: accounting file format. accounting file(s). acctcom: accounting. • . . . . . . acct: enable or disable acct: per-process accounting acctcom: search and print acos, atan, atan2:/ acos, dacos: Fortran arccosine activity graph. activity reporter. activity. sact: print activity. /time a command; adapter macro package for adb: absolute debugger. admin: create and administer administer sees files. . aimag, dimag: Fortran . aint, dint: Fortran integer alarm clock. • . • . . alarm: set a process's alarm . allocation. brk, sbrk: - 1- hp(1) hp(1) hpio(1) 300(1) 300(1) 300(1) 300(1) dis(1) list(l) sys3b(2) system(4) 13tol(3e) diff3(J) 4014(1) 4014(1) 450(1) 450(1) fget (1 C) fsend(lC) gcat(1C) f77(1) a641(3C) abort(3C) abort (3 F) abs(3F) abs(3C) adb(1) abs(3C) abs(3F) floor (3 M) touch(l) utime(2) access (2) graphics(IG) sput!(3X) sadp(J) Idfcn (4) getut(3C) access(2) acct(2) acct(4) acctcom(l) mclock(3F) acct(2) acct(4) acctcom(l) trig(3M) acos (3 F) sag(IG) sar(1) sact(1) timex(I) mosd(5) adb(1) admin(1) admin(l) aimag(3F) aint(3F) alarm(2) alarm(2) brk(2) Permuted Index realloc, calloc: main memory natural logarithm/ log, logarithm intrinsic/ log 10, Fortran/ max, maxO, max, maxO, amaxO, max 1, Fortran/ min, minO, min, minO, aminO, min 1, remaindering intrinsic/ mod, rshift: Fortran bitwise/ sort: sort send, gath: gather files Fortran nearest integer/ link editor output. link editor output. introduction to commands and maintainer. maintainer for portable/ format. language. bc: acos, dacos: Fortran maintainer. ar: for portable archives. ar: cpio: format of cpio ar: common ar: header of a member of an common archive/ arcv: convert convert: convert object and files from PDP-II to common an archive/ ldahread: read the HP 264SA terminal tape file tar: tape file maintainer for portable cpio: copy file asin, dasin: Fortran atan2, datan2: Fortran atan, datan: Fortran from PDP-II to common archive/ imaginary part of complex return Fortran command-line command. xargs: construct getopt: get option letter from expr: evaluate echo: echo bc: arbitrary-precision number facts. expr: evaluate arguments characters. asa: interpret control characters. ascii: map of set. long integer and base-64 number. atof: convert and/ ctime, localtime, gmtime, trigonometric/ sin, cos, tan, intrinsic function. help: output. a.out: common output. a.out: PDP-II as: common as: allocator. malloc, free, . . . . alog, dlog, clog: Fortran alog 10, dlog 10: Fortran common amaxO, maxi, amaxI, dmaxI: amax 1, dmax 1: Fortran/ . aminO, mini, amini, dminI: amin 1, dmin 1: Fortran/ amod, dmod: Fortran and, or, xor, not, lshift, . and/or merge files. and/or submit RJE jobs. ani nt, dnint, nint, idnint: a.out: common assembler and a.out: PDP-II assembler and application programs. intro: ar: archive and library ar: archive and library ar: archive file format. ar: common archive file arbitrary-precision arithmetic arccosine intrinsic function. . archive and library . . . . . archive and library maintainer archive. archive file format. archive file format. archive file. /the archive archive files from PDP-Ii to archive files to common/ archive format. /archive archive header of a member of archiver. hpio: . . . . . . archiver. . . . . . . . . . • archives. /archive and library archives in and out. arcsine intrinsic function. . . arctangent intrinsic function. arctangent intrinsic function. arcv: convert archive files . argument. /dimag: Fortran . argument. getarg: . . . . . argument list(s) and execute argument vector. arguments as an expression. arguments. . . . . • . . arithmetic language. . . . arithmetic: provide drill in as an expression. as: assembler for PDP-II. as: common assembler. . ASA carriage control asa: interpret ASA carriage ASCII character set. ascii: map of ASCII character ASCII string. /convert between ASCII string to floating-point asctime, tzset: convert date asin, acos, atan, atan2: . . asin, dasin: Fortran arcsine ask for help. • . . . . assembler and link editor assembler and link editor assembler. . . . . . assembler for PDP-II. . - 2- . malloc(3C) log(3F) 10gi0(3F) max(3F) max(3F) min(3F) min(3F) mod (3 F) boo I(3 F) sort (1) send(l C) round(3F) a.out(4) a.out.pdp(4) intro(I) ar.pdp(I) ar(I) ar.pdp(4) ar(4) bc(I) acos(3F) ar.pdp(I) ar(I) cpio(4) ar(4) ar.pdp(4) Idahread(3X) arcv(I) convert(l) arcv(I) ldahread (3X) hpio(I) tarO) ar(I) cpio(I) asin(3F) atan2(3F) atan(3F) arcv(I) aimag(3F) getarg(3F) xargs(I) getopt(3C) expr(I) echo(I) bc(I) arithmetic(6) expr(I) as.pdp(I) as(I) asa(I) asa(I) ascii(S) ascii(S) a641(3C) atof(3C) ctime(3C) trig(3M) asin(3F) help(I) a.out(4) a.out.pdp(4) as(I) as.pdp(I) Permuted Index KMC 11 B/ kasb, kunb: assertion. assert: verify program setbuf: sin, cos, tan, asin, acos, arctangent intrinsic/ arctangent intrinsic/ cos, tan, asin, acos, atan, floating-point number. integer. strtol, atol, integer. strtol, link. x25alnk, x25ilnk: wait: processing language. ungetc: push character back: the game of between long integer and portions of path names. arithmetic language. cb: C program jO, j 1, jn, yO, y 1, yn: fread, fwrite: bsearch: tdelete, twalk: manage remove symbols and relocation /not, Ishift, rshift: Fortran bj: the game of sum: print checksum and sync: update the super rshift: Fortran bitwise space allocation. modest-sized programs. stdio: standard setbuf: assign x25ilnk: attach or install a x25clnk: change over a x25dlnk: halt or detach a swab: swap cc, pec: programs. scc: cflow: generate cpp: the cb: lint: a cxref: generate object file. list: produce value. abs, iabs, dabs, dc: desk cal: print cu: data returned by stat system malloc, free, realloc, intro: introduction to system sys3b: 3B20S specific system to an LP line printer. lp, pnch: file format for assembler/un-assembler for the assert: verify program assertion. ....... . assign buffering to a stream. atan, atan2: trigonometric! atan, datan: Fortran . . atan2, datan2: Fortran . . atan2: trigonometric/ sin, atof: convert ASCII string to atoi: convert string to atol, atoi: convert string to attach or install a BX.25 . await completion of process. awk: pattern scanning and back into input stream. back: the game of backgammon. backgammon. ...... . banner: make posters. base-64 ASCII string. /convert basename, dirname: deliver bc: arbitrary-precision bdiff: big diff. . beautifier. Bessel functions. bfs: big file scanner. binary input/output. binary search. binary search trees. tsearch, bits. strip:.. . . . . . bitwise boolean functions. bj: the game of black jack. black jack. . . . . block count of a file. . . block. . • . . • . . . boolean functions. Ilshift, brk, sbrk: change data segment bs: a compiler/interpreter for bsearch: binary search. . . . . buffered input/output package. buffering to a stream. BX.25 link. x25alnk, BX.25 link. BX.25 link. x25hlnk, bytes. .• . . • . C compiler. C compiler for stand-alone C flow graph. . • . . . C language preprocessor. C program beautifier. C program checker. C program cross reference. C source listing from 3B20S cabs, zabs: Fortran absolute cal: print calendar. calculator. . . . . . . . calendar. . . . . . . . . calendar: reminder service. call another UNIX system. call. stat: ..•.••. calloc: main memory allocator. calls and error numbers. calls. • • . • . . . . . cancel: send/cancel requests card images. . . . . . . -3- kasb(l) assert(3X) assert(3X) setbuf(3S) trig(3M) atan(3F) atan2(3F) trig(3M) atof(3C) strtol(3C) strtol(3C) x25alnk (3C) wait(l) awk(l) ungetc(3S) back(6) . back(6) banned!) a641(3C) basename{ 1) bc(l) bdiff(l) cb(l) bessel (3 M) bfs(l) fread(3S) bsearch (3C) tsearch (3C) strip.pdp(!) boo1(3 F) bj(6) bj(6) sum(l) sync(!) bool(3F) brk(2) bs(l) bsearch (3C) stdio(3S) setbuf(3S) x25alnk(3C) x25clnk(3C) x25hlnk(3C) swab(3C) cc(l) scc(!) cflow(l) cpp(l) cb(l) lint (1) cxref(l) list(l) abs(3F) cal(l) dc(l) cal(!) calendar(!) cu(lC) stat (5) malloc(3C) intro(2) sys3b(2) Ip(!) pnch(4) Permuted Index asa: interpret ASA carriage control characters. files. cat: concatenate and print cb: C program beautifier. . cc, pcc: C compiler. function. cos, dcos, ccos: Fortran cosine intrinsic cd: change working directory. commentary of an SCCS delta. cdc: change the delta ceiling, remainder,! floor, ceil, fmod, fabs: floor, !ceil, fmod, fabs: floor, ceiling, remainder, absolute! intrinsic! exp, dexp, cexp: Fortran exponential cflow: generate C flow graph. delta: make a delta (change) to an SCCS file. pipe: create an inter process channel. • . . . . . . . !dble, cmplx, dcmplx, ichar, char: explicit Fortran type/ stream. ungetc: push character back into input . and neqn. eqnchar: special character definitions for eqn user. cuserid: get character login name of the /getchar, fgetc, getw: get character or word from stream. /putchar, fputc, putw: put character or word on a stream. ascii: map of ASCII character set. . . . . interpret ASA carriage control characters. asa: . . . . . . tolower, toascii: translate characters. !_toupper, - iscntrl, isascii: classify characters. !isprint, isgraph, tr: translate characters. . . . . . directory. chdir: change working constant-width text for! cw, checkcw: prepare text for nroff or! eqn, neqn, checkeq: format mathematical lint: a C program checker. . . . . . . . . . systems processed by fsck. checklist: list of file formatted with the/ mm,osdd, checkmm: print/check documents file. sum: print checksum and block count of a chess: the game of chess. .• . . . . . . . . chess: the game of chess. . . chown, chgrp: change owner or group. times: get process and child process times. terminate. wait: wait for child process to stop or . . chmod: change mode. chmod: change mode of file. of a file. chown: change owner and group group. chown, chgrp: change owner or chroot: change root directory. isgraph, iscntrl, isascii: classify characters. !isprint, status/ ferror, feof, clearerr, fileno: stream . . . . alarm: set a process's alarm clock. •. . . . . . . . . • clock: report CPU time used. logarithm/ log, alog, dlog, clog: Fortran natural ldclose, ldaclose: close a common object file. close: close a file descriptor. descriptor. close: close a file fclose, ffiush: close or flush a stream. cmp: compare two files. /real, float, sngl, dble, cmplx, dcmplx, ichar, char:/ line-feeds. col: filter reverse . . . . . comb: combine SCCS deltas. comb: combine SCCS deltas. common to two sorted files. comm: select or reject lines nice: run a command at low priority. env: set environment for command execution. . . uux: unix to unix command execution. • . system: issue a shell command from Fortran. quits. nohup: run a command immune to hangups and net: execute a command on the PCL network. getopt: parse command options. . • . . . • . /shell, the standard/restricted command programming language. -4- asa(I) cat(I) cb(l) cc(I) cos (3 F) cd(I) cdc(I) floor(3M) floor(3M) exp(3F) cflow(I) delta(I) pipe(2) ftype(3F) ungetc(3S) eqnchar(S) cuserid (3S) getc(3S) putc(3S) ascii(S) asa(l) conv(3C) ctype(3C) tr(I) chdir(2) cw(l) eqn(I) lint(I) checklist (4) mm(l) sum(I) chess(6) chess(6) chown(l) times(2) wait(2) chmod(l) chmod(2) chown(2) chown(l) chroot(2) ctype(3C) ferror(3S) alarm(2) clock(3C) log (3 F) Idclose(3X) close (2) close (2) fclose(3S) cmp(l) ftype (3 F) coI(l) comb(I) comb(I) comm(l) nice(I) env(l) uux(IC) system(3F) nohup(I) net (I C) getopt(l) sh(l) Permuted Index and system/ timex: time a system: issue a shell test: condition evaluation time: time a argument list(s) and execute getarg: return Fortran intro: introduction to access graphical and numerical network useful with graphical cdc: change the delta ar: /archive files from PDP-II to editor output. a.out: as: object and archive files to logl0, alogIO, dlogIO: Fortran routines. ldfcn: ldopen, ldaopen: open a /line number entries of a ldclose, ldaclose: close a read the file header of a entries of a section of a the optional file header of a /entries of a section of a / section header of a an indexed/named section of a of a symbol table entry of a symbol table entry of a seek to the symbol table of a line number entries in a nm: print name list of relocation information for a scnhdr: section header for a line number information from a table format. syms: filehdr: file header for Id: link editor for size: print section sizes of comm: select or reject lines ipcs: report inter-process stdipc: standard interprocess diff: differential file cmp: sees file. sccsdiff: diff3: 3-way differential file dircmp: directory expression. regcmp, regex: regexp: regular expression regcmp: regular expression cc, pcc: e f7 7: Fortran 77 programs. scc: e yacc: yet another modest-sized programs. bs: a erf, erfc: error function and wait: await Fortran imaginary part of conjg, dconjg: Fortran cprs: pack, peat, unpack: table entry of a/ ldtbindex: cat: synchronous printer. scat: test: command; report process data command. command. • . . . . . . command. command. xargs: construct command-line argument. . • commands and a pplica tion/ commands. graphics: commands. stat: statistical commentary of an sees delta. common archive file format. common archive format. common assembler and link common assembler. common formats. /convert common logarithm intrinsicl common object file access common object file forI common object file function. common object file. common object file. ldfhread: common object file. Inumber common object file. Iseek to common object file. common object file. common object file. Iseek to common object file. !the index common object file. /indexed common object file. ldtbseek: common object file. linenum: common object file. common object file. reloc: common object file. common object file. land common object file symbol common object files. common object files. . . . common object files. . . . common to two sorted files. communication facilities/ communication package. comparator. ... .. compare two files. . . . compare two versions of an comparison. ..... . comparison. . ....• compile and execute regular compile and match routines. compile. compiler. . ..•.. compiler. •..•.. compiler for stand-alone compiler-compiler. compiler/interpreter for complementary error function. completion of process. complex argument. /dimag: complex conjugate intrinsid compress an IS25 object file. compress and expand files. compute the index of a symbol concatenate and print files. concatenate and print files on . condition evaluation command. -5- timex(l) system(3S) test (I) time(l) xargs(l) getarg(3F) intro(l) graphics (J G) stat(JG) cdc(1) ar(4) arcv(I) a.out(4) as(l) convert(l) logI0(3F) Idfcn(4) Idopen(3X) ldlread (3 x) Idclose(3X) ldfhread (3X) Idlseek(3X) Idohseek(3X) ldrseek (3X) ldshread (3X) ldsseek (3 X) Idtbindex OX) Idtbread(3X) ldtbseek (3X) linenum(4) nm(J) reloc(4) scnhdr(4) strip(l) syms(4) filehdr(4) Id(l) size(l) comm(l) ipcs(l) stdipc(3e) diff(l) cmp(l) sccsdiff(I ) diff3(l) dircmp(I) regcmp(3X) regexp(5) regcmp(I) cc(1) f77(1) scc(!) yacc(l) bs(I) erf(3M) wait(I) aimag(3F) conjg(3F) cprs(l) pack(I) ldtbindex OX) cat(l) scat(l) test(l) Permuted Index conjugate intrinsic function. conjg, dconjg: Fortran complex an out-going terminal line report and interactive status cw, checkcw: prepare execute command. xargs: nroff/troff, tbl, and eqn Is: list toc: graphical table of csplit: asa: interpret ASA carriage ioctl: fcnt!: file msgct!: message semct!: semaphore shmctl: shared memory fcnt!: file uucp status inquiry and job vc: version terminals. term: char: explicit Fortran type units: dd: PDP-II to common/ arcv: floating-point number. atof: integers and/ 13tol, !to13: and base-64 ASCII/ a64l, 164a: archive files to common/ /gmtime, asctime, tzset: to string. ecvt, fcvt, gcvt: scanf, fscanf, sscanf: files to common/ convert: strtol, atol, atoi: dd: convert and cpio: cp, In, mv: uulog, uuname: unix to unix public UNIX-to-UNIX file file. core: format of cosine intrinsic function. atan2: trigonometric/ sin, hyperbolic cosine intrinsic/ functions. sinh, cos, dcos, ccos: Fortran /dcosh: Fortran hyperbolic sum: print checksum and block wc: word files. cpio: format of and out. preprocessor. file. clock: report craps: the game of rewrite an existing one. file. tmpnam, tempnam: an existing one. creat: fork: tmpfile: channel. pipe: files. admin: conjg, dconjg: Fortran complex conjugate intrinsic function. connection. dial: establish console. rjestat: RJE status constant-width text for troff. construct argument list (s) and constructs. deroff: remove contents of directories. contents routines. context split. control characters. control device. control. control operations. control operations. control operations. . control options. control. uustat: control. conventional names for conversion. /dcmplx, ichar, conversion program. convert and copy a file. convert archive files from convert ASCII string to convert between 3-byte . convert between long integer convert: convert object and convert date and time to/ convert floating-point number convert formatted input. convert object and archive convert string to integer. copy a file. . . . . . . . copy file archives in and out. copy, link or move files. copy. uucp, copy. uuto, uupick: core: format of core image core image file. cos, dcos, ccos: Fortran . cos, tan, asin, acos, atan, cosh, dcosh: Fortran . . cosh, tanh: hyperbolic cosine intrinsic function. cosine intrinsic function. count of a file. count. . . • . . • . . cp, In, mv: copy, link or move cpio archive. . . . . . . cpio: copy file archives in . cpio: format of cpio archive. cpp: the C language . . . cprs: compress an IS25 object CPU time used. • • . . craps. • . . . • . . . craps: the game of craps. creat: create a new file or create a name for a temporary create a new file or rewrite create a new process. create a temporary file. create an interprocess create and administer SCCS -6- conjg(3F) • conjg (3 F) dial(3C) rjestat(IC) cw(I) xargs( I) deroff(l) Is(l) toc(l G) csplit(I) asa(I) ioctl(2) fcntl(2) msgct!(2) semct!(2) shmctl(2) fcnt! (5) uustat(IC) vc(l) term(5) ftype(3F) units(I) dd(l) arcv(I) atof(3C) 13tol(3C) a64I(3C) convert (I) ctime(3C) ecvt(3C) scanf(3S) convert (I) strtol(3C) dd(l) cpio(I) cp(l) uucp(I C) uuto(IC) core(4) core(4) cos(3F) trig(3M) cosh (3 F) sinh(3M) cos(3F) cosh (3 F) sum(I) wc(I) cp(I) cpio(4) cpio(I) cpio(4) cpp(I) cprs(I) clock(3C) craps(6) craps(6) creat(2) tmpnam(3S) creat(2) • fork(2) tmpfile(3S) pipe(2) admin(l) Permuted Index umask: set and get file cxref: generate C program generate DES encryption. function. sin, dsin, intrinsic/ sqrt, dsqrt, terminal. for terminal. asctime, tzset: convert date/ ttt, activity. sact: print uname: print name of una me: get name of slot in the utmp file of the getcwd: get path-name of spline: interpolate smooth name of the user. of each line of a file. each line of a file. cut: constant-width text fori cross reference. absolute value. abs, iabs, intrinsic function. acos, sending daemon, line printer dpd, Ipd: HONEYWELL sending /handle special functions of special functions of the intrinsic function. asin, /time a command; report process /sgetl: access long numeric plock: lock process, text, or prof: display profile call. stat: brk, sbrk: change types: primitive system join: relational intrinsic function. atan, intrinsic function. atan2, /asctime, tzset: convert date: print and set the /idint, real, float, sngl, /float, sngl, dble, cmplx, conjugate intrinsic/ conjg, intrinsic function. cos, cosine intrinsic/ cosh, adb: absolute sdb: symbolic eqnchar: special character names. basename, dirname: file. tail: delta commentary of an SCCS file. delta: make a delta. cdc: change the rmdel: remove a to an SCCS file. comb: combine SCCS mesg: permit or tbl, and eqn constructs. setkey, encrypt: generate creation mask. cross reference. crypt: encode/decode. crypt, setkey, encrypt: csin: Fortran sine intrinsic csplit: context split. csqrt: Fortran square root ct: spawn getty to a remote ctermid: generate file name ctime, local time, gmtime, . cu: call another UNIX system. cubic: tic-tac-toe. current SCCS file editing current UNIX system. current UNIX system. . current user. /find the . current working directory. curve. . . . . . . . . . cuserid: get character login cut: cut out selected fields cut out selected fields of cw, checkcw: prepare cxref: generate C program dabs, cabs, zabs: Fortran . dacos: Fortran arccosine daemon. dpd, Ipd: HONEYWELL daemon, line printer daemon. DASI 300 and 300s terminals. DASI 450 terminal. /handle dasin: Fortran arcsine data and system activity. . . . data in a machine independent/ data in memory. .... . data. ......... . data returned by stat system data segment space allocation. data types. . . . . . . database operator. . . . . datan: Fortran arctangent datan2: Fortran arctangent date and time to string. date. ........ . date: print and set the date. dble, cmplx, dcmplx, ichar,/ dc: desk calculator. dcmplx, ichar, char: explicit/ dconjg: Fortran complex dcos, ccos: Fortran cosine • dcosh: Fortran hyperbolic dd: convert and copy a file. debugger. . . . . . . . debugger. . . . . . . . • definitions for eqn and neqn. deliver portions of path deliver the last part of a delta. cdc: change the delta (change) to an SCCS delta commentary of an SCCS delta from an SCCS file. . • delta: make a delta (change) deltas. • . • . . . . . deny messages. deroff: remove nroff/troff, DES encryption. crypt, -7- · • • • umask(2) cxref(I) crypt( I) crypt(3C) sin(3F) csplit{I) sqrt(3F) ct(JC) ctermid OS) ctime(3C) cu(JC) ttt (6) sact(J) uname(l) uname(2) ttyslot (3C) getcwd(3C) spline{IG) cuserid (3S) cut(I) cut(I) cw(l) cxref(l) abs(3F) acos(3F) dpd(1C) dpd(IC) 300(1) 450(1) asin(3F) timex(1) sputl(3X) plock(2) prof(l) stat(5) brk(2) types (5) join(1) atan(3F) atan2(3F) ctime(3C) date{I) date{I) ftype (3 F) dc(1) ftype(3F) conjg(3F) cos (3 F) cosh(3F) dd(l) adb(l) sdb(I) eqnchar(S) basenamd I) tail (I) cdc(I) delta(I) cdc(I) rmdel(l) delta(I) combO) mesg(l) deroff(I) crypt(3C) Permuted Index system: format of 3B20S system close: close a file dup: duplicate an open file dc: x2Shlnk, x2Sdlnk: halt or file. access: file: master: master master: master ioctl: control /tekset, td: graphical exponential intrinsic/ exp, terminal line connection. ratfor: rational Fortran bdiff: big comparator. comparison. sdiff: side-by-side diffmk: mark diff: diff3: 3-way between files. of complex argument. aimag, intrinsic function. aint, dir: format of Is: list contents of rm, rmdir: remove files or cd: change working chdir: change working chroot: change root dircmp: unlink: remove path-name of current working mkdir: make a pwd: working ordinary file. mknod: make a path names. basename, printers. enable, acct: enable or dis: 3B20S sadp: du: summarize prof: hypot: Euclidean /lcong48: generate uniformly logarithm/ log, alog, logarithm/ loglO, aloglO, max, maxO, amaxO, maxI, amaxl, min, minO, aminO, minI, aminI, intrinsic/ mod, amod, nearest integer/ anint, mm, osdd, checkmm: print/check macro package for formatting macro package for formatting slides. mmt, mvt: typeset daemon, line printer daemon. reversi: a game of nrand48, mrand48, jrand48,1 graph: arithmetic: provide description file. descriptor. descriptor. desk calculator. detach a BX.2S link. determine accessibility of a determine file type. device information table. device information table. device. . . . . . . . . device routines and filters. dexp, cexp: Fortran dial: establish an out-going dialect. ..... diff. . . . . . . . . . . diff: differential file diff3: 3-way differential file difference program. differences between files. differential file comparator. differential file comparison. diffmk: mark differences dimag: Fortran imaginary part dint: Fortran integer part . . dir: format of directories. . . dircmp: directory comparison. directories. directories. directories. directory. directory. directory. directory comparison. directory entry. directory. getcwd: get directory. ..... directory name. . . . directory, or a special or dirname: deliver portions of dis: 3B20S disassembler. disable: enable/disable LP disable process accounting. disassembler. . . . disk access profiler. disk usage. . . . . display profile data. distance function. distributed pseudo-random/ dlog, clog: Fortran natural dlogIO: Fortran common . dmaxl: Fortran maximum-value/ dminI: Fortran minimum-value/ dmod: Fortran remaindering dnint, nint, idnint: Fortran documents formatted with the/ documents. mm: the MM documents. /the OSDD adapter documents, view graphs, and dpd, Ipd: HONEYWELL sending dpr: off-line print. • . . • dramatic reversals. drand48, erand48, lrand48, draw a graph. drill in number facts. -8- system(4) close (2) dup(2) dc(I) x2Shlnk(3C) access(2) file(I) master.dec(4) master.u3b(4) ioctl(2) gdev(IG) exp(3F) dial(3C) ratfor(I) bdiff(l) diff(I) diff3(I) sdiff(l) diffmk(I) diff(I) diff3(J) diffmk(I) aimag(3F) aint(3F) dir(4) dircmp(I) dir(4) Is(l) rm(l) cd(I) chdir(2) chroot(2) dircmp(I) unlink(2) getcwd(3C) mkdir(I) pwd(I) mknod(2) basename(l) dis(J) enable(I) acct(2) dis(I) sadp(I) du(I) proHI) hypot(3M) drand48 (3C) log (3 F) logIO(3F) max(3F) min(3F) mod(3F) round (3 F) • mm(I) mm(S) • mosd(S) mmt(I) dpd(IC) dpr(IC) reversi(6) drand48 (3C) graph(1G) arithmetic(6) Permuted Index transfer-of-sign/ sign, isign, intrinsic function. sin, intrinsic function. sinh, root intrinsicl sqrt, intrinsic function. tan, tangent intrinsicl tanh, an object file. od: octal object file. dump: descriptor. descriptor. dup: echo: floating-point number tol program. end, etext, sact: print current SCCS file ed, red: text files. ld: link se: screen ged: graphical ld: link common assembler and link PDP-II assembler and link sed: stream luser, real group, and andl Igetegid: get real user, Language. fsplit: split f77, ratfor, or for a pattern. grep, enable/disable LP printers. accounting. acct: enable, disable: crypt: encryption. crypt, setkey, setkey, encrypt: generate DES makekey: generate locations in program. / getgrgid, getgrnam, setgrent, Igetpwuid, getpwnam, setpwent, utmp/ /pututline, setutent, nlist: get file. linenum: line number man, manprog: print man: macros for formatting file/ /manipulate line number commonl Iseek to line number Ildnrseek: seek to relocation utmp, wtmp: utmp and wtmp endgrent: get group file endpwent: get password file utmpname: access utmp file Ithe index of a symbol table Iread an indexed symbol table putpwent: write password file unlink: remove directory command execution. profile: setting up an environ: user execution. env: set getenv: return value for getenv: return Fortran dsign: Fortran ..... . dsin, csin: Fortran sine . . . dsinh: Fortran hyperbolic sine dsqrt, csqrt: Fortran square dtan: Fortran tangent dtanh: Fortran hyperbolic du: summarize disk usage. dump: dump selected parts of dump. • . . . . . . . . dump selected parts of an dup: duplicate an open file duplicate an open file echo arguments. echo: echo arguments. ecvt, fcvt, gcvt: convert ed, red: text editor. edata: last locations in editing activity. . . . editor. . . . . . . . editor for common object editor for video terminals. editor. . . . . . . editor. . . • . . . editor output. a.out: editor output. a.out: editor. . . . . . . effective group IDs. effective user, real group, efl: Extended Fortran efl files. . . . . . . . egrep, fgrep: search a file enable, disable: enable or disable process enable/disable LP printers. encode/decode. encrypt: generate DES encryption. crypt, . . encryption key. end, etext, edata: last endgrent: get group filel endpwent: get password filel endutent, utmpname: access entries from name list. . . entries in a common object entries in this manual. entries in this manual. entries of a common object entries of a section of a entries of a section of al entry formats. entry. Igetgrnam, setgrent, entry. Igetpwnam, setpwent, entry. Isetutent, endutent, entry of a common object file. entry of a common object file. entry. . . . . . . . . entry. . . . . . . . . . env: set environment for environ: user environment. environment at login time. environment. . . . . . . environment for command environment name. environment variable. -9- sign(3F) sin(3F) sinh(3F) sqrt (3 F) tan(3F) tanh(3F) du(I) dump(I) od(I) dump(I) dup(2) dup(2) echo (I ) echo(I) ecvt(3C) ed(I) end(3C) sact(I) ed(I) Id(I) se(I) ged(IG) Id.pdp(I) a.out(4} a.out.pdp(4) sed(I) getuid(2) getuid(2) efl (I) fsplit(I) grep(I) enable(l) acct(2) enable(I) crypt(I) crypt(3C) crypt(3C) makekey(I) end (3 C) getgrent (3C) getpwent(3C) getut(3C) nlist(3C) linenum(4) man(I) man(S) Idlread(3X) Idlseek(3X) Idrseek(3X) utmp(4) getgrent (3C) getpwent(3C) getut(3C) ldtbindex (3X) ldtbread (3X) putpwent(3C) unlink(2) env(I) environ(S) profile (4) environ(S) env(I) getenv(3C) getenv(3F) Permuted Index sky: obtain character definitions for remove nroff/troff, tbl, and mathematical text for nroff/ definitions for eqn and neqn. mrand48, jrand48,! drand48, graphical device/ hpd, complementary error function. complementary error/ erf, format. system error/ perror, complementary/ erf, erfc: function and complementary sys _errlist, sys _nerr: system to system calls and matherr: errfile: hashcheck: find spelling terminal line/ dial: in program. end, hypot: expression. expr: test: condition execlp, execvp: execute a/ execvp: execute/ execl, execv, execl, execv, execle, execve, network. net: execve, execlp, execvp: construct argument list(s) and \ regcmp, regex: compile and set environment for command sleep: suspend sleep: suspend monitor: prepare profil: uux: unix to unix command execvp: execute a/ execl, execute/ execl, execv, execle, /execv, execle, execve, execlp, a new file or rewrite an process. exit, exponential intrinsic/ exponential, logarithm,! peat, unpack: compress and cmplx, dcmplx, ichar, char: exp, dexp, cexp: Fortran exp, log, 10gIO, pow, sqrt: expression. routines. regexp: regular regcmp: regular expr: evaluate arguments as an compile and execute regular efl: greek: graphics for the fsplit: split remainder,! floor, ceil, fmod, factor: true, data in a machine independent abort: generate an lOT a stream. ephemerides. eqn and neqn. /special eqn constructs. deroff: eqn, neqn, checkeq: format eqnchar: special character erand48, Irand48, nrand48, erase, hardcopy, tekset, td: erf, erfc: error function and erfc: error function and errfile: error-log file ermo, sys_errlist, sys_nerr: error function and . . . . error function. /erfc: error error messages. /ermo, error numbers. /introduction error-handling function. error-log file format. . . . errors. /hashmake, spellin, establish an out-going etext, edata: last locations Euclidean distance function. evaluate arguments as an . evaluation command. execl, execv, execle, execve, execle, execve, execlp, execlp, execvp: execute a/ execute a command on the PCL execute a file. /execle, . . execute command. xargs: . execute regular expression. execution. env: execution for an interval. execution for interval. execution profile. execution time profile. execution. . . . . . execv, execle, execve, execlp, execve, execlp, execvp: . execvp: execute a file. existing one. creat: create exit, _exit: terminate . . _exit: terminate process. exp, dexp, cexp: Fortran exp, log, 10gIO, pow, sqrt: expand files. pack, explicit Fortran type/ /dble, exponential intrinsic/ exponential, logarithm, power,! expr: evaluate arguments as an expression compile and match expression compile. expression. . . . . . . . . expression. regcmp, regex: Extended Fortran Language. extended TTY -37 type-box. n7: Fortran 77 compiler. n7, ratfor, or efl files. fabs: floor, ceiling, • . • factor a number. factor: factor a number. false: provide truth values. fashion .. /access long numeric fault. • • . . . • . . . fclose, ffiush: close or flush - 10 - · · • • • · • • • sky(6) eqnchar(S) deroff(l) eqn(I) eqnchar(S) drand48 (3C) gdev(IG) erf(3M) erf(3M) errfile(4) perror(3C) erf(3M) erf(3M) perror(3C) intro(2) rna therr (3 M) errfiie(4) spell (I) diai(3C) end(3C) hypot(3M) expr(I) test(I) exec(2) exec(2) exec(2) net (I C) exec(2) xargs(I) regcmp(3X) env(I) sieep(I) sieep(3C) monitor(3C) profil(2) uux(IC) exec(2) exec(2) exec(2) creat(2) exit(2) exit (2) exp(3F) exp(3M) pack(I) ftype(3F) exp(3F) exp(3M) expr(I) regexp(S) regcmp(l) expr(I) regcmp(3X) efl (1) greek(S) n7(I) fsplit (I) floor(3M) factor(I) factor(l) true(I) sput!(3X) abort(3C) fclose(3S) Permuted Index floating-point number/ ecvt, fopen, freopen, status inquiries. ferror, fileno: stream status/ stream. fclose, files from the HONEYWELL/ word from/ getc, getchar, from the HONEYWELL/ fget, stream. gets, pattern. grep, egrep, times. utime: set ldfcn: common object determine accessibility of a hpio: HP 264SA terminal tape tar: tape cpio: copy chmod: change mode of change owner and group of a diff: differential diff3: 3-way differential fcnt!: fcnt!: uupick: public UNIX-to-UNIX core: format of core image cprs: compress an IS2S object umask: set and get fields of each line of a dd: convert and copy a a delta (change) to an SCCS close: close a dup: duplicate an open selected parts of an object sact: print current SCCS setgrent, endgrent: get group endpwent: get password utmpname: access utmp putpwent: write password execlp, execvp: execute a grep, egrep, fgrep: search a ldaopen: open a common object acct: per-process accounting ar: common archive ar: archive errfile: error-log pnch: intro: introduction to entries of a common object get: get a version of an SCCS group: group files. filehdr: file. ldfhread: read the ldohseek: seek to the optional split: split a issue: issue identification of a member of an archive close a common object file header of a common object a section of a common object file header of a common object a section of a common object header of a common object fcnt!: file control. fcnt!: file control options. fcvt, gcvt: convert . . . fdopen: open a stream. . feof, clearerr, fileno: stream ferror, feof, clearerr, . . mush: close or flush a fget, fget.demon: retrieve . fgetc, getw: get character or fget.demon: retrieve files fgets: get a string from a . fgrep: search a file for a file access and modification file access routines. file. access: . file archiver. file archiver. file archives in and out. file. . . . . . file. chown: file comparator. file comparison. file control. . . file control options. file copy. uuto, file. • . . . . • file. • . . . . . file creation mask. file. cut: cut out selected file. . . . . . file. delta: make file descriptor. file descriptor. file: determine file type. file. dump: dump file editing activity. file entry. /getgrnam, file entry. /setpwent, file entry. /endutent, file entry. file. /execv, execle, execve, file for a pattern. file for reading. ldopen, file format. file format. file format. file format. file format for card images. file formats. ..... . file function. /line number file. . . . . . . • . . . file. . . . . . . . . . . file header for common object file header of a common object file header of a common object/ file into pieces. . • . . . . file. • . . . . . . . . . . file. /read the archive header file. ldclose, ldaclose: file. ldfhread: read the . . file. /line number entries of file. /seek to the optional . file. /relocation entries of . file. /indexed/named section - 11 - fcntl(2) fcntl(S) ecvt(3C) fopen(3S) ferror(3S) ferror(3S) fclose(3S) fget(lC) getc(3S) fget(IC) gets(3S) grep(I) utime(2) ldfcn (4) access(2) hpio(I) tadl) cpio(I) chmod(2) chown(2) diff(l) diff3(I) fcntl(2) fcntl(S) uuto(IC) core (4) cprs(I) • umask(2) cut(}) dd(l) deita(I) close (2) dup(2) file(I) dump(}) sact(I) getgrent(3C) getpwent(3C) getut(3C) putpwent (3C) exec (2) grep(I) Idopen(3X) acct(4) ar(4) ar.pdp(4) errfile(4) pnch(4) intro(4) ldlread OX) get(I) group(4) filehdr(4) Idfhread(3X) Idohseek(3X) split (I) issue(4) Idahread(3X) Idclose(3X) Idfhread(3X) ldlseek (3X) ldohseek (3 X) IdrseekOX) Idshread(3X) Permuted Index section of a table entry of a table entry of a table of a entries in a common object common object common object common object common object link: link to a listing from 3B20S object or a special or ordinary ctermid: generate mktemp: make a unique change the format of a text name list of common object /find the slot in the utmp one. creat: create a new passwd: password or subsequent lines of one /rewind, ftell: reposition a Iseek: move read/write prs: print an SCCS read: read from for a common object remove a delta from an SCCS bfs: big two versions of an SCCS sccsfile: format of SCCS header for a common object stat, fstat: get from a common object checksum and block count of a syms: common object volume. mount: mount a ustat: get mnttab: mounted umount: unmount a of 3B20S system description fsck. checklist: list of deliver the last part of a tmpfile: create a temporary create a name for a temporary and modification times of a ftw: walk a file: determine undo a previous get of an SCCS report repeated lines in a val: validate SCCS write: write on a umask: set common object files. ferror, feof, dearerr, and print process accounting create and administer SCCS send, gath: gather cat: concatenate and print cmp: compare two lines common to two sorted cp, In, mv: copy, link or move mark differences between file header for common object find: find archive/ arcv: convert archive fget, fget.demon: retrieve format specification in text split f77, ratfor, or efl file. Ito an indexed/named file. /the index of a symbol file. /read an indexed symbol file. /seek to the symbol file. linen urn: line number file. • . . • . . . . . . file. list: produce C source file. /make a directory, file name for terminal. file name. file. newform: file. nm: print file of the current user. file or rewrite an existing file. . . . . . . . . . file. /lines of several files file pointer in a stream. file pointer. file. • . . • . . . . file. . . . . . . . . file. /relocation information file. rmdel: . . . . . file scanner. file. sccsdiff: compare file. • . . • . . . file. scnhdr: section file status. file. /line number information file. sum: print . . . . . . file symbol table format. file system: format of system file system. . . . . file system statistics. file system table. file system. . . . . file. system: format file systems processed by file. tail: . • . . . . . file. . . . . . . . . . file. tmpnam, tempnam: file. touch: update access file tree. file type. . file. unget: file. uniq: file. file. file-creation mode mask. filehdr: file header for fileno: stream status/ file (s). acctcom: search files. admin: files and/or submit RJE jobs. files. ..•...... files. ........ . files. comm: select or reject files. files. diffmk: files. filehdr: files. files from PDP-II to common files from the HONEYWELL 6000. files. fspec: files. fsplit: . . . . . . . . . . . - 12 - Idsseek(3X) Idtbindex (3X) Idtbread(3X) Idtbseek(3X) linenum(4) link(2) list (1) mknod(2) ctermid (3S) mktemp(3C) newform(I) nm(I) ttyslot (3C) creat(2) passwd(4) paste(I) fseek(3S) Iseek(2) prs(I) read(2) reloc(4) rmdel(l) bfs(I) sccsdiff( 1) sccsfile(4) scnhdr(4) stat(2) stripe 1) sum(1) syms(4) fs(4) mount(2) ustat (2) mnttab(4) umount(2) system (4) checklist (4) tail (1) tmpfile(3S) tmpnam(3S) touch(l) ftw(3C) file(I) unget(l) uniq(I) val(I) write(2) umask(l) filehdr(4) ferror(3S) acctcom(l) admin(l) send (1 C) cat(I) cmp(I) comm(l) cp(1) diffmk(I) filehdr(4) find(l) arcv(I) fget (1 C) fspec(4) fsplit(I) Permuted Index string, format of graphical link editor for common object scat: concatenate and print rm, rmdir: remove /merge same lines of several unpack: compress and expand pr: print section sizes of common object size: print sizes of object sort: sort and/or merge NSC network. nusend: send /convert object and archive fsend: send what: identify SCCS greek: select terminal nl: line numbering col: graphicql device routines and tplot: graphics find: hyphen: ttyname, isatty: object library. larder: hashmake, spellin, hashcheck: of the current user. ttyslot: tee: pipe int, ifix, idint, real, atof: convert ASCII string to ecvt, fcvt, gcvt: convert /modf: manipulate parts of floor, ceiling, remainder,! floor, ceil, fmod, fabs: cflow: generate C fclose, ffiush: close or remainder,! floor, ceil, stream. per-process accounting file ar: common archive file from PDP-II to common archive ar: archive file errfile: error-log file pnch: file nroft' or/ eqn, neqn, checkeq: description file. system: newform: change the inode: core: cpio: dir: /graphical primitive string, sccsfile: file system: files. fspec: object file symbol table troft'. tbl: nroft': and archive files to common intra: introduction to file wtmp: utmp and wtmp entry scanf, fscanf, sscanf: convert fprintf, sprintf: print /checkmm: print/check documents files. /graphical primitive files. Id: . . . . . . . files on synchronous printer. files or directories. . . . . files or subsequent lines of! files. pack, pcat, files. files. size: print files. files. files to another UNIX on the files to common formats. files to the HONEYWELL 6000. files. filter. filter. filter reverse line-feeds. filters. /tekset, td: filters. . . . find files . . . . . find: find files. find hyphenated words. find name of a terminal. find ordering relation for an find spelling errors. spell, . find the slot in the utmp file fitting . . . . . . . . . float, sngl, dble, cmplx,! floating-point number. floating-point number to/ floating-point numbers. . floor, ceil, fmod, fabs: floor, ceiling, remainder,! flow graph. . . . . . . flush a stream. fmod, fabs: floor, ceiling, fopen, freopen, fdopen: open a fork: create a new process. format. acct: . . . . . . . format. . . . . . . . . . format. /convert archive files format. ..... . format. . . . . . . . . . format for card images. format mathematical text for format of 3B20S system format of a text file. . . format of an inode. format of core image file. format of cpio archive. . format of directories. format of graphical files. format of SCCS file . . . format of system volume. format specification in text format. syms: common . format tables for nroft' or format text. ..... formats. /convert object formats. formats. utmp, formatted input. formatted output. printf, formatted with the MM macros. - 13 - gps(4) Id(I) scat(I) rm(1) paste(1) pack(J) pr(I) size(I) size.pdp(I ) sort(J) nusend(IC) convert (1) fsend(lC) what(I) greek (I) nl(1) col(1) gdev(JG) tplot(IG) find(I) find(J) hyphen(1) ttynameOC) 10rder(I) spell( 1) ttyslot(3C) tee(!) ftype(3F) atofOC) ecvtOC) frexp(3C) floor OM) floor(3M) cflow(I) fclose(3S) floor OM) fopenOS) fork (2) acct(4) ar(4) arcv(I) ar.pdp(4) errfile(4) pnch(4) eqn(I) system(4) newform(I) inode(4) core(4) cpio(4) dir(4) gps(4) sccsfile(4) fs(4) fspec(4) syms(4) tbl(I) nroft'(I) • convert(I) intro(4) utmp(4) scanfOS) printf(3S) mm(I) Permuted Index mptx: the macro package for mm: the MM macro package for OSDD adapter macro package for manual. man: macros for f77: abs, iabs, dabs, cabs, zabs: system/ signal: specify function. acos, dacos: function. asin, dasin: function. atan2, datan2: function. atan, datan: or, xor, not, lshift, rshift: getarg: return 10gIO, alogIO, dloglO: intrinsic/ conjg, dconjg: function. cos, dcos, ccos: ratfor: rational getenv: return function. exp, dexp, cexp: intrinsic/ cosh, dcosh: intrinsic/ sinh, dsinh: intrinsic/ tanh, dtanh: complex/ aimag, dimag: function. aint, dint: efl: Extended amaxO, max I, amax I, dmax I: aminO, min I, amin I, dmin I: log, alog, dlog, clog: anint, dnint, nint, idnint: abort: terminate functions. mod, amod, dmod: function. sin, dsin, csin: function. sqrt, dsqrt, csqrt: len: return length of index: return location of issue a shell command from function. tan, dtan: mc!ock: return intrinsic/ sign, isign, dsign: /dcmplx, ichar, char: explicit generator. srand, rand: formatted output. printf, word on a/ putc, putchar, stream. puts, input/output. memory allocator. malloc, stream. fopen, parts of floating-point/ list: produce C source listing land line number information gets, fgets: get a string rmdel: remove a delta getopt: get option letter read: read system: issue a shell command nlist: get entries arcv: convert archive files getw: get character or word /fget.demon: retrieve files nsctorje: re-route jobs getpw: get name formatted input. scanf, of file systems processed by reposition a file pointer in/ formatting a permuted index. formatting documents. . . formatting documents. /the formatting entries in this Fortran 77 compiler. . . . Fortran absolute value. . . Fortran action on receipt of a Fortran arccosine intrinsic Fortran arcsine intrinsic Fortran arctangent intrinsic Fortran arctangent intrinsic Fortran bitwise boolean/ and, Fortran command-line argument. Fortran common logarithm/ Fortran complex conjugate Fortran cosine intrinsic . . Fortran dialect. . . . . . Fortran environment variable. Fortran exponential intrinsic Fortran hyperbolic cosine . Fortran hyperbolic sine Fortran hyperbolic tangent Fortran imaginary part of Fortran integer part intrinsic Fortran Language. Fortran maximum-value/ /maxO, Fortran minimum-value/ IminO, Fortran natural logarithm/ Fortran nearest integer/ Fortran program. . . . . . Fortran remaindering intrinsic Fortran sine intrinsic Fortran square root intrinsic Fortran string. Fortran substring. . . . Fortran. system: Fortran tangent intrinsic Fortran time accounting. Fortran transfer-of-sign Fortran type conversion. Fortran uniform random-number fprintf, sprintf: print . . . . fputc, putw: put character or fputs: put a string on a . fread, fwrite: binary . . free, realloc, calloc: main freopen, fdopen: open a frexp, ldexp, modf: manipulate from 3B20S object file. from a common object file. from a stream. from an SCCS file. from argument vector. from file. from Fortran. ... . . from name list. from PDP-II to common archive/ from stream. /getchar, fgetc, . from the HONEYWELL 6000. from the NSC network to RJE. from UID. . . . . . fscanf, sscanf: convert fsck. checklist: list fseek, rewind, ftell: - 14 - mptx(S) mm(S) mosd(S) man(S) f77(I) abs(3F) signaI(3F) acos(3F) asin(3F) atan2(3F) atan(3F) bool(3F) getarg(3F) log 10 (3 F) conjg (3 F) cos (3 F) ratfor(I) getenv(3F) exp(3F) cosh (3 F) sinh(3F) tanh (3F) aimag(3F) aint(3F) efl (1) max(3F) min(3F) 10g(3F) round(3F) abort (3 F) mod (3 F) sin(3F) sqrt(3F) len(3F) index (3 F) system (3 F) tan(3F) mc!ock(3F) sign(3F) ftype (3 F) rand(3F) printf(3S) putc(3S) puts(3S) fread(3S) malloc(3C) fopen(3S) frexp(3C) list(I) strip(I) gets(3S) rmdel(l) getopt(3C) read(2) system (3 F) nlist(3C) arcv(I) getc(3S) fget(IC) nsctorje(I C) getpw(3C) scanf(3S) checklist (4) fseek(3S) Permuted Index HONEYWELL 6000. text files. efl files. stat, pointer in a/ fseek, rewind, Fortran arccosine intrinsic Fortran integer part intrinsic error/ erf, erfc: error Fortran arcsine intrinsic Fortran arctangent intrinsic Fortran arctangent intrinsic complex conjugate intrinsic ccos: Fortran cosine intrinsic hyperbolic cosine intrinsic and complementary error Fortran exponential intrinsic gamma: log gamma hypot: Euclidean distance of a common object file common logarithm intrinsic natural logarithm intrinsic matherr: error-handling transfer-of-sign intrinsic csin: Fortran sine intrinsic hyperbolic sine intrinsic Fortran square root intrinsic Fortran tangent intrinsic hyperbolic tangent intrinsic jO, j I , jn, yO, y I, yn: Bessel Fortran bitwise boolean logarithm, power, square root remainder, absolute value dmax I: Fortran maximum-value dminl: Fortran minimum-value Fortran remaindering intrinsic 300, 300s: handle special hp: handle special terminal. 450: handle special Fortran nearest integer sinh, cosh, tanh: hyperbolic atan, atan2: trigonometric fread, jotto: secret word moo: guessing back: the bj: the chess: the craps: the reversi: a wump: the intro: introduction to gamma: log submit RJE jobs. send, jobs. send, gath: output to the HONEYWELL 6000. user. number to string. ecvt, fcvt, maze: abort: cflow: reference. cxref: fsend: send files to the fspec: format specification in fsplit: split f77, ratfor, or fstat: get file status. ftell: reposition a file . ftw: walk a file tree. . function. acos, dacos: function. aint, dint: function and complementary function. asin, dasin: function. atan2, datan2: function. atan, datan: function. /dconjg: Fortran function. cos, dcos, function. /dcosh: Fortran function. /error function function. exp, dexp, cexp: function . . . . . . . . function. . . . ..• . . function. /line number entries function. /dloglO: Fortran function. /dlog, clog: Fortran function. . . . . . . . function. /dsign: Fortran function. sin, dsin, function. /dsinh: Fortran function. sqrt, dsqrt, csqrt: function. tan, dtan: function. /dtanh: Fortran functions. ..... . functions. /lshift, rshift: functions. /sqrt: exponential, functions. /floor, ceiling, functions. /max I, amax I, functions. /minl, amini, functions. mod, amod, dmod: functions of DASI 300 and 300s/ functions of HP 2640 and/ functions of the DASI 450 functions. Inint, idnint: functions. ...... . functions. Itan, asin, acos, fwrite: binary inputloutput. game. . . • • . • . game. . . . . . • . game of backgammon. game of black jack. game of chess. game of craps. game of dramatic reversals. game of hunt-the-wumpus. games. ....... . gamma function. gamma: log gamma function. gath: gather files and/or gather files and/or ~ubmit RJE gcat: send phototypesetter gcosmail: send mail to HIS gcvt: convert floating-point ged: graphical editor. generate a maze. generate an lOT fault. generate C flow graph. generate C program cross - 15 - fsend(IC) fspec(4) fsplit(I) stat(2) fseek(3S) ftw(3C) acos(3F) aint(3F) erf(3M) asin(3F) atan2(3F) atan(3F) conjg (3 F) cos(3F) cosh(3F) erf(3M) exp(3F) gamma(3M) hypot(3 M) Idlread(3X) 10gl0(3F) log (3 F) matherrC3M) sign(3F) sin(3F) sinh(3F) sqrt(3F) tan(3F) tanh(3F) besseI(3M) bool (3 F) exp(3M) ftoor(3M) max(3F) min(3F) mod (3 F) 300(1) hp(I) 450(1) round (3 F) sinh(3M) trig(3M) fread(3S) jotto(6) moo(6) back(6) bj(6) chess (6) craps(6) reversi(6) wump(6) intro(6) gamma(3M) gamma(3M) send(1 C) send(IC) gcat(IC) gcosmail (I C) ecvt(3C) ged(IG) maze(6) abort(3C) cftow(I) cxref(I) Permuted Index crypt, setkey, encrypt: makekey: terminal. ctermid: lexical tasks. lex: /srand48, seed48, Icong48: srand: simple random-number Fortran uniform random-number gets, fgets: get: ulimit: the user. cuserid: getc, getchar, fgetc, getw: nlist: umask: set and stat, fstat: ustat: file. /getgrnam, setgrent, endgrent: getlogin: logname: msgget: getpw: system. uname: unget: undo a previous argument vector. getopt: /getpwnam, setpwent, endpwent: working directory. getcwd: times. times: and/ getpid, getpgrp, getppid: /geteuid, getgid, getegid: semget: shmget: tty: time: command-line argument. get character or word from/ character or word from/ getc, current working directory. getuid, geteuid, getgid, environment variable. environment name. real user, effective/ getuid, user,! getuid, geteuid, setgrent, endgrent: get group/ endgrent: get group/ getgrent, get group/ getgrent, getgrgid, argument vector. process group, and/ getpid, process, process group, and/ group, and/ getpid, getpgrp, setpwent, endpwent: get/ get/ getpwent, getpwuid, endpwent: get/ getpwent, a stream. and terminal settings used by ct: spawn settings used by getty. getegid: get real user,! pututline, setutent,! setutent, endutent,! getutent, generate DES encryption. generate encryption key. generate file name for generate programs for simple generate uniformly distributed/ generator. rand, generator. srand, rand: . • . get a string from a stream. get a version of an SCCS file. get and set user limits. . . get character login name of get character or word from/ get entries from name list. get file creation mask. get file status. ....• get file system statistics. get: get a version of an SCCS get group file entry. get login name. . . get login name. . • get message queue. get name from UID. get name of current UNIX get of an SCCS file. . get option letter from get password file entry. get path-name of current get process and child process get process, process group, get real user, effective user,! get set of semaphores. get shared memory segment. get the terminal's name. get time. . . . . • . . getarg: return Fortran getc, getchar, fgetc, getw: getchar, fgetc, getw: get getcwd: get path-name of getegid: get real user,! getenv: return Fortran . getenv: return value for geteuid, getgid, getegid: get getgid, getegid: get real getgrent, getgrgid, getgrnam, getgrgid, getgrnam, setgrent, getgrnam, setgrent, endgrent: getlogin: get login name. getopt: get option letter from getopt: parse command options. getpass: read a password. . . getpgrp, getppid: get process, getpid, getpgrp, getppid: get getppid: get process, process getpw: get name from UID. getpwent, getpwuid, getpwnam, getpwnam, setpwent, endpwent: getpwuid, getpwnam, setpwent, gets, fgets: get a string from getty. gettydefs: speed . . . getty to a remote terminal. gettydefs: speed and terminal getuid, geteuid, getgid, • • getutent, getutid, getutline, getutid, getutline, pututline, - 16 - • • • • · · • • • crypt(3C) makekey(l) ctermid (3S) lex(I) drand48 (3C) rand(3C) rand (3 F) gets(3S) get(I) ulimit(2) cuserid (3S) getc(3S) nlist(3C) umask(2) stat (2) ustat(2) get(I) getgrent(3C) getlogin (3C) logname(l) msgget(2) getpw(3C) uname(2) unget(l) getopt(3C) getpwent (3C) getcwd(3C) times (2) getpid(2) getuid(2) semget(2) shmget(2) tty (I) time(2) getarg (3 F) getc(3S) getc(3S) getcwd(3C) getuid(2) getenv (3 F) getenv(3C) getuid(2) getuid(2) getgrent (3C) getgrent(3C) getgrent(3C) getlogin (3C) getopt(3C) getopt(l) getpass(3C) getpid(2) getpid(2) getpid(2) getpw(3C) getpwent (3C) getpwent (3C) getpwent(3C) gets(3S) gettydefs(4) ct(IC) gettydefs(4) getuid(2) getut(3C) getut(3C) Permuted Index setutent,/ getutent, getutid, from/ getc, getchar, fgetc, convert/ ctime, localtime, setjmp, longjmp: non-local string, format of graphical! cHow: generate C How graph: draw a sag: system activity commands. graphics: access /network useful with /erase, hardcopy, tekset, td: ged: primitive string, format of format of graphical! gps: routines. toc: gutil: numerical commands. tplot: TTY -37 type-box. greek: plot: subroutines. plot: mvt: typeset documents, view package for typesetting view extended TTY -37 type-box. file for a pattern. luser, effective user, real /getppid: get process, process chown, chgrp: change owner or setgrent, endgrent: get group: setpgrp: set process id: print user and real group, and effective setuid, setgid: set user and newgrp: log in to a new chown: change owner and a signal to a process or a update, and regenerate ssignal, hangman: moo: x25hlnk, x25dlnk: DASI 300 and 300s/ 300, 300s: 2640 and 2621-series/ hp: the DASI 450 terminal. 450: nohup: run a command immune to graphical device/ hpd, erase, hcreate, hdestroy: manage spell, hashmake, spellin, find spelling errors. spell, search tables. hsearch, tables. hsearch, hcreate, file. scnhdr: section files. filehdr: file file. ldfhread: read the file /seek to the optional file Iread an indexed/named section Idahread: read the archive getutline, pututline, getw: get character or word gmtime, asctime, tzset: . goto. .•...... gps: graphical primitive graph. . • . . . . graph: draw a graph. graph. . . . . . . graph. . • . . . . graphical and numerical graphical commands. graphical device routines andl graphical editor. graphical files. /graphical graphical primitive string, graphical table of contents graphical utilities. . . . . graphics: access graphical and graphics filters. graphics for the extended graphics interface. . . . graphics interface . . . graphs, and slides. mmt, graphs and slides. Imacro greek: graphics for the • . greek: select terminal filter. grep, egrep, fgrep: search a group, and effective group/ group, and parent process IDs. group. . . . . . . . . . group file entry. Igetgrnam, group file. group: group file. group 10. group IDs and names. group IDs. /effective user, group IDs. group. . . . . . . • . group of a file. group of processes. Isend groups of programs. /maintain, gsignal: software signals. guess the word. • . . . guessing game. gutil: graphical utilities. halt or detach a BX.25 link. handle special functions of handle special functions of HP handle special functions of hangman: guess the word. hangups and quits. hardcopy, tekset, td: . . • hash search tables. hsearch, hashcheck: find spellingl . hashmake, spellin, hashcheck: hcreate, hdestroy: manage hash hdestroy: manage hash search header for a common object header for common object header of a common object header of a common object/ header of a common object/ header of a member of ani help: ask for help. . . . . - 17 - getut(3C) getc(3S) ctime(3C) setjmp(3C) gps(4) cHow(I) graph(IG) graph(IG) sag(IG) graphics (I G) stat (I G) gdev(lG) ged(IG) gps(4) gps(4) toc(IG) gutil(lG) graphics(IG) tplot(lG) greek(S) plot(4) plot{3X) mmt(l) mv(5) greek(5) greek(l) grep(I) getuid(2) getpid (2) chown(l) getgrent (3C) group(4) group(4) setpgrp(2) id(l) getuid(2) setuid(2) newgrp(I) chown(2) kill (2) make(I) ssignal (3C) hangman(6) moo(6) gutiI(IG) x25hlnk (3C) • 300(1) hp(I) 450(I) hangman(6) nohup(I) gdev(IG) hsearch(3C) spell(l) spell (I) hsearch (3C) hsearch(3C) scnhdr(4) • filehdr(4) Idfhread (3X) Idohseek(3X) Idshread (3X) Idahread(3X) help(I) Permuted Index help: ask for retrieve files from the fsend: send files to the phototypesetter output to the printer daemon. dpd, Ipd: handle special functions of archiver. hpio: of HP 2640 and 2621-series/ td: graphical device routines/ file archiver. manage hash search tables. wump: the game of cosh, dcosh: Fortran sinh, cosh, tanh: sinh, dsinh: Fortran tanh, dtanh: Fortran hyphen: find function. Fortran absolute value. abs, /sngl, dble, cmplx, dcmplx, semaphore set or shared memory and names. setpgrp: set process group issue: issue what: dble, cmplx,/ int, ifix, integer/ anint, dnint, nint, id: print user and group group, and parent process group, and effective group setgid: set user and group sngl, dble, cmplx,/ int, core: format of core pnch: file format for card aimag, dimag: Fortran nohup: run a command long numeric data in a machine for formatting a permuted of a/ ldtbindex: compute the ptx: permuted Fortran substring. a common/ ldtbread: read an ldshread, ldnshread: read an ldsseek, ldnsseek: seek to an inittab: script for the process. popen, pclose: process. inode: format of an sscanf: convert formatted push character back into fread, fwrite: binary stdio: standard buffered fileno: stream status uustat: uucp status x2Salnk, x2Silnk: attach or link. x2Sipvc, x2Srpvc: sngl, dble, cmplx, dcmplx,/ abs: return /164a: convert between long nint, idnint: Fortran nearest function. aint, dint: Fortran atol, atoi: convert string to help. .•.•..•...•.. HONEYWELL 6000. /fget.demon: HONEYWELL 6000. . . . • . . HONEYWELL 6000. gcat: send HONEYWELL sending daemon, line HP 2640 and 2621-series/ hp: HP 2645A terminal tape file hp: handle special functions . • hpd, erase, hardcopy, tekset, hpio: HP 2645A terminal tape hsearch, hcreate, hdestroy: hunt-the-wumpus. . . . . hyperbolic cosine intrinsic/ hyperbolic functions. . . . hyperbolic sine intrinsic/ . hyperbolic tangent intrinsic/ hyphen: find hyphenated words. hyphenated words. hypot: Euclidean distance iabs, dabs, cabs, zabs: ichar, char: explicit Fortran/ id. /remove a message queue, id: print user and group IDs 10. . • . . . . . identification file. identify SCCS files. idint, real, float, sngl, idnint: Fortran nearest IDs and names. . . • IDs. /get process, process IDs. /effective user, real IDs. setuid, ifix, idint, real, float, image file. images. . . . . . imaginary part of complex/ immune to hangups and quits. independent fashion .. /access index. /the macro package index of a symbol table entry index. . . . . . . • . . . index: return location of indexed symbol table entry of indexed/named section header/ indexed/named section of a/ init process. ...•. initiate pipe to/from a inittab: script for the init inode: format of an inode. inode. . . . . . . . input. scanf, fscanf, input stream. ungetc: input/output. . . . . input/output package. inquiries. !feof, clearerr, inquiry and job control. install a BX.25 link. . . . install or remove a PVC on a int, ifix, idint, real, float, integer absolute value. integer and base-64 ASCII/ integer functions. /dnint, integer part intrinsic integer. strtol, . - 18 - • • • · • • • . help(I) fget(IC) fsend(IC) gcat(IC) dpd(IC) hp(I) hpio(I) hp(I) gdev(IG) hpio(I) hsearch (3C) wump(6) cosh (3 F) sinh(3M) sinh(3F) tanh (3 F) hyphen(I) hyphen(I) hypot(3M) abs(3F) ftype(3F) ipcrm(I) id(l) setpgrp(2) issue(4) what(I) ftype(3F) round (3 F) id(l) getpid(2) getuid(2) setuid(2) ftype(3F) core(4) pnch(4) aimag(3F) nohup(I) sput!(3X) mptx(S) ldtbindex (3X) ptx(I) index (3 F) Idtbread(3X) Idshread(3X) Idsseek(3X) inittab(4) popen(3S) inittab(4) inode(4) inode(4) scanf(3S) ungetc(3S) fread(3S) stdio(3S) ferror(3S) uustat(IC) x25alnk(3C) x25ipvc(3C) ftype(3F) abs(3C) a64I(3C) round (3 F) aint(3F) strtol (3C) Permuted Index Ilto13: convert between 3-byte 3-byte integers and long rjestat: RJE status report and plot: graphics plot: graphics spline: characters. asa: sno: SNOBOL pipe: create an facilitiesl ipcs: report package. stdipc: standard suspend execution for an sleep: suspend execution for acos, dacos: Fortran arccosine dint: Fortran integer part asin, dasin: Fortran arcsine datan2: Fortran arctangent datan: Fortran arctangent Fortran complex conjugate dcos, ccos: Fortran cosine Fortran hyperbolic cosine cexp: Fortran exponential Fortran common logarithm Fortran natural logarithm Fortran transfer-of-sign sin, dsin, csin: Fortran sine dsinh: Fortran hyperbolic sine csqrt: Fortran square root tan, dtan: Fortran tangent Fortran hyperbolic tangent dmod: Fortran remaindering commands and applicationl formats. miscellany. subroutines and libraries. calls and error numbers. application programs. intra: intro: intra: intra: and libraries. intra: and error numbers. intra: abort: generate an semaphore set or sharedl communication facilitiesl cprs: compress an lislower, isdigit, isxdigit, isdigit, isxdigit, isalnum,l lisprint, isgraph, iscntrl, terminal. tty name, lispunct, isprint, isgraph, isalpha, isupper, islower, lisspace, ispunct, isprint, transfer-of-signl sign, isalnum,l isalpha, isupper, lisalnum, isspace, ispunct, lisxdigit, isalnum, isspace, lisdigit, isxdigit, isalnum, Fortran. system: system: issue: file. integers and long integers. integers. I convert between interactive status console. interface. • •..•. interface subroutines. interpolate smooth curve. interpret ASA carriage control interpreter. • . . . • . . . interprocess channel. • . . . inter-process communication interprocess communication interval. sleep: interval. . • . . . . intrinsic function. intrinsic function. aint, intrinsic function. intrinsic function. atan2, intrinsic function. atan, intrinsic function. Idconjg: '. intrinsic function. cos, intrinsic function. Idcosh: intrinsic function. Idexp, intrinsic function. IdloglO: intrinsic function. Iclog: intrinsic function. Idsign: intrinsic function. intrinsic function. sinh, intrinsic function. Idsqrt, intrinsic function. intrinsic function. Idtanh: intrinsic functions. lamod, intra: introduction to . . . intra: introduction to file intra: introduction to games. intra: introduction to . . . intra: introduction to . . . intro: introduction to system introduction to commands and introduction to file formats. introduction to games. introduction to miscellany. introduction to subroutines introduction to system calls ioctl: control device. lOT fault. . . . • . . . ipcrm: remove a message queue, ipcs: report inter-process IS2S object file. . . . . . isalnum, isspace, ispunct,l isalpha, isupper, islower, isascii: classify characters. isatty: find name of a iscntrl, isascii: classify I . isdigit, isxdigit, isalnum,l isgraph, iscntrl, isascii:1 isign, dsign: Fortran islower, isdigit, isxdigit, isprint, isgraph, iscntrl,l ispunct, isprint, isgraph,l isspace, ispunct, isprint,l issue a shell command from issue a shell command. . issue identification file. . issue: issue identification - 19 - 13tol (3C) 13tol(3C) rjestat(} C) plot (4) plot(3X) spline(IG) asa(l) sno(1) pipe(2) ipcs(I) stdipc(3C) sleep(I) sleep(3C) acos(3F) aint(3F) asin(3F) atan2(3F) atan(3F) conjg(3F) cos(3F) cosh (3 F) exp(3F) logIO(3F) 10g(3F) sign (3 F) sin (3 F) sinh(3F) sqrt (3 F) tan(3F) tanh(3F) mod (3 F) intro(I) intro(4) intro(6) intro(S) intro(3) intro(2) intro(I) intro(4) intro(6) intro(S) intro(3) intro(2) ioctl(2) abort(3C) ipcrm(I) ipcs(I) cprs(I) ctype(3C) ctype(3C) ctype(3C) ttynameOC) ctype(3C) ctype(3C) ctype(3C) sign(3F) ctype(3C) ctype(3C) ctype(3C) ctype(3C) system (3 F) system(3S) issue(4) issue(4) Permuted Index isxdigit, isalnum,/ isalpha, lisupper, is lower, isdigit, news: print news functions. functions. jO, bj: the game of black functions. jO, j 1, operator. Ilrand48, nrand48, mrand48, assembler/un-assembler forI makekey: generate encryption process or a group of! lassembler/un-assembler for the quiz: test your for the KMCII B/ kasb, 3-byte integers and longl integer and base-641 a64l, scanning and processing arbitrary-precision arithmetic efl: Extended Fortran cpp: the C command programming Ijrand48, srand48, seed48, object files. object file. Idclose, header of a member of anI file for reading. Idopen, common object file. of floating-pointl frexp, access routines. of a common object file. line number entriesl ldlread, numberl Idlread, Idlinit, manipulate line numberl number entries of a section I entries of a section I ldrseek, indexed/namedl ldshread, indexed/namedl ldsseek, file header of a common I object file for reading. relocation entries of al indexed/named section header I indexed/named section of al of a symbol table entry of al symbol table entry of al table of a common objectl string. len: return getopt: get option simple lexical tasks. generate programs for simple to subroutines and relation for an object ar: archive and portablel ar: archive and ulimit: get and set user an out-going terminal line: read one common object file. linen urn: Ildlinit, ldlitem: manipulate ldlseek,ldnlseek: seek to isupper, islower, isdigit, isxdigit, isalnum, isspace,/ items. • • . . • • . . . • jO, jl, jn, yO, yl, yn: Bessel jl, jn, yO, yl, yn: Bessel jack. .•••••.. jn, yO, y 1, yn: Bessel . . join: relational database jotto: secret word game. jrand48, srand48, seed48,/ kasb, kunb: • . • • . • key. • . • • . • • . . kill: send a signal to a kill: terminate a process. KMCIIB microprocessor. knowledge. . . • • . • . kunb: assembler/un-assembler 13tol, Itol3: convert between 164a: convert between long language. awk: pattern language. be: . . . . Language. • . . • . • language preprocessor. language. Istandard/restricted lcong48: generate uniformly/ Id: link editor for common Id: link editor. •...• Idaclose: close a common . Idahread: read the archive Idaopen: open a common object Idclose, Idaclose: close a ldexp, mOOf: manipulate parts ldfcn: common object file • . • ldfhread: read the file header Idlinit, Idlitem: manipulate ldlitem: manipulate line ldlread, ldlinit, Idlitem: . • ldlseek,ldnlseek: seek to line Idnrseek: seek to relocation Idnshread: read an Idnsseek: seek to an ldohseek: seek to the optional ldopen, ldaopen: open a common Idrseek, Idnrseek: seek to . Idshread, ldnshread: read an ldsseek, ldnsseek: seek to an Idtbindex: compute the index ldtbread: read an indexed ldtbseek: seek to the symbol len: return length of Fortran length of Fortran string. letter from argument vector. lex: generate programs for lexical tasks. lex: libraries. lintroduction • library. lfind ordering library maintainer. library maintainer for limits. • . . • • . • line connection. lestablish line. • • • • • • • • . line number entries in a line number entries of al line number entries of a/ . 20· • • ctype(3C) ctype(3C) news(I) bessel(3M) bessel (3 M) • bj(6) · • bessel (3 M) • join(I) • • jotto(6) • • drand48 (3C) • • kasb(l) makekey(l) • • kill (2) · kilI(I) • • kasb(I) quiz(6) • • kasb(I) • • 13tol(3C) a641(3C) · • awk(I) · • bc(I) eft (I) • • cpp(I) sh(l) drand48 (3C) · • Id(I) Id.pdp(I) • Idclose(3X) • Idahread (3X) Idopen(3X) • Idclose(3X) • frexp(3C) • Idfcn(4) • Idfhread (3X) • Idlread (3X) • Idlread(3X) • Idlread (3X) • Idlseek(3X) • Idrseek(3X) • Idshread (3X) • Idsseek (3X) Idohseek(3X) Idopen(3X) • Idrseek(3X) • Idshread (3X) • Idsseek (3X) Idtbindex OX) Idtbread (3X) Idtbseek(3X) len (3 F) • len(3F) • getopt (3C) • lex(I) • lex(I) • intro(3) • 10rder(I) • ar.pdp(I) · ad!) • ulimit(2) • dial(3C) • line(I) • linenum(4) ldlread (3X) Idlseek(3X) Permuted Index strip: strip symbol and nl: out selected fields of each lpd: HONEYWELL sending daemon, send/cancel requests to an LP lpr: Isearch: col: filter reverse in a common object file. files. comm: select or reject uniq: report repeated of several files or subsequent subsequentl paste: merge same files. ld: Id: a.out: common assembler and a.out: PDP-II assembler and cp, In, mv: copy, link: attach or install a BX.25 x25clnk: change over a BX.25 halt or detach a BX.25 install or remove a PVC on a Is: nlist: get entries from name nm: print name nm: print name by fsck. checklist: from 3B20S object file. file. list: produce C source xargs: construct argument files. cp, tzset: convert datel ctime, index: return end, etext, edata: last memory. plock: trouble: natural logarithm intrinsicl gamma: newgrp: exponential, logarithm,! exp, common logarithm intrinsicl logarithm, power,! exp, log, laloglO, dloglO: Fortran common Idlog, clog: Fortran natural /loglO, pow, sqrt: exponential, getlogin: get logname: get cuserid: get character logname: return passwd: change setting up an environment at user. a64l, 164a: convert between between 3-byte integers and sputl, sget1: access setjmp, for an object library. nice: run a command at line number information from al line numbering filter. line of a file. cut: cut line printer daemon. dpd, line printer. lp, cancel: line printer spooler. line: read one line. . • • linear search and update. line-feeds. . . . . • . linen urn: line number entries lines common to two sorted lines in a file. • • . • . . lines of one file. Isame lines lines of several files or link editor for common object link editor. . • . link editor output. link editor output. link: link to a file. link or move files. link to a file. link. x25alnk, x25ilnk: link. . . • . • . . . link. x25hlnk, x25dlnk: link. x25ipvc, x25rpvc: lint: a C program checker. list contents of directories. list. . . . . . . . • . list. . . . . . . . • . . list of common object file. list of file systems processed list: produce C source listing listing from 3B20S object list(s) and execute command. In, mv: copy, link or move localtime, gmtime, asctime, . location of Fortran substring. locations in program. lock process, text, or data in log a trouble report. • . . log, alog, dlog, clog: Fortran log gamma function . . log in to a new group. log, 10g10, pow, sqrt: log I 0, alog I 0, dlog I 0: Fortran 10glO, pow, sqrt: exponential, logarithm intrinsic function. logarithm intrinsic function. logarithm, power, square root I login name. login name. login name of the user. login name of user. login password. login: sign on. login time. profile: logname: get login name. logname: return login name of long integer and base-64 ASCIII long integers. Iltol3: convert long numeric data in a machinel longjmp: non-local goto. lorder: find ordering relation low priority. • • . • • . . • - 21 - strip(I) nl(l) cut(I) dpd(IC) Ip(I) Ipr(I) line(I) Isearch (3C) coI(l) linenum(4) comm(l) uniQ(I) paste(I) paste(I) Id(l) Id.pdp(I) a.out(4) a.out.pdp(4) link(2) cp(l) link(2) • x25alnk (3 C) x25clnk (3C) x25hlnk (3C) x25ipvc(3C) lint(I) Is(l) nlist(3C) nm.{)dp(I) nm(I) checklist (4) • list(I) list(I) xargs(l) cp(I) ctime(3C) index (3 F) end(3C) plock(2) trouble(I) log(3F) gamma(3M) newgrp(I) exp(3M) logI0(3F) exp(3M) 10gI0(3F) log (3 F) exp(3M) getlogin (3C) logname(I) cuserid (3S) 10gname(3X) passwd(l) 10gin(l) profile (4) 10gname(I) 10gname(3X) a64I(3C) 13tol(3C) sputI(3X) setjmp(3C) 10rder(I) nice(I) Permuted Index requests to an LP line/ send/cancel requests to an disable: enable/disable Ipstat: print line printer daemon. dpd, information. jrand48,1 drand48, erand48, directories. update. pointer. bitwise/ and, or, xor, not, integers and long/ 13tol, /access long numeric data in a permuted index. mptx: the documents. mm: the MM mosd: the OSDD adapter view graphs and/ mv: a troff m4: in this manual. man: formatted with the MM send mail to users or read users or read mail. gcosmail: send mail, rmail: send malloc, free, realloc, calloc: regenerate groups of! make: ar: archive and library ar: archive and library SCCS file. delta: mkdir: or ordinary file. mknod: mktemp: regenerate groups of! banner: key. main memory allocator. entries in this manual. this manual. tsearch, tdelete, twalk: hsearch, hcreate, hdestroy: off Idlread, Idlinit, Idlitem: frexp, Idexp, modf: manual. man, manprog: print entries in this for formatting entries in this ascii: files. diffmk: umask: set file-creation mode set and get file creation table. master: table. master: information table. information table. regular expression compile and eqn, neqn, checkeq: format function. multiple-access-user-space/ dmax I: Fortran maximum-value/ dmaxI: Fortran/ max, max, maxO, amaxO, /maxI, amaxI, dmaxI: Fortran •••• Ip, cancel: send/cancel • • LP line printer. Ip, cancel: LP printers. enable, • . . LP status information. . . • lpd: HONEYWELL sending daemon, Ipr: line printer spooler. Ipstat: print LP status • Irand48, nrand48, mrand48, Is: list contents of lsearch: linear search and • lseek: move read/write file Ishift, rshift: Fortran . • . ltol3: convert between 3-byte • m4: macro processor. • • machine independent fashion .. macro package for formatting a macro package for formatting . macro package for formatting/ macro package for typesetting macro processor. . . . • . . • • macros for formatting entries • macros. /print/check documents mail. mail, rmail: • . • mail, rmail: send mail to . mail to HIS user. mail to users or read mail. • • • main memory allocator. maintain, update, and maintainer. . . • . . • maintainer for portable/ make a delta (change) to an • make a directory. • . • . . • make a directory, or a special make a unique file name. . . make: maintain, update, and make posters. . • . . . . . · makekey: generate encryption • malloc, free, realloc, calloc: . • • • man: macros for formatting . . · . man, manprog: print entries in • manage binary search trees. • manage hash search tables. . • • • manipulate line number entries • • manipulate parts of! . • . . manprog: print entries in this ...•..• manual. man, • • manual. man: macros · map of ASCII character set. mark differences between mask. . • . . • • . . • • mask. umask: • • master device information master device information • • master: master device • • master: master device match routines. regexp: mathematical text for nroff or/ matherr: error-handling · . maus: • max, maxO, amaxO, max I, amax I, maxO, amaxO, max I, amax I, maxI, amaxI, dmaxI: Fortran! • • maximum-value functions. • • maze: generate a ma~e. • • - 22 - Ip(l) lp(l) enable(I) Ipstat(I) dpd(IC) Ipr(I) Ipstat(I) drand48 (3C) Is(I) lsearch (3 C) Iseek(2) bool (3 F) 13toI(3C) m4(l) sputl(3X) mptx(S) mm(S) mosd(S) mv(S) m4(l) man(S) mm(I) mail(I) mail (I) gcosmail (I C) mail (I) malloc(3C) make(I) ar.pdp(I) ar(I) delta(l) mkdir(l) mknod(2) mktemp(3C) make(l) banner(l) makekey (I) malloc{3C) man(S) man(l) tsearch (3C) hsearch (3C) Idlread(3X) frexp(3C) man(l) man(l) man(S) ascii(S) diffmk(l) umask(l) umask(2) master.dec{ 4) master.u3b(4) master.dec(4) master.u3h(4) regexp(S) eqn(l) matherr(3M) maus(2) max (3 F) max(3F) max(3F) max (3 F) maze(6) Permuted Index maze: generate a accounting. memcpy, memset: memory/ memset: memory/ memccpy, operations. memccpy, memchr, memccpy, memchr, memcmp, free, realloc, calloc: main shmctl: shared queue, semaphore set or shared /(shared memcmp, memcpy, memset: shmop: shared lock process, text, or data in shmget: get shared /memchr, memcmp, memcpy, sort: sort and/or files or subsequent/ paste: msgctl: msgop: msgget: get or shared/ ipcrm: remove a mesg: permit or deny sys_nerr: system error /for the KMCIIB dminI: Fortran minimum-value/ dminl: Fortran/ min, min, minO, aminO, IminI, aminI, dminI: Fortran special or ordinary file. name. formatting documents. mm: the documents formatted with the documents formatted with the/ formatting documents. view graphs, and slides. table. remaindering intrinsic/ chmod: change umask: set file-creation chmod: change bs: a compiler/interpreter for floating-point/ frexp, Idexp, touch: update access and utime: set file access and profile. package for formatting/ mount: mnttab: cp, In, mv: copy, link or Iseek: formatting a permuted index. /erand48, lrand48, nrand48, operations. (shared memory)/ maus: typesetting view graphs and/ cp, In, graphs, and slides. mmt, log, alog, dlog, clog: Fortran maze. .' . . . . . . • mclock: return Fortran time memccpy, memchr, memcmp, memchr, memcmp, memcpy, memcmp, memcpy, memset: memory memcpy, memset: memory/ memory allocator. malloc, memory control operations. memory id. /remove a message memory) operations. . . . . memory operations. /memchr, memory operations. memory. plock: . . . • . . memory segment. . . . . . memset: memory operations. merge files. • • . . . • . . merge same lines of several . mesg: permit or deny messages. message control operations. message operations. message queue. . . . • . . message queue, semaphore set messages. . . . . . . . . messages. /errno, sys_errlist, microprocessor. . . . • . . min, minO, aminO, minI, aminI, minO, aminO, minI, aminI, . minI, aminI, dminI: Fortran/ minimum-value functions. mkdir: make a directory. . . mknod: make a directory, or a mktemp: make a unique file MM macro package for MM macros. /print/check mm, osdd, checkmm: print/check mm: the MM macro package for mmt, mvt: typeset documents, mnttab: mounted file system mod, amod, dmod: Fortran mode. mode mask. mode of file. modest-sized programs. modf: manipulate parts of modification times of a file. modification times. monitor: prepare execution moo: guessing game. . . . • mosd: the OSDD adapter macro mount a file system. . . . mount: mount a file system. mounted file system table. move files. . . • . . . . move read/write file pointer. mptx: the macro package for mrand48, jrand48, srand48,1 msgctl: message control msgget: get message queue. msgop: message operations. multiple-access-user-space mv: a troff macro package for mv: copy, link or move files. mvt: typeset documents, view naturallogaritbm intrinsic/ . - 23 - maze(6) mclock (3 F) memory (3C) memory(3C) memory(3C) memory (3 C) malloc(3C) shmctl(2) ipcrm(I) maus(2) memory(3C) shmop(2) plock(2) shmget(2) memory(3C) sort (I) paste(I) mesg(I) msgctl(2) msgop(2) msgget(2) ipcrm(I) mesg(l) perror(3C) kasb(I) min (3 F) min (3 F) min(3F) min(3F) mkdir(I) mknod(2) mktemp(3C) mm(5) mm(l) mm(I) mm(5) mmt(I) · mnttab(4) mod (3 F) chmod(I) umask(I) chmod(2) bs(I) frexp (3 C) touch(I) utime(2) monitor(3C) moo (6) mosd(5) mount(2) mount(2) mnttab(4) cp(I) • Iseek(2) mptx(5) drand48 (3C) msgctl(2) msgget(2) msgop(2) maus(2) mv(5) • cp(I) mmt(I) log (3 F) Permuted Index Idnint, nint, idnint: Fortran nearest integer functions. mathematical text forI eqn, neqn, checkeq: format definitions for eqn and neqn. Ispecial character PCL network. net: execute a command on the execute a command on the PCL network. net: • . • . . • operation status of the NSC network. nscstat: query the to another UNIX on the NSC network. nusend: send files re-route jobs from the NSC network to RJE. nsctorje: commands. stat: statistical network useful with graphical a text file. newform: change the format of newgrp: log in to a new group. news: print news items. ..... news: print news items. process. nice: change priority of a priority. nice: run a command at low integerl anint, dnint, nint, idnint: Fortran nearest nl: line numbering filter. list. nlist: get entries from name nm: print name list. object file. nm: print name list of common hangups and quits. nohup: run a command immune to setjmp, longjmp: non-local goto. . • . . . . bitwise booleanl and, or, xor, not, lshift, rshift: Fortran . . drand48, erand48, lrand48, nrand48, mrand48, jrand48,1 nroff: format text. . . . format mathematical text for nroff or troff. Icheckeq: tbl: format tables for nroff or troff. . . . . . constructs. deroff: remove nroff/troff, tbl, and eqn the operation status of the NSC network. nscstat: query files to another UNIX on the NSC network. nusend: send re-route jobs from the NSC network to RJE. nsctorje: status of the NSC network. nscstat: query the operation the NSC network to RJE. nsctorje: re-route jobs from nl: line numbering filter. sputl, sgetl: access long numeric data in a machinel graphics: access graphical and numerical commands. UNIX on the NSC network. nusend: send files to another commonl convert: convert object and archive files to Idfcn: common object file access routines. cprs: compress an IS25 object file. . . . . . dump selected parts of an object file. dump: Idopen, ldaopen: open a common object file for reading. number entries of a common object file function. Iline Idaclose: close a common object file. Idclose, the file header of a common object file. Idfhread: read of a section of a common object file. Inumber entries file header of a common object file. Ito the optional of a section of a common object file. lentries section header of a common object file. lindexed/named section of a common object file. lindexed/named symbol table entry of a common object file. /the index of a symbol table entry of a common object file. Iread an indexed the symbol table of a common object file. Iseek to number entries in a common object file. linenum: line C source listing from 3B20S object file. list: produce nm: print name list of common object file. . . . . . information for a common object file. !relocation section header for a common object file. scnhdr: information from a common object file. land line number format. syms: common object file symbol table file header for common object files. filehdr: Id: link editor for common object files. . . print section sizes of common object files. size: size: print sizes of object files. . • - 24 - round (3 F) eqn(I) eqnchar(5) net (I C) net (I C) nscstat (I C) nusend (I C) nsctorje(l C) stat(lG) new form (I) newgrp(1) news(1) news(1) . nice(2) nice(1) round(3F) nl (1) nlist(3C) nm.pdp(l) nm(1) nohup(1) setjmp(3C) bool (3 F) drand48 (3C) nroff(l) eqn(I) tbl(l) deroff(l) • nscstat(IC) nusend(IC) nsctorje(l C) nscstat(1C) nsctorje(l C) nl(l) sputl(3X) graphics (1 G) nus end (1 C) convert(I) Idfcn(4) cprs(1) dump(I) Idopen(3X) Idlread(3X) Idclose(3X) Idfhread(3X) Idlseek (3X) Idohseek(3X) Idrseek(3X) Idshread (3 X) Idsseek(3X) Idtbindex(3X) Idtbread(3X) Idtbseek(3X) linenum(4) list (I) nm(1) reloc(4) scnhdr(4) strip(1) syms(4) filehdr(4) Id(l) size(I) size.pdp( 1) Permuted Index find ordering relation for an object library. lorder: sky: obtain ephemerides. ad: octal dump. ad: octal dump. . • dpr: off-line print. . . . reading. Idopen, Idaopen: open a common object file for fopen, freopen, fdopen: open a stream. . • . . . dup: duplicate an open file descriptor. open: open for reading or writing. writing. open: open for reading or . network. nscstat: query the operation status of the NSC /(shared memory) operations. • . . • • . . memcmp, memcpy, memset: memory operations. memccpy, memchr, msgct!: message control operations. msgop: message operations. semctl: semaphore control operations. semop: semaphore operations. shmctl: shared memory control operations. shmop: shared memory operations. strcspn, strtok: string operations. /strpbrk, strspn, join: relational database operator. . • . . . . . • vector. getopt: get option letter from argument common/ Idohseek: seek to the optional file header of a fcnt!: file control options. • • . . . . stty: set the options for a terminal. getopt: parse command options. . • . . • • Fortran bitwise boolean/ and, or, xor, not, Ishift, rshift: object library. lorder: find ordering relation for an a directory, or a special or ordinary file. mknod: make formatting/ mosd: the OSDD adapter macro package for documents formatted with/ mm, osdd, checkmm: print/check dial: establish an out-going terminal line/ assembler and link editor output. a.out: common assembler and link editor output. a.out: PDP-II sprintf: print formatted output. printf, fprintf, gcat: send phototypesetter output to the HONEYWELL 6000. chown: change owner and group of a file. chown, chgrp: change owner or group. . • • • • • and expand files. pack, peat, unpack: compress permuted/ mptx: the macro package for formatting a documents. mm: the MM macro package for formatting . . . mosd: the OSDD adapter macro package for formatting/ graphs and/ mv: a troff macro package for typesetting view standard buffered input/output package. stdio: . . • . . interprocess communication package. stdipc: standard 4014 terminal. 4014: paginator for the Tektronix process, process group, and parent process IDs. /get getopt: parse command options. passwd: change login password. passwd: password file. /setpwent, endpwent: get password file entry. putpwent: write password file entry. passwd: password file. getpass: read a password. passwd: change login password. several files or subsequent/ paste: merge same lines of dirname: deliver portions of path names. basename, directory. getcwd: get path-name of current working fgrep: search a file for a pattern. grep, egrep, • . . • processing language. awk: pattern scanning and signal. pause: suspend process until expand files. pack, peat, unpack: compress and cc, pec: C compiler. net: execute a command on the PCL network. ..••. - 25 - • • • • • • • • • • • • • 10rder(I) sky(6) od(I) od(I) dpr(IC) Idopen(3X) fopen(3S) dup(2) open(2) open (2) nscstat(IC) maus(2) memory(3C) msgctl(2) msgop(2) semctl(2) semop(2) shmct!(2) shmop(2) string(3C) join(I) getopt(3C) Idohseek(3X) fcntl(S) stty(I) getopt(I) bool (3 F) 10rder(I) mknod(2) mosd(S) mm(I) dial(3C) a.out(4) a.out.pdp(4) printf(3S) gcat(IC) chown(2) chown(l) pack(I) mptx(S) mm(S) mosd(S) mv(S) stdio(3S) stdipc(3C) 4014(I) getpid(2) getopt(l) passwd(I) passwd(4) getpwent(3C) putpwent(3C) passwd(4) getpass(3C) passwd(I) paste(I) basename(I) getcwd(3C) grep(I) awk(I) pause(2) pack(I) cc(I) net (I C) Permuted Index a process. popen, as: assembler for editor output. a.out: /convert archive files from truth value about your/ mesg: macro package for formatting a ptx: format. acct: sys_nerr: system error/ HONEYWELL 6000. gcat: send tc: split: split a file into channel. tee: popen, pclose: initiate data in memory. subroutines. images. ftell: reposition a file Iseek: move read/write file to/from a process. and library maintainer for basename, dirname: deliver banner: make logarithm,! exp, log, logl0, /sqrt: exponential, logarithm, for troff. cw, checkcw: monitor: cpp: the C language unget: undo a graphical! gps: graphical types: prs: date: cal: of a file. sum: editing activity. sact: dpr: off-line man, manprog: cat: concatenate and scat: concatenate and pr: printf, fprintf, sprintf: Ipstat: nm: object file. nm: system. uname: news: file(s). acctcom: search and object files. size: size: names. id: formatted/ mm, osdd, checkmm: HONEYWELL sending daemon, line requests to an LP line and print files on synchronous Ipr: line vpr: Versatec disable: enable/disable LP print formatted output. nice: run a command at low pclose: initiate pipe to/from . PDP-II. • . . . . . . . PDP-II assembler and link PDP-II to common archive/ pdpll, u3b, u3b5, vax: provide permit or deny messages. . permuted index. mptx: the permuted index. per-process accounting file perror, errno, sys_errlist, phototypesetter output to the phototypesetter simulator. pieces. . • • . . . . . . pipe: create an interprocess ..... . pipe fitting. pipe to/from a process. . . . • plock: lock process, text, or plot: graphics interface. plot: graphics interface . . pnch: file format for card . pointer in a stream. /rewind, pointer. • . . . . . • . popen, pclose: initiate pipe portable archives. /archive portions of path names. posters. . • . • . . . . pow, sqrt: exponential, . . power, square root functions. pr: print files. . . . . . . prepare constant-width text prepare execution profile. . preprocessor. . • . . • . previous get of an SCCS file. primitive string, format of primitive system data types. print an SCCS file. print and set the date. print calendar. print checksum and block count print current SCCS file print. . • • . . . . . • print entries in this manual. print files. . • . . . • . print files on synchronous/ print files. • . • . . . . print formatted output. print LP status information. print name list. . • • . . print name list of common print name of current UNIX print news items. • . . . . print process accounting print section sizes of common print sizes of object files. print user and group IDs and print/check documents • . . printer daemon. dpd, Ipd: printer. /cancel: send/cancel printer. scat: concatenate printer spooler. printer spooler. printers. enable, printf, fprintf, sprintf: priority. • • • . . • • - 26 - • • · • • . • • • • popen(3S) as.pdp(I) a.out.pdp(4) arcv(I) machid(I) mesg(I) mptx(S) ptx(I) acct(4) perror(3C) gcat(IC) tc(I) split(I) pipe(2) tee(I) popen(3S) plock(2) plot (4) plot(3X) , pnch(4) fseek(3S) Iseek(2) popen(3S) ar(I) basename (1 ) banned I) exp(3M) exp(3M) pr(l) cw(l) monitor(3C) cpp(I) unget(l) gps(4) types(S) prs(I) date(I) caI(I) sum(l) sact(I) dpr(I C) man(I) cat(I) scat(I) pr(I) printf(3S) lpstat(l) nm.pdp(I) nm(l) uname(l) news(l) acctcom(l) size(I) size.pdp(I) id(l) mm(I) dpd(lC) Ip(I) scat(l) IpdI) vpdI) enable(I) printf(3S) nice(I) Permuted Index nice: change acct: enable or disable acctcom: search and print times. times: get timex: time a command; report exit, _exit: terminate fork: create a new / getpgrp, getppid: get process, setpgrp: set process group, and parent inittab: script for the init kill: terminate a nice: change priority of a kill: send a signal to a initiate pipe to/from a getpid, getpgrp, getppid: get ps: report memory. plock: lock times: get process and child wait: wait for child ptrace: pause: suspend wait: await completion of list of file systems to a process or a group of awk: pattern scanning and m4: macro provide truth value about your alarm: set a 3B20S object file. list: profile. prof: display monitor: prepare execution profil: execution time environment at login time. sadp: disk access standard/restricted command arithmetic: pdpll, u3b, u3b5, vax: true, false: /generate uniformly distributed stream. ungetc: put character or word on a/ character or word on a/ putc, entry. stream. getutent, getutid, getutline, a/ putc, putchar, fputc, x25rpvc: install or remove a the NSC network. nscstat: msgget: get message ipcrm: remove a message qsort: command immune to hangups and random-number/ srand, random-number generator. priority of a process. • . • process accounting. process accounting file (s). process and child process process data and system/ process. • • • • . •. process. . • • . • •. process group, and parenti process group ID. • •. process IDs. /get process, process. process. . . • . . • process. • • . . . • process or a group ofl process. popen, pclose: process, process group, and/ process status. process, text, or data in process times. . . . . process to stop or terminate. process trace. • . . process until signal. process. . • . . • processed by fsck. checklist: processes. Isend a signal processing language. • . . processor. . . . • • . • processor type. lu3b5, vax: process's alarm clock. produce C source listing from prof: display profile data. profil: execution time profile data. profile. .••.. profile. .••.. profile: setting up an profiler. . • • . • programming language. /the provide drill in number facts. provide truth value about your/ provide truth values. • . • prs: print an SCCS file. ps: report process status. pseudo-random numbers. ptrace: process trace. ptx: permuted index. . . • push character back into input putc, putchar, fputc, putw: putchar, fputc, putw: put • . putpwent: write password file puts, fputs: put a string on a pututline, setutent, endutent,l putw: put character or word on PVC on a link. x25ipvc, pwd: working directory name. qsort: quicker sort. query the operation status of queue. • . • . • • . . • . queue, semaphore set or sharedl quicker sort. . . • . . . quits. nohup: run a quiz: test your knowledge. rand: Fortran uniform rand, srand: simple - 27 - • • • • • • • • · • • • • nice(2) acct(2) acctcom(l) times(2) timex(l) exit(2) fork (2) getpid(2) setpgrp(2) getpid(2) inittab(4) kill(I) nice(2) kill (2) popen(3S) getpid(2) ps(I) plock (2) times (2) wait(2) ptrace(2) pause (2) wait(I) checklist (4) kill (2) awk(I) m4(I) machid(l) alarm(2) list(l) prof(l) profil (2) prof(l) monitor(3C) profil(2) profile(4) sadp(I) sh(I) arithmetic(6) machid(l) true(I) prs(I) ps(I) drand48 (3C) ptrace(2) ptx(I) ungetc(3S) putc(3S) putc(3S) putpwent (3C) puts(3S) getut(3C) putc(3S) x25ipvc(3C) pwd(I) qsort(3C) nscsta t (1 C) msgget(2) ipcrm(I) qsort(3C) nohup(I) quiz(6) rand (3 F) rand<3C) Permuted Index rand, srand: simple srand, rand: Fortran uniform fsplit: split f77, dialect. ratfor: getpass: entry of a common! ldtbread: header/ ldshread,ldnshread: read: rmail: send mail to users or line: member of an! ldahread: common object file. ldfhread: open a common object file for open: open for lseek: move cmplx,/ int, ifix, idint, allocator. malloc, free, specify what to do upon !specify Fortran action on ed, generate C program cross execute regular expression. compile. make: maintain, update, and regular expression. regcmp, compile and match routines. match routines. regexp: regcmp: regex: compile and execute sorted files. comm: select or lorder: find ordering join: for a common object file. strip: remove symbols and ldrseek, ldnrseek: seek to common object file. reloc: !fmod, fabs: floor, ceiling, mod, amod, dmod: Fortran calendar: ct: spawn getty to a file. rmdel: semaphore set or! ipcrm: x2Sipvc, x2Srpvc: install or unlink: rm, rmdir: eqn constructs. deroff: bits. strip: uniq: report console. rjestat: RJE status clock: communication! ipcs: timex: time a command; ps: file. uniq: facilities status. ststat: trouble: log a trouble sar: system activity stream. fseek, rewind, ftell: lp, cancel: send!cancel network to RJE. nsctorje: HONEYWELL! fget, fget.demon: argument. getarg: random-number generator. random-number generator. ratfor, or efl files. ratfor: rational Fortran . rational Fortran dialect. read a password. read an indexed symbol table read an indexed!named section read from file. read mail. mail, read one line. . read: read from file. read the archive header of a read the file header of a reading. ldopen, ldaopen: reading or writing. read!write file pointer. . real, float, sngl, dble, realloc, calloc: main memory receipt of a signal. signal: receipt of a system signal. red: text editor. • . . • reference. cxref: regcmp, regex: compile and regcmp: regular expression regenerate groups of programs. regex: compile and execute . . regexp: regular expression regular expression compile and regular expression compile. regular expression. regcmp, reject lines common to two relation for an object! relational database operator. reloc: relocation information relocation bits. . • . . . relocation entries of a! . . relocation information for a remainder, absolute value! remaindering intrinsic! reminder service. remote terminal. remove a delta from an SCCS remove a message queue, remove a PVC on a link. . remove directory entry. remove files or directories. remove nroff!troff, tbl, and remove symbols and relocation repeated lines in a file. . . report and interactive status report CPU time used. . . report inter-process report process data and system! report process status. report repeated lines in a • report synchronous terminal report. . • . • • . • . . reporter. • . • . . . . . reposition a file pointer in a requests to an LP line! . . re-route jobs from the NSC retrieve files from the return Fortran command-line - 28 - • rand(3C) • rand(3F) fsplit(I) ratfor(I) ratfor(I) • getpass(3C) • Idtbread(3X) ldshread (3 x) read (2) • mail(I) • line(I) read (2) • Idahread(3X) ldfhread (3 X) • Idopen(3X) open (2) Iseek(2) ftype(3F) malloc(3C) signal(2) signal (3 F) ed(I) cxref(l) regcmp(3X) regcmp(I) make(I) regcmp(3X) regexp(S) • regexp(S) regcmp(I) regcmp(3X) comm(l) lorder(l) join(I) reloc(4) strip.pdp(I) Idrseek(3X) reloc(4) floor(3M) mod (3 F) calendar(I) ct(I C) rmdel(l) ipcrm(I) x25ipvc(3C) unlink(2) rm(l) deroff(l) • strip.pdp(I) uniq(I) rjestat (I C) clock(3C) ipcs(I) timex(l) ps(I) uniq(I) ststat(I) trouble(I) sar(I) fseek(3S) • Ip(I) nsctorje(l C) fget(IC) getarg(3F) Permuted Index variable. getenv: accounting. mclock: abs: string. len: substring. index: logname: name. getenv: stat: data reversi: a game of dramatic col: filter reversals. file pointer in a/ fseek, creat: create a new file or gather files and/or submit jobs from the NSC network to interactive status/ rjestat: interactive status console. directories. read mail. mail, SCCS file. directories. rm, chroot: change logarithm, power, square /dsqrt, csqrt: Fortran square Itekset, td: graphical device common object file access expression compile and match graphical table of contents standard/restricted/ sh, and, or, xor, not, Ishift, nice: hangups and quits. nohup: editing activity. space allocation. brk, formatted input. bfs: big file language. awk: pattern files on synchronous printer. stand-alone programs. the delta commentary of an comb: combine make a delta (change) to an sact: print current get: get a version of an prs: print an rmdel: remove a delta from an compare two versions of an sccsfile: format of undo a previous get of an val: validate admin: create and administer what: identify of an SCCS file. common object file. terminals. se: inittab: program. terminals. grep, egrep, fgrep: return Fortran environment . return Fortran time return integer absolute value. return length of Fortran return location of Fortran return login name of user. return value for environment returned by stat system call. reversals. •.•.... reverse line-feeds. reversi: a game of dramatic rewind, ftell: reposition a rewrite an existing one. RJE jobs. send, gath: RJE. nsctorje: re-route RJE status report and rjestat: RJE status report and rm, rmdir: remove files or rmail: send mail to users or . rmdel: remove a delta from an rmdir: remove files or root directory. ..... . root functions. /exponential, root intrinsic function. routines and filters. routines. Idfcn: routines. regexp: regular routines. toc: . . . . rsh: shell, the . . . . . rshift: Fortran bitwise/ . run a command at low priority. run a command immune to • sact: print current SCCS file sadp: disk access profiler. . . sag: system activity graph. sar: system activity reporter. sbrk: change data segment scanf, fscanf, sscanf: convert scanner. . . . • . . . . scanning and processing scat: concatenate and print scc: C compiler for SCCS delta. cdc: change SCCS deltas. . . . . . SCCS file. delta: SCCS file editing activity. SCCS file. SCCS file. SCCS file. SCCS file. sccsdiff: SCCS file. SCCS file. unget: SCCS file. SCCS files. . . . SCCS files. . . . sccsdiff: compare two versions sccsfile: format of SCCS file. scnhdr: section header for a screen editor for video script for the init process. sdb: symbolic debugger. sdiff: side-by-side difference se: screen editor for video . search a file for a pattern. - 29 - • • • · • • • · • · getenv(3F) mclock(3F) abs(3C) len(3F) index(3F) 10gname(3X) getenv(3C) stadS) reversi (6) col(I) reversi (6) fseek(3S) creat(2) send(lC) nsctorje (1 C) rjestat(IC) rjestat(IC) rm(I) mail(l) rmdel(l) rm(I) chroot(2) exp(3M) sqrt (3 F) gdev (I G) Idfcn(4) regexp(S) toc(lG) sh(l) boo I (3 F) nice(I) nohup(I) sact(I) sadp(\) sag (I G) sar(I) brk(2) scanf(3S) bfs(I) awk(I) scat(I) scc(\) cdc(I) comb(I) delta (I) sact(I) get(\) prs(I) rmdel(l) sccsdiff(I ) sccsfile(4) unget(l) vaI(l) admin(l) what(I) sccsdiff(I ) sccsfile(4) scnhdr(4) se(I) inittab(4) sdb(I) sdiff(l) se(I) grep(I) Permuted Index accounting file(s). acctcom: lsearch: linear bsearch: binary hcreate, hdestroy: manage hash tdelete, twalk: manage binary jotto: object file. scnhdr: object/ tread an indexed/named Ito line number entries of a Ito relocation entries of a /seek to an indexed/named files. size: print /mrand48, jrand48, srand48, section off ldsseek, ldnsseek: a section/ ldlseek,ldnlseek: a section/ ldrseek, ldnrseek: header of a common/ ldohseek: common object file. ldtbseek: shmget: get shared memory brk, sbrk: change data to two sorted files. comm: greek: of a file. cut: cut out file. dump: dump semctl: semop: ipcrm: remove a message queue, semget: get set of operations. a group of processes. kill: the NSC network. nusend: 6000. fsend: and/or submit RJE jobs. gcosmail: mail. mail, rmail: the HONEYWELL 6000. gcat: line printer. lp, cancel: daemon. dpd, lpd: HONEYWELL stream. IDs. setuid, getgrent, getgrgid, getgrnam, goto. encryption. crypt, getpwent, getpwuid, getpwnam, login time. profile: gettydefs: speed and terminal group IDs. /getutid, getutline, pututline, data in a machine/ sputl, standard/restricted command/ operations. shmctl: queue, semaphore set or /multiple-access-user-space shmop: shmget: get system: issue a system: issue a command programming/ sh, rsh: operations. segment. search and print process search and update. search. •..... search tables. hsearch, search trees. tsearch, secret word game. . . section header for a common section header of a common section of a common object/ section of a common object/ section of a common object/ section sizes of common object sed: stream editor. . . . . seed48, 1cong48: generate/ seek to an indexed/named seek to line number entries of seek to relocation entries of . seek to the optional file seek to the symbol table of a segment. . . . . . . . . . segment space allocation. . . select or reject lines common select terminal filter. . . . selected fields of each line selected parts of an object semaphore control operations. semaphore operations. semaphore set or shared memory/ semaphores. . . . • . . . semctl: semaphore control semget: get set of semaphores. semop: semaphore operations. send a signal to a process or send files to another UNIX on send files to the HONEYWELL send, gath: gather files . send mail to HIS user. . . . send mail to users or read send phototypesetter output to send/cancel requests to an LP sending daemon, line printer setbuf: assign buffering to a . setgid: set user and group setgrent, endgrent: get group/ setjmp, longjmp: non-local setkey, encrypt: generate DES setpgrp: set process group 10. setpwent, endpwent: get/ . . setting up an environment at settings used by getty. setuid, setgid: set user and setutent, endutent, utmpname:/ sgetl: access long numeric sh, rsh: shell, the . . . . . . shared memory control . . . . shared memory id. /a message (shared memory) operations. I shared memory operations. shared memory segment. . . shell command from Fortran. shell command. . . . ~ . . shell, the standard/restricted shmctl: shared memory control shmget: get shared memory . . - 30 - acctcom(l) lsearch (3C) bsearch (3C) hsearch (3C) tsearch (3C) jotto(6) scnhdr(4) Idshread(3X) Idlseek(3X) Idrseek(3X) Idsseek(3X) size(I) sed(l) drand48 (3C) ldsseek (3X) Idlseek(3X) Idrseek(3X) ldohseek (3 X) Idtbseek(3X) shmget(2) brk(2) comm(l) greek(l) cut(I) dump(I) semctl(2) semop(2) ipcrm(I) semget(2) semctl(2) . semget(2) semop(2) kill (2) nusend(lC) fsend(lC) send (I C) gcosmail (1 C) mail(l) gcat(IC) Ip(I) dpd(IC) setbuf(3S) setuid(2) getgrent (3C) setjmp(3C) crypt(3C) setpgrp(2) getpwent (3C) profile(4) gettydefs(4) setuid(2) getut(3C) sputl(3X) sh(l) shmctl(2) ipcrm(I) maus(2) shmop(2) shmget(2) system (3 F) system(3S) sh (1) shmctl(2) shmget(2) Permuted Index operations. program. sdiff: transfer-of-sign intrinsic/ login: terminal. stlogin: pause: suspend process until what to do upon receipt of a action on receipt of a system on receipt of a system/ upon receipt of a signal. of processes. kill: send a ssignal, gsignal: software lex: generate programs for generator. rand, srand: tc: phototypesetter atan, atan2: trigonometric/ intrinsic function. sin, dsin, csin: Fortran /dsinh: Fortra,n hyperbolic functions. hyperbolic sine intrinsic/ common object files. files. size: print section size: print an interval. interval. documents, view graphs, and typesetting view graphs and current/ ttyslot: find the spline: interpolate int, ifix, idint, real, float, sno: ssignal, gsignal: sort: qsort: quicker tsort: topological or reject lines common to two object file. list: produce C brk, sbrk: change data segment terminal. ct: sys3b: 3B20S fspec: format receipt of a system/ signal: receipt of a signal. signal: used by getty. gettydefs: hashcheck: find spelling/ spelling/ spell, hashmake, spellin, hashcheck: find curve. split: csplit: context files. fsplit: pieces. Ipr: line printer vpr: Versatec printer output. printf, fprintf, numeric data in a machine/ square root intrinsic/ power,! exp, log, 10glO, pow, exponential, logarithm, power, shmop: shared memory . side-by-side difference sign, isign, dsign: Fortran sign on. • . . . . . sign on to synchronous signal. . . . . . . . signal. signal: specify signal. /specify Fortran signal: specify Fortran action signal: specify what to do . . signal to a process or a group ..... . signals. simple lexical tasks. simple random-number simulator. . . . . . sin, cos, tan, asin, acos, sin, dsin, csin: Fortran sine sine intrinsic function. sine intrinsic function. sinh, cosh, tanh: hyperbolic sinh, dsinh: Fortran size: print section sizes of . size: print sizes of object sizes of common object files. sizes of object files. sky: obtain ephemerides. sleep: suspend execution for sleep: suspend execution for slides. mmt, mvt: typeset . slides. /macro package for slot in the utmp file of the smooth curve. ..... sngl, dble, cmplx, dcmplx,! sno: SNOBOL interpreter. SNOBOL interpreter. software signals. sort and/or merge files. sort. . . . . . . . . sort: sort and/or merge files. sort. . . . . . . . . . sorted files. comm: select source listing from 3B20S space allocation. spawn getty to a remote specific system calls. . . specification in text files. specify Fortran action on specify what to do upon speed and terminal settings spell, hashmake, spellin, spellin, hashcheck: find . . spelling errors. /hashmake, spline: interpolate smooth split a file into pieces. split. .•..... split fl?, ratfor, or efl split: split a file into spooler. . . . . . . spooler. . . . . . . sprintf: print formatted spud, sgetl: access long sqrt, dsqrt, csqrt: Fortran sqrt: exponential, logarithm, square root functions. /sqrt: - 31 - shmop(2) sdiff(I ) sign(3F) login(l) stlogin(l) pause(2) signal(2) signal(3F) signal(3F) signal(2) kill (2) ssignal (3C) lex(I) rand(3C) tc( I) trig(3M) sin(3F) sin(3F) sinh(3F) sinh(3M) sinh(3F) size(1) size.pdp(I) size(1) size.pdp(I) sky(6) sleep(I) sleep(3C) mmt(I) mv(S) ttyslot (3C) spline(IG) ftype (3 F) sno(I) sno(1) ssignal (3C) sort(I) qsort(3C) sort(I) tsort (I) comm(I) list(l) brk(2) ct(lC) sys3b(2) fspec(4) signal(3F) signal(2) gettydefs(4) spell(I) spell(l) spell(l) spline (I G) split(1) csplit(I) fsplit(I) split(I) Ipr(1) vpr(I) printf(3S) sputl(3X) sqrt (3 F) exp(3M) exp(3M) Permuted Index sqrt, dsqrt, csqrt: Fortran random-number generator. generator. rand, /nrand48, mrand48, jrand48, input. scanf, fscanf, signals. scc: C compiler for package. stdio: communication/ stdipc: sh, rsh: shell, the system call. useful with graphical/ stat: data returned by with graphical! stat: ustat: get file system status report and interactive lpstat: print LP feof, clearerr, fileno: stream control. uustat: uucp communication facilities nscstat: query the operation ps: report process status console. rjestat: RJE stat, fstat: get file terminal facilities input/output package. communication package. synchronous terminal. wait for child process to strncmp, strcpy, strncpy'/ /strcpy, strncpy, strlen, strncpy,/ strcat, strncat, /strncat, strcmp, strncmp, /strrchr, strpbrk, strspn, sed: fHush: close or flush a fopen, freopen, fdopen: open a reposition a file pointer in a get character or word from fgets: get a string from a put character or word on a puts, fputs: put a string on a setbuf: assign buffering to a /feof, clearerr, fileno: push character back into input long integer and base-64 ASCII convert date and time to floating-point number to gps: graphical primitive gets, fgets: get a len: return length of Fortran puts, fputs: put a strspn, strcspn, strtok: number. atof: convert ASCII strtol, atol, atoi: convert relocation bits. number information from a/ information from a/ strip: /strncmp, strcpy, strncpy, strcpy, strncpy'/ strcat, strcat, strncat, strcmp, /strcmp, strncmp, strcpy, square root intrinsic/ srand, rand: Fortran uniform srand: simple random-number srand48, seed48, lcong48:/ sscanf: convert formatted ssignal, gsignal: software . stand-alone programs. standard buffered input/output standard interprocess standard/restricted command/ stat: data returned by stat stat, fstat: get file status. stat: statistical network stat system call. . . • . statistical network useful statistics. .•.... status console. rjestat: RJE status information. status inquiries. ferror, . . status inquiry and job status. /report inter-process status of the NSC network. status. • . . . . . . . . status report and interactive status. . . . . . . . . . status. /report synchronous stdio: standard buffered stdipc: standard interprocess stime: set time. stlogin: sign on to . • stop or terminate. wait: strcat, strncat, strcmp, strchr, strrchr, strpbrk'/ strcmp, strncmp, strcpy, strcpy, strncpy, strlen,/ strcspn, strtok: string/ stream editor. stream. fclose, stream. stream. fseek, rewind, ftell: stream. /getchar, fgetc, getw: stream. gets, . . . . . . . stream. /putchar, fputc, putw: stream. . ..... stream. stream status inquiries. stream. ungetc: . . . string. 1l64a: convert between string. /asctime, tzset: . . string. /fcvt, gcvt: convert string, format of graphical! string from a stream. string. . . . . . . . . . string on a stream. string operations. /strpbrk, string to floating-point . • string to integer. strip: remove symbols and strip: strip symbol and line strip symbol and line number strlen, strchr, strrchr,/ . strncat, strcmp, strncmp, strncmp, strcpy, strncpy'/ strncpy, strlen, strchr,/ . - 32 - sqrt (3 F) rand(3F) rand(3C) drand48 (3C) scanf(3S) ssignal (3C) scc(I) stdio(3S) stdipc(3C) sh(l) stat (5) stat(2) stat(lG) stat(5) stat(lG) ustat(2) rjestat (I C) Ipstat(I) ferror(3S) uustat(1C) ipcs(1) nscstatoptarg where < > is optional white space. noargletter A single letter representing an option without an argument. argletter A single letter representing an option requiring an argument. Argument (character string) satisfying preceding argletter. optarg cmdarg Path name (or other command argument) not beginning with or, - by itself indicating the standard input. SEE ALSO getopt(1), getopt(3C). Section 6 of this volume for computer games. How to Get Started, at the front of this volume. DIAGNOSTICS Upon termination, each command returns two bytes of status, one supplied by the system and giving the cause for termination, and Gn the case of "normal" termination) one supplied by the program (see wait (2) and exit (2». The former byte is 0 for normal termination; the latter is customarily 0 for successful execution and non-zero to indicate troubles such as erroneous parameters, bad or inaccessible data, or other inability to cope with the task at hand. It is called variously "exit code", "exit status", or "return code", and is described only where special conventions are involved. BUGS Regretfully, many commands do not adhere to the aforementioned syntax. - 1- 300(1) 300(1) NAME 300, 300s - handle special functions of DASI 300 and 300s terminals SYNOPSIS 300 [ +12 ] [ -0 ] [ -dt,l,c ] 300s [ +12 ] [ -0] [ -dt,l,c ] DESCRIPTION 300 supports special functions and optimizes the use of the DASI 300 (GSI 300 or DTC 300) terminal; 300s performs the same functions for the DASI 300s (GSI 300s or DTC 300s) terminal. It converts half-line forward, half-line reverse, and full-line reverse motions to the correct vertical motions. It also attempts to draw Greek letters and other special symbols. It permits convenient use of 12-pitch text. It also reduces printing time 5 to 70%. 300 can be used to print equations neatly, in the sequence: neqn file ... I nrofT I 300 WARNING: if your terminal has a PLOT switch, make sure it is turned on before 300 is used. The behavior of 300 can be modified by the optional flag arguments to handle 12-pitch text, fractional line spacings, messages, and delays. +12 permits use of 12-pitch, 6 lines/inch text. DASI 300 terminals normally allow only two combinations: 10-pitch, 6 lineslinch, or 12pitch, 8 lines/inch. To obtain the 12-pitch, 6 lines per inch combination, the user should turn the PITCH switch to 12, and use the + 12 option. -n controls the size of half-line spacing. A half-line is, by default, equal to 4 vertical plot increments. Because each increment equals 1/48 of an inch, a lO-pitch line-feed requires 8 increments, while a 12-pitch line-feed needs only 6. The first digit of n overrides the default value, thus allowing for individual taste in the appearance of subscripts and superscripts. For example, nroff half-lines could be made to act as quarter-lines by using -2. The user could also obtain appropriate half-lines for 12-pitch, 8 lines/inch mode by using the option -3 alone, having set the PITCH switch to 12-pitch. -dt,i,c controls delay factors. The default setting is -d3,90,30. DASI 300 terminals sometimes produce peculiar output when faced with very long lines, too many tab characters, or long strings of blankless, nonidentical characters. One null (delay) character is inserted in a line for every set of t tabs, and for every contiguous string of c nonblank, non-tab characters. If a line is longer than i bytes, 1+(total length) /20 nulls are inserted at the end of that line. Items can be omitted from the end of the list, implying use of the default values. Also, a value of zero for t (c) results in two null bytes per tab (character). The former may be needed for C programs, the latter for files like /etc/passwd. Because terminal behavior varies according to the specific characters printed and the load on a system, the user may have to experiment with these values to get correct output. The -d option exists only as a last resort for those few cases that do not otherwise print properly. For example, the file /ete/passwd may be printed using -d3,30,5. The value -dO,l is a good one to use for C programs that have many levels of indentation. Note that the delay control interacts heavily with the prevailing carriage return and line-feed delays. The stty (1) modes 010 er2 or 010 er3 are recommended for most uses. - 1- 300(1) 300 (1) 300 can be used with the nroff -s flag or .rd requests, when it is necessary to insert paper manually or change fonts in the middle of a document. Instead of hitting the return key in these cases, you must use the line-feed key to get any response. In many (but not all) cases, the following sequences are equivalent: nroff -T300 files ... and nroff files ... I 300 nroff - T300-12 files... and nroff files... I 300 + 12 The use of 300 can thus often be avoided unless special delays or options are required; in a few cases, however, the additional movement optimization of 300 may produce better-aligned output. The neqn names of, and resulting output for, the Greek and special characters supported by 300 are shown in greek (5). SEE ALSO 450(1), eqn(I), graph(1G), mesg(I), tplot(1G), greek(5). nroff(1), stty(I), tabs(I), tbl(I), BUGS Some special characters cannot be correctly printed in column 1 because the print head cannot be moved to the left from there. If your output contains Greek and/or reverse line-feeds, use a friction-feed platen instead of a forms tractor; although good enough for drafts, the latter has a tendency to slip when reversing direction, distorting Greek characters and misaligning the first line of text after one or more reverse line-feeds. - 2 - 4014 (1) 4014 (1) NAME 4014 - paginator for the Tektronix 4014 terminal SYNOPSIS 4014 [ -t ] [ -0 ] [ -eN ] [ -pL ] [ file ] DESCRIPTION The output of 4014 is intended for a Tektronix 4014 terminal; 4014 arranges for 66 lines to fit on the screen, divides the screen into N columns, and contributes an eight-space page offset in the (default) single-column case. Tabs, spaces, and backspaces are collected and plotted when necessary. TELETYPE@ Teletypewriter Model 37 half- and reverse-line sequences are interpreted and plotted. At the end of each page, 4014 waits for a new-line (empty line) from the keyboard before continuing on to the next page. In this wait state, the command !cmd will send the cmd to the shell. The command line options are: -t Don't wait between pages (useful for directing output into a file). -0 Start printing at the current cursor position and never erase the screen. -eN Divide the screen into N columns and wait after the last column. -pL Set page length to L; L accepts the scale factors i (inches) and I (Jines); default is lines. SEE ALSO pr (I), tc( 1), troff(I). - 1- 450 (1) 450(1 ) NAME 450 - handle special functions of the DASI 450 terminal SYNOPSIS 450 DESCRIPTION 450 supports special functions of, and optimizes the use of, the DASI 450 terminal, or any terminal that is functionally identical, such as the DIABLO 1620 or XEROX 1700. It converts half-line forward, half-line reverse, and full-line reverse motions to the correct vertical motions. It also attempts to draw Greek letters and other special symbols in the same manner as 300(1). 450 can be used to print equations neatly, in the sequence: neqn file ... I nroff I 450 WARNING: make sure that the PLOT switch on your terminal is ON before 450 is used. The SPACING switch should be put in the desired position (either 10or 12-pitch). In either case, vertical spacing is 6 lines/inch, unless dynamically changed to 8 lines per inch by an appropriate escape sequence. 450 can be used with the nroff -s flag or .rd requests, when it is necessary to insert paper manually or change fonts in the middle of a document. Instead of hitting the return key in these cases, you must use the line-feed key to get any response. In many (but not all) cases, the use of 450 can be eliminated in favor of one of the following: nroff -T450 files ... or nroff -T450-12 files The use of 450 can thus often be avoided unless special delays or options are required; in a few cases, however, the additional movement optimization of 450 may produce better-aligned output. The neqn names of, and resulting output for, the Greek and special characters supported by 450 are shown in greek (5). SEE ALSO 300(1), eqn(1), graph(1G), tplot(IG), greek(5). mesg(1), nroff(l), stty(1), tabs(1), tbI(l), BUGS Some special characters cannot be correctly printed in column 1 because the print head cannot be moved to the left from there. If your output contains Greek and/or reverse line-feeds, use a friction-feed platen instead of a forms tractor; although good enough for drafts, the latter has a tendency to slip when reversing direction, distorting Greek characters and misaligning the first line of text after one or more reverse line-feeds. - 1- ACCTCOM(I) ACCTCOM(I) NAME acctcom - search and print process accounting file(s) SYNOPSIS acctcorn [[ options] [ file] ] DESCRIPTION Acctcom reads file, the standard input, or lusr/adrn/pacct, in the form described by acct (4) and writes selected records to the standard output. Each record represents the execution of one process. The output shows the COMMAND NAME, USER, TTYNAME, START TIME, END TIME, REAL (SEC), CPU (SEC), MEAN SIZE(K), and optionally, F (the fork/exec flag: 1 for fork without exec) and STAT (the system exit status). The command name is prepended with a # if it was executed with super-user privileges. If a process is not associated with a known terminal, a ? is printed in the TTYNAME field. If no files are specified, and if the standard input is associated with a terminal or Idev/null (as is the case when using & in the shell), lusr/adm/pacct is read, otherwise the standard input is read. If any file arguments are given, they are read in their respective order. Each file is normally read forward, i.e., in chronological order by process completion time. The file /usr/adm/pacct is usually the current file to be examined; a busy system may need several such files of which all but the current file are found in /usr/adm/pacct? The options are: -b Read backwards, showing latest commands first. Print the fork/exec flag and system exit status columns in the output. -b Instead of mean memory size, show the fraction of total available CPU time consumed by the process during its execution. This "hog factor" is computed as: (total CPU time) / (elapsed time). -i Print columns containing the I/O counts in the output. -k Instead of memory size, show total kcore-minutes. -m Show mean core size (the default). -r Show CPU factor (user timet (system-time + user-time). -t Show separate system and user CPU times. -v Exclude column headings from the output. -I line Show only processes belonging to terminal /devlline. -u user Show only processes belonging to user that may be specified by: a user ID, a login name that is then converted to a user ID, a # which designates only those processes executed with super-user privileges, or ? which designates only those processes associated with unknown user IDs. -g group Show only processes belonging to group. The group may be designated by either the group ID or group name. -d mm/dd Any time arguments following this flag are assumed to occur on the given month mm and the day dd rather than during last 24 hours. This is needed for looking at old files. -s time Select processes existing at or after time, given in the format hr [ :min [:sec ]]. -e time Select processes existing at or before time. -S time Select processes starting at or after time. -E time Select processes ending at or before time. -n pattern Show only commands matching pattern that may be a regular expression as in ed(1) except that + means one or more occurrences. -f - 1- ACCTCOM(I) ACCTCOM(I) -0 ofile -H factor -0 sec -C sec Copy selected process records in the input data format to ofile; supress standard output printing. Show only processes that exceed factor, where factor is the "hog factor" as explained in option -h above. Show only processes with CPU system time exceeding sec seconds. Show only processes with total CPU time, system plus user, exceeding sec seconds. Listing options together has the effect of a logical and. FILES /etc/passwd / usr / adm/ pacct /etc/group SEE ALSO ps(l), su(I), acct(2), acct(4) , utmp(4). acct (I M), acctcms (I M), acctcon (I M), acctmerg (I M), acctprc( I M), acctsh(IM), fwtmp(IM), runacct(IM) in the UNIX System Administrator's Manual. BUGS Acctcom only reports on processes that have terminated; use ps(I) for active processes. If time exceeds the present time and option -d is not used, then time is interpreted as occurring on the previous day. -2- ADB(I) (DEC only) ADB(I) NAME adb - absolute debugger SYNOPSIS adb [-w] [ objfil [ corfil ] ] DESCRIPTION Adb is a general purpose debugging program. It may be used to examine files and to provide a controlled environment for the execution of UNIX System programs. Objfil is normally an executable program file, preferably containing a symbol table; if not then the symbolic features of adb cannot be used although the file can still be examined. The default for objfil is a.out. Corfil is assumed to be a core image file produced after executing objfil; the default for eorfil is core. Requests to adb are read from the standard input and responses are to the standard output. If the -w flag is present then both objfil and corfil are created if necessary and opened for reading and writing so that files can be modified using adb. Adb ignores QUIT; INTERRUPT causes return to the next adb command. In general requests to adb are of the form [ address] [, count] [command] [;] If address is present then dot is set to address. Initially dot is set to O. For most commands count specifies how many times the command will be executed. The default count is 1. Address and count are expressions. The interpretation of an address depends on the context it is used in. If a subprocess is being debugged then addresses are interpreted in the usual way in the address space of the subprocess. For further details of address mapping see ADDRESSES. EXPRESSIONS The value of dot. + The value of dot incremented by the current increment. The value of dot decremented by the current increment. The last address typed. integer An octal number if integer begins with a 0; a hexadecimal number if preceded by #; otherwise a decimal number. integer .fraction A 32 bit floating point number. 'ecce The ASCII value of up to 4 characters. \ may be used to escape a '. < name The value of name, which is either a variable name or a register name. Adb maintains a number of variables (see VARIABLES) named by single letters or digits. If name is a register name then the value of the register is obtained from the system header in corfil. The register names are rO ... r5 sp pc ps. symbol A symbol is a sequence of upper or lower case letters, underscores or digits, not starting with a digit. The value of the symbol is taken from the symbol table in objfil. An initial or - will be prefixed to symbol if needed. _ symbol In C, the "true name" of an external symbol begins with _. It may be necessary to utter this name to distinguish it from internal or hidden - 1- ADB(I) (DEC only) ADB(I) variables of a program. routine .name The address of the variable name in the specified C routine. Both routine and name are symbols. If name is omitted the value is the address of the most recently activated C stack frame corresponding to routine. (exp) The value of the expression exp. Monadic operators: *exp The contents of the location addressed by exp in corfil. @exp The contents of the location addressed by exp in objfil. -exp Integer negation. -exp Bitwise complement. Dyadic operators are left associative and are less binding than monadic operators. el +e2 Integer addition. el -e2 Integer subtraction. el*e2 Integer multiplication. el %e2 Integer division. el & e2 Bitwise conjunction. el Ie2 Bitwise disjunction. el #e2 El rounded up to the next multiple of e2. COMMANDS Most commands consist of a verb followed by a modifier or list of modifiers. The following verbs are available. (The commands? and / may be followed by *; see ADDRESSES for further details') ?f Locations starting at address in objfil are printed according to the format f. dot is incremented by the sum of the increments for each format letter (q.v.). /f Locations starting at address in corfil are printed according to the format f and dot is incremented as for? =f The value of address itself is printed in the styles indicated by the format f. (For i format ? is printed for the parts of the instruction that reference subsequent words') A format consists of one or more characters that specify a style of printing. Each format character may be preceded by a decimal integer that is a repeat count for the format character. While stepping through a format dot is incremented by the amount given for each format letter. If no format is given then the last format is used. The format letters available are as follows: o 2 o 4 q 2 Q 4 d 2 D 4 x 2 X 4 Print 2 bytes in octal. All octal numbers output by adb are preceded by o. Print 4 bytes in octal. Print in signed octal. Print long signed octal. Print in decimal. Print long decimal. Print 2 bytes in hexadecimal. Print 4 bytes in hexadecimal. - 2- ADB(I) ADB(I) (DEC only) u 2 U 4 f 4 F 8 b 1 c 1 C 1 s n S n Y 4 i n a 0 Print as an unsigned decimal number. Print long unsigned decimal. Print the 32 bit value as a floating point number. Print double floating point. Print the addressed byte in octal. Print the addressed character. Print the addressed character using the following escape convention. Character values 000 to 040 are printed as @ followed by the corresponding character in the range 0100 to 0140. The character @ is printed as @ @. Print the addressed characters until a zero character is reached. Print a string using the @ escape convention. n is the length of the string including its zero terminator. Print 4 bytes in date format (see clime Print as PDP-II instructions. n is the number of bytes occupied by the instruction. This style of printing causes variables 1 and 2 to be set to the offset parts of the source and destination respectively. Print the value of dot in symbolic form. Symbols are checked to ensure that they have an appropriate type as indicated below. OC»' I local or global data symbol ? local or global text symbol local or global absolute symbol P 2 o 0 n 0 "... " 0 r + Print the addressed value in symbolic form using the same rules for symbol lookup as a. When preceded by an integer tabs to the next appropriate tab stop. For example, 8t moves to the next 8-space tab stop. Print a space. Print a new-line. Print the enclosed string. Dot is decremented by the current increment. Nothing is printed. Dot is incremented by 1. Nothing is printed. Dot is decremented by 1. Nothing is printed. new-line Repeat the previous command with a count of 1. [? 111 value mask Words starting at dot are masked with mask and compared with value until a match is found. If L is used then the match is for 4 bytes at a time instead of 2. If no match is found then dot is unchanged; otherwise dot is set to the matched location. If mask is omitted then -1 is used. [? 11w value ... Write the 2-byte value into the addressed location. If the command is W, write 4 bytes. Odd addresses are not allowed when writing to the subprocess address space. [? 11m bi el IJ[? /1 New values for (bI, eI, II) are recorded. If less than three expressions are given then the remaining map parameters are left unchanged. If the ? or / is followed by • then the second segment (b2, e2 ,f2) of the mapping is changed. If the list is terminated by ? or / then the file (objfil or corfil respectively) is used for subsequent requests. (So that, - 3- ADB(O (DEC only) ADB(I) .for example, 1m? will cause I to refer to objfil.) > name Dot is assigned to the variable or register named. A shell is called to read the rest of the line following !. $ modifier Miscellaneous commands. The available modifiers are: f r r b a e e w s o d q v .m Read commands from the file f and return. Send output to the file f, which is created if it does not exist. Print the general registers and the instruction addressed by pc. Dot is set to pc. Print the floating registers in single or double length. If the floating point status of ps is set to double (0200 bit) then double length is used anyway. Print all breakpoints and their associated counts and commands. ALGOL 68 stack backtrace. If address is given then it is taken to be the address of the current frame (instead of r4). If count is given then only the first count frames are printed. C stack backtrace. If address is given then it is taken as the address of the current frame (instead of rS). If C is used then the names and (16 bit) values of all automatic and static variables are printed for each active function. If count is given then only the first count frames are printed. The names and values of external variables are printed. Set the page width for output to address (default 80). Set the limit for symbol matches to address (default 255). All integers input are regarded as octal. Reset integer input as described in EXPRESSIONS. Exit from adb. Print all non zero variables in octal. Print the address map. :modifier Manage a subprocess. Available modifiers are: be Set breakpoint at address. The breakpoint is executed eount-l times before causing a stop. Each time the breakpoint is encountered the command e is executed. If this command sets dot to zero then the breakpoint causes a stop. d Delete breakpoint at address. r Run objfil as a subprocess. If address is given explicitly then the program is entered at this point; otherwise the program is entered at its standard entry point. count specifies how many breakpoints are to be ignored before stopping. Arguments to the subprocess may be supplied on the same line as the command. An argument starting with < or > causes the standard input or output to be established for the command. All signals are turned on on entry to the subprocess. es The subprocess is continued with signal s (see signaI(2»). If address is given then the subprocess is continued at this address. If no signal is specified then the signal that caused the subprocess to stop is sent. Breakpoint skipping is the same as for r. ss As for e except that the subprocess is single stepped count times. If there is no current subprocess then objfil is run as a subprocess as for r. In this case no signal can be sent; the -4- (DEC only) ADBU) ADBU) remainder of the line is treated as arguments to the subprocess. k The current subprocess, if any, is terminated. VARIABLES Adb provides a number of variables. Named variables are set initially by adb but are not used subsequently. Numbered variables are reserved for communication as follows. o 1 2 The last value printed. The last offset part of an instruction source. The previous value of variable 1. On entry the following are set from the system header in the corfil. If corfil does not appear to be a core file then these values are set from objfil. b d e m s t The The The The The The base address of the data segment. data segment size. entry point. "magic" number (0405, 0407, 0410 or 0411). stack segment size. text segment size. ADDRESSES The address in a file associated with a written address is determined by a mapping associated with that file. Each mapping is represented by two triples (bI, e 1, /1) and (b2, e2, f2) and the file address corresponding to a written address is calculated as follows: bi otherwise ~address file address =address +f1 -bi b2 ~address file address=address+f2 -b2, otherwise, the requested address is not legal. In some cases (e.g. for programs with separated I and D space) the two segments for a file may overlap. If a ? or / is followed by an • then only the second triple is used. The initial setting of both mappings is suitable for normal a.out and core files. If either file is not of the kind expected then, for that file, bi is set to 0, ei is set to the maximum file size and fi is set to 0; in this way the whole file can be examined with no address translation. In order for adb to be used on large files all appropriate values are kept as signed 32 bit integers. FILES Idev/mem Idev/swap a.out core SEE ALSO ptrace(2), a.out(4), core(4). DIAGNOSTICS "Adb" when there is no current command or format. Comments about inaccessible files, syntax errors, abnormal termination of commands, etc. Exit status is 0, unless last command failed or returned nonzero status. BUGS A breakpoint set at the entry point is not effective on initial entry to the program. When single stepping, system calls do not count as an executed instruction. Local variables whose names are the same as an external variable may foul up -5- ADBU) (DEC only) the accessing of the external. -6- ADB(I) ADMIN(I) ADMIN (I) NAME admin - create and administer sees files SYNOPSIS admin [ -0] [ -ilname]] [ -rrel] [ -t[name]] [ -fflag[flag-vaI]] [-dflag[flag-vaI]] [-alogin] [-elogin] [-m[mrlist]] [-ylcomment]] [-h] [-z] files DESCRIPTION Admin is used to create new sees files and change parameters of existing ones. Arguments to admin, which may appear in any order, consist of keyletter arguments, which begin with -, and named files (note that sees file names must begin with the characters s.). If a named file doesn't exist, it is created, and its parameters are initialized according to the specified key letter arguments. Parameters not initialized by a keyletter argument are assigned a default value. If a named file does exist, parameters corresponding to specified key letter arguments are changed, and other parameters are left as is. If a directory is named, admin behaves as though each file in the directory were specified as a named file, except that non-sees files (last component of the path name does not begin with s.) and unreadable files are silently ignored. If a name of - is given, the standard input is read; each line of the standard input is taken to be the name of an sees file to be processed. Again, nonsees files and unreadable files are silently ignored. The key letter arguments are as follows. Each is explained as though only one named file is to be processed since the effects of the arguments apply independently to each named file. -0 This keyletter indicates that a new sees file is to be created. -ilname] The name of a file from which the text for a new sees file is to be taken. The text constitutes the first delta of the file (see -r keyletter for delta numbering scheme). If the i key letter is used, but the file name is omitted, the text is obtained by reading the standard input until an end-of-file is encountered. If this keyletter is omitted, then the sees file is created empty. Only one sees file may be created by an admin command on 'which the i keyletter is supplied. Using a single admin to create two or more sees files require that they be created empty (no -i keyletter). Note that the -i key letter implies the - 0 keyletter. -rrel The release into which the initial delta is inserted. This keyletter may be used only if the -i keyletter is also used. If the -r keyletter is not used, the initial delta is inserted into release 1. The level of the initial delta is always 1 (by default initial deltas are named 1. 1). -dname] The name of a file from which descriptive text for the sees file is to be taken. If the -t keyletter is used and admin is creating a new sees file (the - 0 and/or -i keyletters also used), the descriptive text file name must also be supplied. In the case of existing sees files: (1) a -t keyletter without a file name causes removal of descriptive text (if any) currently in the sees file, and (2) a -t keyletter with a file name causes text (if any) in the named file to replace the descriptive text (if any) currently in the sees file. - 1- ADMIN(I) ADMIN(I) -fflag This keyletter specifies a flag, and, possibly, a value for the flag, to be placed in the sees file. Several f keyletters may be supplied on a single admin command line. The allowable flags and their values are: b Allows use of the - b keyletter on a get (I) command to create branch deltas. cceil The highest release (i.e., "ceiling"), a number less than or equal to 9999, which may be retrieved by a get (1) command for editing. The default value for an unspecified c flag is 9999. ffloor The lowest release (i.e., "floor"), a number greater than o but less than 9999, which may be retrieved by a get (!) command for editing. The default value for an unspecified f flag is I. dSID The default delta number (SID) to be used by a get (I) command. Causes the "No id keywords (ge6)" message issued by get(!) or delta(!) to be treated as a fatal error. In the absence of this flag, the message is only a warning. The message is issued if no sees identification keywords (see get (1)) are found in the text retrieved or stored in the sees file. Allows concurrent get (I) commands for editing on the same SID of an sees file. This allows mUltiple concurrent updates to the same version of the sees file. llist A list of releases to which deltas can no longer be made (get -e against one of these "locked" releases fails). The list has the following syntax: ::=
I ,
::= RELEASE NUMBER I a The character a in the list is equivalent to specifying all releases for the named sees file. D Causes delta(!) to create a "null" delta in each of those releases (if any) being skipped when a delta is made in a new release (e.g., in making delta 5.1 after delta 2.7, releases 3 and 4 are skipped). These null deltas serve as "anchor points" so that branch deltas may later be created from them. The absence of this flag causes skipped releases to be non-existent in the sees file __ preventing branch deltas from being created from them in the future. qtext User definable text substituted for all occurrences of the %Q% keyword in sees file text retrieved by get (1) . mmod Module name of the sees file substituted for all occurrences of the %M% keyword in sees file text retrieved by get (!). If the m flag is not specified, the value assigned is the name of the sees file with the leading s. removed. ttype Type of module in the sees file substituted for all occurrences of %Y% keyword in sees file text retrieved by get (I). - 2- ADMIN (1) ADMIN(I) v[pgm] Causes delta (1) to prompt for Modification Request (M R) numbers as the reason for creating a delta. The optional value specifies the name of an M R number validity checking program (see delta (1». (If this flag is set when creating an sees file, the m key letter must also be used even if its value is null). -djlag i Causes removal (deletion) of the specified flag from an file. The -d key letter may be specified only . when processing existing sees files. Several -d keyletters may be supplied on a single admin command. See the -f keyletter for allowable flag names. sees Ilist A list of releases to be "unlocked". See the -f keyletter for a description of the I flag and the syntax of a list. -alogin A login name, or numerical UNIX System group ID, to be added to the list of users which may make deltas (changes) to the sees file. A group ID is equivalent to specifying all login names common to that group ID. Several a keyletters may be used on a single admin command line. As many logins, or numerical group IDs, as desired may be on the list simultaneously. If the list of users is empty, then anyone may add deltas. -elogin A login name, or numerical group ID, to be erased from the list of users allowed to make deltas (changes) to the sees file. Specifying a group ID is equivalent to specifying all login names common to that group ID. Several e key letters may be used on a single admin command line. -ylcomment1 The comment text is inserted into the sees file as a comment for the initial delta in a manner identical to that of delta (I). Omission of the -y keyletter results in a default comment line being inserted in the form: date and time created YY/MM/DD HH:MM:SS by login The -y key letter is valid only if the -i and/or -n key letters are specified (i.e., a new sees file is being created) . -mlmrlist] The list of Modification Requests (MR) numbers is inserted into the sees file as the reason for creating the initial delta in a manner identical to delta (I). The v flag must be set and the M R numbers are validated if the v flag has a value (the name of an M R number vali- \ dation program). Diagnostics will occur if the v flag is not set or M R validation fails. -h Causes admin to check the structure of the sees file (see sccsjile(S», and to compare a newly computed check-sum (the sum of all the characters in the sees file except those in the first line) with the check-sum that is stored in the first line of the sees file. Appropriate error diagnostics are produced. This keyletter inhibits writing On the file, so that it nullifies the effect of any other key letters supplied, and is, therefore, only meaningful when processing existing files. - 3 - ADMIN (1) ADMIN(l) -z The sees file check-sum is recomputed and stored in the first line of the sees file (see -h, above). Note that use of this keyletter on a truly corrupted file may prevent future detection of the corruption. FILES The last component of all sees file names must be of the form s.jile-name. New sees files are given mode 444 (see chmod(I». Write permission in the pertinent directory is, of course, required to create a file. All writing done by admin is to a temporary x-file, called x.jile-name, (see get (I», created with mode 444 if the admin command is creating a new sees file, or with the same mode as the sees file if it exists. After successful execution of admin, the sees file is removed (if it exists), and the x-file is renamed with the name of the sees file. This ensures that changes are made to the sees file only if no errors occurred. It is recommended that directories containing sees files be mode 755 and that files themselves be mode 444. The mode of the directories allows only the owner to modify sees files contained in the directories. The mode of the sees files prevents any modification at all except by sees commands. sees If it should be necessary to patch an sees file for any reason, the mode may be changed to 644 by the owner allowing use of ed(I). Care must be taken! The edited file should always be processed by an admin - h to check for corruption followed by an admin -z to generate a proper check-sum. Another admin -h is recommended to ensure the sees file is valid. Admin also makes use of a transient lock file (called z.jile-name) , which is used to prevent simultaneous updates to the sees file by different users. See get (1) for further information. SEE ALSO delta(1), ed(1), get(1), help(1), prs(l), what(1), sccsfile(4). Source Code Control System User's Guide in the UNIX System User's Guide. DIAGNOSTICS Use help (1) for explanations. -4 - AR(l) (not on PDP-l 1) AR(l) NAME ar - archive and library maintainer for portable archives SYNOPSIS ar key [ posname ] afile name ... DESCRIPTION Ar maintains groups of files combined into a single archive file. Its main use is to create and update library files as used by the link editor. It can be used, though, for any similar purpose. When ar creates an archive, it creates headers in a format that is portable across all machines. The portable archive format and structure is described in detail in ar (4). The archive symbol table (described in ar (4)) is used by the link editor adO)) to effect multiple passes over libraries of object files in an efficient manner. Whenever the arC!) command is used to create or update the contents of an archive, the symbol table is rebuilt. The symbol table can be forced to be rebuilt by the s option described below. Key is one character from the set drqtprnx, optionally concatenated with one or more of vuaibcls. Afile is the archive file. The names are constituent files in the archive file. The meanings of the key characters are: d Delete the named files from the archive file. r Replace the named files in the archive file. If the optional character u is used with r, then only those files with modified dates later than the archive files are replaced. If an optional positioning character from the set abi is used, then the posname argument must be present and specifies that new files are to be placed after (a) or before (b or i) posname. Otherwise new files are placed at the end. q Quickly append the named files to the end of the archive file. Optional positioning characters are invalid. The command does not check whether the added members are already in the archive. Useful only to avoid quadratic behavior when creating a large archive piece-by-piece. Print a table of contents of the archive file. If no names are given, all files in the archive are tabled. If names are given, only those files are tabled. p Print the named files in the archive. rn Move the named files to the end of the archive. If a positioning character is present, then the posname argument must be present and, as in r, specifies where the files ~re to be moved. x Extract the named files. If no names are given, all files in the archive are extracted. In neither case does x alter the archive file. v Verbose. Under the verbose option, ar gives a file-by-file description of the making of a new archive file from the old archive and the constituent files. When used with t, it gives a long listing of all information about the files. When used with x, it precedes each file with a name. c Create. Normally ar will create afile when it needs to. The create option suppresses the normal message that is produced when afile is created. Local. Normally ar places its temporary files in the directory /trnp. This option causes them to be placed in the local directory. s Symbol table creation. Force the regeneration of the archive symbol table even if arC!) is not invoked with a command which will modify the archive contents. This command is useful to restore the archive - 1- AR(l) (not on PDP-l 1) AR(l) symbol table after the strip (1) command has been used on the archive. FILES /tmp/ar* temporaries SEE ALSO arcv(1), Id(1), lorder(1), a.out(4), ar(4). BUGS If the same file is mentioned twice in an argument list, it may be put in the archive twice. - 2- (PDP-ll only) AR(I) AR(I) NAME ar - archive and library maintainer SYNOPSIS ar key [ posname ] afile name ... DESCRIPTION Ar maintains groups of files combined into a single archive file. Its main use is to create and update library files as used by the link editor. It can be used, though, for any similar purpose. When ar creates an archive, it always creates the header in the format of the local system. A conversion program exists to convert PDP-II archives to preUNIX System 5.0 VAX-I 1/780 archive format (see arcv(1». Another conversion program, convert(l), exists on the VAX and 3B20S to convert archives from the pre-UNIX System 5.0 format to the "common" archive format described in ar(4). Individual files are inserted without conversion into the archive file. Key is one character from the set drqtpmx, optionally concatenated with one or more of vuaibcl. Afile is the archive file. The names are constituent files in the archive file. The meanings of the key characters are: d Delete the named files from the archive file. r Replace the named files in the archive file. If the optional character u is used with r, then only those files with modified dates later than the archive files are replaced. If an optional positioning character from the set abi is used, then the posname argument must be present and specifies that new files are to be placed after (a) or before (b or i) posname. Otherwise new files are placed at the end. q Quickly append the named files to the end of the archive file. Optional positioning characters are invalid. The command does not check whether the added members are already in the archive. Useful only to avoid quadratic behavior when creating a large archive piece-by-piece. Print a table of contents of the archive file. If no names are given, all files in the archive are tabled. If names are given, only those files are tabled. p Print the named files in the archive. m Move the named files to the end of the archive. If a positioning character is present, then the posname argument must be present and, as in r, specifies where the files are to be moved. x Extract the named files. If no names are given, all files in the archive are extracted. In neither case does x alter the archive file. v Verbose. Under the verbose option, ar gives a file-by-file description of the making of a new archive file from the old archive and the constituent files. When used with t, it gives a long listing of all information about the files. When used with x, it precedes each file with a name. c Create. Normally ar will create afile when it needs to. The create option suppresses the normal message that is produced when afile is created. Local. Normally ar places its temporary files in the directory Itmp. This option causes them to be placed in the local directory. FILES Itmp/v* temporaries SEE ALSO arcv(1), ld(l), 10rder(1), ar(4). - I - AR (1) (PDP-II only) AR(I) BUGS If the same file is mentioned twice in an argument list, it may be put in the archive twice. - 2- ARCV(I) " ARCV(l) NAME arcv - convert archive files from PDP-II to common archive format SYNOPSIS arc\' infile outfile DESCRIPTION Arcv converts source archive files from the PDP-II format to the UNIX System 5.0 portable archive format. The input archive file infile is converted to an equivalent output archive file outfile . Note that there is no conversion of the members of the input archive file. FILES Itmp/arcv* SEE ALSO adO, convert(1), ar(4). - 1- (not on PDP-I 1) ASUJ AS (I) NAME as - common assembler SYNOPSIS as [-0 objfile] [-n] [-m] [-R] [-r] [-[bwU] [-V] file-name DESCRIPTION The as command assembles the named file. specified in any order: -0 The following flags may be objfile Output of assembly is put in objfile. By default, the output file name is formed by removing the .s suffix, if there is one, from the input file name and appending a .0 suffix. -n Turns off long/short address optimization. optimization takes place. By default, address -m Runs the m4 macro pre-processor on the input to the assembler. -R Instructs the assembler to delete (unlink) the input file after assembly is completed. This option is off by default. -r For the V AX version of the common assembler only. This option instructs the assembler to place all assembled data (normally placed in the .data section) into the .text section. This option effectively disables the .data pseudo operation. This option is off by default. -[bwU For the VAX version of the common assembler only. This option instructs the assembler to create byte (b) , halfword (w) or long (I) displacements for undefined symbols. The default value for this option is long (J) displacements. -v Causes the version number of the assembler being run to be written on standard error. FILES /usrltmp/as[1-6]XXXXXX temporary files SEE ALSO ld(t), m4(t), nm(1), strip(1), a.out(4). DIAGNOSTICS If the input file cannot be read, the assembly will terminate with the message "Unable to open input file". If assembly errors are detected the following infor- mation is written to standard error: the input file name, line number where the error occurred in the assembly code, a (hopefully) descriptive message of the problem, and, if the input file was produced by the C compiler (see ec(t) the line number in the C program that generated the erroneous code. CAVEATS Those running the assembler explicitly should take note of some possible pitfalls: If the -m ( m4 macro pre-processor invocation) option is used, keywords for m4 (see m4(1» cannot be used as symbols (variables, functions, labels) in the input file since m4 cannot determine which are assembler symbols· and which are real m4 macros. ~UGS The .align assembler directive is not guaranteed to work in the .text section when optimization is performed. Arithmetic expressions may only have one forward referenced symbol per expression. - 1- AS (1) (PDP-ll only) AS(l) NAME as - assembler for PDP-II SYNOPSIS as [ - ] [ -0 objfile ] file DESCRIPTION As assembles the concatenation of the named files. If the optional first argument - is used, all undefined symbols in the assembly are treated as global. The output of the assembly is left on the file obJfile; if that is omitted, a.out is used. It is executable if no errors occurred during the assembly, and if there were no unresolved external references. FILES llib/as2 Itmp/atm[I-3]? a.out pass 2 of the assembler temporary object SEE ALSO adb(l), Id(1), nm(1), a.out(4). UNIX System Assembler Manual by D. M. Ritchie. DIAGNOSTICS If the name chosen for the output file is of the form *? .lcsl, the assembler issues an appropriate complaint and quits. When an input file cannot be read, its name followed by a question mark is typed and assembly ceases. When syntactic or semantic errors occur, a single-character diagnostic is typed out, together with the line number and the file name in which it occurred. Errors in pass 1 cause cancellation of pass 2. The possible errors are: < • a b e f g m o p r u x Parentheses error Parentheses error String not terminated properly Indirection used illegally Illegal assignment to . Error in address Branch instruction is odd or too remote Error in expression Error in local (f or b) type symbol Garbage (unknown) character End of file inside an .if Multiply-defined symbol as label Word quantity assembled at odd address . different in pass 1 and 2 Relocation error Undefined symbol Syntax error BUGS Syntax errors can cause incorrect line numbers in subsequent diagnostics. - 1- ASA(I) ASA (I) NAME asa - interpret ASA carriage control characters SYNOPSIS asa [files] DESCRIPTION Asa interprets the output of FORTRAN programs that utilize ASA carriage control characters. It processes either the files whose names are given as arguments or the standard input if no file names are supplied. The first character of each line is assumed to be a control character; their meanings are: (blank) single new line before printing o double new line before printing 1 new page before printing + overprint previous line. Lines beginning with other than the above characters are treated as if they began with' '. The first character of a line is not printed. If any such lines appear, an appropriate diagnostic will appear on standard error. This program forces the first line of each input file to start on a new page. To correctly view the output of FORTRAN programs which use ASA carriage control characters, asa could be used as a filter thusly: a.out I asa Ilpr and the output, properly formatted and pagenated, would be directed to the line printer. FORTRAN output sent to a file could be viewed by: asa file SEE ALSO efl(I), f77(I), fsplit(I), ratfor(I). - 1- AWK(I) AWK(I) NAME awk - pattern scanning and processing language SYNOPSIS awk [ - Fc ] [ prog ] [ parameters ] [ files ] DESCRIPTION Awk scans each input file for lines that match any of a set of patterns specified in prog. With each pattern in prog there can be an associated action that will be performed when a line of a file matches the pattern. The set of patterns may appear literally as prog, or in a file specified as -f file. The prog string should be enclosed in single quotes (') to protect it from the shell. Parameters, in the form x= ... y= ... etc., may be passed to awk. Files are read in order; if there are no files, the standard input is read. The file name - means the standard input. Each line is matched against the pattern portion of every pattern-action statement; the associated action is performed for each matched pattern. An input line is made up of fields separated by white space. (This default can be changed by using FS, see below). The fields are denoted $1, $2, ... ; $0 refers to the entire line. A pattern-action statement has the form: pattern { action } A missing action means print the line; a missing pattern always matches. An action is a sequence of statements. A statement can be one of the following: if ( conditional ) statement [ else statement ] while ( conditional) statement for (expression conditional; expression ) statement break continue { [ statement ] ... } variable = expression print [ expression-list ] [ >expression ] printf format [ , expression-list ] [ >expression # skip remaining patterns on this input line next exit # skip the rest of the input Statements are terminated by semicolons, new-lines, or right braces. An empty expression-list stands for the whole line. Expressions take on string or numeric values as appropriate, and are built using the operators +, -, ., I, %, and concatenation (indicated by a blank). The C operators + +, - -, + =, - =, • =, 1=, and % = are also available in expressions. Variables may be scalars, array elements (denoted xli]) or fields. Variables are initialized to the null string. Array subscripts may be any string, not necessarily numeric; this allows for a form of associative memory. String constants are quoted ("). The print statement prints its arguments on the standard output (or on a file if >expr is present), separated by the current output field separator, and terminated by the output record separator. The printj statement formats its expression list according to the format (see printj(3S». The built-in function length returns the length of its argument taken as a string, or of the whole line if no argument. There are also built-in functions exp, log, sqrt, and into The last truncates its argument to an integer; substr(s, m, n) returns the n-character substring of s that begins at position m. The function sprintj(Jmt, expr, expr, .. .) formats the expressions according to the printj(3S) format given by jmt and returns the resulting string. - 1- AWK(I) AWK(I) Patterns are arbitrary Boolean combinations ( !, II, & &, and parentheses) of regular expressions and relational expressions. Regular expressions must be surrounded by slashes and are as in egrep (see grep (1» . Isolated regular expressions in a pattern apply to the entire line. Regular expressions may also occur in relational expressions. A pattern may consist of two patterns separated by a comma; in this case, the action is performed for all lines between an occurrence of the first pattern and the next occurrence of the second. A relational expression is one of the following: expression matchop regular-expression expression relop expression where a relop is any of the six relational operators in C, and a matchop is either - (for contains) or !- (for does not contain). A conditional is an arithmetic expression, a relational expression, or a Boolean combination of these. The special patterns BEGIN and END may be used to capture control before the first input line is read and after the last. BEGIN must be the first pattern, END the last. A single character c may be used to separate the fields by starting the program with: BEG IN { FS = c } or by using the - Fc option. Other variable names with special meanings include NF, the number of fields in the current record; NR, the ordinal number of the current record; FILENAME, the name of the current input file; OFS, the output field separator (default blank); ORS, the output record separator (default new-line); and OFMT, the output format for numbers (default % .6g) . EXAMPLES Print lines longer than 72 characters: length> 72 Print first two fields in opposite order: { print $2, $1 } Add up first column, print sum and average: END { s += $1 } {print "sum is", s, " average is", s/NR } Print fields in reverse order: { for (i = NF; i > 0; --0 print $i } Print all lines between start/stop pairs: /start/, /stop/ Print all lines whose first field is different from previous one: $1 != prev { print; prev = $1 } Print file, filling in page numbers starting at 5: /Page/ { $2 = n++; } { print } command line: awk -f program n=5 input SEE ALSO grep(I), lex(I), sed(I). Awk - A Pattern Scanning and Processing Language - 2- AWK(1) AWK(1) BUGS Input white space is not preserved on output if fields are involved. There are no explicit conversions between numbers and strings. To force an expression to be treated as a number add 0 to it; to force it to be treated as a string concatenate the null string ("") to it. - 3- BANNER(l) BANNER(l) NAME banner - make posters SYNOPSIS banner strings DESCRIPTION Banner prints its arguments (each up to 10 characters long) in large letters on the standard output. SEE ALSO echo(1) . - 1- BASEN AME (1 ) BASENAME (1) NAME basename, dirname - deliver portions of path names SYNOPSIS basename string [ suffix ] dirname string DESCRIPTION Basename deletes any prefix ending in / and the suffix (if present in string) from string, and prints the result on the standard output. It is normally used inside substitution marks (, ,) within shell procedures. Dirname delivers all but the last level of the path name in string. EXAMPLES The following example, invoked with the argument /usr/src/cmd/cat.c, compiles the named file and moves the output to a file named cat in the current directory: cc $1 mv a.out 'basename $1 .c' The following example will set the shell variable NAME to /usr/src/cmd: NAME='dirname lusrlsrclcmd/cat.c' SEE ALSO sh(t) . BUGS The basename of / is null and is considered an error. - 1- BC(I) BC(I) NAME be - arbitrary-precision arithmetic language SYNOPSIS be [ -e ] [ -I ] [ file ... ] DESCRIPTION Be is an interactive processor for a language that resembles C but provides unlimited precision arithmetic. It takes input from any files given, then reads the standard input. The -I argument stands for the name of an arbitrary precision math library. The syntax for be programs is as follows; L means letter a-z, E means expression, S means statement. Comments are enclosed in /. and ./. Names simple variables: L array elements: L [ E ] The words "ibase", "obase", and "scale" Other operands arbitrarily long numbers with optional sign and decimal point. ( E) sqrt ( E ) length ( E) number of significant decimal digits scale ( E ) number of digits right of decimal point L(E, ... ,E) Operators + - • / % " (% is remainder; " is power) ++ - (prefix and postfix; apply to names) ==<=>=!=<> = =+ =. =/ = % =" Statements E { S ; ... ; S } if ( E) S while ( E) S for ( E ; E ; E ) S null statement break quit Function definitions define L ( L ,... , L ) auto L, ... , L S; ... S return ( E ) Functions in -I math library s(x) sine c(x) cosine e(x) exponential I (x) log a (x) arctangent j(n,x) Bessel function All function arguments are passed by value. - 1- BC(I) BC (I) The value of a statement that is an expression is printed unless the main operator is an assignment. Either semicolons or new-lines may separate statements. Assignment to scale influences the number of digits to be retained on arithmetic operations in the manner of dc(l). Assignments to ibase or obase set the input and output number radix respectively. The same letter may be used as an array, a function, and a simple variable simultaneously. All variables are global to the program. "Auto" variables are pushed down during function calls. When using arrays as function arguments or defining them as automatic variables empty square brackets must follow the array name. Be is actually a preprocessor for dc(l), which it invokes automatically, unless the -c (compile only) option is present. In this case the de input is sent to the standard output instead. EXAMPLE scale = 20 define e(x){ auto a, b, c, i, s a = 1 b=l s = 1 forG=l; 1==1; i++){ a = a*x b = b*i c = alb if(c == 0) return (s) s = s+c defines a function to compute an approximate value of the exponential function and forG=l; i<=lO; i++) e(i) prints approximate values of the exponential function of the first ten integers. FILES lusrllibllib.b I usr Ibinl dc mathematical library desk calculator proper SEE ALSO deCl). BC-An Arbitrary Precision Desk-Calculator Language by L. L. Cherry and R. Morris. BUGS No & &, I I yet. For statement must have all three E's. Quit is interpreted when read, not when executed. -2- BDIFF(t) BDIFF(I) NAME bdiff - big diff SYNOPSIS bdiff filel file2 [n] [-s] DESCRIPTION Bdiff is used in a manner analogous to dijJ(1) to find which lines must be changed in two files to bring them into agreement. Its purpose is to allow processing of files which are too large for diff. Bdiff ignores lines common to the beginning of both files, splits the remainder of each file into n-line segments, and invokes diff upon corresponding segments. The value of n is 3500 by default. If the optional third argument is given, and it is numeric, it is used as the value for n. This is useful in those cases in which 3500-line segments are too large for diff, causing it to fail. If file] (file2) is -, the standard input is read. The optional -s (silent) argument specifies that no diagnostics are to be printed by bdijJ (note, however, that this does not suppress possible exclamations by diff. If both optional arguments are specified, they must appear in the order indicated above. The output of bdiff is exactly that of dijJ, with line numbers adjusted to account for the segmenting of the files (that is, to make it look as if the files had been processed whole). Note that because of the segmenting of the files, bdiff does not necessarily find a smallest sufficient set of file differences. FILES /tmp/bd????? SEE ALSO diff(I) . DIAGNOSTICS Use help (1) for explanations. - 1- BFS(1) BFS(1) NAME bfs - big file scanner SYNOPSIS bfs [ - ] name DESCRIPTION Bfs is (almost) like ed(l) except that it is read-only and processes much larger files. Files can be up to 1024K bytes (the maximum possible size) and 32K lines, with up to 255 characters per line. Bfs is usually more efficient than ed for scanning a file, since the file is not copied to a buffer. It is most useful for identifying sections of a large file where esplit (1) can be used to divide it into more manageable pieces for editing. Normally, the size of the file being scanned is printed, as is the size of any file written with the w command. The optional - suppresses printing of sizes. Input is prompted with • if P and a carriage return are typed as in ed. Prompting can be turned off again by inputting another P and carriage return. Note that messages are given in response to errors if prompting is turned on. All address expressions described under ed are supported. In addition, regular expressions may be surrounded with two symbols besides / and ?: > indicates downward search without wrap-around, and < indicates upward search without wrap-around. Since bfs uses a different regular expression-matching routine from ed, the regular expressions accepted are slightly wider in scope (see regemp OX». There is a slight difference in mark names: only the letters a through z may be used, and all 26 marks are remembered. The e, g, v, k, n, p, q, W, =, ! and null commands operate as described under ed. Commands such as - - -, + + + -, + + + =, -12, and +4p are accepted. Note that 1,10p and 1,10 will both print the first ten lines. The f command only prints the name of the file being scanned; there is no remembered file name. The w command is independent of output diversion, truncation, or crunching (see the XO, xt and xc commands, below). The following additional commands are available: xf file Further commands are taken from the named file. When an endof-file is reached, an interrupt signal is received or an error occurs, reading resumes with the file containing the xf. Xf commands may be nested to a depth of 10. xo [file] Further output from the p and null commands is diverted to the named file, which, if necessary, is created mode 666. If file is missing, output is diverted to the standard output. Note that each diversion causes truncation or creation of the file. : label This positions a label in a command file. The label is terminated by new-line, and blanks between the: and the start of the label are ignored. This command may also be used to insert comments into a command file, since labels need not be referenced. ( . , • )xb/regular expressionllabel A jump (either upward or downward) is made to label if the command succeeds. It fails under any of the following conditions: - 1- BFS (I) BFS(I ) 1. Either address is not between 1 and $. 2. The second address is less than the first. 3. The regular expression doesn't match at least one line in the specified range, including the first and last lines. On success, • is set to the line matched and a jump is made to label. This command is the only one that doesn't issue an error message on bad addresses, so it may be used to test whether addresses are bad before other commands are executed. Note that the command xbr/ label is an unconditional jump. The xb command is allowed only if it is read from someplace other than a terminal. If it is read from a pipe only a downward jump is possible. xt number Output from the p and null commands is truncated to at most number characters. The initial number is 255. xv[digit] [spaces] [value] The variable name is the specified digit following the xv. xv5100 or xv5 100 both assign the value 100 to the variable 5. xv61,100p assigns the value 1,100p to the variable 6. To reference a variable, put a % in front of the variable name. For example, using the above assignments for variables 5 and 6: 1,%5p 1,%5 %6 will all print the first 100 lines. g/%5/p would globally search for the characters 100 and print each line containing a match. To escape the special meaning of %, a \ must precede it. g/". *\%[cds]/p could be used to match and list lines containing print! of characters, decimal integers, or strings. Another feature of the xv command is that the first line of output from a UNIX System command can be stored into a variable. The only requirement is that the first character of value be an!. For example: .w junk xv5!cat junk !rm junk !echo "%5" xv6!expr %6 +1 would put the current line into variable 5, print it, and increment the variable 6 by one. To escape the special meaning of ! as the first character of value, precede it with a \. - 2- BFS(1) BFS(1) xv7\!date stores the value !date into variable 7. xbz label xbn label These two commands will test the last saved return code from the execution of a UNIX System command (!command) or nonzero value, respectively, to the specified label. The two examples below both search for the next five lines containing the string size. xv55 :I Isizel xv5!expr %5 - 1 !if 0%5 != 0 exit 2 xbn I xv45 :I Isizel xv4!expr %4 - 1 !if 0%4 = 0 exit 2 xbz I xc [switch] If switch is 1, output from the p and null commands is crunched; if switch is 0 it isn't. Without an argument, xc reverses switch. Initially switch is set for no crunching. Crunched output has strings of tabs and blanks reduced to one blank and blank lines suppressed. SEE ALSO csplit(I), ed(I), regcmp(3X). DIAGNOSTICS ? for errors in commands, if prompting is turned off. Self-explanatory error messages when prompting is on. - 3- BS(I) BS (1) NAME bs - a compiler/interpreter for modest-sized programs SYNOPSIS bs [ file [ args ] ] DESCRIPTION Bs is a remote descendant of Basic and Snobol4 with a little C language thrown in. Bs is designed for programming tasks where program development time is as important as the resulting speed of execution. Formalities of data declaration and file/process manipulation are minimized. Line-at-a-time debugging, the trace and dump statements, and useful run-time error messages all simplify program testing. Furthermore, incomplete programs can be debugged; inner functions can be tested before outer functions have been written and vice versa. If the command line file argument is provided, the file is used for input before the console is read. By default, statements read from the file argument are compiled for later execution. Likewise, statements entered from the console are normally executed immediately (see compile and execute below). Unless the final operation is assignment, the result of an immediate expression statement is printed. Bs programs are made up of input lines. If the last character on a line is a \, the line is continued. Bs accepts lines of the following form: statement label statement A label is a name (see below) followed by a colon. A label and a variable can have the same name. A bs statement is either an expression or a keyword followed by zero or more expressions. Some keywords (clear, compile, !, execute, include, ibase, obase, and run) are always executed as they are compiled. Statement Syntax: expression The expression is executed for its side effects (value, assignment or function call). The details of expressions follow the description of statement types below. break Break exits from the inner-most forlwhile loop. clear Clears the symbol table and compiled statements. immediately. Clear is executed compile [ expression ] Succeeding statements are compiled (overrides the immediate execution default). The optional expression is evaluated and used as a file name for further input. A clear is associated with this latter case. Compile is executed immediately. continue Continue transfers to the loop-continuation of the current forlwhile loop. dump [ name] The name and current value of every non-local variable is printed. Optionally, only the named variable is reported. After an error or interrupt, the number of the last statement and (possibly) the user-function trace are displayed. - 1- BS(l) BS(l) exit [ expression] Return to system level. The expression is returned as process status. execute Change to immediate execution mode (an interrupt has a similar effect). This statement does not cause stored statements to execute (see run below). for name = expression expression statement for name = expression expression next for expression, expression, expression statement for expression , expression , expression next The for statement repetitively executes a statement (first form) or a group of statements (second form) under control of a named variable. The variable takes on the value of the first expression, then is incremented by one on each loop, not to exceed the value of the second expression. The third and fourth forms require three expressions separated by commas. The first of these is the initialization, the second is the test (true to continue), and the third is the loop-continuation action (normally an increment). fun f( [a, ... ]) [v, ... ] nuf Fun defines the function name, arguments, and local variables for a userwritten function. Up to ten arguments and local variables are allowed. Such names cannot be arrays, nor can they be I/O associated. Function definitions may not be nested. freturn A way to signal the failure of a user-written function. See the interrogation operator (?) below. If interrogation is not present, fretum merely returns zero. When interrogation is active, fretum transfers to that expression (possibly by-passing intermediate function returns). goto name Control is passed to the internally stored statement with the matching label. ibase N [base sets the input base (radix) to N. The only supported values for N are 8, 10 (the default), and 16. Hexadecimal values 10-15 are entered as a-I. A leading digit is required (i.e., lOa must be entered as OlOa). [base (and abase, below) are executed immediately. if expression statement if expression [ else fi The statement (first form) or group of statements (second form) is executed if the expression evaluates to non-zero. The strings 0 and "" (null) evaluate as zero. In the second form, an optional else allows for a group of statements to be executed when the first group is not. The only statement permitted on the same line with an else is an if; only other fi's can be on the same line with a fi. The elision of else and if into an elif is supported. Only a single fi is required to close an if ... elif ... [ else ... ] sequence. - 2 - BS(I) BS(I) include expression The expression must evaluate to a file name. The file must contain bs source statements. Such statements become part of the program being compiled. Include statements may not be nested. obase N Obase sets the output base to N (see ibase above). onintr label onintr The onintr command provides program control of interrupts. In the first form, control will pass to the label given, just as if a goto had been executed at the time onintr was executed. The effect of the statement is cleared after each interrupt. In the second form, an interrupt will cause bs to terminate. return [expression] The expression is evaluated and the result is passed back as the value of a function call. If no expression is given, zero is returned. run The random number generator is reset. Control is passed to the first internal statement. If the run statement is contained in a file, it should be the last statement. stop Execution of internal statements is stopped. Bs reverts to immediate mode. trace [ expression ] The trace statement controls function tracing. If the expression is null (or evaluates to zero), tracing is turned off. Otherwise, a record of userfunction calls/returns will be printed. Each return decrements the trace expression value. while expression statement while expression next While is similar to for except that only the conditional expression for loopcontinuation is given. ! shell command An immediate escape to the Shell. # ... This statement is ignored. It is used to interject commentary in a program. Expression Syntax: name A name is used to specify a variable. Names are composed of a letter (upper or lower case) optionally followed by letters and digits. Only the first six characters of a name are significant. Except for names declared in fun statements, all names are global to the program. Names can take on numeric (double float) values, string values, or can be associated with input/ output (see the built-in function open 0 below). name ( [expression [ , expression] ... ] ) Functions can be called by a name followed by the arguments in parentheses separated by commas. Except for built-in functions Oisted beloW), the name must be defined with a fun statement. Arguments to functions are passed by value. -3- BS(I) BS(I) name [ expression [ , expression ] ... ) This syntax is used to reference either arrays or tables (see built-in table functions below). For arrays, each expression is truncated to an integer and used as a specifier for the name. The resulting array reference is syntactically identical to a name; all,2) is the same as allll21. The truncated expressions are restricted to values between 0 and 32767. number A number is used to represent a constant value. A number is written in Fortran style, and contains digits, an optional decimal point, and possibly a scale factor consisting of an e followed by a possibly signed exponent. string Character strings are delimited by "characters. The \ escape character allows the double quote (\"), new-line (\n), carriage return (\r), backspace (\b), and tab (\t) characters to appear in a string. Otherwise, \ stands for itself. ( expression) Parentheses are used to alter the normal order of evaluation. ( expression, expression [, expression ... ] ) [ expression) The bracketed expression is used as a subscript to select a comma-separated expression from the parenthesized list. List elements are numbered from the left, starting at zero. The expression: ( False, True )[ a == b ] has the value True if the comparison is true. ? expression The interrogation operator tests for the success of the expression rather than its value. At the moment, it is useful for testing end-of-file (see examples in the Programming Tips section below), the result of the eval built-in function, and for checking the return from user-written functions (see fretum). An interrogation "trap" (end-of-file, etc.) causes an immediate transfer to the most recent interrogation, possibly skipping assignment statements or intervening function levels. - expression The result is the negation of the expression. + + name Increments the value of the variable (or array reference). The result is the new value. - - name Decrements the value of the variable. The result is the new value. ! expression The logical negation of the expression. Watch out for the shell escape command. expression operator expression Common functions of two arguments are abbreviated by the two arguments separated by an operator denoting the function. Except for the assignment, concatenation, and relational operators, both operands are converted to numeric form before the function is applied. Binary Operators (in increasing precedence): = is the assignment operator. The left operand must be a name or an array element. The result is the right operand. Assignment binds right to left, all other operators bind left to right. -4- BS(I) BS (1) _ (underscore) is the concatenation operator. & I & (logical and) has result zero if either of its arguments are zero. It has result one if both of its arguments are non-zero; I (logical or) has result zero if both of its arguments are zero. It has result one if either of its arguments is non-zero. Both operators treat a null string as a zero. < <= > >= == != The relational operators « less than, < = less than or equal, > greater than, > = greater than or equal, = = equal to, ! = not equal to) return one if their arguments are in the specified relation. They return zero otherwise. Relational operators at the same level extend as follows: a>b>c is the same as a>b & b>c. A string comparison is made if both operands are strings. + Add and subtract. • / % Multiply, divide, and remainder. Exponentiation. Built-in Functions: Dealing with arguments arg(i) is the value of the i -th actual parameter on the current level of function call. At level zero, arg returns the i-th command-line argument (arg(O) returns bs). nargO returns the number of arguments passed. At level zero, the command argument count is returned. Mathematical abs(x) is the absolute value of x. atan(x) is the arctangent of x. Its value is between -7r/2 and 7r12. ceil (x) returns the smallest integer not less than x. cos (x) is the cosine of x (radians). exp(x) is the exponential function of x. ftoor(x) returns the largest integer not greater than x. log (x) is the natural logarithm of x. rand() is a uniformly distributed random number between zero and one. sin (x) is the sine of x (radians). -5- BS(I) BS(I) sqrt(x) is the square root of x. String operations size(s) the size (length in bytes) of s is returned. format(f, a) returns the formatted value of a. F is assumed to be a format specification in the style of printf{3S). Only the % ••• f, % ••• e, and % ••. s types are safe. index(x, y) returns the number of the first position in x that any of the characters from y matches. No match yields zero. trans (s, f, t) Translates characters of the source s from matching characters in f to a character in the same position in t. Source characters that do not appear in f are copied to the result. If the string f is longer than t, source characters that match in the excess portion of f do not appear in the result. substr (s, start, width) returns the sub-string of s defined by the starting position and width. matcb(string, pattern) mstring(n) The pattern is similar to the regular expression syntax of the ed(I) command. The characters ., l, J, " (inside brackets), • and $ are special. The mstring function returns the n-th (I < = n < = 10) substring of the subject that occurred between pairs of the pattern symbols \( and \) for the most recent call to match. To succeed, patterns must match the beginning of the string (as if all patterns began with"). The function returns the number of characters matched. For example: match{"aI23abI23", ".*\([a-zl\)") mstring(I) == "b" == 6 File handling open (name, file, function) close (name) The name argument must be a bs variable name (passed as a string). For the open, the file argument may be 1) a 0 (zero), 1, or 2 representing standard input, output, or error output, respectively, 2) a string representing a file name, or 3) a string beginning with an ! representing a command to be executed (via sh -c). The function argument must be either r (read), w (write), W (write without new-line), or a (append). After a close, the name reverts to being an ordinary variable. The initial associations are: open{"get", 0, "r") open {"put", 1, "w") open {"puterr", 2, "w") Examples are given in the following section. access (s, m) executes access (2). ftype(s) returns a single character file type indication: f for regular file, p for FIFO (i.e., named pipe), d for directory, b for block special, or c for character special. -6- 8S(I) BS (1) Tables table(name, size) A table in bs is an associatively accessed, single-dimension array. "Subscripts" (called keys) are strings (numbers are converted). The name argument must be a bs variable name (passed as a string). The size argument sets the minimum number of elements to be allocated. Bs prints an error message and stops on table overflow. item(name, i) key 0 The item function accesses table elements sequentially Gn normal use, there is no orderly progression of key values). Where the item function accesses values, the key function accesses the "subscript" of the previous item call. The name argument should not be quoted. Since exact table sizes are not defined, the interrogation operator should be used to detect end-of-table, for example: table("t", 100) # If word contains "party", the following expression adds one # to the count of that word: ++dword1 # To print out the the key/value pairs: for i = 0, ?(s = item(t, 0), ++i if keyO put = keyO _":" __s iskey(name, word) The iskey function tests whether the key word exists in the table name and returns one for true, zero for false. Odds and ends eval(s) The string argument is evaluated as a bs expression. The function is handy for converting numeric strings to numeric internal form. Eval can also be used as a crude form of indirection, as in: name = "xyz" eval ("++"_ name) which increments the variable xyz. In addition, eval preceded by the interrogation operator permits the user to control bs error conditions. For example: ?evaI("open(\"X\", \"XXX\", \"r\")") returns the value zero if there is no file named "XXX" (instead of halting the user's program). The following executes a gala to the label L (if it exists) : label="L" if ! (?evaI("goto "_ label) puterr = "no label" plot(request, args) The plot function produces output on devices recognized by tplot(IG). The requests are as follows: Call plot (0, term) Function causes further plot output to be piped into tplot (I G) with an argument of -Tterm. -7- BS(I) H~~l} plot (4) "erases" the plotter. plot (2, string) labels the current point with string. plotO, xl, yl, x2, y2) draws the line between (xl,y]) and (x2,y2). . plot(4, x, y, r) draws a circle with center (x,y) and radius r. plot(5, xl, yl, x2, y2, x3, y3) draws an arc (counterclockwise) with center (xl,y]) and endpoints (x2,y2) and (x3,y3). plot(6) is not implemented. plot(7, x, y) makes the current point (x,y). plot(8, x, y) draws a line from the current point to plot(9, x, y) draws a point at (x,yL plot (1 0, string) sets the line mode to string. plot (1 1, xl, yl, x2, y2) makes (xl,y]) the lower left corner of the plotting area and (x2,y 2) the upper right corner of the plotting area. plot(12, xl, yl, x2, y2) causes subsequent x (y) coordinates to be multiplied by xl (y]) and then added to x2 (y2) before they are plotted. The initial scaling is plot(12, 1.0, 1.0, 0.0, 0.0). (x,y). Some requests do not apply to all plotters. All requests except zero and twelve are implemented by piping characters to tplot (I G). See plot (4) for more details. lastO in immediate mode, last returns the most recently computed value. PROGRAMMING TIPS Using bs as a calculator: $ bs # Distance (inches) light travels in a nanosecond. 186000 * 5280 * 12 / le9 11.78496 # Compound interest (6% for 5 years on $1,000). int = .06 / 4 bal = 1000 for i = 1 5*4 bal = bal + bal*int bal - 1000 346.855007 exit The outline of a typical bs program: # initialize things: varl = 1 open("read", "infile", "r") # compute: -8- BS(I) BS (1) while ?(str = read) next # clean up: close ("read ") # last statement executed (exit or stop): exit # last input line: run Input/Output examples: # Copy "oldfile" to "newfile". open ("read", "oldfile", "r") open ("write", "newfile", "w") while ?(write = read) # close "read" and "write": close ("read") close ("wri te ") # Pipe between commands. open("ls", "!Is *", "r") open ("pr", "!pr -2 -h 'List''', "w") while? (pr = Is) ... # be sure to close (wait for) these: close("ls") close ("pr") SEE ALSO ed(I), sh(I), tplot(IG), access(2), printf(3S), stdio(3S), plot(4). See Section 3 of this volume for further description of the mathematical functions (pow on exp OM) is used for exponentiation); bs uses the Standard Input/Output package. -9- CAL(I) CAL(I) NAME cal - print calendar SYNOPSIS cal [ month 1 year DESCRIPTION Cal prints a calendar for the specified year. If a month is also specified, a calendar just for that month is printed. Year can be between 1 and 9999. The month is a number between 1 and 12. The calendar produced is that for England and her colonies. Try September 1752. BUGS The year is always considered to start in January even though this is historically naive. Beware that "cal 78" refers to the early Christian era, not the 20th century. - 1- CALENDAR (1) CALENDAR (1 ) NAME calendar - reminder service SYNOPSIS calendar [ - ] DESCRIPTION Calendar consults the file calendar in the current directory and prints out lines that contain today's or tomorrow's date anywhere in the line. Most reasonable month-day dates such as "Dec. 7," "december 7," "12/7," etc., are recognized, but not "7 December' or "7112". On weekends "tomorrow" extends through Monday. When an argument is present, calendar does its job for every user who has a file calendar in their login directory and sends them any positive results by mail(I). Normally this is done daily by facilities in the UNIX operating system. FILES calendar lusrlliblcalprog letclpasswd Itmp/cal. to figure out today's and tomorrow's dates SEE ALSO maiI(I). BUGS Your calendar must be public information for you to get reminder service. Calendar's extended idea of "tomorrow" does not account for holidays. - 1- CAT(1) CAT(I) NAME cat - concatenate and print files SYNOPSIS cat [ -u ] [ -s ] file ... DESCRIPTION Cat reads each file in sequence and writes it on the standard output. Thus: cat file prints the file, and: cat file 1 file2 > file3 concatenates the first two files and places the result on the third. If no input file is given, or if the argument - is encountered, cat reads from the standard input file. Output is buffered unless the -u option is specified. The -s option makes cat silent about non-existent files. No input file may be the same as the output file unless it is a special file. WARNING Command formats such as ca t file 1 file2 > file 1 will cause the original data in file1 to be lost, therefore, take care when using shell special characters. SEE ALSO cp (1 ), pr ( 1) . - 1- CB(l) CB(l) NAME cb - C program beautifier SYNOPSIS cb [ -s ] [ -j ] [ -I leng ] [ file ... ] DESCRIPTION Cb reads C programs either from its arguments or from the standard input and writes them on the standard output with spacing and indentation that displays the structure of the code. Under default options, cb preserves all user newlines. Under the -s flag cb canonicalizes the code to the style of Kernighan and Ritchie in The C Programming Language. The -j flag causes split lines to be put back together. The -I flag causes cb to split lines that are longer than leng. SEE ALSO cc(1). The C Programming Language by B. W. Kernighan and D. M. Ritchie. BUGS Punctuation that is hidden in preprocessor statements will cause indentation errors. - 1- CC(I) CC (I) NAME cc, pcc - C compiler SYNOPSIS cc [ option 1 ... file .. . pcc [ option 1 ... file .. . DESCRIPTION Ce is the UNIX System C compiler. Pee is the portable version for a PDP-II machine. They accept several types of arguments: Arguments whose names end with .c are taken to be C source programs; they are compiled, and each object program is left on the file whose name is that of the source with .0 substituted for .c. The.o file is normally deleted, however, if a single C program is compiled and loaded all at one go. In the same way, arguments whose names end with .s are taken to be assembly source programs and are assembled, producing a .0 file. The following options are interpreted by ee and pee. See [d(1) for link editor options and epp(I) for more preprocessor options. -c Suppress the link edit phase of the compilation, and force an object file to be produced even if only one program is compiled. -p Arrange for the compiler to produce code which counts the number of times each routine is called; also, if link editing takes place, replace the standard startoff routine by one which automatically calls monitorOC) at the start and arranges to write out a mon.out file at normal termination of execution of the object program. An execution profile can then be generated by use of prof{I). -f Link the object program with the floating-point interpreter for systems without hardware floating-point. -g Cause the compiler to generate additional information needed for the use of sdb{I). (Not for PDP-ll.) -0 Invoke an object-code optimizer. -8 Compile the named C programs, and leave the assembler-language output on corresponding files suffixed .s. -E Run only epp(I) on the named C programs, and send the result to the standard output. -p Run only epp(I) on the named C programs, and leave the result on corresponding files suffixed .i. -Bstring Construct pathnames for substitute compiler, assembler and link editor passes by concatenating string with the suffixes cpp, cO (or ccom or comp, see under FILES below), cl, c2, as and Id. If string is empty it is taken to be /lib/o. -dpOl2al1 Find only the designated compiler, assembler and link editor passes in the files whose names are constructed by a - B option. In the absence of a - B option, the string is taken to be /lib/n. -t "" is equivalent to -tpOI2. -We,argllarg2 .. .l Hand off the argumends1 argi to pass. e where e is one of [pOl2al1 indicating preprocessor, compiler first pass, compiler second pass, optimizer, assembler, or link editor, respectively. - I - CC(I) CC(I) -d This option is no longer allowed because of a conflict of meaning. The - W option must be used to specify precisely its destination. To indicate the -dn option for the VAX assembler, use -Wa, -dn. To indicate the -d option for the link editor, use -WI, -d. Other arguments are taken to be either link editor option arguments, C preprocessor option arguments, or C-compatible object programs, typically produced by an earlier ee or pee run, or perhaps libraries of C-compatible routines. These programs, together with the results of any compilations specified, are linked Gn the order given) to produce an executable program with the name a.out. FILES file.c file.o a.out /tmp/ctm* /lib/cpp /lib/elOl ] /usr /lib/ comp /lib/ccom /lib/c2 /lib/oc· /lib/nc· /bin/as /bin/ld /lib/crtO.o /lib/mcrtO.o /lib/fcrtO.o /Ii b/ fmcrtO.o /lib/libc.a input file object file linked output temporary C preprocessor epp (1) PDP-II compiler, ee compiler, pee V AX compiler, ee optional optimizer backup compiler, oee test compiler, nee assembler, as(I) link editor, Id(I) runtime startoff startoff for profiling startoff for floating-point interpretation (PDP-II only) startoff for floating-point interpretation and profiling (PDP-II only) standard library, see (3) SEE ALSO The C Programming Language by B. W. Kernighan and D. M. Ritchie. Programming in C-A Tutorial by B. W. Kernighan. C Reference Manual by D. M. Ritchie. adb(l), cpp(l), as(l), ld(l), prof(l), sdb(l), monitor(3C). DIAGNOSTICS The diagnostics produced by C itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or the link editor. Of these, the most mystifying are from the PDP-II assembler, in particular m, which means a multiply-defined external symbol (function or data). - 2- CD(I) CD(I) NAME cd - change working directory SYNOPSIS cd [ directory ] DESCRIPTION If directory is not specified, the value of shell parameter $HOME is used as the new working directory. If directory specifies a complete path starting with t, ., .. , directory becomes the new working directory. If neither case applies, cd tries to find the designated directory relative to one of the paths specified by the $CDPATH shell variable. $CDPATH has the same syntax as, and similar semantics to, the $PATH shell variable. Cd must have execute (search) permission in directory. Because a new process is created to execute each command, cd would be ineffective if it were written as a normal command; therefore, it is recognized and internal to the shell. SEE ALSO pwd (1), sh (I), chdir(2). - 1- CDC(I) CDC(l) NAME cdc - change the delta commentary of an sccs delta SYNOPSIS cdc -rSID l -mlmrlist]] l -ylcomment]] files DESCRIPTION Cdc changes the delta commentary, for the SID specified by the -r keyletter, of each named sees file. Delta commentary is defined to be the Modification Request (MR) and comment information normally specified via the delta (1) command (-m and -y key letters) . If a directory is named, cdc behaves as though each file in the directory were specified as a named file, except that non-sees files (last component of the path name does not begin with s.) and unreadable files are silently ignored. If a name of - is given, the standard input is read (see WARNINGS); each line of the standard input is taken to be the name of an sees file to be processed. Arguments to cdc, which may appear in any order, consist of keyletter arguments, and file names. All the described key letter arguments apply independently to each named file: -rSID Used to specify the sees IDentification (SID) string of a delta for which the delta commentary is to be changed. - mlmrlisd If the sees file has the v flag set (see admin then a list of MR numbers to be added and/or deleted in the delta commentary of the SID specified by the -r keyletter may be supplied. A null MR list has no effect. (I» MR entries are added to the list of MRs in the same manner as that of delta (1). In order to delete an MR, precede the MR number with the character ! (see EXAMPLES). If the MR to be deleted is currently in the list of MRs, it is removed and changed into a "comment" line. A list of all deleted MRs is placed in the comment section of the delta commentary and preceded by a comment line stating that they were deleted. If -m is not used and the standard input is a terminal, the prompt MRs? is issued on the standard output before the standard input is read; if the standard input is not a terminal, no prompt is issued. The MRs? prompt always precedes the comments? prompt (see -y key letter). MRs in a list are separated by blanks and/or tab characters. An unescaped new-line character terminates the MR list. Note that if the v flag has a value (see admin (1», it is taken to be the name of a program (or shell procedure) which validates the correctness of the MR numbers. If a non-zero exit status is returned from the MR number validation program, cdc terminates and the delta commentary remains unchanged. -ylcomment] Arbitrary text used to replace the comment (s) already existing for the delta specified by the -r key letter. The previous comments are kept and preceded by a comment - 1- COCO) COCO) line stating that they were changed. A null comment has no effect. If -y is not specified and the standard input is a terminal, the prompt comments? is issued on the standard output before the standard input is read; if the standard input is not a terminal, no prompt is issued. An unescaped new-line character terminates the comment text. The exact permissions necessary to modify the sees file are documented in the Source Code Control System User's Guide. Simply stated, they are either (1) if you made the delta, you can change its delta commentary; or (2) if you own the file and directory you can modify the delta commentary. EXAMPLES cdc -r1.6 -m"b178-12345 !bI77-54321 b179-00001" -ytrouble sofile adds b178-12345 and b179-00001 to the MR list, removes b177-54321 from the MR list, and adds the comment trouble to delta 106 of sofile. cdc -r 1.6 sofile MRs? !b177-54321 b178-12345 b179-00001 comments? trouble does the same thing. WARNINGS If sees file names are supplied to the cdc command via the standard input (on the command line), then the -m and -y keyletters must also be used. FILES x-file z-file (see d,elta (1» (see delta (1» SEE ALSO admin(1), delta(1), get(1), help(1), prs(1), sccsfile(4). Source Code Control System User's Guide in the UNIX System User's Guide. DIAGNOSTICS Use help(l) for explanations. - 2- CFLOW(l ) CFLOW( I) NAME cflow - generate C flow graph SYNOPSIS cftow [-r] [-ix] [-i.J [-dnum] files DESCRIPTION Cflow analyzes a collection of C, YACC, LEX, assembler, and object files and attempts to build a graph charting the external references. Files suffixed in .y, .I, .c, and .i are Y ACC'd, LEX'd, and C-preprocessed (bypassed for .i files) as appropriate and then run through the first pass of lint (1 ). (The - I, - D, and - U options of the C-preprocessor are also understood.) Files suffixed with .s are assembled and information is extracted (as in .0 files) from the symbol table. The output of all this non-trivial processing is collected and turned into a graph of external references which is displayed upon the standard output. Each line of output begins with a reference (i.e., line) number, followed by a suitable number of tabs indicating the level. Then the name of the global (normally only a function not defined as an external or beginning with an underscore; see below for the - i inclusion option) a colon and its definition. For information extracted from C source, the definition consists of an abstract type declaration (e.g., char *), and, delimited by angle brackets, the name of the source file and the line number where the definition was found. Definitions extracted from object files indicate the file name and location counter under which the symbol appeared (e.g., text). Leading underscores in C-style external names are deleted. Once a definition of a name has been printed, subsequent references to that name contain only the reference number of the line where the definition may be found. For un~efined references, only < > is printed. As an example, given the following in file.c: int i; mainO { fO; gO; fO; fO { i = hO; the command cflow file.c produces the the output 1 2 3 4 5 main: intO, f: intO, h: <> i: int, g: <> - 1- CFLOW( 1) CFLOW( 1) When the nesting level becomes too deep, the -e option of pr(1) can be used to compress the tab expansion to something less than every eight spaces. The following options are interpreted by cfiow: -r Reverse the "caller:callee" relationship producing an inverted listing showing the callers of each function. The listing is also sorted in lexicographical order by callee. -ix Include external and static data symbols. The default is to include only functions in the flow graph. - i_ Include names that begin with an underscore. The default is to exclude these functions (and data if -ix is used). -dnum The num decimal integer indicates the depth at which the flow graph is cut off. By default this is a very large number. Attempts to set the cutoff depth to a nonpositive integer will be met with contempt. DIAGNOSTICS Complains about bad options. Complains about multiple definitions and only believes the first. Other messages may come from the various programs used (e.g., the C-preprocessor). SEE ALSO as(1), cc(1), lex(1), lint(1), nm(1), pr(1), yacc(1). BUGS Files produced by lex(1) and yacc(1) cause the reordering of line number declarations which can confuse cfiow. To get proper results, feed cfiow the yacc or lex input. - 2- CHMOD(l) CHMOD(l) NAME chmod - change mode SYNOPSIS chmod mode files DESCRIPTION The permissions of the named files are changed according to mode, which may be absolute or symbolic. An absolute mode is an octal number constructed from the OR of the following modes: 4000 2000 1000 0400 0200 0100 0070 0007 set user ID on execution set group ID on execution sticky bit, see chmod (2) read by owner write by owner execu te (search in directory) by owner read, write, execute (search) by group read, write, execute (search) by others A symbolic mode has the form: [ who ] op permission [ op permission ] The who part is a combination of the letters u (for user's permissions), g (group) and 0 (other). The letter a stands for ugo, the default if who is omitted. Op can be + to add permission to the file's mode, - to take away permission, or = to assign permission absolutely (all other bits will be reset). Permission is any combination of the letters r (read), w (write), x (execute), S (set owner or group ID) and t (save text, or sticky); u, g, or 0 indicate that permission is to be taken from the current mode. Omitting permission is only useful with = to take away all permissions. Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter s is only useful with u or g and t only works with u. Only the owner of a file (or the super-user) may change its mode. EXAMPLES The first example denies write permission to others, the second makes a file executable: chmod o-w file chmod +x file SEE ALSO Is(I), chmod(2). - I - CHOWN(l) CHOWN(l) NAME chown, chgrp - change owner or group SYNOPSIS chown owner file .. . chgrp group file .. . DESCRIPTION Chown changes the owner of the files to owner. The owner may be either a decimal user 10 or a login name found in the password file. Chgrp changes the group 10 of the files to group. The group may be either a decimal group 10 or a group name found in the group file. FILES /etc/passwd /etc/group SEE ALSO chown(2), group(4), passwd(4). - 1- CMP(I) CMP(I) NAME cmp - compare two files SYNOPSIS cmp [ -I ] [ -s ] filel file2 DESCRIPTION The two files are compared. (If filel is -, the standard input is used.) Under default options, cmp makes no comment if the files are the same; if they differ, it announces the byte and line number at which the difference occurred. If one file is an initial subsequence of the other, that fact is noted. Options: -I Print the byte number (decimal) and the differing bytes (octal) for each difference. -s Print nothing for differing files; return codes only. SEE ALSO comm (I), diff( 1) . DIAGNOSTICS Exit code 0 is returned for identical files, I for different files, and 2 for an inaccessible or missing argument. - 1- COL(I) COLO) NAME col - filter reverse line-feeds SYNOPSIS col [ -bfpx ] DESCRIPTION Col reads from the standard input and writes onto the standard output. It performs the line overlays implied by reverse line feeds (ASCII code ESC-7), and by forward and reverse half-line-feeds (ESC-9 and ESC-8). Col is particularly useful for filtering multicolumn output made with the .rt command of nroff and output resulting from use of the tbl(1) preprocessor. If the -b option is given, col assumes that the output device in use is not capable of backspacing. In this case, if two or more characters are to appear in the same place, only the last one read will be output. Although col accepts half-line motions in its input, it normally does not emit them on output. Instead, text that would appear between lines is moved to the next lower full-line boundary. This treatment can be suppressed by the -f (fine) option; in this case, the output from col may contain forward half-linefeeds (ESC-9), but will still never contain either kind of reverse line motion. Unless the -x option is given, col will convert white space to tabs on output wherever possible to shorten printing time. The ASCII control characters SO (\017) and SI (\016) are assumed by col to start and end text in an alternate character set. The character set to which each input character belongs is remembered, and on output SI and SO characters are generated as appropriate to ensure that each character is printed in the correct character set. On input, the only control characters accepted are space, backspace, tab, return, new-line, SI, SO, VT (\013), and ESC followed by 7, 8, or 9. The VT character is an alternate form of full reverse line-feed, included for compatibility with some earlier programs of this type. All other non-printing characters are ignored. Normally, col will ignore any unknown to it escape sequences found in its input; the -p option may be used to cause col to output these sequences as regular characters, subject to overprinting from reverse line motions. The use of this option is highly discouraged unless the user is fully aware of the textual position of the escape sequences. SEE ALSO nrofHI), tbl(1). NOTES The input format accepted by col matches the output produced by nroff with either the -T37 or -Tip options. Use -T37 (and the -f option of co/) if the ultimate disposition of the output of col will be a device that can interpret half-line motions, and -Tip otherwise. BUGS Cannot back up more than 128 lines. Allows at most 800 characters, including backspaces, on a line. Local vertical motions that would result in backing up over the first line of the document are ignored. As a result, the first line must not have any superscripts. - 1- eOMB(I) eOMB(t) NAME comb - combine sees deltas SYNOPSIS comb [-0] [-s] [-psid] [-c1ist1 files DESCRIPTION Comb generates a shell procedure (see sh (1» which, when run, will reconstruct the given sees files. The reconstructed files will, hopefully, be smaller than the original files. The arguments may be specified in any order, but all keyletter arguments apply to all named sees files. If a directory is named, comb behaves as though each file in the directory were specified as a named file, except that non-SeeS files (last component of the path name does not begin with s.) and unreadable files are silently ignored. If a name of - is given, the standard input is read; each line of the standard input is taken to be the name of an sees file to be processed; non-SeeS files and unreadable files are silently ignored. The generated shell procedure is written on the standard output. The keyletter arguments are as follows. Each is explained as though only one named file is to be processed, but the effects of any key letter argument apply independently to each named file. -pSID The sees IDentification string (SID) of the oldest delta to be preserved. All older deltas are discarded in the reconstructed file. -clist A list (see get (1) for the syntax of a list) of deltas to be preserved. All other deltas are discarded. -0 For each get -e generated, this argument causes the reconstructed file to be accessed at the release of the delta to be created, otherwise the reconstructed file would be accessed at the most recent ancestor. Use of the - 0 keyletter may decrease the size of the reconstructed sees file. It may also alter the shape of the delta tree of the original file. -s This argument causes comb to generate a shell procedure which, when run, will produce a report giving, for each file: the file name, size (in blocks) after combining, original size (also in blocks), and percentage change computed by: 100 • (original - combined) / original It is recommended that before any sees files are actually combined, one should use this option to determine exactly how much space is saved by the combining process. If no key letter arguments are specified, comb will preserve only leaf deltas and the minimal number of ancestors needed to preserve the tree. FILES s.eOMB comb????? The name of the reconstructed sees file. Temporary. SEE ALSO admin(1), delta(1), get(1), help(t), prs(1), sccsfile(4). Source Code Control System User's Guide in the UNIX System User's Guide. DIAGNOSTICS Use help (1) for explanations. BUGS Comb may rearrange the shape of the tree of deltas. It may not save any space; in fact, it is possible for the reconstructed file to actually be larger than the original. - 1- COMM(I) COMM(I) NAME comm - select or reject lines common to two sorted files SYNOPSIS comm [ - [ 123 ] ] filel file2 DESCRIPTION Comm reads file1 and file2, which should be ordered in ASCII collating sequence (see sort (1», and produces a three-column output: lines only in file1; lines only in file2; and lines in both files. The file name - means the standard input. Flags l, 2, or 3 suppress printing of the corresponding column. Thus comm -12 prints only the lines common to the two files; comm -23 prints only lines in the first file but not in the second; comm -123 is a no-op. SEE ALSO cmp (1), diff(1), sort (1), uniq (1). - 1- CONVERT(I) (not on PDP-ll) CONVERT(l) NAME convert - convert object and archive files to common formats SYNOPSIS convert infile outfile DESCRIPTION Convert transforms input infile to output outfile. Infile must be different from outfile. Injile may be anyone of the following: 1) a pre-UNIX System 5.0 VAX object file or link edited (a.out) module 2) a pre-UNIX System 5.0 VAX archive of object files or link edited (a.out) modules 3) a pre-UNIX System 5.0 3B20S archive of object files or link edited (a.out) modules. Convert will transform infile to one of the following: 1) an equivalent UNIX System 5.0 VAX object file or link edited (a.out) module 2) an equivalent UNIX System 5.0 portable archive of equivalent object files or link edited (a.out) modules 3) an equivalent UNIX System 5.0 portable archive of unaltered 3B20S object files or link edited (a.out) modules. All other types of input to the convert (1) command will be passed unmodified from the input file to the output file (along with appropriate warning messages). When transforming archive files, the convert (1) command will inform the user that the archive symbol table has been deleted. The archive symbol table may be restored by executing the ar(1) command with the s option. The convert command may be used in conjunction with the arcv(1) command to transform archives generated on a PDP-II to the UNIX System 5.0 archive format for usage on a 3B20S or VAX processor. FILES Itmp/conv. SEE ALSO ar(1), arcv(1), a.out(4), ar(4). - I - CP(l) CP(l) NAME cp, In, mv - copy, link or move files SYNOPSIS cp file 1 [ file2 ... ] target In file 1 [ file2 ... ] target mv file 1 [ file2 .. .1 target DESCRIPTION File] is copied Oinked, moved) to target. Under no circumstance can file] and target be the same (take care when using sh (1) metacharacters). If target is a directory, then one or more files are copied Oinked, moved) to that directory. If rnv determines that the mode of target forbids writing, it will print the mode (see chrnod (2» and read the standard input for one line (if the standard input is a terminal); if the line begins with y, the move takes place; if not, rnv exits. Only rnv will allow file] to be a directory, in which case the directory rename will occur only if the two directories have the same parent. SEE ALSO cpio(1), rm(I), chmod(2). BUGS If file] and target lie on different file systems, rnv must copy the file and delete the original. In this case the owner name becomes that of the copying process and any linking relationship with other files is lost. Ln will not link across file systems. - 1- CPIO (1) CPIO(l) NAME cpio - copy file archives in and out SYNOPSIS cpio -0 [ acBv ] cpio -i [ BcdmrtuvfsSb6 ] [ patterns cpio - p [ adlmruv ] directory DESCRIPTION Cpio -0 (copy out) reads the standard input to obtain a list of path names and copies those files onto the standard output together with path name and status information. Cpio -i (copy in) extracts files from the standard input which is assumed to be the product of a previous cpio -0. Only files with names that match patterns are selected. Patterns are given in the name-generating notation of sh (1). In patterns, meta-characters ?, ., and [ .. .1 match the slash / character. Multiple patterns may be specified and if no patterns are specified, the default for patterns is • (i.e., select all files). The extracted files are conditionally created and copied into the current directory tree based upon the options described below. Cpio -p (pass) reads the standard input to obtain a list of path names of files that are conditionally created and copied into the destination directory tree based upon the options described below. The meanings of the available options are: a B d c r t u v m f s S b 6 Reset access times of input files after they have been copied. Input/output is to be blocked 5,120 bytes to the record (does not apply to the pass option; meaningful only with data directed to or from /dev/rmt?) . Directories are to be created as needed. Write header information in ASCII character form for portability. Interactively rename files. If the user types a null line, the file is skipped. Print a table of contents of the input. No files are created. Copy unconditionally (normally, an older file will not replace a newer file with the same name). Verbose: causes a list of file names to be printed. When used with the t option, the table of contents looks like the output of an Is -I command (see Is (1». Whenever possible, link files rather than copying them. Usable only with the -p option. Retain previous file modification time. This option is ineffective on directories thatare being copied. Copy in all files except those in patterns. Swap bytes. Use only with the -i option. Swap halfwords. Use only with the -i option. Swap both bytes and halfwords. Use only with the -i option. Process an old (i.e., UNIX System Sixth Edition format) file. Only useful with -i (copy in). EXAMPLES The first example below copies the contents of a directory into an archive; the second duplicates a directory hierarchy: Is I cpio -0 >/dev/mtO cd olddir find • -depth -print I cpio -pdl newdir - 1- CPIO(t) CPIO(l) The trivial case "find. -depth -print dled more efficiently by: cpio -oB > Idev/rmtO" can be han- find. -cpio Idev/rmtO SEE ALSO ar(1), find(l), cpio(4). BUGS Path names are restricted to 128 characters. If there are too many unique linked files, the program runs out of memory to keep track of them and, thereafter, linking information is lost. Only the super-user can copy special files. The - B option does not work with certain magnetic tape drives (see un32(7) in the UNIX System Administrator's Manual). - 2- CPP(I) CPP(I ) NAME cpp - the C language preprocessor SYNOPSIS llih/cpp [ option ... ] [ ifile [ ofile ] DESCRIPTION Cpp is the C language preprocessor which is invoked as the first pass of any C compilation using the cc(1) command. Thus the output of cpp is designed to be in a form acceptable as input to the next pass of the C compiler. As the C language evolves, cpp and the rest of the C compilation package will be modified to follow these changes. Therefore, the use of cpp other than in this framework is not suggested. The preferred way to invoke cpp is through the cc(1) command since the functionality of cpp may someday be moved elsewhere. See m4 (1) for a general macro processor. Cpp optionally accepts two file names as arguments. [file and ofile are respectively the input and output for the preprocessor. They default to standard input and standard output if not supplied. The following options to cpp are recognized: - P Preprocess the input without producing the line control information used by the next pass of the C compiler. -C By default, cpp strips C-style comments. If the -C option is specified, all comments (except those found on cpp directive lines) are passed along. -Uname Remove any initial definition of name, where name is a reserved symbol that is predefined by the particular preprocessor. The current list of these possibly reserved symbols includes: operating system: ibm, gcos, os, tss, unix hardware: interdata, pdpll, u370, u3b, vax UNIX System variant: RES, RT -Dname -Dname=def Define name as if by a #define directive. If no =def is given, name is defined as 1. - Idir Change the algorithm for searching for #include files whose names do not begin with I to look in dir before looking in the directories on the standard list. Thus, #include files whose names are enclosed in "" will be searched for first in the directory of the ifile argument, then in directories named in - I options, and last in directories on a standard list. For #include files whose names are enclosed in < >, the directory of the ifile argument is not searched. Two special names are understood by cpp. The name __LINE __ is defined as the current line number (as a decimal integer) as known by cpp, and __FILE__ is defined as the current file name (as a C string) as known by cpp. They can be used anywhere (including in macros) just as any other defined name. All cpp directives start with lines begun by #. The directives are: #define name token-string Replace subsequent instances of name with token-string. #define name( arg, ••. , arg ) token-string Notice that there can be no space between name and the (. Replace subsequent instances of name followed by a (, a list of comma separated tokens, and a ) by token-string where each occurrence of an - 1- cPp(l) CPP(l) arg in the token-string is replaced by the corresponding token in the comma separated list. #undef name Cause the definition of name (if any) to be forgotten from now on. #include ''filename'' #include Include at this point the contents of filename (which will then be run through cpp). When the notation is used, filename is only searched for in the standard places. See the -I option above for more detail. #line integer-constant ''filename'' Causes cpp to generate line control information for the next pass of the C compiler. Integer-constant is the line number of the next line and filename is the file where it comes from. If ''filename'' is not given, the current file name is unchanged. #endif Ends a section of lines begun by a test directive (#if, #ifdef, or #ifndef). Each test directive must have a matching #endif. #ifdef name The lines following will appear in the output if and only if name has been the subject of a previous #define without being the subject of an intervening #undef. #ifndef name The lines following will not appear in the output if and only if name has been the subject of a previous #define without being the subject of an intervening #undef. #if constant-expression Lines following will appear in the output if and only if the constantexpression evaluates to non-zero. All binary non-assignment C operators, the ?: operator, the unary -, !, and - operators are all legal in constant-expression. The precedence of the operators is the same as defined by the C language. There is also a unary operator defined, which can be used in constant-expression in these two forms: defined ( name) or defined name. This allows the utility of #ifdef and #ifndef in a #if directive. Only these operators, integer constants, and names which are known by cpp should be used in constant-expression. In particular, the sizeof operator is not available. #eIse Reverses the notion of the t~st directive which matches this directive. So if lines previous to this directive are ignored, the following lines will appear in the output. And vice versa. The test directives and the possible #else directives can be nested. FILES lusr/include standard directory for #include files SEE ALSO cc(l), m4(1). DIAGNOSTICS The error messages produced by cpp are intended to be self-explanatory. The line number and filename where the error occurred are printed along with the diagnostic. NOTES When newline characters were found in argument lists for macros to be - 2- CPp(l) CPP(l) expanded, previous versions of cpp put out the newlines as they were found and expanded. The current version of cpp replaces these newlines with blanks to alleviate problems that the previous versions had when this occurred. - 3- CPRS(I) (3820S only) CPRS(I) NAME cprs - compress an IS25 object file SYNOPSIS cprs [- pv] file 1 file2 DESCRIPTION The cprs command reduces the size of an IS25 object file, filel, by removing duplicate structure and union descriptors. The reduced file, file2, is produced as output. The options are: -p Print statistical messages including: total number of tags, total duplicate tags, and total reduction of filel. -v Print verbose error messages if error condition occurs. SEE ALSO strip(l) . - 1- CRYPT (I ) CRYPT (I) NAME crypt - encode/decode SYNOPSIS crypt [ password ] DESCRIPTION Crypt reads password is given, crypt key is being from the standard input and writes on the standard output. The a key that selects a particular transformation. If no password is demands a key from the terminal and turns off printing while the typed in. Crypt encrypts and decrypts with the same key: crypt key < clear > cypher crypt key file - I - CSPLIT(l) CSPLIT(l) Note that this example overwrites the original file. csplit -k file 100 {99} This example would split the file at every 100 lines, up to 10,000 lines. The - k option causes the created files to be r'.etained if there are less than 10,000 lines; however, an error message would still be printed. csplit -k prog.c '%main(%' 'r}/+l' {20} Assuming that prog.c follows the normal C coding convention of ending routines with a } at the beginning of the line, this example will create a file containing each separate C routine (up to 21) in prog.c. SEE ALSO ed (1), sh (I), regexp(S). DIAGNOSTICS Self explanatory except for: arg - out of range which means that the given argument did not reference a line between the current position and the end of the file. - 2- CT(tC> CT(tC> NAME ct - spawn getty to a remote terminal SYNOPSIS ct [ -h ] [ -v ] [ -wn ] [ -sspeed ] telno ... DESCRIPTION Ct dials the phone number of a modem that is attached to a terminal, and spawns a getty process to that terminal. Telno is a telephone number, with equal signs for secondary dial tones and minus signs for delays at appropriate places. If more than one telephone number is specified, ct will try each in succession until one answers; this is useful for specifying alternate dialing paths. Ct will try each line listed in the file lusrRibluucplL-devices until it finds an available line with appropriate attributes or runs out of entries. if there are no free lines, ct will ask if it should wait for one, and if so, for how many minutes it should wait before it gives up. Ct will continue to try to open the dialers at one-minute intervals until the specified limit is exceeded. The dialogue may be overridden by specifying the -wn option, where n is the maximum number of minutes that ct is to wait for a line. Normally, ct will hang up the current line, so that that line can answer the incoming call. The -h option will prevent this action. If the -v option is used, ct will send a running narrative to the standard error output stream. The data rate may be set with the -s option, where speed is expressed in baud. The default rate is 300. After the user on the destination terminal logs out, ct prompts, Reconnect? If the response begins with the letter n the line will be dropped; otherwise, getty will be started again and the login: prompt will be printed. Of course, the destination terminal must be attached to a modem that can answer the telephone. FILES lusrllib/uucp/L-devices I usr I adml ctlog SEE ALSO cu(IC), login(l), uucp(IC). - 1- cu (lC> cu(IC> NAME cu - call another UNIX System SYNOPSIS co [ -sspeed] [-lline] [-h] [-t] [ -d] [-m] [ -ol-e] telno I dir DESCRIPTION Cu calls up another UNIX System, a terminal, or possibly a non-UNIX System. It manages an interactive conversation with possible transfers of ASCII files. Speed gives the transmission speed (11 0, 150, 300, 600, 1200, 4800, 9600); 300 is the default value. Most of our modems are either 300 or 1200 baud. For dial out lines, cu will choose a modem speed (300 or 1200) as the slowest available which will handle the specified transmission speed. Directly connected lines may be set to speeds higher than 1200 baud. The -I value may be used to specify a device name for the communications line device to be used. This can be used to override searching for the first available line having the right speed. The speed of a line is taken from the file /usrRib/uucp/L-devices, overriding any speed specified by the -s option. The -h option emulates local echo, supporting calls to other computer systems which expect terminals to be in half-duplex mode. The -t option is used when dialing an ASCII terminal which has been set to auto-answer. Appropriate mapping of carriage-returns to carriage-return-line-feed pairs is set. The -d oprtion cause diagnostic traces to be printed. The -m option specifies a direct line which has modem control. The -e (-0) option designates that even (odd) parity is to be generated for data sent to the remote. The -d option causes diagnostic traces to be printed. Telno is the telephone number, with equal signs for secondary dial tone or minus signs for delays, at appropriate places. The string dir for telno may be used for directly connected lines, and implies a null ACU. Using dir insures that a line has been specified by the -I option. Cu will try each line listed in the file /usrRib/uucp/L-devices until it finds an available line with appropriate attributes or runs out of entries. After making the connection, cu runs as two processes: the transmit process reads data from the standard input and, except for lines beginning with -, passes it to the remote system; the receive process accepts data from the remote system and, except for lines beginning with -, passes it to the standard output. Normally, an automatic DC3/DCl protocol is used to control input from the remote so the buffer is not overrun. Lines beginning with - have special meanings. The transmit process interprets the following: terminate the conversation. -! escape to an interactive shell on the local system. -!cmd... run cmd on the local system (via sh -c). -Scmd... run cmd locally and send its output to the remote system. copy file from (on the remote system) to file to on the local system. If to is omitted, the from argument is used in both places. -%take from [ to] -% put from [ to] copy file from (on local system) to file to on remote system. If to is omitted, the from argument is used in both places. send the line -... to the remote system. -%nostop turn off the DC3/0Cl input control protocol for the remainder of the session. This is useful in case the - 1- CU(IC) cu(tC) remote system is one which does not respond properly to the DC3 and DC 1 characters, The receive process normally copies data from the remote system to its standard output. A line from the remote that begins with -> initiates an output diversion to a file. The complete sequence is: -> [> 1:file zero or more lines to be written to file -> Data from the remote is diverted (or appended, if trailing -> terminates the diversion. >> is used) to file. The The use of - % put requires stty (1) and cat (1) on the remote side. It also requires that the current erase and kill characters on the remote system be identical to the current ones on the local system. Backslashes are inserted at appropriate places. The use of -%take requires the existence of echo (1) and cadI) on the remote system. Also, stty tabs mode should be set on the remote system if tabs are to be copied without expansion. FILES I usr IIi bl uucp/L-devices lusrlspool/uucp/LCK .. (tty-device) Idev/null SEE ALSO cat(1), ctOC), echo(1), stty(I), uucp(1C). DIAGNOSTICS Exit code is zero for normal exit, non-zero (various values) otherwise. BUGS Cu buffers input internally. There is an artificial slowing of transmission by cu during the - % put operation so that loss of data is unlikely. - 2- CUT(I) CUT(I) NAME cut - cut out selected fields of each line of a file SYNOPSIS cut -clist [filel file2 .. .1 cut -flist [-dchar] [-s] [filel file2 .. .1 DESCRIPTION Use cut to cut out columns from a table or fields from each line of a file; in data base parlance, it implements the projection of a relation. The fields as specified by list can be fixed length, i.e., character positions as on a punched card (-c option), or the length can vary from line to line and be marked with a field delimiter character like tab (-f option). Cut can be used as a filter; if no files are given, the standard input is used. The meanings of the options are: list A comma-separated list of integer field numbers (in increasing order), with optional - to indicate ranges as in the - 0 option of nroffltroff for page ranges; e.g., 1,4,7; 1 - 3,8; -5,10 (short for 1 -5,10); or 3(short for third through last field). -c/ist The list following -c (no space) specifies character positions (e.g., -c1-72 would pass the first 72 characters of each line). -flist The list following -f is a list of fields assumed to be separated in the file by a delimiter character (see -d ); e.g. , -fl,7 copies the first and seventh field only. Lines with no field delimiters will be passed through intact (useful for table subheadings), unless -s is specified. -dchar The character following -d is the field delimiter (-f option only). Default is tab. Space or other characters with special meaning to the shell must be quoted. -s Suppresses lines with no delimiter characters in case of -f option. Unless specified, lines with no delimiters will be passed through untouched. Either the -c or -f option must be specified. HINTS Use grep(1) to make horizontal "cuts" (by context) through a file, or paste (I) to put files together column-wise (i.e., horizontally). To reorder columns in a table, use cut and paste. EXAMPLES cut -d: -£1,5 /etc/passwd mapping of user IDs to names name='who am i I cut -£1 -d" '" to set name to current login name. DIAGNOSTICS line too long A line can have no more than 511 characters or fields. bad list for c If option Missing -c or -f option or incorrectly specified list. No error occurs if a line has fewer fields than the list calls for. no fields The list is empty. SEE ALSO grep (1), paste( 1) . - 1- cwO) cwO) NAME cw, checkcw - prepare constant-width text for troff SYNOPSIS cw [ -Ixx ] [ -rxx ] [ -fn ] [ -t ] [ +t ] [ -d ] [ files ] checkcw [ -Ix x ] [ -rxx ] files DESCRIPTION Cw is a preprocessor for troff(I) input files that contain text to be typeset in the constant-width (CW) font. Text typeset with the CW font resembles the output of terminals and of line printers. This font is used to typeset examples of programs and of computer output in user manuals, programming texts, etc. (An earlier version of this font was used in typesetting The C Programming Language by B. W. Kernighan and D. M. Ritchie.) It has been designed to be quite distinctive (but not overly obtrusive) when used together with the Times Roman font. Because the cw font contains a "non-standard" set of characters and because text typeset with it requires different character and inter-word spacing than is used for "standard" fonts, documents that use the CW font must be preprocessed by cw. The CW font contains the 94 printing ASCII characters: abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 !$%&O"*+@.'!:;=?[]I__A_"<>O# plus eight non-ASCII characters represented by four-character troff(I) names Gn some cases attaching these names to "non-standard" graphics): Character "Cents" sign EBCDIC "not" sign Left arrow Right arrow Down arrow Vertical single quote Control-shift indicator Visible space indicator Hyphen Symbol Troff Name % t % %%(ct% %...,% %%(no% %-% %%«-% % -% %%(->% %! % %%(da% % '% %%(fm% % t% %%(dg% % D % %%(sq% % -% %%(hy% The hyphen is a synonym for the unadorned minus sign (-). Certain versions of cw recognize two additional names: %\(ua% for an up arrow and %\Oh% for a diagonal left-up (home) arrow. Cw recognizes five request lines, as well as user-defined delimiters. The request lines look like troff(I) macro requests, and are copied in their entirety by cw onto its output; thus, they can be defined by the user as troff(I) macros; in fact, the %.CW% and %.CN% macros should be so defined (see HINTS below). The five requests are: .CW Start of text to be set in the CW font; %.CW% causes a break; it can take precisely the same options, in precisely the same format, as are available on the cw command line . .CN End of text to be set in the CW font; %.CN% causes a break; it can take the same options as are available on the cw command line . .CD Change delimiters and!or settings of other options; takes the same options as are available on the cw command line. - 1- CW(I) CW(I) .CP argJ arg2 arg3 ... argn All the arguments (which are delimited like troff(1) macro arguments) are concatenated, with the odd-numbered arguments set in the CW font and the even-numbered ones in the prevailing font. .PC argl arg2 arg3 ... argn Same as %.CP%, except that the even-numbered arguments are set in the CW font and the odd-numbered ones in the prevailing font. The %.CW% and %.CN% requests are meant to bracket text (e.g., a program fragment) that is to be typeset in the CW font "as is." Normally, cw operates in the transparent mode. In that mode, except for the %.CD% request and the nine special four-character names listed in the table above, every character between %.CW% and %.CN% request lines stands for itself. In particular, cw arranges for periods (.) and apostrophes (,) at the beginning of lines, and backslashes (%) everywhere to be "hidden" from troff(t). The transparent mode can be turned off (see below), in which case normal troff(t) rules apply; in particular, lines that begin with %.% and %'% are passed through untouched (except if they contain delimiters-see below). In either case, cw hides the effect of the font changes generated by the %.CW% and %.CN% requests; cw also defeats all ligatures (%fi%, %ff%, etc.) in the CW font. The only purpose of the %.CD% request is to allow the changing of various options other than just at the beginning of a document. The user can also define delimiters. The left and right delimiters perform the same function as the %.CW%/%.CN% requests; they are meant, however, to enclose CW "words" or "phrases" in running text (see example under BUGS below). Cw treats text between delimiters in the same manner as text enclosed by %.CW%/%.CN% pairs, except that, for aesthetic reasons, spaces and backspaces inside %.CW% /%.CN% pairs have the same width as other CW characters, while spaces and backspaces between delimiters are half as wide, so they have the same width as spaces in the prevailing text (but are not adjustable). Font changes due to delimiters are not hidden. Delimiters have no special meaning inside %.CW%/%.CN% pairs. The options are: -Ixx The one- or two-character string xx becomes the left delimiter; if xx is omitted, the left delimiter becomes undefined, which 'it is initially. -fXX Same for the right delimiter. The left and right delimiters may (but need not) be different. -fn The CW font is mounted in font position n; acceptable values for n are 1, 2, and 3 (default is 3, replacing the bold font). This option is only useful at the beginning of a document. -t Turn transparent mode off. +t Turn transparent mode on (this is the initial default). Print current option settings on file descriptor 2 in the form of troff(t) comment lines. This option is meant for debugging. -d Cw reads the standard input when no files are specified (or when - is specified as the last argument), so it can be used as a filter. Typical usage is: cw files I troff ... Checkcw checks that left and right delimiters, as well as the %.CW% /%.CN% pairs, are properly balanced. It prints out all offending lines. - 2- CW(I) CW(}) HINTS Typical definitions of the %.CW% and %.CN% macros meant to be used with the mm (5) macro package: At the very least, the %.CW% macro should invoke the troff(l) no-fill (%.n[%) mode. When set in running text, the CW font is meant to be set in the same point size as the rest of the text. In displayed matter, on the other hand, it can often be profitably set one point smaller than the prevailing point size (the displayed definitions of %.CW% and %.CN% above are one point smaller than the running text on this page). The CW font is sized so that, when it is set in 9-point, there are 12 characters per inch. Documents that contain cw text may also contain tables and/or equations. If this is the case, the order of preprocessing should be: CW, tbl, and eqn. Usually, the tables contained in such documents will not contain any cw text, although it is entirely possible to have elements of the table set in the cw font; of course, care must be taken that tbJ(l) format information not be modified by CWo Attempts to set equations in the cw font are not likely to be either pleasing or successful. In the cw font, overstriking is most easily accomplished with backspaces: letting %-% represent a backspace, %d --dg% yields %It%. (Because backspaces are half as wide between delimiters as inside %.CW%/%.CN% pairs-see above-two backspaces are required for each overstrike between delimiters') -3- CwO) CwO) FILES /usr /lib/font/ftew ew font-width table SEE ALSO eqn(I), mmt(I), tbI(l), troff(l), mm(5), mv(5). WARNINGS If text preprocessed by cw is to make any sense, it must be set on a typesetter equipped with the ew font or on a STARE facility; on the latter, the ew font appears as bold, but with the proper CW spacing. BUGS Only a masochist would use periods (%. %), backslashes (%), or double quotes (%"%) as delimiters, or as arguments to %.CP% and %.PC%. Certain ew characters don't concatenate gracefully with certain Times Roman characters, e.g., a ew ampersand (%&%) followed by a Times Roman comma(%,%); in such cases, judicious use of troff(I) half- and quarter-spaces (%% and %%) is most salutary, e.g., one should use %_&_,% (rather than just plain %_&_,%) to obtain %&%, (assuming that %_% is used for both delimiters) . Using cw with nroff is silly. The output of cw is hard to read. See also BUGS under troff(l). -4 - CXREF(l) CXREF(l) NAME cxref - generate C program cross reference SYNOPSIS cxref [ options ] files DESCRIPTION Cxref analyzes a collection of C files and attempts to build a cross reference table. Cxref utilizes a special version of cpp to include #define'd information in its symbol table. It produces a listing on standard output of all symbols (auto, static, and global) in each file separately, or with the -c option, in combination. Each symbol contains an asterisk (.) before the declaring reference. In addition to the -D, -I and -U options (which are identical to their interpretation by ceO», the following options are interpreted by cxref: -c Print a combined cross-reference of all input files. -w Width option which formats output no wider than (decimal) columns. This option will default to 80 if is not specified or is less than 51. -0 file Direct output to named file. -s Operate silently; does not print input file names. -t Format listing for 80-column width. FILES lusr/lib/xcpp special version of C-preprocessor. SEE ALSO cdt). DIAGNOSTICS Error messages are unusually cryptic, but usually mean that you can't compile these files, anyway. - 1- DATE(l) DATE (I) NAME date - print and set the date SYNOPSIS date [ mmddhhmm[yy] ] [ +format ] DESCRIPTION If no argument is given, or if the argument begins with +, the current date and time are printed. Otherwise, the current date is set. The first mm is the month number; dd is the day number in the month; hh is the hour number (24 hour system); the second mm is the minute number; yy is the last 2 digits of the year number and is optional. For example: date 10080045 sets the date to Oct 8, 12:45 AM. The current year is the default if no year is mentioned. The system operates in GMT. Date takes care of the conversion to and from local standard and daylight time. If the argument begins with +, the output of date is under the control of the user. The format for the output is similar to that of the first argument to printfOS). All output fields are of fixed size (zero padded if necessary). Each field descriptor is preceded by % and will be replaced in the output by its corresponding value. A single % is encoded by % %. All other characters are copied to the output without change. The string is always terminated with a new-line character. Field Descriptors: n insert a new-line character t insert a tab character m month of year - 01 to 12 d day of month - 01 to 31 y last 2 digits of year - 00 to 99 D date as mm/dd/yy H hour - 00 to 23 M minute - 00 to 59 S second - 00 to 59 T time as HH:MM:SS day of year - 001 to 366 w day of week - Sunday = 0 a abbreviated weekday - Sun to Sat h abbreviated month - Jan to Dec r time in AM/PM notation EXAMPLE date '+DATE: %m/%d/%y%nTIME: %H:%M:%S' would have generated as output: DATE: 08/01176 TIME: 14:45:05 DIAGNOSTICS No permission if you aren't the super-user and you try to change the date; bad conversion if the date set is syntactically incorrect; bad format character if the field descriptor is not recognizable. FILES Idev/kmem WARNING It is a bad practice to change the date while the system is running multi-user. - 1- DC(l) DC(l) NAME dc - desk calculator SYNOPSIS de [ file ] DESCRIPTION De is an arbitrary precIsIon arithmetic package. Ordinarily it operates on decimal integers, but one may specify an input base, output base, and a number of fractional digits to be maintained. The overall structure of de is a stacking (reverse Polish) calculator. If an argument is given, input is taken from that file until its end, then from the standard input. The following constructions are recognized: number The value of the number is pushed on the stack. A number is an unbroken string of the digits 0-9. It may be preceded by an underscore () to input a negative number. Numbers may contain decimal points. +_/*%A • The top two values on the stack are added (+), subtracted (-), multiplied (.), divided (f), remaindered (%), or exponentiated (A). The two entries are popped off the stack; the result is pushed on the stack in their place. Any fractional part of an exponent is ignored. sx The top of the stack is popped and stored into a register named x, where x may be any character. If the s is capitalized, x is treated as a stack and the value is pushed on it. Ix The value in register x is pushed on the stack. The register x is not altered. All registers start with zero value. If the I is capitalized, register x is treated as a stack and its top value is popped onto the main stack. d The top value on the stack is duplicated. p The top value on the stack is printed. The top value remains unchanged. P interprets the top of the stack as an ASCII string, removes it, and prints it. f All values on the stack are printed. q exits the program. If executing a string, the recursion level is popped by two. If q is capitalized, the top value on the stack is popped and the string execution level is popped by that value. x treats the top element of the stack as a character string and executes it as a string of de commands. X replaces the number on the top of the stack with its scale factor. [ ... ] puts the bracketed ASCII string onto the top of the stack. x =x The top two elements of the stack are popped and compared. Register x is evaluated if they obey the stated relation. v replaces the top element on the stack by its square root. Any existing fractional part of the argument is taken into account, but otherwise the scale factor is ignored. interprets the rest of the line as a UNIX System command. e All values on the stack are popped. The top value on the stack is popped and used as the number radix for further input. I pushes the input base on the top of the stack. - 1- DC(I) DC(I) o The top value on the stack is popped and used as the number radix for further output. o pushes the output base on the top of the stack. k the top of the stack is popped, and that value is used as a non-negative scale factor: the appropriate number of places are printed on output, and maintained during multiplication, division, and exponentiation. The interaction of scale factor, input base, and output base will be reasonable if all are changed together. z The stack level is pushed onto the stack. z replaces the number on the top of the stack with its length. ? A line of input is taken from the input source (usually the terminal) and executed. ,. are used by be for array operations. EXAMPLE This example prints the first ten values of n!: Hal +dsa*plaIO>y]sy Osal lyx SEE ALSO bc(I), which is a preprocessor for de providing infix notation and a C-like syntax which implements functions and reasonable control structures for programs. DIAGNOSTICS x is unimplemented where x is an octal number. stack empty for not enough elements on the stack to do what was asked. Out of space when the free list is exhausted (too many digits). Out of headers for too many numbers being kept around. Out of pushdown for too many items on the stack. Nesting Depth for too many levels of nested execution. - 2- DD(1) DD(1) NAME dd - convert and copy a file SYNOPSIS dd [option=value] ... DESCRIPTION Dd copies the specified input file to the specified output with possible conversions. The standard input and output are used by default. The input and output block size may be specified to take advantage of raw physical I/O. option if=Jile of=Jile ibs=n obs=n bs=n values input file name; standard input is default output file name; standard output is default input block size n bytes (default 512) output block size (default 512) set both input and output block size, superseding ibs and obs; also, if no conversion is specified, it is particularly efficient since no in-core copy need be done cbs = n conversion buffer size skip n input records before starting copy skip = n seek=n seek n records from beginning of output file before copying count = n copy only n input records com = ascii convert EBCDIC to ASCII ebcdic convert ASCII to EBCDIC ibm slightly different map of ASCII to EBCDIC lease map alphabetics to lower case ucase map alphabetics to upper case swab swap every pair of bytes noerror do not stop processing on an error sync pad every input record to ibs ... , ... several comma-separated conversions Where sizes are specified, a number of bytes is expected. A number may end with k, b, or w to specify multiplication by 1024, 512, or 2 respectively; a pair of numbers may be separated by x to indicate a product. Cbs is used only if ascii or ebcdic conversion is specified. In the former case cbs characters are placed into the conversion buffer, converted to ASCII, and trailing blanks trimmed and new-line added before sending the line to the output. In the latter case ASCII characters are read into the conversion buffer, converted to EBCDIC, and blanks added to make up an output record of size cbs. After completion, dd reports the number of whole and partial input and output blocks. EXAMPLE This command will read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into the ASCII file x: dd if=/dev/rmtO of=x ibs=800 cbs=80 conv=ascii,lcase Note the use of raw magtape. Dd is especially suited to I/O on the raw physical devices because it allows reading and writing in arbitrary record sizes. SEE ALSO cp(I) . - 1- DD(I) DD(I) DIAGNOSTICS j+p records in (out) numbers of full and partial records read (written) BUGS The ASCII/EBCDIC conversion tables are taken from the 256 character standard in the CACM Nov, 1968. The ibm conversion, while less blessed as a standard, corresponds better to certain IBM print train conventions. There is no universal solution. New-lines are inserted only on conversion to ASCII; padding is done only on conversion to EBCDIC. These should be separate options. - 2- DELTA (1) DELTA (1) NAME delta - make a delta (change) to an sees file SYNOPSIS delta [-rSID] [-s] [-n] [-glistl [-m[mrlistl] [-y[commentl] [-p] files DESCRIPTION Delta is used to permanently introduce into the named sees file changes that were made to the file retrieved by get (1) (called the g-file, or generated file). Delta makes a delta to each named sees file. If a directory is named, delta behaves as though each file in the directory were specified as a named file, except that non-sees files (last component of the path name does not begin with sJ and unreadable files are silently ignored. If a name of - is given, the standard input is read (see WARNINGS); each line of the standard input is taken to be the name of an sees file to be processed. Delta may issue prompts on the standard output depending upon certain key letters specified and flags (see admin (1» that may be present in the sees file (see -m and -y keyletters below). Keyletter arguments apply independently to each named file. -rSID Uniquely identifies which delta is to be made to the sees file. The use of this key letter is necessary only if two or more outstanding gets for editing (get -e) on the same sees file were done by the same person (login name). The SID value specified with the -r keyletter can be either the SID specified on the get command line or the SID to be made as reported by the get command (see get (1». A diagnostic results if the specified SID is ambiguous, or, if necessary and omitted on the command line. -s Suppresses the issue, on the standard output, of the created delta's SID, as well as the number of lines inserted, deleted and unchanged in the sees file. -n Specifies retention of the edited g-file removed at completion of delta processing). -gUst Specifies a list (see get (1) for the definition of list) of deltas which are to be ignored when the file is accessed at the change level (SID) created by this delta. -m[mrlistl If the see~ file has the v flag set (see admin (1» then a Modification Request (MR) number must be supplied as the reason for creating the new delta. (normally If -m is not used and the standard input is a terminal, the prompt MRs? is issued on the standard output before the standard input is read; if the standard input is not a terminal, no prompt is issued. The MRs? prompt always precedes the comments? prompt (see -y keyletter). MRs in a list are separated by blanks and/or tab characters. An unescaped new-line character terminates the MR list. Note that if the v flag has a value (see admin(1», it is taken to be the name of a program (or shell procedure) '.' hich will validate the correctness of the MR numbers. If a non-zero exit status is returned from MR number validation program, delta terminates {it is assumed that - 1- DELTA (I) DELTA (I) the MR numbers were not all valid). -y[comment] Arbitrary text used to describe the reason for making the delta. A null string is considered a valid comment. If -y is not specified and the standard input is a terminal, the prompt comments? is issued on the standard output before the standard input is read; if the standard input is not a terminal, no prompt is issued. An unescaped new-line character terminates the comment text. -p Causes delta to print (on the standard output) the sees file differences before and after the delta is applied in a dijJ(l) format. FILES All files of the form ?-file are explained in the Source Code Control System User's Guide. The naming convention for these files is also described there. Existed before the execution of delta; removed after completion of delta. p-file Existed before the execution of delta; may exist after completion of delta. q-file Created during the execution of delta; removed after completion of delta. x-file Created during the execution of delta; renamed to sees file after completion of delta. z-file Created during the execution of delta; removed during the execution of delta. d-file Created during the execution of delta; removed after completion of delta. lusr/bin/bdiff Program to compute differences between the "gotten" file and the g-file. g-file WARNINGS Lines beginning with an SOH Asell character (binary 00I) cannot be placed in the sees file unless the SOH is escaped. This character has special meaning to sees (see sccsjile(5» and will cause an error. A get of many sees files, followed by a delta of those files, should be avoided when the get generates a large amount of data. Instead, multiple get/delta sequences should be used. If the standard input (-) is specified on the delta command line, the -m (if necessary) and -y keyletters must also be present. Omission of these keyletters causes an error to occur. Comments are limited to text strings of at most 512 characters. SEE ALSO admin(1), bdiff(l), cdc(l), get(1), help(1), prs(I), rmdel(l), sccsfile(4). Source Code Control System User's Guide in the UNIX System User's Guide. DIAGNOSTICS Use help(I) for explanations. - 2- DEROFF(I) DEROFF(I) NAME deroff - remove nroff/troff, tbl, and eqn constructs SYNOPSIS deroff [ -mx] [ -w] [ files ] DESCRIPTION Deroff reads each of the files in sequence and removes all troff(I) requests, macro calls, backslash constructs, eqn (1) constructs (between .EQ and .EN lines, and between delimiters), and tbl(1) descriptions, perhaps replacing them with white space (blanks and blank lines), and writes the remainder of the file on the standard output. Deroff follows chains of included files (.so and .ox troff commands); if a file has already been included, a .so naming that file is ignored and a .ox naming that file terminates execution. If no input file is given, deroff reads the standard input. The -m option may be followed by an m, s, or I. The -mm option causes the macros be interpreted so that only running text is output (i.e., no text from macro lines.) The -ml option forces the -mm option and also causes deletion of lists associated with the mm macros. If the -w option is given, the output is a word list, one "word" per line, with all other characters deleted. Otherwise, the output follows the original, with the deletions mentioned above. In text, a "word" is any string that contains at least two letters and is composed of letters, digits, ampersands (&), and apostrophes ('); in a macro call, however, a "word" is a string that begins with at least two letters and contains a total of at least three letters. Delimiters are any characters other than letters, digits, apostrophes, and ampersands. Trailing apostrophes and ampersands are removed from "words." SEE ALSO eqn(I), nroff(I), tbl(1), troff(I). BUGS Deroff is not a complete troff interpreter, so it can be confused by subtle constructs. Most such errors result in too much rather than too little output. The -ml option does not handle nested lists correctly. - 1- DIFF( I) DIFF(I) NAME diff - differential file comparator SYNOPSIS diff [ -efbh ] file 1 file2 DESCRIPTION DijJ tells what lines must be changed in two files to bring them into agreement. If filel (file2) is -, the standard input is used. If filel (file2) is a directory, then a file in that directory with the name file2 (file]) is used. The normal output contains lines of these forms: nl a n3,n4 nl,n2dn3 nl,n2 c n3,n4 These lines resemble ed commands to convert filel into file2. The numbers after the letters pertain to file2. In fact, by exchanging a for d and reading backward one may ascertain equally how to convert file2 into filel. As in ed, identical pairs where nl = n2 or n3 = n4 are abbreviated as a single number. Following each of these lines come all the lines that are affected in the first file flagged by <, then all the lines that are affected in the second file flagged by >. The -b option causes trailing blanks (spaces and tabs) to be ignored and other strings of blanks to compare equal. The -e option produces a script of a, c and d commands for the editor ed, which will recreate file2 from filel. The -f option produces a similar script, not useful with ed, in the opposite order. In connection with -e, the following shell program may help maintain multiple versions of a file. Only an ancestral file ($1) and a chain of version-to-version ed scripts ($2,$3, .. ') made by diff need be on hand. A "latest version" appears on the standard output. (shift; cat $.; echo 'l,$p') I ed - $1 Except in rare circumstances, dijJ finds a smallest sufficient set of file differences. Option -h does a fast, half-hearted job. It works only when changed stretches are short and well separated, but does work on files of unlimited length. Options -e and -f are unavailable with -h. FILES Itmp/d????? /usr/lib/diffh for -h SEE ALSO cmp(I), comm(I), ed(I). DIAGNOSTICS Exit status is 0 for no differences, 1 for some differences, 2 for trouble. BUGS Editing scripts produced under the -e or -f option are naive about creating lines consisting of a single period (.). - 1- DIFF3 (I) DIFF3 (t) NAME diff3 - 3-way differential file comparison SYNOPSIS diff3 [ - ex3 ] file 1 file2 file3 DESCRIPTION Diff3 compares three versions of a file, and publishes disagreeing ranges of text flagged with these codes: all three files differ ====1 filel is different ====2 file2 is different ====3 file3 is different The type of change suffered in converting a given range of a given file to some other is indicated in one of these ways: f: nl a Text is to be appended after line number nl in file f, where f = 1, 2, or 3. f: nl , n2 c Text is to be changed in the range line n 1 to line n2. If nl = n2, the range may be abbreviated to nl. The original contents of the range follows immediately after a c indication. When the contents of two files are identical, the contents of the lowernumbered file is suppressed. Under the -e option, diff3 publishes a script for the editor ed that will incorporate into file 1 all changes between file2 and file3, i.e., the changes that normally would be flagged ==== and ====3. Option -x (-3) produces a script to incorporate only changes flagged ==== (====3). The following command will apply the resulting script to file 1 . (cat script; echo ' 1,$p') I ed - file 1 FILES /tmp/d3* /usr/lib/diff3prog SEE ALSO diff(l). BUGS Text lines that consist of a single. will defeat -e. Files longer than 64K bytes won't work. - 1- DIFFMK(I) DIFFMK(l) NAME diffmk - mark differences between files SYNOPSIS diffmk name I name2 name3 DESCRIPTION Diffmk compares two versions of a file and creates a third file that includes "change mark" commands for nroff or troff(1). Name1 and name2 are the old and new versions of the file. Diffmk generates name3, which contains the lines of name2 plus inserted formatter "change mark" (.me) requests. When name3 is formatted, changed or inserted text is shown by I at the right margin of each line. The position of deleted text is shown by a single •. If anyone is so inclined, diffmk can be used to produce listings of C (or other) programs with changes marked. A typical command line for such use is: diffmk old.c new.c tmp; nroff macs tmp I pr where the file macs contains: .pl I .11 77 .nf .eo .nc ' The .ll request might specify a different line length, depending on the nature of the program being printed. The .eo and .nc requests are probably needed only for C programs. If the characters I and • are inappropriate, a copy of diffmk can be edited to change them (diffmk is a shell procedure). SEE ALSO diff(I), nroff( 1), troff(I). BUGS Aesthetic considerations may dictate manual adjustment of some output. File differences involving only formatting requests may produce undesirable output, i.e., replacing .sp by .sp 2 will produce a "change mark" on the preceding or following line of output. - I - DIRCMP(I) DIRCMP(I) NAME dircmp - directory comparison SYNOPSIS dircmp [ -d ] [ -s ] dirl dir2 DESCRIPTION Dircmp examines dirl and dir2 and generates various tabulated information about the contents of the directories. Listings of files that are unique to each directory are generated for all the options. If no option is entered, a list is output indicating whether the filenames common to both directories have the same contents. -d Compare the contents of files with the same name in both directories and output a list telling what must be changed in the two files to bring them into agreement. The list format is described in diff(l). -s Suppress messages about identical files. SEE ALSO cmp(l), diff(l). - 1- DIS (I) (3B20S only) DIS(I) NAME dis - 3B20S disassembler SYNOPSIS dis [-0] [-V] [- L] [-d sed [-da sec ] [- t sed [-I string] files DESCRIPTION The dis command produces an assembly language listing of each of its object file arguments. The listing includes assembly statements and the binary that produced those statements. The following options are interpreted by the disassembler and may be specified in any order. -0 Will print numbers in octal. Default is hexadecimal. -V Version number of the disassembler will be written to standard error. -L Invokes a lookup of C source labels in the symbol table for subsequent printing . . -d sec Disassembles the named section as data, printing the offset of the data from the beginning of the section. -da sec Disassembles the named section as data, printing the actual address of the data. -t sec Disassembles the named section as text. -1 string Will disassemble the library file specified as string. For example, one would issue the command dis -I x -I z to disassemble Iibx.a and libz.a. All libraries are assumed to be in lusr/lib. If the -d, -da or - t options are specified, only those named sections from each user supplied file name will be disassembled. Otherwise, all sections containing text will be disassembled. On output, a number enclosed in brackets at the beginning of a line, such as lSI, represents that the C breakpointable line number, starts with the following instruction. An expression such as <40> in the operand field, following a relative displacement for control transfer instructions, is the computed address within the section to which control will be transferred. A C function name will appear in the first column, followed by (). SEE ALSO as(I), cc(I), Id(I). DIAGNOSTICS The self explanatory diagnostics indicate errors in the command line or problems encountered with the specified files. - 1- DPD(tC) DPD(tC) NAME dpd, lpd - HONEYWELL sending daemon, line printer daemon SYNOPSIS lusr/lib/dpd lusr llib/lpd DESCRIPTION Dpd is the daemon for the 200-series DAT A-PHONE® data set or for a KMCll-B using vpm(7). It is designed to submit jobs to the HONEYWELL 6000 computer via the GRTS interface. Lpd is the daemon for a line printer. Dpd uses the directory lusrlspool/dpd. Lpd uses the directory lusrlspool/lpd. The file lock in either directory is used to prevent two daemons from becoming active simultaneously. After the program has successfully set the lock, it forks and the main path exits, thus spawning the daemon. The directory is scanned for files beginning with "dr'. Each such file is submitted as a job. Each line of a job file must begin with a key character to specify what to do with the remainder of the line. S L I B F U M N Q directs dpd to generate a unique snumb card. The snumb number is generated from the file snumb in the spooling directory in the case of the DATA-PHONE data set daemon. This key character is not used by /pd. specifies that the remainder of the line is to be sent as a literal. is the same as L, hut signals the $ IDENT card which is to be mailed back by the mail option. specifies that the rest of the line is a file name. That file is to be sent as binary cards. is the same as B except a form-feed is prepended to the file. specifies that the rest of the line is a file name. After the job has been transmitted, the file is unlinked. is followed by a user ID; after the job is sent, a message is mailed to the user via the mail (I) command to verify the sending of the job. is followed by a user file name, to be sent back under the mail option. is followed by a string of characters, which is a message to be sent back to the user under the mail option. (Not used by /pd). Any error encountered will cause the daemon to drop the call, wait up to 20 minutes, (only 10 seconds for /pd), and start over. This means that an improperly constructed "dr' file may cause the same job to be submitted every 20 minutes. Dpd is automatically initiated by all of the GCOS commands (dpr, gcat, gcosmail, fget, and fsend). Lpd is automatically initiated by the line printer command, /pr. To restart dpd or /pd On the case of hardware or software malfunction), it is necessary to first kill the old daemon Of it is still alive), and remove the lock file Of present), before initiating the new daemon. This can be done automatically by letc/rc when the system is brought up, in the event there were jobs left in the spooling directory when the system last went down. FILES /usr/spool/dpd/* /usr/spool/lpd/* /etc/passwd /dev/dn? /dev/du? /dev/vpm? spool area for GCOS daemons. spool area for line printer daemon. to get the user's name. ACU device. DATA-PHONE data set. VPM device to interface to KMCII-B. - 1- DPD(IC) /dev/lp DPD(IC) line printer device. SEE ALSO dpr(IC), fget(IC), fsend(IC), gcat(IC), gcosmail(IC), lpr(l). BUGS If a umask(1) of 077 is used, the print jobs may be spooled but won't be able to be printed. - 2- DPR(lC) DPR(IC) NAME dpr - off-line print SYNOPSIS dpr [ -destination ] [ options ] [ files ] DESCRIPTION Dpr causes the named files to be printed off-line at the specified destination, by GCOS at the Murray Hill Computation Center. GCOS identification must appear in the UNIX System password file (see passwd (4», or be supplied by the -i option. If no files are listed the standard input is assumed; thus dpr may be used as a filter. The destination is a two-character code which is taken to be a Murray Hill GCOS "station id." Useful codes are rl for quality print, and ql for quality print with special ribbon, both on regular wide paper. The codes r2 and q2 give the same print on narrow paper. The code mx is a Xerox 9700 printer. The default destination is on-line at the Murray Hill Computation Center. The following options, each as a separate argument, and in any combination (multiple outputs are permitted), may be given before or after the destination: -c Makes a copy of the file to be sent before returning to the user. -r Removes the file after sending it. -ffile Use file as a dummy file name to report back in the mail. (This is useful for distinguishing multiple runs, especially when dpr is being used as a filter). -ijob,bin Supply the GCOS "ident card" image as the parameter -ijob,bin where job is the GCOS job number and bin the GCOS bin number or any comment to the GCOS operators. -m When transmission is complete, reports by mail(1) the so-called snumb of the receiving GCOS job. The mail is sent by the UNIX daemon; there is no guarantee that the GCOS job ran successfully. This is the default option. - n Does not report the completion of transmission by mail( 1). -p Selects portrait mode. Used in conjunction with a XEROX 9700 printer. -sn Submits job to GCOS with service grade n (n=l, 2, 3, 4). Default is -s2. EXAMPLES The command: dpr -r -n errorl error2 will send the files errorl and error2 to GCOS for printing, removing the files after they have been sent, but not sending mail. The line: pr filel I dpr -sl -fjobl -rl will send the output of pr to GCOS for printing on the quality printer with service grade 1, and will send mail that jobl has been sent. FILES /etc/passwd /usr/lib/dpd /usr/spool/dpd/* user's identification and GCOS ident card. sending daemon. spool area. SEE ALSO dpd (I C), fget (I C), fsend (I C), gcat (I C) . - 1- DU(I) DU(I) NAME du - summarize disk usage SYNOPSIS du [ -ars ] [ names DESCRIPTION Du gives the number of blocks contained in all files and (recursively) directories within each directory and file specified by the names argument. The block count includes the indirect blocks of the file. If names is missing, . is used. The optional argument -s causes only the grand total (for each of the specified names) to be given. The optional argument -a causes an entry to be generated for each file. Absence of either causes an entry to be generated for each directory only. Du is normally silent about directories that cannot be read, files that cannot be opened, etc. The -r option will cause du to generate messages in such instances. A file with two or more links is only counted once. BUGS If the -a option is not used, non-directories given as arguments are not listed. If there are too many distinct linked files, du will count the excess files more than once. Files with holes in them will get an incorrect block count. - 1- DUMP(I) (not on PDP-I 1) DUMP(I) NAME dump - dump selected parts of an object file SYNOPSIS dump [-a] [-f] [-0] [-h] [-s] [-r] [-I] [-t] [-z name] files DESCRIPTION The dump command dumps selected parts of each of its object file arguments. This command will accept both object files and archives of object files. It processes each file argument according to one or more of the following options: -a Dump the archive header of each member of each archive file argument. -f Dump each file header. -0 Dump each optional header. - h Dump section headers. -s Dump section contents. -r Dump relocation information. -I Dump line number information. -t Dump symbol table entries. - z name Dump line number entries for the named function. The following modifiers are used in conjunction with the options listed above to modify their capabilities. -d number Dump the section number or range of sections starting at number and ending either at the last section number or number specified by +d. +d number Dump sections in the range either beginning with first section or beginning with section specified by -d. -n name Dump information pertaining only to the named entity. modifier applies to -h, -S, -r, -I, and -t. This -t index Dump only the indexed symbol table entry. The -t used in conjunction with +t, specifies a range of symbol table entries. +t index Dump the symbol table entries in the range ending with the indexed entry. The range begins at the first symbol table entry or at the entry specified by the -t option. -v Dump information in symbolic representation rather than numeric (e.g., C_STATIC instead of OX02). This modifier can be used with all the above options except -s and - 0 options of dump. -z name,number Dump line number entry or range of line numbers starting at number for the named function. +z number Dump line numbers starting at either function name or number specified by -z, up to number specified by +z. Blanks separating an option and its modifier are optional. The comma separating the name from the number modifying the -z option may be replaced by a blank. The dump command attempts to format the information it dumps in a meaningful way, printing certain information in character, hex, octal or decimal representation as appropriate. - 1- DUMP(I) (not on PDP-ll) SEE ALSO a.out(4), ar(4). - 2- DUMP(I) ECHO(I) ECHO(I) NAME echo - echo arguments SYNOPSIS echo [ arg ] ... DESCRIPTION Echo writes its arguments separated by blanks and terminated by a new-line on the standard output. It also understands C-like escape conventions; beware of conflicts with the shell's use of \: \b \c \f \0 \r \t \\ \n backspace print line without new-line form-feed new-line carriage return tab backslash the 8-bit character whose ASCII code is the 1-, 2- or 3-digit octal number n, which must start with a zero. Echo is useful for producing diagnostics in command files and for sending known data into a pipe. SEE ALSO sh(l) . - 1- ED(I) ED(I) NAME ed, red - text editor SYNOPSIS ed [ - red [ - ] [ -x ] [ file ] ] [ -x ] [ file ] DESCRIPTION Ed is the standard text editor. If the file argument is given, ed simulates an e command (see below) on the named file; that is to say, the file is read into ed's buffer so that it can be edited. The optional - suppresses the printing of character counts bye, r, and w commands, of diagnostics from e and q commands, and of the! prompt after a !shell command. If -x is present, an x command is simulated first to handle an encrypted file. Ed operates on a copy of the file it is editing; changes made to the copy have no effect on the file until a w (write) command is given. The copy of the text being edited resides in a temporary file called the buffer. There is only one buffer. Red is a restricted version of ed. It will only allow editing of files in the current directory. It prohibits executing shell commands via !shell command. Attempts to bypass these restrictions result in an error message (restricted shell) . Both ed and red support the !spec(4) formatting capability. After including a format specification as the first line of file and invoking ed with your terminal in stty -tabs or stty tab3 mode (see stty{I), the specified tab stops will automatically be used when scanning file. For example, if the first line of a file contained: <:t5,10,15 s72:> tab stops would be set at columns 5, 10 and 15, and a maximum line length of 72 would be imposed. NOTE: while inputting text, tab characters when typed are expanded to every eighth column as is the default. Commands to ed have a simple and regular structure: zero, one, or two addresses followed by a single-character command, possibly followed by parameters to that command. These addresses specify one or more lines in the buffer. Every command that requires addresses has default addresses, so that the addresses can very often be omitted. In general, only one command may appear on a line. Certain commands allow the input of text. This text is placed in the appropriate place in the buffer. While ed is accepting text, it is said to be in input mode. In this mode, no commands are recognized; all input is merely collected. Input mode is left by typing a period (.) alone at the beginning of a line. Ed supports a limited form of regular expression notation; regular expressions are used in addresses to specify lines and in some commands (e.g., s) to specify portions of a line that are to be substituted. A regular expression (RE) specifies a set of character strings. A member of this set of strings is said to be matched by the RE. The REs allowed by ed are constructed as follows: The following one-character REs match a single character: 1.1 An ordinary character (not one of those discussed in 1.2 below) is a onecharacter RE that matches itself. 1.2 A backslash (\) followed by any special character is a one-character RE that matches the special character itself. The special characters are: a. .,., l, and \ (period, asterisk, left square bracket, and backslash, respectively), which are always special, except when they appear within square brackets ([]; see 1.4 below). - 1- ED(I) ED(I) b. "(caret or circumflex), which is special at the beginning of an entire RE (see 3.1 and 3.2 below), or when it immediately follows the left of a pair of square brackets ([ I) (see 1.4 below). c. $ (currency symbol), which is special at the end of an entire RE (see 3.2 below). d. The character used to bound {i.e., delimit} an entire RE, which is special for that RE (for example, see how slash U) is used in the g command, below.) 1.3 A period (.) is a one-character RE that matches any character except new-line. 1.4 A non-empty string of characters enclosed in square brackets ([]) is a one-character RE that matches anyone character in that string. If, however, the first character of the string is a circumflex (,,), the onecharacter. RE matches any character except new-line and the remaining characters in the string. The" has this special meaning only if it occurs first in the string. The minus (-) may be used to indicate a range of consecutive ASCII characters; for example, [0 -91 is equivalent to [01234567891. The - loses this special meaning if it occurs first (after an initial ", if any) or last in the string. The right square bracket (J) does not terminate such a string when it is the first character within it (after an initial ", if any); e.g., [Ia -fJ matches either a right square bracket (]) or one of the letters a through f inclusive. The four characters listed in 1.2.a above stand for themselves within such a string of characters. The following rules may be used to construct REs from one-character REs: 2.1 A one-character RE is a RE that matches whatever the one-character RE matches. 2.2 A one-character RE followed by an asterisk (.) is a RE that matches zero or more occurrences of the one-character RE. If there is any choice, the longest leftmost string that permits a match is chosen. 2.3 A one-character RE followed by \(m\J, \(m,\}, or \(m,n\J is a RE that matches a range of occurrences of the one-character RE. The values of m and n must be non-negative integers less than 256; \(m\J matches exactly m occurrences; \{m,\J matches at least m occurrences; \{m,n\J matches any number of occurrences between m and n inclusive. Whenever a choice exists, the RE matches as many occurrences as possible. 2.4 The concatenation of REs is a RB that matches the concatenation of the strings matched by each component of the RE. 2.5 A RE enclosed between the character sequences \ ( and \) is a RE that matches whatever the unadorned RE matches. 2.6 The expression \n matches the same string of characters as was matched by an expression enclosed between \ ( and \) earlier in the same RE. Here n is a digit; the sub-expression specified is that beginning with the n-th occurrence of \ ( counting from the left. For example, the expression "\<'.\)\1$ matches a line consisting of two repeated appearances of the same string. Finally, an entire RE may be constrained to match only an initial segment or final segment of a line (or both): 3.1 A circumflex (,,) at the beginning of an entire RE constrains that RE to match an initial segment of a line. - 2- ED (l) ED (l) 3.2 A currency symbol ($) at the end of an entire RE constrains that RE to match a final segment of a line. The construction "entire RE$ constrains the entire RE to match the entire line. The null RE (e.g., / /) is equivalent to the last RE encountered. See also the last paragraph before FILES below. To understand addressing in ed it is necessary to know that at any time there is a current line. Generally speaking, the current line is the last line affected by a command; the exact effect on the current line is discussed under the description of each command. Addresses are constructed as follows: 1. The character. addresses the current line. 2. The character $ addresses the last line of the buffer. 3. A decimal number n addresses the n-th line of the buffer. 4. IX addresses the line marked with the mark name character x, which must be a lower-case letter. Lines are marked with the k command described below. 5. A RE enclosed by slashes U) addresses the first line found by searching forward from the line following the current line toward the end of the buffer and stopping at the first line containing a string matching the RE. If necessary, the search wraps around to the beginning of the buffer and continues up to and including the current line, so that the entire buffer is searched. See also the last paragraph before FILES below. 6. A RE enclosed in question marks (?) addresses the first line found by searching backward from the line preceding the current line toward the beginning of the buffer and stopping at the first line containing a string matching the RE. If necessary, the search wraps around to the end of the buffer and continues up to and including the current line. See also the last paragraph before FILES below. 7. An address followed by a plus sign (+) or a minus sign (-) followed by a decimal number specifies that address plus (respectively minus) the indicated number of lines. The plus sign may be omitted. 8. If an address begins with + or -, the addition or subtraction is taken with respect to the current line; e.g, -5 is understood to mean. -5. 9. If an address ends with + or -, then 1 is added to or subtracted from the address, respectively. As a consequence of this rule and of rule 8 immediately above, the address - refers to the line preceding the current line. (To maintain compatibility with earlier versions of the editor, the character " in addresses is entirely equivalent to -.) Moreover, trailing + and - characters have a cumulative effect, so - - refers to the current line less 2. 10. For convenience, a comma (,) stands for the address pair 1,$, while a semicolon (;) stands for the pair .,$. - 3- ED(I) ED(I) Commands may require zero, one, or two addresses. Commands that require no addresses regard the presence of an address as an error. Commands that accept one or two addresses assume default addresses when an insufficient number of addresses is given; if more addresses are given than such a command requires, the last one(s) are used. Typically, addresses are separated from each other by a comma (,). They may also be separated by a semicolon (;). In the latter case, the current line (.) is set to the first address, and only then is the second address calculated. This feature can be used to determine the starting line for forward and backward searches (see rules 5. and 6. above). The second address of any two-address sequence must correspond to a line that follows, in the buffer, the line corresponding to the first address. In the following list of ed commands, the default addresses are shown in parentheses. The parentheses are not part of the address; they show that the given addresses are the default. It is generally illegal for more than one command to appear on a line. However, any command (except e, f, r, or w) may be suffixed by I, nor p, in which case the current line is either listed, numbered or printed, respectively, as discussed below under the I, nand p commands. (.)a The append command reads the given text and appends it after the addressed line; is left at the last inserted line, or, if there were none, at the addressed line. Address 0 is legal for this command: it causes the "appended" text to be placed at the beginning of the buffer. The maximum number of characters that may be entered from a terminal is 256 per line (including the newline character). 0 (.)c The change command deletes the addressed lines, then accepts input text that replaces these lines; is left at the last line input, or, if there were none, at the first line that was not deleted. 0 (',oM The delete command deletes the addressed lines from the buffer. The line after the last line deleted becomes the current line; if the lines deleted were originally at the end of the buffer, the new last line becomes the current line. efile The edit command causes the entire contents of the buffer to be deleted, and then the named file to be read in; is set to the last line of the buffer. If no file name is given, the currently-remembered file name, if any, is used (see the f command). The number of characters read is typed; file is remembered for possible use as a default file name in subsequent e, r, and w commands. If file is replaced by!, the rest of the line is taken to be a shell {sh command whose output is to be read. Such a shell command is not remembered as the current file name. See also DIAGNOSTICS below. 0 (1» Efile The Edit command is like e, except that the editor does not check to see if any changes have been made to the buffer since the last w command. -4- ED(I) ED(I) f file If file is given, the file-name command changes the currentlyremembered file name to file; otherwise, it prints the currentlyremembered file name. (t , $) g/ RE / command list In the global command, the first step is to mark every line that matches the given RE. Then, for every such line, the given command list is executed with. initially set to that line. A single command or the first of a list of commands appears on the same line as the global command. All lines of a multi-line list except the last line must be ended with a \; a, i, and c commands and associated input are permitted; the • terminating input mode may be omitted if it would be the last line of the command list. An empty command list is equivalent to the p command. The g, G, v, and V commands are not permitted in the command list. See also BUGS and the last paragraph before FILES below. (t,$)G/RE/ In the interactive Global command, the first step is to mark every line that matches the given RE. Then, for every such line, that line is printed, . is changed to that line, and anyone command (other than one of the a, c, i, g, G, v, and V commands) may be input and is executed. After the execution of that command, the next marked line is printed, and so on; a new-line acts as a null command; an & causes the re-execution of the most recent command executed within the current invocation of G. Note that the commands input as part of the execution of the G command may address and affect any lines in the buffer. The G command can be terminated by an interrupt signal (ASCII DEL or BREAK). h The help command gives a short error message that explains the reason for the most recent ? diagnostic. H The Help command causes ed to enter a mode in which error messages are printed for all subsequent ? diagnostics. It will also explain the previous ? if there was one. The H command alternately turns this mode on and off; it is initially off. ( Ji The insert command inserts the given text before the addressed line; . is left at the last inserted line, or, if there were none, at the addressed line. This command differs from the a command only in the placement of the input text. Address 0 is not legal for this command. The maximum number of characters that may be entered from a terminal is 256 per line (including the newline character). C,. +OJ The join command joins contiguous lines by removing the appropriate new-line characters. If exactly one address is given, this command does nothing. CHu The mark command marks the addressed line with name x, which must be a lower-case letter. The address IX then addresses this line; • is unchanged. -5- ED(I) ED(I) <.,.)1 The list command prints the addressed lines in an unambiguous way: a few non-printing characters (e.g., tab, backspace) are represented by (hopefully) mnemonic overstrikes, all other non-printing characters are printed in octal, and long lines are folded. An I command may be appended to any other command other than e,j, r, or w. <.,.)ma The move command repositions the addressed line(s) after the line addressed by a. Address 0 is legal for a and causes the addressed line(s) to be moved to the beginning of the file; it is an error if address a falls within the range of moved lines; . is left at the last line moved. <.,.)0 The number command prints the addressed lines, preceding each line by its line number and a tab character; . is left at the last line printed. The n command may be appended to any other command other than e, j, r, or w. <.,.>p The print command prints the addressed lines; • is left at the last line printed. The p command may be appended to any other command other than e, j, r, or w; for example, dp deletes the current line and prints the new current line. p The editor will prompt with a • for all subsequent commands. The P command alternately turns this mode on and off; it is initially off. q The quit command causes ed to exit. No automatic write of a file is done (but see DIAGNOSTICS below). Q The editor exits without checking if changes have been made in the buffer since the last w command. ($)r file The read command reads in the given file after the addressed line. If no file name is given, the currently-remembered file name, if any, is used (see e and j commands). The currently-remembered file name is not changed unless file is the very first file name mentioned since ed was invoked. Address 0 is legal for r and causes the file to be read at the beginning of the buffer. If the read is successful, the number of characters read is typed; • is set to the last line read in. If file is replaced by!, the rest of the line is taken to be a shell (sh command whose output is to be read. For example, "$r !Is" appends current directory to the end of the file being edited. Such a shell command is not remembered as the current file name. (1» <.,.)s/RE/replacement/ or (., .>s/RE/replacement /g The substitute command searches each addressed line for an occurrence of the specified RE. In each line in which a match is found, all (non-overlapped) matched strings are replaced by the replacement if the global replacement indicator g appears after the command. If the global indicator does not appear, only the first occurrence of the matched string is replaced. It is an error for the substitution to fail on all addressed lines. Any character other than space or new-line may be used instead of / to delimit the RE and the replacement; . is left at the last line on which a substitution occurred. See also the last -6- EO(l) EO(l) paragraph before FILES below. An ampersand (&) appearing in the replacement is replaced by the string matching the RE on the current line. The special meaning of & in this context may be suppressed by preceding it by \. As a more general feature, the characters \n, where n is a digit, are replaced by the text matched by the n-th regular subexpression of the specified RE enclosed between \( and \). When nested parenthesized subexpressions are present, n is determined by counting occurrences of \ ( starting from the left. When the character % is the only character in the replacement, the replacement used in the most recent substitute command is used as the replacement in the current substitute command. The % loses its special meaning when it is in a replacement string of more than one character or is preceded by a \. A line may be split by substituting a new:line character into it. The new-line in the replacement must be escaped by preceding it by \. Such substitution cannot be done as part of a g or v command list. <.,.>ta This command acts just like the m command, except that a copy of the addressed lines is placed after address a (which may be 0); . is left at the last line of the copy. u The undo command nullifies the effect of the most recent command that modified anything in the buffer, namely the most recent a, c, d, g, i, j, m, r, s, t, v, G, or V command. (1 ,$hIRElcommand list This command is the same as the global command g except that the command list is executed with. initially set to every line that does not match the RE. (1 ,$)V IREI This command is the same as the interactive global command G except that the lines that are marked during the first step are those that do not match the RE. An address alone on a line causes the addressed line to be printed. A new-line alone is equivalent to . + Ip; it is useful for stepping forward through the buffer. If an interrupt signal (ASCII DEL or BREAK) is sent, ed prints a\. ? and retti'rns to its command level. Some size limitations: 512 characters per line, 256 characters per global command list, 64 characters per file name, and 128K characters in the buffer. The limit on the number of lines depends on the amount of user memory: each line takes I word. When reading a file, ed discards ASCII NUL characters and all characters after the last new-line. Files (e.g., a.out) that contain characters not in the ASCII set (bit 8 on) cannot be edited by ed. If the closing delimiter of a RE or of a replacement string (e.g., /) would be the last character before a new-line, that delimiter may be omitted, in which case the addressed line is printed. The following pairs of commands are equivalent: s/s1/s2 s/s1/s2/p glsl g/sl/p ?sl ?sl? FILES Itmp/e# ed.hup temporary; # is the process number. work is saved here if the terminal is hung up. DIAGNOSTICS ? ?file for command errors. for an inaccessible file. (use the help and Help commands for detailed explanations). If changes have been made in the buffer since the last w command that wrote the entire buffer, ed warns the user if an attempt is made to destroyed's buffer via the e or q commands: it prints ? and allows one to continue editing. A second e or q command at this point will take effect. The - command-line option inhibits this feature. SEE ALSO crypt(1), grep(t), sed(1), sh(1), stty(t), fspec(4), regexp(5). A Tutorial Introduction to the UNIX Text Editor by B. W. Kernighan. Advanced Editing on UNIX by B. W. Kernighan. CA VEA TS AND BUGS A ! command cannot be subject to a g or a v command. The! command and the! escape from the e, r, and w commands cannot be used if the the editor is invoked from a restricted shell (see sh (1» . The sequence \0 in a RE does not match a new-line character. The I command mishandles DEL. Files encrypted directly with the crypt (1) command with the null key cannot be edited. Characters are masked to 7 bits on input. -8- EFL(I) EFL(1) NAME eft - Extended Fortran Language SYNOPSIS eft [ options ] [ files ] DESCRIPTION Eft compiles a program written in the EFL language into clean Fortran on the standard output. Eft provides the C-like control constructs of ratfor(I): statement grouping with braces. decision-making: if, if-else, and select-case (also known as switch-case); while, for, Fortran do, repeat, and repeat ... until loops; multi-level break and next. EFL has C-like data structures, e.g.: struct { integer flags(3) character(8) name long real coords (2) } table(IOO) The language offers generic functions, assignment operators (+ =, & =, etc.), and sequentially evaluated logical operators (& & and II). There is a uniform input/output syntax: write(6,x,y:f(7,2), do i==l,lO { a(i,j),z.b(i) }) EFL also provides some syntactic "sugar": free-form input: mUltiple statements per line; automatic continuation; statement label names (not just numbers). comments: # this is a comment. translation of relational and logical operators: >, > =, &, etc., become .GT., .GE., .AND., etc. return expression to caller from function: return (expression) defines: define name replacement includes: include file Eft understands several option arguments: -w suppresses warning messages, -# suppresses comments in the generated program, and the default option -C causes comments to be included in the generated program. An argument with an embedded = (equal sign) sets an EFL option as if it had appeared in an option statement at the start of the program. Many options are described in the reference manual. A set of defaults for a particular target machine may be selected by one of the choices: system=unix, system=gcos, or system =cray. The default setting of the system option is the same as the machine the compiler is running on. Other specific options determine the style of input/output, error handling, continuation conventions, the number of characters packed per word, and default formats. - 1- EFL(1) EFL(l) Efl is best used withj77(1). SEE ALSO cd 1) , £17 (1), ratfor(I). The Programming Language EFL by S.1. Feldman. - 2- ENABLE(I) ENABLE(I) NAME enable, disable - enable/disable LP printers SYNOPSIS enable printers disable [ -c] [ -r[ reason]] printers DESCRIPTION Enable activates the named printers, enabling them to print requests taken by lp (1). Use lpstat (1) to find the status of printers. Disable deactivates the named printers, disabling them from printing requests taken by lp (1). By default, any requests that are currently printing on the designated printers will be reprinted in their entirety either on the same printer or on another member of the same class. Use lpstat (1) to find the status of printers. Options useful with disable are: -c Cancel any requests that are currently printing on any of the designated printers. -r[ reason] Associates a reason with the deactivation of the printers. This reason applies to all printers mentioned up to the next -r option. If the -r option is not present or the -r option is given without a reason, then a default reason will be used. Reason is reported by lpstat (1). FILES /usr/spoolllp/. SEE ALSO Ip(I),lpstat(1). - 1- ENV(I) ENV(l) NAME env - set environment for command execution SYNOPSIS env [-] [ name=value ] ... [command args DESCRIPTION Env obtains the current environment, modifies it according to its arguments, then executes the command with the modified environment. Arguments of the form name = value are merged into the inherited environment before the command is executed. The - flag causes the inherited environment to be ignored completely, so that the command is executed with exactly the environment specified by the arguments. If no command is specified, the resulting environment is printed, one namevalue pair per line. SEE ALSO sh(I), exec(2), profile(4), environ(5). - 1- EQN(1) EQN(t) NAME eqn, neqn, checkeq - format mathematical text for nroff or troff SYNOPSIS eqn [ -dxy ] [ -pn ] [ -sn ] [ -fn ] [ files ] neqn [ -dxy ] [ -pn ] [ -sn ] [ -fn ] [ files ] checkeq [ files ] DESCRIPTION Eqn is a troff(I) preprocessor for typesetting mathematical text on a phototypesetter, while neqn is used for the same purpose with nroff on typewriter-like terminals. Usage is almost always: eqn files I troff neqn files I nroff or equivalent. If no files are specified (or if - is specified as the last argument), these programs read the standard input. A line beginning with .EQ marks the start of an equation; the end of an equation is marked by a line beginning with .EN. Neither of these lines is altered, so they may be defined in macro packages to get centering, numbering, etc. It is also possible to designate two characters as delimiters; subsequent text between delimiters is then treated as eqn input. Delimiters may be set to characters x and y with the command-line argument -dxy or (more commonly) with delim xy between .EQ and .EN. The left and right delimiters may be the same character; the dollar sign is often used as such a delimiter. Delimiters are turned off by delim off. All text that is neither between delimiters nor between .EQ and .EN is passed through untouched. The program checkeq reports missing or unbalanced delimiters and .EQ/.EN pairs. Tokens within eqn are separated by spaces, tabs, new-lines, braces, double quotes, tildes, and circumflexes. Braces {} are used for grouping; generally speaking, anywhere a single character such as x could appear, a complicated construction enclosed in braces may be used instead. Tilde (-) represents a full space in the output, circumflex (,,) half as much. Subscripts and superscripts are produced with the keywords sub and sup. Thus x sub j makes Xj' a sub k sup 2 produces ai, while eX'+Y' is made with sup 2}. Fractions are made with over: a over b yields ~; e sup {x sup 2 +y sqrt square makes 1 roots: lover sqrt {ax sup 2 +bx +c} results in ---------- »i is made n The keywords from and to introduce lower and upper limits: lim n- oo 0 with lim from {n - > inf} sum from 0 to n x sub i. Left and right brackets, braces, etc., of the right height are made with left and right· left [x sup 2+ y sup 2over alpha right J - =- I produces [X2+~: 1~ I: Legal characters after left and right are braces, brackets, bars, c and f for ceiling and floor, and "" for nothing at all (useful for a right-side-only bracket). A left thing need not have a matching right thing. - 1- EQN(t) EQN(I) Vertical piles of things are made with pile, Ipile, cpile, and rpile: a pile {a above b above c} produces b. Piles may have arbitrary numbers of elec ments; Ipile left-justifies, pile and cpile center (but with different vertical spacing), and rpile right justifies. Matrices are made with matrix: matrix { Icol { x Xi sub i above y sub 2 } ceo I { 1 above 2 } } produces Y2 1 2' In addition, there is rcol for a right-justified column. Diacritical marks are made whh_dot, dotdot, hat, tilde, bar, vee, dyad, and under: x dot = f(t} bar is x=f(r), y dotdot bar -=- n under is = !!, and x vee - =- y dyad is x = y. y Point sizes and fonts can be changed with size n or size ±n, roman, italic, bold, and font n. Point sizes and fonts can be changed globally in a document by gsize nand gfont n, or by the command-line arguments -sn and -fn. Normally, subscripts and superscripts are reduced by 3 points from the previous size; this may be changed by the command-line argument -pn. Successive display arguments can be lined up. Place mark before the desired lineup point in the first equation; place lineup at the place that is to line up vertically in subsequent equations. Shorthands may be defined or existing keywords redefined with define: define thing % replacement % defines a new token called thing that will be replaced by replacement whenever it appears thereafter. The % may be any character that does not occur in replacement. Keywords such as sum (~), int (f), inf (00), and shorthands such as >= (~), != (~), and -> (-) are recognized. Greek letters are spelled out in the desired case, as in alpha (a), or GAMMA (r). Mathematical words such as sin, cos, and log are made Roman automatically. TrojJ(I) four-character escapes such as \(dd (:\:) and \(bs (@) may be used anywhere. Strings enclosed in double quotes (" ... ") are passed through untouched; this permits keywords to be entered as text, and can be used to communicate with trojJ(I) when all else fails. Full details are given in the manual cited below. SEE ALSO Typesetting Mathematics-User's Guide by B. W. Kernighan and L. L. Cherry. cw(I), mm(I), mmt(I), nroff(I), tbI(I), troff(I), eqnchar(5), mm(5), mv(5). BUGS To embolden digits, parentheses, etc., it is necessary to quote them, as in bold "12.3". See also BUGS under trojJ(I). -2- EXPR(l) EXPR(l) NAME expr - evaluate arguments as an expression SYNOPSIS expr arguments DESCRIPTION The arguments are taken as an expression. After evaluation, the result is written on the standard output. Terms of the expression must be separated by blanks. Characters special to the shell must be escaped. Note that 0 is returned to indicate a zero value, rather than the null string. Strings containing blanks or other special characters should be quoted. Integer-valued arguments may be preceded by a unary minus sign. Internally, integers are treated as 32-bit, 2's complement numbers. The operators and keywords are listed below. Characters that need to be escaped are preceded by \. The list is in order of increasing precedence, with equal precedence operators grouped within {} symbols. expr \1 expr returns the first expr if it is neither null nor 0, otherwise returns the second expr. expr \& expr returns the first expr if neither expr is null or 0, otherwise returns O. expr { =, \>, \> =, \<, \< =, != } expr returns the result of an integer comparison if both arguments are integers, otherwise returns the result of a lexical comparison. expr { +, - } expr addition or subtraction of integer-valued arguments. expr { \*, I, % } expr multiplication, division, or remainder of the integer-valued arguments. expr: expr The matching operator: compares the first argument with the second argument which must be a regular expression; regular expression syntax is the same as that of ed (1) , except that all patterns are "anchored" (i.e., begin with A) and, therefore, A is not a special character, in that context. Normally, the matching operator returns the number of characters matched (0 on failure). Alternatively, the \(. •. \) pattern symbols can be used to return a portion of the first argument. EXAMPLES 1. a='expr $a + l' adds 1 to the shell variable a. 2. # 'For $a equal to either "/usr/abc/file" or just "file'" expr $a : '.*1\(.*\)' \1 $a returns the last segment of a path name (i.e., file). Watch out for I alone as an argument: expr will take it as the division operator (see BUGS below). 3. # A better representation of example 2. expr I/$a : '.*1\(.*\)' The addition of the I I characters eliminates any ambiguity about the division operator and simplifies the whole expression. 4. expr $VAR : '.-' - 1- EXPR(I) EXPR(I) returns the number of characters in $VAR. SEE ALSO ed(l), sh(1). EXIT CODE As a side effect of expression evaluation, expr returns the following exit values: o if the expression is neither null nor 0 1 if the expression is null or 0 2 for invalid expressions. DIAGNOSTICS syntax error non-numeric argument for operator/operand errors if arithmetic is attempted on such a string BUGS After argument processing by the shell, expr cannot tell the difference between an operator and an operand except by the value. If $a is an =, the command: expr $a = '=' looks like: expr as the arguments are passed to expr (and they will all be taken as the operator). The following works: expr X$a = X= - 2- F77 (I) F77 (I) NAME f77 - Fortran 77 compiler SYNOPSIS f77 [ options ] files DESCRIPTION F77 is the UNIX Fortran 77 compiler; it accepts several types of file arguments: Arguments whose names end with .f are taken to be Fortran 77 source programs; they are compiled and each object program is left in the current directory in a file whose name is that of the source, with .0 substituted for .f. Arguments whose names end with .r or .e are taken to be RA TFOR or EFL source programs, respectively; these are first transformed by the appropriate preprocessor, then compiled by 177, producing .0 files. In the same way, arguments whose names end with .c or .s are taken to be C or assembly source programs and are compiled or assembled, producing .0 files. The following options have the same meaning as in cc (1) (see Id(1) for link editor options): -c -p -0 -S -ooutput -f -g Suppress link editing and produce .0 files for each source file. Prepare object files for profiling (see prof( I) ) . Invoke an object-code optimizer. Compile the named programs and leave the assembler-language output in corresponding files whose names are suffixed with .s. (No .0 files are created.) Name the'final output file output, instead of a.out. In systems without floating-point hardware, use a version of j77 that handles floating-point constants and links the object program with the floating-point interpreter. Generate additional information needed for the use of sdb (1) (VAX-I 1/780 only). The following options are peculiar to 177: -onetrip -1 -66 -C -1[24s] -u -u -w -F Compile DO loops that are performed at least once if reached. (Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.) Same as -onetrip. Suppress extensions which enhance Fortran 66 compatibility. Generate code for run-time subscript range-checking. Change the default size of integer variables (only valid on machines where the "normal" integer size is not equal to the size of a single precision real). -12 causes all integers to be 2-byte quantities, -14 (default) causes all integers to be 4-byte quantities, and - Is changes the default size of subscript expressions (only) from the size of an integer to 2 bytes. Do not "fold" cases. F77 is normally a no-case language (i.e. a is equal to A). The - U option causes 177 to treat upper and lower cases to be separate. Make the default type of a variable undefined, rather than using the default Fortran rules. Suppress all warning messages. If the option is -w66, only Fortran 66 compatibility warnings are suppressed. Apply EFL and RA TFOR preprocessor to relevant files, put the result in files whose names have their suffix changed to .of. (No - I - F77 (1) F77 (I) files are created.) Apply the M4 preprocessor to each EFL or RATFOR source file before transforming with the ratfor (1) or eft (l) processors. The remaining characters in the argument are used as an EFL flag argument whenever processing a .e file. The remaining characters in the argument are used as a RA TFOR flag argument whenever processing a .r file. .0 -m -E -R Other arguments are taken to be either link-editor option arguments or 177compilable object programs (typically produced by an earlier run), or libraries of 177 -compilable routines. These programs, together with the results of any compilations specified, are linked Gn the order given) to produce an executable program with the default name a.out . FILES file.[fresc] file.o a.out .lfordpidl? /usrllib/f77pass 1 /lib/cl llib/c2 /usrllib/libF77.a /usrllib/libI77.a llib/libc.a input file object file linked output temporary compiler pass 2 optional optimizer intrinsic function library Fortran 110 library C library; see Section 3 of this Manual. SEE ALSO A Portable Fortran 77 Compiler by S. I. Feldman and P. J. Weinberger. asa(l), ccO), efl(l), fsplit(l), ld(l), m4(1), prof 0), ratfor(l), sdb(l). I DIAGNOSTICS The diagnostics produced by 177 itself are intended to be self-explanatory. Occasional messages may be produced by the link editor Id(l). - 2- I FACTOR(I) FACTOR(I) NAME factor - factor a number SYNOPSIS factor [ number ] DESCRIPTION When factor is invoked without an argument, it waits for a number to be typed in. If you type in a positive number less than 256 (about 7 .2x 10 16 ) it will factor the number and print its prime factors; each one is printed the proper number of times. Then it waits for another number. It exits if it encounters a zero or any non-numeric character. If factor is invoked with an argument, it factors the number as above and then exits. Maximum time to factor is proportional to .In and occurs when n is prime or the square of a prime. It takes 1 minute to factor a prime near 10 14 on a PDP-ll. DIAGNOSTICS "Ouch" for input out of range or for garbage input. - 1- FGET(IC) (DEC only) FGET(IC) NAME fget, fget.demon - retrieve files from the HONEYWELL 6000 SYNOPSIS fget [ options ] [ files ] lusr Ilib/fget.demon time DESCRIPTION Fget arranges to have one or more GCOS files sent to the UNIX System. GCOS identification must appear in the UNIX System password file (see passwd(4», or be supplied by the -i option. Normally, the files retrieved will appear in the UNIX System user's current directory under the GCOS file name. Fget.demon is the daemon that does the actual retrieval. The GCOS catalog from which the files are obtained depends on the form of the file name argument. If the file name has only embedded slashes, then it is assumed to be a full GCOS path name and that file is retrieved. If the file name has no. embedded slashes or begins with a slash, then the GCOS catalog from which the file is retrieved is the same as the UNIX System login name of the person who issues the command. If, however, a user has a different name in the third field of the GCOS "ident card image" (which image is extracted from the UNIX System password file-see passwd(4», this name is taken as the GCOS catalog name. Whatever GCOS catalog is finally used, the files must either have general read permission or the user must have arranged that the user ID network has read permission on that catalog (see fsend Cl C». This can be accomplished with the GCOS command: filsys mc ,(r)/networkl The UNIX System file into which the retrieved GCOS file will ultimately be written is initialized with one line containing the complete GCOS file name. If the file contains the initial line for an extended period, it means that GCOS is down or something has gone horribly wrong and you should try again. The following options, each as a separate argument may appear in any order but must precede all file arguments. -a Retrieve files as ASCII (default). - b Retrieve files as binary. -ddir Use dir as the UNIX System directory into which retrieved files are written. -ffile Use file as the UNIX System filename for the retrieved file. -ijob,bin Supply the GCOS "ident card" image as the parameter -ijob,bin where job is the GCOS job number and bin the GCOS bin number or any comment to the GCOS operators. -m When the request has been forwarded to GCOS, report by mail(I) the so-called snumb of the receiving job; mail is sent by the UNIX System dpdClC) daemon; there is no guarantee that the GCOS job ran or that the UNIX System retrieved the output. This is the default option. -n Do not report the forwarding of the request by mail(I). -0 Print the on-line GCOS accounting output. -t Toss out the on-line GCOS accounting output. This is the default option. -sn Submit job to GCOS with service grade n (n=l, 2, 3, 4). Default is -sl. -uuserid Use userid as the GCOS catalog name for all files. The GCOS job to send the requested files to the UNIX System is sent by the dpd Cl C) daemon. Receiving these files is then done by a corresponding - 1- FGET(IC) (DEC only) FGET(IC) retrieval daemon, fget.demon, which stays alive for a minimum of time seconds, (default 360), or until it has successfully retrieved one or more files. The file glock in the spooling directory lusrlspool/dpd is used to prevent two daemons from becoming active simultaneously. After the program has successfully set the lock, it forks and the main path exits, thus spawning the daemon. GRTS is interrogated for any output for the daemon's station-id. If none, fget.demon will wait up to time seconds, interrogating GRTS every minute or so to see if any output has arrived. All problems and successful transactions are recorded in the errors file in the spooling directory. To restart fget.demon (in the case of hardware or software malfunction), it is necessary to first kill the old fget.demon (if still alive), and remove the lock file (if present), before initiating fget.demon. This should be done automatically by letclrc when the system is brought up, in case there are any files waiting to come over. EXAMPLES The command: fget -ugcosme -t -n -d/usr/meltest filel file2 will retrieve the GCOS files gcosme/filel and gcosme/file2, as the UNIX System files lusr/me/test/filel and lusr/me/test/file2, respectively, but will not generate any mail or GCOS accounting output as a result of the transaction. FILES letc/passwd /usrllib/dpd /usr/spool/dpd/* /dev/dn? /dev/du? /dev/vpb? /dev/vpm? user's identification and GCOS ident card. sending daemon. spool area. ACU device. DATA-PHONE data set. Bottom VPM device to interface to KMCII-B. Top VPM device to interface to KMCII-B. SEE ALSO dpd (I C), dpr(I C), fsend (I C), passwd (4). - 2- FILE (I) FILE(l) NAME file - determine file type SYNOPSIS file [ -c ] [ -f ffile ] [ -m mfile ] arg ... DESCRIPTION File performs a series of tests on each argument in an attempt to classify it. If an argument appears to be ASCII, file examines the first 512 bytes and tries to guess its language. If an argument is an executable a.out, file will print the version stamp, provided it is greater than 0 (see ld (1». If the -f option is given, the next argument is taken to be a file containing the names of the files to be examined. File uses the file /etc/magic to identify files that have some sort of magic ( number, that is, any file containing a numeric or string constant that indicates its type. Commentary at the beginning of fete/magic explains its format. The -m option instructs file to use an alternate magic file. The -c flag causes file to check the magic file for format errors. This validation is not normally carried out for reasons of efficiency. No file typing is done under -c. - 1- FIND(I) FIND (I) NAME find - find files SYNOPSIS find path-name-list expression DESCRIPTION Find recursively descends the directory hierarchy for each path name in the path-name-Iist (i.e., one or more path names) seeking files that match a boolean expression written in the primaries given below. In the descriptions, the argument n is used as a decimal integer where +n means more than n, -n means less than nand n means exactly n. -name file True if file matches the current file name. Normal shell argument syntax may be used if escaped (watch out for [, ? and .). -perm onum True if the file permission flags exactly match the octal number onum (see chmod (1». If onum is prefixed by a minus sign, more flag bits (017777, see stat (2» become significant and the flags are compared: (flags&onum) ==onum -type c True if the type of the file is c, where c is b, c, d, p, or f for block special file, character special file, directory, fifo (a.k.a named pipe), or plain file. -links n True if the file has n links. -user uname True if the file belongs to the user uname. If uname is numeric and does not appear as a login name in the /etc/passwd file, it is taken as a user ID. -group gname True if the file belongs to the group gname. If gname is numeric and does not appear in the /etc/group file, it is taken as a group 10. -size n True if the file is n blocks long (512 bytes per block). -atime n True if the file has been accessed in n days. - mtime n True if the file has been modified in n days. -ctime n True if the file has been changed in n days. -exec cmd True if the executed cmd returns a zero value as exit status. The end of cmd must be punctuated by an escaped semicolon. A command argument {} is replaced by the current path name. -ok cmd Like -exec except that the generated command line is printed with a question mark first, and is executed only if the user responds by typing y. -print Always true; causes the current path name to be printed. -cpio device Write the current file on device in cpio (4) format (5120 byte records). -newer file True if the current file has been modified more recently than the argument file. ( expression ) True if the parenthesized expression is true (parentheses are special to the shell and must be escaped). The primaries may be combined using the following operators (in order of decreasing precedence): - 1- FIND(I) FIND(I) I) The negation of a primary (! is the unary not opera tor) . 2) Concatenation of primaries (the and operation is implied by the juxtaposition of two primaries). 3) Alternation of primaries (-0 is the or operator). EXAMPLE To remove all files named a.out or •. 0 that have not been accessed for a week: find / \ ( -name a.out -0 -name '•. 0' \) -atime +7 -exec rm {} \; FILES /etc/passwd, /etc/group SEE ALSO cpio(1), sh(l), test(1), stat(2), cpio(4), fs(4). - 2- FSEND(IC) (DEC only) FSEND(IC) NAME fsend - send files to the HONEYWELL 6000 SYNOPSIS fsend [ options ] [ files ] DESCRIPTION Fsend arranges to have one or more UNIX System files sent to HONEYWELL GCOS. GCOS identification must appear in the UNIX System password file (see passwd(4)), or be supplied by the -i option. If no names appear, the standard input is sent; thus fsend may be used as a filter. Normally, the catalog on the HONEYWELL file system in which the new file will appear is the same as the UNIX System login name of the person who issues the command. If, however, a user has a different name in the third field of the GCOS "ident card image" (which image is extracted from the UNIX System password file; see passwd(4)), this name is taken as the GCOS catalog name. Whatever GCOS catalog is finally used, the user must have arranged that the user 10 "network" has create permission on that catalog, or read and write permission on the individual files. The latter is more painful but preferred if access to other files in the catalog is to be fully controlled. This can be accomplished with the GCOS commands: filsys mc ,c/network/,ml 1 or filsys cf ,w/network/,bl ,unlimitedl The name of the GCOS file is ordinarily the same as the name of the UNIX System file. When the standard input is sent, the GCOS file is normally taken to be pipe.end. The following options, each as a separate argument, may appear in any order but must precede all file name arguments. -a Send succeeding files as ASCII (default). If the last character of the file is not a new-line, one is added. All other characters are preserved. -b Send succeeding files as binary. Each UNIX System byte is right justified in a GCOS byte and the bytes packed into 120-byte logical records (30 GCOS words). The last record is padded out with NULs. -c Make copies of the files to be sent before returning to the user. -r Remove the files after sending them. -ffile Use file as the GCOS file name for the file being sent. -ijob,bin Supply the GCOS "ident card" image as the parameter -ijob,bin where job is the GCOS job number and bin the GCOS bin number or any comment to the GCOS operators. -m When transmission is complete, report by rnai/(1) the so-called snumb of the receiving GCOS job. The mail is sent by the UNIX System daemon; there is no guarantee that the GCOS job ran successfully. This is the default option. -n Do not report the completion of transmission by mail (1). -0 Print the on-line GCOS accounting output. -t Toss out the on-line GCOS accounting output. This is the default option. -sn Submit job to·GCOS with service grade n (n=l, 2, 3, 4). Default is -51. -uuserid Use userid as the GCOS catalog name for all files. -x Send succeeding files to be archived by the GCOS archive command. - I - FSEND(lC) (DEC only) FSEND(lC) EXAMPLE The command: fsend -t -u unixsup -b -fgfile ufile will send the binary UNIX System file ufile to become the GCOS file unixsup/gfile, and will not produce anyon-line GCOS accounting output. FILES /etc/passwd /usr/lib/dpd /usr/spool/dpd/* user's identification and GCOS ident card. sending daemon. spool area. SEE ALSO dpd(IC), dpr(IC), fget(1C), gcat(1C), mail(l). - 2- FSPLIT(I) FSPLIT(I) NAME fsplit - split f77, ratfor, or efl files SYNOPSIS fsplit options files DESCRIPTION Fsplit splits the named file (s) into separate files, with one procedure per file. A procedure includes blockdata, function, main, program, and subroutine program segments. Procedure X is put in file X.f, X.r, or X.e depending on the language option chosen, with the following exceptions: main is put in the file MAIN.lefrJ and unnamed blockdata segments in the files biockdataN.lefr1 where N is a unique integer value for each file. The following options pertain: -f (default> Input files are 177. -r Input files are ratfor. -e Input files are Eft. -s Strip 177 input lines to 72 or fewer characters with trailing blanks removed. SEE ALSO csplit(I), efl(I), f77(1), ratfor(1), split(1). - 1- GCAT(IC) GCAT(1C) NAME gcat - send phototypesetter output to the HONEYWELL 6000 SYNOPSIS gcat [ options ] [ files ] DESCRIPTION Gcat arranges to have troff(1) output sent to the phototypesetter or debugging devices (STARE or line printer) attached to the HONEYWELL system. GCOS identification must appear in the UNIX System password file (see passwd(4», or be supplied by the -i option. If no file name appears, the standard input is sent; thus gcat may be used as an output pipe for troff(I). The option -g (for GCOS) must be used with the troff(l) command to make things work properly. This command string sends output to the GCOS phototypesetter: troff -g file I gcat The following options, each as a separate argument, and in any combination (multiple outputs are permitted), may be given after gcat: -ph -st Send output to the phototypesetter. This is a default option. Send output to STARE for fast turn-around. -tx Send output as text to the line printer (useful for checking spelling, hyphenation, pagination, etc.). -du Send output to the line printer, dummied up to make the format correct. Because many characters are dropped, the output is unreadable, but useful for seeing the shape (margins, etc.) of the document. -c Make a copy of the file to be sent before returning to the user. -r Remove the file after sending it. -ffile Use file as a dummy file name to report back in the mail. (This is useful for distinguishing multiple runs, especially when gcat is being used as a filter). -ijob,bin Supply the GCOS "ident card" image as the parameter -ijob,bin where job is the GCOS job number and bin the GCOS bin number or any comment to the GCOS operators. -m When transmission is complete, report by mai/(I) the so-called snumb of the receiving GCOS job. The mail is sent by the UNIX daemon; there is no guarantee that the GCOS job ran successfully. This is a default option. - n Do not report the completion of transmission by mail (1) . -0 Print the on-line GCOS accounting output. -t Toss out the on-line GCOS accounting output. This is a default option. -sn Submit job to GCOS with service grade n (n=l, 2, 3, 4). Default is -st. If none of the output options are specified, phototypesetter output (-ph) is assumed by default. EXAMPLE The command: troff -g myfile I gcat -st -im1234,m567,myname -fmyfile will send the output of troff(I) to STARE, with the GCOS "ident card" specifying "M1234,M567,MYNAME", and will report back that myfile has been sent. FILES / etc/ passwd /usrlIib/dpd user's identification and GCOS ident card. sending daemon. - 1- GCAT(IC) lusr/spool/dpd/. GCAT(IC) spool area. SEE ALSO dpd(IC), dpr(IC), fget(IC), fsend(1C), trofH!). - 2- GCOSMAIL(IC) GCOSMAIL (IC) NAME gcosmail - send mail to HIS user SYNOPSIS gcosmail [ option ... ] [ HISuserid ... ] DESCRIPTION Gcosmai/ takes the standard input up to an end of file and sends it as mail to the named users on the HONEYWELL 6000 system, using the HIS mail command. The following options are recognized by gcosmail: -fjile Use file as a dummy file name to report back in the mail. (This is useful for distinguishing multiple runs). -ijob,bin Supply the GCOS "ident card" image as the parameter -ijob,bin where job is the GeOS job number and bin the GeOS bin number or any comment to the GeOS operators. -m When transmission is complete, report by mai/O) the so-called snumb of the receiving GeOS job. The mail is sent by the UNIX System daemon; there is no guarantee that the GeOS job ran successfully. This is a default option. - n Do not report the completion of transmission by mail (1) . -0 Print the on-line GeOS accounting output. -t Toss out the on-line GeOS accounting output. This is a default option. -sn Submit job to GeOS with service grade n (n=l, 2, 3, 4). Default is -st. FILES / etc/ passwd /usrllib/dpd /usr/spool/dpd/. user's identification and GeOS ident card. sending daemon. spool area. SEE ALSO dpd(IC), dpr(IC), fsend(IC). - 1- GDEV(IG) GDEV(IG) NAME hpd, erase, hardcopy, tekset, td - graphical device routines and filters SYNOPSIS bpd [-options] [GPS file 00.1 erase bard copy tekset td [-eurn] [GPS file 000] DESCRIPTION All of the graphics (I G». bpd commands described below reside in /usr/bin/graf (see Hpd translates a GPS (see gps(4», to instructions for the HewlettPackard 7221A Graphics Plotter. A viewing window is computed from the maximum and mInImUm points in file unless the -u or -r option is provided. If no file is given, the standard input is assumed. Options are: cn Select character set n, n between 0 and 5 (see the HP7221 A Plotter Operating and Programming Manual, Appendix A). pn Select pen numbered n, n between 1 and 4 inclusive. rn Window on GPS region n, n between 1 and 25 inclusive. sn Slant characters n degrees clockwise from the vertical. u Window on the entire GPS universe. xdn Set x displacement of the viewport's lower left corner to n inches. xvn Set width of viewport to n inches. ydn Set y displacement of the viewport's lower left corner to n inches. yvn Set h~ight of viewport to n inches. erase Erase sends characters to a Tektronix 4010 series storage terminal to erase the screen. hardcopy When issued at a Tektronix display terminal with a hard copy unit, hardcopy generates a screen copy on the unit. tekset Tekset sends characters to a Tektronix terminal to clear the display screen, set the display mode to alpha, and set characters to the smallest font. td Td translates a GPS to scope code for a Tektronix 4010 series storage terminal. A viewing window is computed from the maximum and minimum points in file unless the -u or -r option is provided. If no file is given, the standard input is assumed. Options are: e Do not erase screen before initiating display. rn Display GPS region n, n between 1 and 25 inclusive. u Display the entire GPS universe. SEE ALSO ged (I G), graphics (I G), gps(4). - 1- GED(tG) GED(IG) NAME ged - graphical editor SYNOPSIS ged [-euRrnl [GPS file .. .l DESCRIPTION Ged is an interactive graphical editor used to display, construct, and edit GPS files on Tektronix 4010 series display terminals. If GPS file(s) are given, ged reads them into an internal display buffer and displays the buffer. The GPS in the buffer can then be edited. If - is given as a file name, ged reads a GPS from the standard input. Ged accepts the following command line options: e Do not erase the screen before the initial display. rn Display region number n. u Display the entire GPS universe. R Restricted shell invoked on use of !. A GPS file is composed of instances of three graphical objects: lines, arc, and text. Arc and lines objects have a start point, or object-handle, followed by zero or more points, or point-handles. Text has only an object-handle. The objects are positioned within a Cartesian plane, or universe, having 64K (-32K to +32K) points, or universe-units, on each axis. The universe is divided into 25 equal sized areas called regions. Regions are arranged in five rows of five squares each, numbered 1 to 25 from the lower left of the universe to the upper right. Ged maps rectangular areas, called windows, from the universe onto the display screen. Windows allow the user to view pictures from different locations and at different magnifications. The universe-window is the window with minimum magnification, i.e. the window that views the entire universe. The homewindow is the window that completely displays the contents of the display buffer. COMMANDS Ged commands are entered in stages. Typically each stage ends with a (return). Prior to the final the command may be aborted by typing rubout. The input of a stage may be edited during the stage using the erase and kill characters of the calling shell. The prompt • indicates that ged is waiting at stage 1. Each command consists of a subset of the following stages: 1. Command line A command line consists of a command name followed by argument(s) followed by a . A command name is a single character. Command arguments are either option(s) or a filename. Options are indicated by a leading -. 2. Text Text is a sequence of characters terminated by an unescaped . (120 lines of text maximum.) 3. Points Points is a sequence of one or more screen locations (maximum of 30) indicated either by the terminal cross hairs or by name. The prompt for entering points is the appearance of the crosshairs. When the crosshairs are visible, typing: sp (space) enters the current location as a point. The point is identified with a number. - 1- GED(IG) GED(IG) $n enters the previous point numbered n. >x labels the last point entered with the upper case letter x. $x enters the point labeled x. establishes the previous points as the current points. At the start of a command the previous points are those locations given with the previous command. echoes the current pOints. $.n enters the point numbered n from the previous points. # erases the last point entered. @ erases all of the points entered. 4. Pivot The pivot is a single location, entered by typing or by using the $ operator, and indicated with a •. 5. Destination The destination is a single location entered by typing or by using $. COMMAND SUMMARY In the summary, characters typed by the user are printed in bold. Command stages are printed in italics. Arguments surrounded by brackets "[ J" are optional. Parentheses "0" surrounding arguments separated by "or" means that exactly one of the arguments must be given. Construct commands: Arc [ -echo,style,weight] points Box [ -echo,style,weight] points Circle [ -echo,style,weight] points Hardware [ -echo] text points Lines [ -echo,style,weight] points Text [ - angle,echo,heigh t,mid -poin t,right -poin t, text, weigh t] points Edit commands: Delete t ex t ( - (universe or view) or points) Edit [-angle,echo,height,style,weightJ ( - (universe or view) or points) Kopy [ -echo,points,x] points pivot destination Move [ -echo,points,x] points pivot destination Rotate [ -angle,echo,kopy,x] points pivot destination Scale [ -echo,factor,kopy,x] points pivot destination View commands: coordinates points erase new-display object-handles ( - (universe or view) or points) - 2- GED(IG) GED(IG) point-handles ( - (labelled-points or universe or view) or points) view ( - (home or universe or region) or [-x] pivot destination) x [ -view] points zoom [-out] points Other commands: quit or Quit read [-angle,echo,height,mid-point,right-point,text,weight] name [destination] set [ -angle,echo,factor,beight,kopy,mid-point,points, point,style,text, weight,x] write file-name file- right- !command ? Options: Options specify parameters used to construct, edit, and view graphical objects. If a parameter used by a command is not specifed as an option, the default value for the parameter will be used (see set below). The format of command options is - option [,option ] where option is key Ie tter[ value]. Flags take on the values of true or false indicated by + and - respectively. If no value is given with a flag, true is assumed. Object options: anglen Angle of n degrees. echo factorn When true, echo additions to the display buffer. Scale factor is n percent. heightn Height of text is n universe-units (0 ~ n < 1280). kopy When true, copy rather than move. mid-point When true, mid-point is used to locate text string. points When true, operate on points otherwise operate on objects. right-point When true, right-point is used to locate text string. styletype Line style set to one of following types: so solid da dashed dd dot-dashed do dotted Id long-dashed - 3- GED(tG) GED(IG) text When false, text strings are outlined rather than drawn. weighttype Sets line weight to one of following types: n narrow m medium b bold Area options: home Reference the home-window. out Reduce magnification. regionn Reference region n. universe Reference the universe-window. view Reference those objects currently in view. x Indicate the center of the referenced area. COMMAND DESCRIPTIONS Construct commands: Arc and Lines behave similarly. Each consists of a command line followed by points. The first point entered is the object-handle. Successive points are pointhandles. Lines connects the handles in numerical order. Arc fits a curve to the handles (currently a maximum of 3 points will be fit with a circular arc; splines will be added in a later version). Box and Circle are special cases of Lines and Arc, respectively. Box generates a rectangle with sides parallel to the universe axes. A diagonal of the rectangle would connect the first point entered with the last point. The first point is the object-handle. Point-handles are created at each of the vertices. Circle generates a circular arc centered about the point numbered zero and passing through the last point. The circle's object-handle coincides with the last point. A point-handle is generated 180 degrees around the circle from the object-handle. Text and Hardware generate text objects. Each consists of a command line, text and points. Text is a sequence of characters delimited by . Multiple lines of text may be entered by preceding a cr with a backslash (i.e. \cr). The Text command creates software generated characters. Each line of software text is treated as a separate text object. The first point entered is the object-handle for the first line of text. The Hardware command sends the characters in text uninterpreted to the terminal. Edit commands: Edit commands operate on portions of the display buffer called defined-areas. A defined-area is referenced either with an area option or interactively. If an area option is not given, the perimeter of the defined-area is indicated by points. If no point is entered, a small defined-area is built around the location of the . This is useful to reference a single point. If only one point is entered, the location of the is taken in conjunction with the point to indicate a diagonal of a rectangle. A defined-area referenced by points will be outlined with dotted lines. Delete removes all objects whose object-handle lies within a defined-area. The universe option removes all objects and erases the screen. - 4 - GED(IG) GED(IG) Edit modifies the parameters of the objects within a defined-area. Parameters that can be edited are: angle angle of text height height of text style style of lines and arc weight weight of lines, arc, and text. Kopy (or Move) copies (or moves) object- and/or point-handles within a defined-area by the displacement from the pivot to the destination. Rotate rotates objects within a defined-area around the pivot. If the kopy flag is true then the objects are copied rather than moved. Scale For objects whose object-handles are within a defined-area, point displacements from the pivot are scaled by factor percent. If the kopy flag is true then the objects are copied rather than moved. View commands: coordina tes prints the location of point(s) in universe- and screen-units. erase clears the screen (but not the display buffer). new-display erases the screen then displays the display buffer. object-handles (or point-handles) labels object- (and/or point-handles) that lie within the defined-area with o (or P). point-handles identifies labelled points when the labelled-points flag is true. view moves the window so that the universe point corresponding to the pivot coincides with the screen point corresponding to the destination. Options for home, universe, and region display particular windows in the universe. x indicates the center of a defined-area. Option view indicates the center of the screen. zoom decreases (zoom out) or increases the magnification of the viewing window based on the defined-area. For increased magnification, the window is set to circumscribe the defined-area. For a decrease in magnification the current window is inscribed within the defined-area. Other commands: quit or Quit exit from ged. quit responds with ? if the display buffer has not been written since the last modification. read inputs the contents of a file. If the file contains a GPS it is read directly. If the file contains text it is converted into text object(s). The first line of a text file begins at destination. set when given option(s) resets default parameters, otherwise it prints current default values. write outputs the contents of the display buffer to a file. -5- GED(IG) GED(IG) escapes ged to execute a UNIX System command. ? lists ged commands. SEE ALSO gdev(lG), graphics(lG), sh(t), gps(4). An Introduction to the Graphical Editor in the UNIX System Graphics Guide. -6- GET(I) GET(l) NAME get - get a version of an sees file SYNOPSIS get [-rSID] [-ccutoff] [-ilistl [-xlistl [-aseq-no.1 [-k] [-e] [-Hp11 [-p] [-m] [-0] [-s] [-b] [-g] [-t] file ... DESCRIPTION Get generates an ASCII text file from each named sees file according to the specifications given by its keyletter arguments, which begin with -. The arguments may be specified in any order, but all key letter arguments apply to all named sees files. If a directory is named, get behaves as though each file in the directory were specified as a named file, except that non-sees files (last component of the path name does not begin with s.) and unreadable files are silently ignored. If a name of - is given, the standard input is read; each line of the standard input is taken to be the name of an sees file to be processed. Again, non-sees files and unreadable files are silently ignored. The generated text is normally written into a file called the g-file whose name is derived from the sees file name by simply removing the leading s.; (see also FILES, below). Each of the key letter arguments is explained below as though only one sees file is to be processed, but the effects of any key letter argument applies independently to each named file. -rSID The Sees IDentification string (SID) of the version (delta) of an sees file to be retrieved. Table I below shows, for the most useful cases, what version of an sees file is retrieved (as well as the SID of the version to be eventually created by delta (1) if the -e key letter is also used), as a function of the SID specified. -ccutoJJ Cutoff date-time, in the form: YY[MM[DD[HH[MM[SS]]]]] No changes (deltas) to the sees file which were created after the specified cutoff date-time are included in the generated ASCII text file. Units omitted from the date-time default to their maximum possible values; that is, -c7502 is equivalent to -c750228235959. Any number of non-numeric characters may separate the various 2 digit pieces of the cutoff date-time. This feature allows one to specify a cutoff date in the form: "-c77 /2/2 9:22:25". Note that this implies that one may use the %E% and %U% identification keywords (see below) for nested gets within, say the input to a send (I C) command: -!get "-c%E% %U%" s.file -e Indicates that the get is for the purpose of editing or making a change (delta) to the sees file via a subsequent use of delta (1). The -e keyletter used in a get for a particular version (SID) of the sees file prevents further gets for editing on the same SID until delta is executed or the j (joint edit) flag is set in the sees file (see admin (1)). Concurrent use of get -e for different SIDs is always allowed. If the g-file generated by get with an -e keyletter is accidentally ruined in the process of editing it, it may be regenerated by reexecuting the get command with the -k keyletter in place of the -e keyletter. - I - GET(l) GET (I) sees file protection specified via the ceiling, floor, and authorized user list stored in the sees file (see admin (I» are enforced when the -e keyletter is used. -b Used with the -e keyletter to indicate that the new delta should have an SID in a new branch as shown in Table 1. This keyletter is ignored if the b flag is not present in the file (see admin (1) or if the retrieved delta is not a leaf delta. (A leaf delta is one that has no successors on the sees file treeJ Note: A branch delta may always be created from a non-leaf delta. -ilist A list of deltas to be included (forced to be applied) in the creation of the generated file. The list has the following syntax: ::=
I ,
::= SID I SID - SID SID, the sees Identification of a delta, may be in any form shown in the "SID Specified" column of Table 1. Partial SIDs are interpreted as shown in the "SID Retrieved" column of Table 1. -xlist A list of deltas to be excluded (forced not to be applied) in the creation of the generated file. See the -i keyletter for the list format. -k Suppresses replacement of identification keywords (see below) in the retrieved text by their value. The - k keyletter is implied by the -e keyletter. -Up] Causes a delta summary to be written into an I-file. If -Ip is used then an I-file is not created; the delta summary is written on the standard output instead. See FILES for the format of the I-file. -p Causes the text retrieved from the sees file to be written on the standard output. No g-file is created. All output which normally goes to the standard output goes to file descriptor 2 instead, unless the -s key letter is used, in which case it disappears. -s Suppresses all output normally written on the standard output. However, fatal error messages (which always go to file descriptor 2) remain unaffected. -m Causes each text line retrieved from the sees file to be preceded by the SID of the delta that inserted the text line in the sees file. The format is: SID, followed by a horizontal tab, followed by the text line. -0 Causes each generated text line to be preceded with the %M% identification keyword value (see below). The format is: %M% value, followed by a horizontal tab, followed by the text line. When both the -m and - 0 keyletters are used, the format is: %M% value, followed by a horizontal tab, followed by the -m keyletter generated format. -g Suppresses the actual retrieval of text from the sees file. It is primarily used to generate an I-file, or to verify the existence of a particular SID. -t Used to access the most recently created ("top") delta in a given release (e.g., -rl), or release and level (e.g., -r1.2). -aseq-no. The delta sequence number of the sees file delta (version) to be retrieved (see sccsfile(5». This keyletter is used by the comb (1) command; it is not a generally useful keyletter, and users should - 2- GET(l) GET(l) not use it. If both the -r and -a key letters are specified, the -a keyletter is used. Care should be taken when using the -a key letter in conjunction with the -e keyletter, as the SID of the delta to be created may not be what one expects. The -r key letter can be used with the -a and -e keyletters to control the naming of the SID of the delta to be created. For each file processed, get responds (on the standard output) with the SID being accessed and with the number of lines retrieved from the sees file. If the -e key letter is used, the SID of the delta to be made appears after the SID accessed and before the number of lines generated. If there is more than one named file or if a directory or standard input is named, each file name is printed (preceded by a new-line) before it is processed. If the -i keyletter is used included deltas are listed following the notation "Included"; if the -x keyletter is used, excluded deltas are listed following the notation "Excluded". SID* Specified nonei nonei R R R R R R R.L R.L R.L R.L.B R.L.B R.L.B.S R.L.B.S R.L.B.S * ** *** # t TABLE 1. Determination of sees Identification String Other SID SID of Delta Conditions Usedt Retrieved to be Created no R defaults to mR mR.(mL+U mR.mL yes R defaults to mR mR.mL.(mB+I).1 mR.mL no R> mR mR.mL R.l *** mR.(mL+l) no R=mR mR.mL yes mR.mL. (mB+ 1).1 R> mR mR.mL yes R=mR mR.mL.(mB+I).1 mR.mL R < mR and hR.mL. (mB+ 1).1 hR.mL** R does not exist Trunk succ.# R.mL.(mB+1).1 in release > R R.mL and R exists no R.(L+U No trunk succ. R.L R.L.(mB+l).1 yes No trunk succ. R.L Trunk succ. R.L. (mB+ 1).1 R.L in release ~ R no R.L.B. (mS+ U No branch succ. R.L.B.mS R.L.(mB+1).1 yes No branch succ. R.L.B.mS R.L.B.(S+I) no No branch succ. R.L.B.S R.L.(mB+1).1 yes No branch succ. R.L.B.S R.L. (mB+ 1).1 Branch succ. R.L.B.S -b Keyletter "R", "L", "B", and "S" are the "release", "level", "branch", and "sequence" components of the SID, respectively; "m" means "maximum". Thus, for example, "R.mL" means "the maximum level number within release R"; "R.L. (mB+ 1).1" means "the first sequence number on the new branch (i.e., maximum branch number plus one) of level L within release R". Note that if the SID specified is of the form "R.L", "R.L.B", or "R.L.B.S", each of the specified components must exist. "hR" is the highest existing release that is lower than the specified, nonexistent, release R. , This is used to force creation of the first delta in a new release. Successor. The -b keyletter is effective only if the b flag (see admin is present in the file. An entry of - means "irrelevant". This case applies if the d (default SID) flag is not present in the file. If the d flag is present in the file, then the SID obtained from the d flag is (1» - 3- GET(I) GET(I) interpreted as if it had been specified on the command line. Thus, one of the other cases in this table applies. IDENTIFICATION KEYWORDS Identifying information is inserted into the text retrieved from the sees file by replacing identification keywords with their value wherever they occur. The following keywords may be used in the text stored in an sees file: Keyword %M% %1% %R% %L% %8% %S% %D% %H% %T% %E% %G% %U% %Y% %F% %P% %Q% %C% %Z% %W% %A% Value Module name: either the value of the m flag in the file (see admin(1», or if absent, the name of the secs file with the leading s. removed. SCCS identification (SIO) (%R%.%L%.%B%.%S%) of the retrieved text. Release. Level. Branch. Sequence. Current date (YY IMM/OO). Current date (MM/OD/YY). Current time (HH:MM:SS). Date newest applied delta was created (YY IMM/OO). Date newest applied delta was created (MM/OO/YY). Time newest applied delta was created (HH:MM:SS). Module type: value of the t flag in the secs file (see admin (1». sces file name. Fully qualified sces file name. The value of the q flag in the file (see admin (1». Current line number. This keyword is intended for identifying messages output by the program such as "this shouldn't have happened" type errors. It is not intended to be used on every line to provide sequence numbers. The 4-character string @(#) recognizable by what (1). A shorthand notation for constructing what (1) strings for the UNIX System program files. %W% = %Z%%M% %I% Another shorthand notation for constructing what (1) strings for non-UNIX System program files. %A% = %Z%%Y% %M% %I%%Z% FILES Several auxiliary files may be created by get, These files are known generically as the g-file, I-file, p-file, and z-file. The letter before the hyphen is called the tag. An auxiliary file name is formed from the SCCS file name: the last component of all sees file names must be of the form s.module-name, the auxiliary files are named by replacing the leading s with the tag. The g-file is an exception to this scheme: the g-file is named by removing the s. prefix. For example, s.xyz.c, the auxiliary file names would be xyz.c, I.xyz.c, p.xyz.c, and z.xyz.c, respectively. The g-file, which contains the generated text, is created in the current directory (unless the -p keyletter is used). A g-file is created in all cases, whether or not any lines of text were generated by the get. It is owned by the real user. If the -k keyletter is used or implied its mode is 644; otherwise its mode is 444. Only the real user need have write permission in the current directory. The I-file contains a table showing which deltas were applied in generating the retrieved text. The I-file is created in the current directory if the -I keyletter is used; its mode is 444 and it is owned by the real user. Only the real user need have write permission in the current directory. -4- GET(I) GET(I) Lines in the I-jile have the following format: a. b. c. d. e. f. g. h. 1. A blank character if the delta was applied; • otherwise. A blank character if the delta was applied or wasn't applied and ignored; • if the delta wasn't applied and wasn't ignored. A code indicating a "special" reason why the delta was or was not applied: "I": Included. "X": Excluded. "C": Cut off (by a -c keyletter). Blank. sees identification (SID). Tab character. Date and time (in the form YY IMM/DD HH:MM:SS) of creation. Blank. Login name of person who created delta. The comments and MR data follow on subsequent lines, indented one horizontal tab character. A blank line terminates each entry. The p-jile is used to pass information resulting from a get with an -e key letter along to delta. Its contents are also used to prevent a subsequent execution of get with an -e keyletter for the same SID until delta is executed or the joint edit flag, j, (see admin (1)) is set in the sees file. The p -jile is created in the directory containing the sees file and the effective user must have write permission in that directory. Its mode is 644 and it is owned by the effective user. The format of the p-jile is: the gotten SID, followed by a blank, followed by the SID that the new delta will have when it is made, followed by a blank, followed by the login name of the real user, followed by a blank, followed by the datetime the get was executed, followed by a blank and the -i key letter argument if it was present, followed by a blank and the -x key letter argument if it was present, followed by a new-line. There can be an arbitrary number of lines in the p-jile at any time; no two lines can have the same new delta SID. The z-jile serves as a lock-out mechanism against simultaneous updates. Its contents are the binary (2 bytes) process ID of the command (i.e., get) that created it. The z-jile is created in the directory containing the sees file for the duration of get. The same protection restrictions as those for the p-jile apply for the z-jile. The z-jile is created mode 444. SEE ALSO admin(1), delta(1), help(1), prs(1), what(I), sccsfile(4). Source Code Control System in the UNIX System Support Tools Guide. DIAGNOSTICS Use help (1) for explanations. BUGS If the effective user has write permission (either explicitly or implicitly) in the directory containing the sees files, but the real user doesn't, then only one file may be named when the -e keyletter is used. -5- GETOPT(I) GETOPT(I) NAME getopt - parse command options SYNOPSIS set - - 'getopt optstring $.' DESCRIPTION Getopt is used to break up options in command lines for easy parsing by shell procedures and to check for legal options. Optstring is a string of recognized option letters (see getopt(3C)); if a letter is followed by a colon, the option is expected to have an argument which mayor may not be separated from it by white space. The special option - - is used to delimit the end of the options. If it is used explicitly, getopt will recognize it; otherwise, getopt will generate it; in either case, getopt will place it at the end of the options. The shell's positional parameters ($1 $2 .. .) are reset so that each option is preceded by a and is in its own positional parameter; each option argument is also parsed into its own positional parameter. EXAMPLE The following code fragment shows how one might process the arguments for a command that can take the options a or b, as well as the option 0, which requires an argument: set - - 'getopt abo: $*' if [ $? != 0 ] then echo $USAGE exit 2 fi for In $* do case $i in -a I -b) -0) --) FLAG=$i; shift;; OARG=$2; shift 2;; shift; break;; esac done This code will accept any of the following as equivalent: cmd cmd cmd cmd -aoarg file file -a -0 arg file file -oarg -a file file -a -oarg - - file file SEE ALSO sh (1), getopt(3C). DIAGNOSTICS Getopt prints an error message on the standard error when it encounters an option letter not included in optstring. - 1- GRAPH(tG) GRAPH(lG) NAME graph - draw a graph SYNOPSIS graph [ options ] DESCRIPTION Graph with no options takes pairs of numbers from the standard input as abscissas and ordinates of a graph. Successive points are c((>nnected by straight lines. The graph is encoded on the standard output for display by the tplot (I G) filters. If the coordinates of a point are followed by a non-numeric string, that string is printed as a label beginning on the point. Labels may be surrounded with quotes ", in which case they may be empty or contain blanks and numbers; labels never contain new-lines. The following options are recognized, each as a separate argument: -a Supply abscissas automatically (they are missing from the input); spacing is given by the next argument (default 1) . A second optional argument is the starting point for automatic abscissas (default 0 or lower limit given by -x). -b Break {disconnect} the graph after each label in the input. -c Character string given by next argument is default label for each point. -g Next argument is grid style, 0 no grid, 1 frame with ticks, 2 full grid (default). -I Next argument is label for graph. -m Next argument is mode (style) of connecting lines: 0 disconnected, 1 connected (default). Some devices give distinguishable line styles for other small integers (e.g., the Tektronix 4014: 2=dotted, 3=dash-dot, 4=short-dash, 5=long-dash). -s Save screen, don't erase before plotting. -x [ 1 ] If 1 is present, x axis is logarithmic. Next 1 (or 2) arguments are lower (and upper) x limits. Third argument, if present, is grid spacing on x axis. Normally these quantities are determined automatically. -y [ 1 ] Similarly for y. -h Next argument is fraction of space for height. -w Similarly for width. -r Next argument is fraction of space to move right before plotting. -u Similarly to move up before plotting. -t Transpose horizontal and vertical axes. {Option -x now applies to the vertical axis.} A legend indicating grid range is produced with a grid unless the -s option is present. If a 'specified lower limit exceeds the upper limit, the axis is reversed. SEE ALSO graphics(IG), spline(IG), tplot(IG). BUGS Graph stores all points internally and drops those for which there isn't room. Segments that run out of bounds are dropped, not windowed. Logarithmic axes may not be reversed. - 1- GRAPHICS(IG) GRAPHICS (IG) NAME graphics - access graphical and numerical commands SYNOPSIS graphics [ -r ] DESCRIPTION Graphics appends the path name lusr/bin/graf to the current $PATH value, changes the primary shell prompt to ", and executes a new shell. The directory lusr/bin/graf contains all of the Graphics subsystem commands. If the -r option is given, access to the graphical commands is created in a restricted environment; that is, $PATH is set to I:rbin:/usr/rbin:/bin:/usr/bin:lusrlbin/graf and the restricted shell, rsh, is invoked. To restore the environment that existed prior to issuing the graphics command, type EOT (control-d on most terminals). To logoff from the graphics environment, type quit. The command line format for a command in graphics is command name followed by argument(s). An argument may be a file name or an option string. A file name is the name of any UNIX System file except those beginning with -. The file name - is the name for the standard input. An option string consists of - followed by one or more option(s). An option consists of a key letter possibly followed by a value. Options may be separated by commas. The graphical commands have been partitioned into four groups. Commands that manipulate and plot numerical data; see stat (I G). Commands that generate tables of contents; see toc(lG). Commands that interact with graphical devices; see gdev (I G) and ged(IG). A collection of graphical utility commands; see guti[(l G). A list of the graphics commands can be generated by typing whatis in the graphics environment. SEE ALSO gdev(IG), ged(IG), gutil(IG), stat(IG), toc(IG), gps(4). UNIX System Graphics Guide. - 1- GREEK(I) GREEK(I) NAME greek - select terminal filter SYNOPSIS greek [ - Tterminal ] DESCRIPTION Greek is a filter that reinterprets the extended character set, as well as the reverse and half-line motions, of a 128-character TELETYPE@ Teletypewriter Model 37 terminal (which is the nroff default terminal) for certain other terminals. Special characters are simulated by overstriking, if necessary and possible. If the argument is omitted, greek attempts to use the environment variable $TERM (see environ (5». The following terminals are recognized currently: 300 300-12 300s 300s-12 450 450-12 1620 1620-12 2621 2640 2645 4014 hp tek 300. 300 in 12-pitch. 300s. 300s in 12-pitch. 450. 450 in 12-pitch. Diablo 1620 (alias DASI 450). Diablo 1620 (alias DASI 450) in 12-pitch. Hewlett-Packard 2621, 2640, and 2645. Hewlett-Packard 2621, 2640, and 2645. Hewlett-Packard 2621, 2640, and 2645. Tektronix 4014. Hewlett-Packard 2621, 2640, and 2645. Tektronix 4014. DASI DASI DASI DASI DASI DASI FILES lusr/bin/300 lusr/bin/300s I usr Ibin/40 14 lusr/bin/450 lusr/bin/hp SEE ALSO 300(1), 4014(1), 450(1), eqn(1), environ (5), greek (5), term (5). - 1- hp(1), mm(1), tplot (1 G) , nroff(1) , GREP(I) GREP(I) NAME grep, egrep, fgrep - search a file for a pattern SYNOPSIS grep [ options ] expression [ files ] egrep [ options ] [ expression ] [ files ] fgrep [ options ] [ strings ] [ files ] DESCRIPTION Commands of the grep family search the input files (standard input default) for lines matching a pattern. Normally, each line found is copied to the standard output. Grep patterns are limited regular expressions in the style of ed(1); it uses a compact non-deterministic algorithm. Egrep patterns are full regular expressions; it uses a fast deterministic algorithm that sometimes needs exponential space. Fgrep patterns are fixed strings; it is fast and compact. The following options are recognized: All lines but those matching are printed. (Exact) only lines matched in their entirety are printed (fgrep only). -c Only a count of matching lines is printed. -I Only the names of files with matching lines are listed (once), separated by new-lines. -0 Each line is preceded by its relative line number in the file. -b Each line is preceded by the block number on which it was found. This is sometimes useful in locating disk block numbers by context. -s The error messages produced for nonexistent or unreadable files are suppressed (grep only). -e expression Same as a simple expression argument, but useful when the expression begins with a - (does not work with grep). -f file The regular expression (egrep) or strings list (fgrep) is taken from the file. -v -x In all cases, the file name is output if there is more than one input file. Care should be taken when using the characters $, *, [, A, I, (, ), and \ in expression, because they are also meaningful to the shell. It is safest to enclose the entire expression argument in single quotes' ... '. Fgrep searches for lines that contain one of the strings separated by new-lines. Egrep accepts regular expressions as in ed(1), except for \( and \), with the addition of: 1. 2. 3. 4. A regular expression followed by + matches one or more occurrences of the regular expression. A regular expression followed by ? matches 0 or 1 occurrences of the regular expression. Two regular expressions separated by I or by a new-line match strings that are matched by either. A regular expression may be enclosed in parentheses () for grouping. The order of precedence of operators is [1, then .? I and new-line. +, then concatenation, then SEE ALSO ed (1), sed (I), sh (1) . DIAGNOSTICS Exit status is 0 if any matches are found, 1 if none, 2 for syntax errors or inaccessible files (even if matches were found). - 1- GREP(I) GREP(I) BUGS Ideally there should be only one grep, but we don't know a single algorithm that spans a wide enough range of space-time tradeoffs. Lines are limited to 256 characters; longer lines are truncated. Egrep does not recognize ranges, such as [a - z], in character classes. -2- GUTIL(IG) GUTIL(IG) NAME gutil - graphical utilities SYNOPSIS command-name [options] [files] DESCRIPTION Below is a list of miscellaneous device independent utility commands found in /usr/bin/graf. If no files are given, input is from the standard input. All output is to the standard output. Graphical data is stored in GPS format; see gps(4). bel cvrtopt - send bel character to terminal [ =sstring fstring istring tstring] [args] - options converter Cvrtopt reformats args (usually the command line arguments of a calling shell procedure) to facilitate processing by shell procedures. An arg is either a file name (a string not beginning with a -, or a - by itself) or an option string (a string of options beginning with a -). Output is of the form: -option -option . .. file name (s) All options appear singularly and preceding any file names. Options that take values (e.g., - r 1.1) or are two letters long must be described through options to cvrtopt. Cvrtopt is usually used with set in the following manner as the first line of a shell procedure: set - 'cvrtopt =[options] $@' Options to cvrtopt are: sstring String accepts string values. fstring String accepts floating point numbers as values. istring String accepts integers as values. tstring String is a two letter option name that takes no value. String is a one or two letter option name. gd [ GPS files ] - GPS dump Gd prints a human readable listing of GPS. gtop [ -rn u ] [GPS files ] - GPS to plot (4) filter Gtop transforms a GPS into plot(4) commands displayable by plot filters. GPS objects are translated if they fall within the window that circumscribes the first file unless an option is given. Options: rn translate objects in GPS region n. u translate all objects in the GPS universe. pd [ plot (5) files ] - plot (4) dump Pd prints a human readable listing of plot (4) format graphical commands. ptog [ plot (5) files ] - plot (4) to GPS filter Ptog transforms plot (4) commands into a GPS. quit remcom - terminate session [files ] - remove comments Remcom copies its input to its output with comments removed. Comments are as defined in C (i.e., /. comment ./). - 1- GUTIL(IG) GUTIL(IG) whatis [-0 ] [ names ] - brief online documentation Whatis prints a brief description of each name given. If no name is given, then the current list of description names is printed. whatis \. prints out every description. Option: o just print command options yoo file - pipe fitting Yoo is a piping primitive that deposits the output of a pipeline into a file used in the pipeline. Note that, without yoo, this is not usually successful as it causes a read and write on the same file simultaneously. SEE ALSO graphics(1G), gps(4). - 2- HELP (I ) HELP(I) NAME help - ask for help SYNOPSIS help [args] DESCRIPTION Help finds information to explain a message from a command or explain the use of a command. Zero or more arguments may be supplied. If no arguments are given, help will prompt for one. The arguments may be either message numbers (which normally appear in parentheses following messages) or command names, of one of the following types: type 1 Begins with non-numerics, ends in numerics. The nonnumeric prefix is usually an abbreviation for the program or set of routines which produced the message (e.g., ge6, for message 6 from the get command). type 2 Does not contain numerics (as a command, such as get) type 3 Is all numeric (e.g., 212) The response of the program will be the explanatory information related to the argument, if there is any. When all else fails, try "help stuck". FILES /usr/lib/help directory containing files of message text. /usr/lib/help/helploc file containing locations of help files not in /usr/lib/help. DIAGNOSTICS Use help (1) for explanations. - 1- HP(I) HP(I) NAME hp - handle special functions of HP 2640 and 2621-series terminals SYNOPSIS bp [ -e ] [ -m ] DESCRIPTION Hp supports special functions of the Hewlett-Packard 2640 series of terminals, with the primary purpose of producing accurate representations of most nroff output. A typical use is: nroff - h files ... I hp Regardless of the hardware options on your terminal, hp tries to do sensible things with underlining and reverse line-feeds. If the terminal has the "display enhancements" feature, subscripts and superscripts can be indicated in distinct ways. If it has the "mathematical-symbol" feature, Greek and other special characters can be displayed. The flags are as follows: -e It is assumed that your terminal has the "display enhancements" feature, and so maximal use is made of the added display modes. Overstruck characters are presented in the Underline mode. Superscripts are shown in Half-bright mode, and subscripts in Half-bright, Underlined mode. If this flag is omitted, hp assumes that your terminal lacks the "display enhancements" feature. In this case, all overstruck characters, subscripts, and superscripts are displayed in Inverse Video mode, i.e., dark-on-light, rather than the usuallight-on-dark. -m Requests minimization of output by removal of new-lines. Any contiguous sequence of 3 or more new-lines is converted into a sequence of only 2 new-lines; i.e., any number of successive blank lines produces only a single blank output line. This allows you to retain more actual text on the screen. With regard to Greek and other special characters, hp provides the same set as does 300(1), except that "not" is approximated by a right arrow, and only the top half of the integral sign is shown. The display is adequate for examining output from neqn. DIAGNOSTICS "line too long" if the representation of a line exceeds 1,024 characters. The exit codes are 0 for normal termination, 2 for all errors. SEE ALSO 300(1), coHO, eqn(1), greek(1), nroff(l), tbl(1). BUGS An "overstriking sequence" is defined as a printing character followed by a backspace followed by another printing character. In such sequences, if either printing character is an underscore, the other printing character is shown underlined or in Inverse Video; otherwise, only the first printing character is shown (again, underlined or in Inverse Video). Nothing special is done if a backspace is adjacent to an ASCII control character. Sequences of control characters (e.g., reverse line-feeds, backspaces) can make text "disappear"; in particular, tables generated by tbl (1) that contain vertical lines will often be missing the lines of text that contain the "foot" of a vertical line, unless the input to hp is piped through co[(O. Although some terminals do provide numerical superscript characters, no attempt is made to display them. - 1- HPIO(I) (3B20S only) HPIO(I) NAME hpio - HP 2645A terminal tape file archiver SYNOPSIS bpio -ofrc] file .. , bpio -ifrta] f -n cound DESCRIPTION Hpio is designed to take advantage of the tape drives on Hewlett Packard 2645A terminals. Up to 255 UNIX System files can be archived onto a tape cartridge for off-line storage or for transfer to another UNIX System. The actual number of files depends on the sizes of the files. One file of about 115,000 bytes will almost fill a tape cartridge. Almost 300 I-byte files will fit on a tape, but the terminal will not be able to retrieve files after the first 255. This manual page is not intended to be a guide for using tapes on HP 2645A terminals, but tries to give enough information to be able to create and read tape archives and to position a tape for access to a desired file in an archive. Hpio - 0 (copy out) copies the specified file (s), together with path name and status information to a tape drive on your terminal (which is assumed to be positioned at the beginning of a tape or immediately after a tape mark). The left tape drive is used by default. Each file is written to a separate tape file and terminated with a tape mark. When hpio finishes, the tape is positioned following the last tape mark written. Hpio -i (copy in) extracts a file(s) from a tape drive (which is assumed to be positioned at the beginning of a file that was previously written by a bpio -0). The default action extracts the next file from the left tape drive. Hpio always leaves the tape positioned after the last file read from or written to the tape. Tapes should always be rewound before the terminal is turned off. To rewind a tape depress the green function button, then function key 5, and then select the appropriate tape drive by depressing either function key 5 for the left tape drive or function key 6 for the right. If several files have been archived onto a tape, the tape may be positioned at the beginning of a specific file by depressing the green function button, then function key 8, followed by typing the desired file number (I -255) with no RETURN, and finally function key 5 for the left tape or function key 6 for the right. The desired file number may also be specified by a signed number relative to the current file number. The meanings of the available options are: Use the right tape drive. Include a checksum at the end of each file. The checksum is always checked by bpio -i for each file written with this option by bpio -0. n count The number of input files to be extracted is set to count. If this option is not given, count defaults to 1. An arbitrarily large count may be specified to extract all files from the tape. Hpio will stop at the end of data mark on the tape. Print a table of contents only. No files are created. Printed information gives the file size in bytes, the file name, the file access modes, and whether or not a checksum is included for the file. a Ask before creating a file. Hpio -i normally prints the file size and name, creates and reads in the file, and prints a status message when the file has been read in. If a checksum is included with the file, it reports whether the checksum matched its computed value. With this option, the file size and name are printed followed by a ? Any response beginning with y or Y will cause the file to be copied in as above. Any other response will cause the file to be skipped. r c - I - HPIO(1) (3B20S only) HPIO(1) \ FILES /dev/tty?? to block messages while accessing a tape SEE ALSO 2645A Display Station User's Manual, Hewlett-Packard Company, Part Number 02645-9000l. DIAGNOSTICS BREAK An interrupt signal terminated processing. Can't create 'file'. File system access permissions did not allow file to be created. Can't get tty options on stdout. Hpio was unable to get the input-output control settings associated with the terminal. Can't open 'file'. File could not be accessed to copy it to tape. End of Tape. No tape record was available when a read from a tape was requested. An end of data mark is the usual reason for this, but it may also occur if the wrong tape drive is being accessed and no tape is present. 'file' not a regular file. File is a directory or other special file. Only regular files will be copied to tape. Readcnt = rc, termcnt = tc. Hpio expected to read rc bytes from the next block on the tape, but the block contained tc bytes. This is caused by having the tape improperly positioned or by a tape block being mangled by interference from other terminal 110. Skip to next file failed. An attempt to skip over a tape mark failed. Tape mark write failed. An attempt to write a tape mark at the end of a file failed. Write failed. A tape write failed. This is most frequently caused by specifying the wrong tape drive, running off the end of the tape, or trying to write on a tape that is write protected. WARNINGS Tape 110 operations may copy bad data if any other I/O involving the terminal occurs. Do not attempt any type ahead while hpio is running. Hpio turns off write permissions for other users while it is running, but processes started asynchronously from your terminal can still interfere. The most common indication of this problem, while a tape is being written, is the appearance of characters on the display screen that should have been copied to tape. The keyboard, including the terminal's BREAK key, is locked during tape write operations; the BREAK key is only functional between writes. Hpio must have complete control of the attributes of the terminal to communicate with the tape drives. Interaction with commands such as cu (1 C) may interfere and prevent successful operation. BUGS Some binary files contain sequences that will confuse the terminal. An bpio -i that encounters the end of data mark on the tape (e.g., scanning the entire tape with bpio -itn 300), leaves the tape positioned after the end of data mark. If a subsequent bpio - 0 is done at this point, the data will not be retrievable. The tape must be repositioned manually using the terminal's FIND -2- HPIO (1) (3B20S only) HPIO(l) FILE -1 operation (depress the green function button, function key 8, and then function key 5 for the left tape or function key 6 for the right tape) before the hpio - 0 is started. If an interrupt is received by hpio while a tape is being written, the terminal may be left with the keyboard locked. If this happens, the terminal's RESET TERMINAL key will unlock the keyboard. -3- HYPHEN (1) HYPHEN(1) NAME hyphen - find hyphenated words SYNOPSIS hyphen [ files ] DESCRIPTION Hyphen finds all the hyphenated words ending lines in files and prints them on the standard output. If no arguments are given, the standard input is used; thus, hyphen may be used as a filter. EXAMPLE The following will allow the proofreading of nroff's hyphenation in textfile. mm text file I hyphen SEE ALSO mm (1), trofH 1) . BUGS Hyphen can't cope with hyphenated italic (i.e., underlined) words; it will often miss them completely, or mangle them. Hyphen occasionally gets confused, but with no ill effects other than spurious extra output. - 1- ID( 1) ID( 1) NAME id - print user and group IDs and names SYNOPSIS id DESCRIPTION Id writes a message on the standard output giving the user and group IDs and the corresponding names of the invoking process. If the effective and real IDs do not match, both are printed. SEE ALSO logname (1), getuid (2) . - 1- IPCRM(I) IPCRM (I) NAME ipcrm - remove a message queue, semaphore set or shared memory id SYNOPSIS ipcrm [ options ] DESCRIPTION [perm will remove one or more specified message, semaphore or shared memory identifiers. The identifiers are specified by the following options: -q msqid removes the message queue identifier msqid from the system and destroys the message queue and data structure associated with it. -m shmid removes the shared memory identifier shmid from the system. The shared memory segment and data structure associated with it are destroyed after the last detach. -s semid removes the semaphore identifier semid from the system and destroys the set of semaphores and data structure associated with it. -Q msgkey removes the message queue identifier, created with key msgkey, from the system and destroys the message queue and data structure associated with it. -M shmkey removes the shared memory identifier, created with key shmkey, from the system. The shared memory segment and data structure associated with it are destroyed after the last detach. -S semkey removes the semaphore identifier, created with key semkey, from the system and destroys the set of semaphores and data structure associated with it. The details of the removes are described in msgctl(2) , shmctl(2) , and semctl(2). The identifiers and keys may be found by using ipcs(1). SEE ALSO ipcs (1), msgct1(2), msgget (2), msgop (2), semct1(2), semget (2), semop (2), shmctl (2), shmget (2), shmop (2) . - 1- IPCS (1) IPCS (1) NAME ipcs - report inter-process communication facilities status SYNOPSIS ipcs [ options ] DESCRIPTION [pes prints certain information about active inter-process communication facilities. Without options, information is printed in short format for message queues, shared memory, and semaphores that are currently active in the system. Otherwise, the information that is displayed is controlled by the following options: 380.spOu -q Print information about active message queues. -m Print information about active shared memory segments. -s Print information about active semaphores. If any of the options -q, -m, or -s are specified, information about only those indicated will be printed. If none of these three are specified, information about all three will be printed. -b Print biggest allowable size information. (Maximum number of bytes in messages on queue for message queues, size of segments for shared memory, and number of semaphores in each set for semaphoresJ See below for meaning of columns in a listing. -c Print creator's login name and group name. See below. -0 Print information on outstanding usage. (Number of messages on queue and total number of bytes in messages on queue for message queues and number of processes attached to shared memory segmentsJ -p Print process number information. (Process ID of last process to send a message and process ID of last process to receive a message on message queues and process ID of creating process and process ID of last process to attach or detach on shared memory segments) See below. -t Print time information. (Time of the last control operation that changed the access permissions for all facilities. Time of last msgsnd and last msgrev on message queues, last shmat and last shmdt on shared memory, last semop(2) on semaphoresJ See below. -a Use all print options. (This is a shorthand notation for -b, -c, -0, -p, and -0 -C eorefile Use the file eorefile in place of Idev/kmem. -N namelist The argument will be taken as the name of an alternate namelist Uunix is the default). The column headings and the meaning of the columns in an ipes listing are given below; the letters in parentheses indicate the options that cause the corresponding heading to appear; all means that the heading always appears. Note that these options only determine what information is provided for each facility; they do not determine which facilities will be listed. T (aU) Type of the facility: q message queue; shared memory segment; m s semaphore. ID (aU) The identifier for the facility entry. - 1- IPCS( 1) IPCS (t) KEY (all) The key used as an argument to msgget, semget, or shmget to create the facility entry. (Note: The key of a shared memory segment is changed to IPC_PRIVATE when the segment has been removed until all processes attached to the segment detach it.) MODE (all) The facility access modes and flags: The mode consists of 11 characters that are interpreted as follows: The first two characters are: R if a process is waiting on a msgrcv; S if a process is waiting on a msgsnd; D if the associated shared memory segment has been removed. It will disappear when the last process attached to the segment detaches it; C if the associated shared memory segment is to be cleared when the first attach is executed; if the corresponding special flag is not set. The next 9 characters are interpreted as three sets of three bits each. The first set refers to the owner's permissions; the next to permissions of others in the user-group of the facility entry; and the last to all others. Within each set, the first character indicates permission to read, the second character indicates permission to write or alter the facility entry, and the last character is currently unused. The permissions are indicated as follows: r w a OWNER (all) GROUP (all) if if if if read permission is granted; write permission is granted; alter permission is granted; the indicated permission is not granted. The login name of the owner of the facility entry. The group name of the group of the owner of the facility entry. CREATOR (a,c) CGROUP (a,c) The login name of the creator of the facility entry. CBYTES QNUM QBYTES LSPID LRPID The group name of the group of the creator of the facility entry. (a,o) The number of bytes in messages currently outstanding on the associated message queue. (a,o) The number of messages currently outstanding on the associated message queue. (a,b) The maximum number of bytes allowed in messages outstanding on the associated message queue. (a,p) The process ID of the last process to send a message to the associated queue. (a,p) The process ID of the last process to receive a message from the associated queue. - 2- IPes (I) IPCS(I) STIME (a,t) RTIME (a,t) The time the last message was sent to the associated queue. The time the last message was received from the associated queue. crIME NATTCH SEGSZ CPID LPID ATIME DTIME NSEMS OTIME (a,t) The time when the associated entry was created or changed. (a,o) The number of processes attached to the associated shared memory segment. (a,b) The size of the associated shared memory segment. (a,p) The process IO of the creator of the shared memory entry. (a,p) The process 10 of the last process to attach or detach the shared memory segment. (a,t) The time the last attach was completed to the associated shared memory segment. (a,t) The time the last detach was completed on the associated shared memory segment. (a,b) The number of semaphores In the set associated with the semaphore entry. (a,t) The time the last semaphore operation was completed on the set associated with the semaphore entry. FILES /unix / dev /kmem /etc/passwd /etc/group system namelist memory user names group names SEE ALSO msgop (2), semop (2), shmop (2) . BUGS Things can change while ipcs is running; the picture it gives is only a close approximation to reality. - 3- JOIN (I) JOIN(I) NAME join - relational database operator SYNOPSIS join [ options ] file 1 file2 DESCRIPTION Join forms, on the standard output, a join of the two relations specified by the lines of file! andfile2. If file! is -, the standard input is used. File! and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in eac~ line. There is one line in the output for each pair of lines in file! and file2 that have identical join fields. The output line normally consists of the common field, then the rest of the line from file! , then the rest of the line from file2. Fields are normally separated by blank, tab or new-line. In this case, multiple separators count as one, and leading separators are discarded. These options are recognized: -an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2. -e s Replace empty output fields by string s. -jn m Join on the mth field of file n. If n is missing, use the mth field in each file. -0 -tc list Each output line comprises the fields specifed in list, each element of which has the form n.m, where n is a file number and m is a field number. Use character c as a separator (tab character). Every appearance of c in a line is significant. SEE ALSO awk(l), comm(l), sort(1). BUGS With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort. The conventions of jOin, sort, comm, uniq and awk(1) are wildly incongruous. - 1- (DEC only) KASB(l) KASB(I) NAME kasb, kunb - assembler/un-assembler for the KMC II B microprocessor SYNOPSIS kasb [ name ] [ -0 namel ] [ -d name2 ] kunb [ name ] [ -0 namel ] DESCRIPTION Kasb is an assembler/debuggerlIoader for the KMCIIB microprocessor. The optional argument name specifies the input file; default is standard input. The optional argument - 0 indicates that the next argument name} will be the output of the assembler; default is a.out. The optional argument -d indicates that the assembler is to be used in debug mode and that the next argument name2 is the device file name of the microprocessor. No output file is created in debug mode. Error diagnostics are written on the standard error output and contain the input file name and line number and a brief description of the error. C preprocessor control lines to change the file name and line number are recognized. This allows the use of the preprocessor to expand the input before assembly. Kunb is an un-assembler for the KMCll/OMCll microprocessor. It produces an output listing, acceptable to the assembler kasb, from the input object. The optional argument name specifies the input object, default is standard input. The format of the input is either assembler output (first word magic 0410), or formatted dump (first word magic 0440), or raw dump (anything else). In the first two cases, the header is ignored. The optional argument -0 indicates that the next argument name} is to contain the output listing, default is standard output. The input object is first scanned to determine branch destinations. Labels will be inserted at these locations with format Lint:, where int is the octal value of the location in words. Immediate values of instructions are also printed in octal. Page breaks are noted by the labels PO:, ..• , P3:. FILES a.out Idev/kmc? Ilib/cpp output object microprocessor device C preprocessor SEE ALSO kmc(7), vpm(7). Assembler for the DEC KMC}} Microprocessor - 1- KILL(I) KILL(t) NAME kill - terminate a process SYNOPSIS kill [ -signo ] PID DESCRIPTION Kill sends signal 15 (terminate) to the specified processes. This will normally kill processes that do not catch or ignore the signal. The process number of each asynchronous process started with & is reported by the Shell (unless more than one process is started in a pipeline, in which case the number of the last process in the pipeline is reported). Process numbers can also be found by using ps (1) . The details of the kill are described in kill(2). For example, if process number o is specified, all processes in the process group are signaled. The killed process must belong to the current user unless he is the super-user. If a signal number preceded by - is given as first argument, that signal is sent instead of terminate (see signa[(2». In particular "kill -9 ... " is a sure kill. SEE ALSO ps (1), sh (I), kill (2), signaI(2). - 1- LD(I) (not on PDP-II) LD(I) NAME ld - link editor for common object files SYNOPSIS Id [-e epsym1 [-f fiU] [-Ix] [-m1 [-r1 [-s1 [-0 outfile1 [-u symname] [- L dir] [-x] [- N] [-V] [- VS num] file-names DESCRIPTION The ld command combines several object files into one, performs relocation, resolves external symbols, and supports symbol table information for symbolic debugging. In the simplest case, the names of several object programs are given, and ld combines them, producing an object module that can either be executed or used as input for a subsequent ld run. The output of ld is left in a.out. This file is executable if no errors occurred during the load. If any input file, file-name, is not an object file, ld assumes it is either an ASCII file containing link editor directives or an archive library. If any argument is a library, it is searched exactly once at the point it is encountered in the argument list. Only those routines defining an unresolved external reference are loaded. The library (archive) symbol table (see ar(4» is searched sequentially with as many passes as are necessary to resolve external references which can be satisfied by library members. Thus, the ordering of library members is unimportant. The following options are recognized by ld. -e epsym Set the default entry point address for the output file to be that of the symbol epsym. -f fill This option sets the default fill pattern for "holes" within an output section as well as initialized bss sections. The argument fill is a twobyte constant. -Ix This option specifies a library named x. It stands for Iibx.a where x is up to seven characters. A library is searched when its name is encountered, so the placement of a -I is significant. By default, libraries are located in /lib and /usr/lib. -m This option causes a map or listing of the input/output sections to be produced on the standard output. -ooutfile This option produces an output object file by the name outfile. The name of the default object file is a.out. -r This option causes relocation entries to be retained in the output object file. Relocation entries must be saved if the output file is to become an input file in a subsequent ld run. The link editor will not complain about unresolved references. -s This option causes line number entries and symbol table information to be stripped from the output object file. -u symname Takes the argument symname as a symbol and enters it as undefined in the symbol table. This is useful for loading entirely from a library, since initially the symbol table is empty and an unresolved reference is needed to force the loading of the first routine. -x Do not preserve local (non-.globl) symbols in the output symbol table; only enter external and static symbols. This option saves some space in the output file. - 1- (not on PDP-l 1) LD(I) LD(I) - L dir Change the algorithm of searching for libx.a to look in dir before looking in Ilib. - N Put the data section immediately following the text in the output file - V Output a message giving information about the version of ld being used. -VS num The num argument is taken as a decimal version number identifying the a.out file that is produced. The version stamp is stored in the optional header. FILES llib/libx.a a.out libraries output file SEE ALSO as(1) ,cc(I),a.out(4) ,ar(4). CAVEATS Through its input directives, the common link editor gives users great flexibility; however, people who use the input directives must assume some added responsibilities. Input directives should insure the following properties for programs: C defines a zero pointer as null. A pointer to which zero has been assigned must not point to any object. To satisfy this, users must not place any object at virtual address zero in the data space. - 2- (PDP-ll only) LD(l) LD(l) NAME ld - link editor SYNOPSIS Id [ -sulxXrdnim ] [ -0 name ] [ -t name ] [ -V num ] file ... DESCRIPTION Ld combines several object programs into one; resolves external references; and searches libraries (as created by ar(I». In the simplest case several object files are given, and ld combines them, producing an object module which can be either executed or become the input for a further ld run. On the latter case, the -r option must be given to preserve the relocation bits.) The output of ld is left on a.out. This file is made executable if no errors occurred during the load and the -r flag was not specified. The argument routines are concatenated in the order specified. The entry point of the output is the beginning of the first routine. If any argument is a library, it is searched exactly once at the point it is encountered in the argument list. Only those routines defining an unresolved external reference are loaded. If a routine from a library references another routine in the library, the referenced routine must appear after the referencing routine in the library. Thus the order of programs within libraries is important. The symbols _etext, _edata and _end (etext, edata and end in C) are reserved, and if referred to, are set to the first location above the program, the first location above initialized data, and the first location above all data respectively. It is erroneous to define these symbols. Ld understands several flag arguments which are written preceded by a Except for -I, they should appear before the file names. -s "Strip" the output, that is, remove the symbol table and relocation bits to save space (but impair the usefulness of the debugger). This information can also be removed by strip (0. This option is turned off if there are any undefined symbols. -u Take the following argument as a symbol and enter it as undefined in the symbol table. This is useful for loading wholly from a library, since initially the symbol table is empty and an unresolved reference is needed to force the loading of the first routine. -I This option is an abbreviation for a library name. -I alone stands for /lib/libe.a, which is the standard system library for C and assembly language programs. -Ix stands for /lib/libx.a, where x is a string. If that does not exist, ld tries /usr/lib/libx.a A library is searched when its name is encountered, so the placement of a -I is significant. -x Do not preserve local (non-.globI) symbols in the output symbol table; only enter external symbols. This option saves some space in the output file. - X Save local symbols except for those whose names begin with L. This option is used by cc to discard internally generated labels while retaining symbols local to routines. -r Generate relocation bits in the output file so that it can be the subject of another ld run. This flag also prevents final definitions from being given to common sy~bols, and suppresses the "undefined symbol" diagnostics. -d Force definition of common storage even if the -r flag is present. -n Arrange that when the output file is executed, the text portion will be read-only and shared among all users executing the file. This involves - 1- (PDP-ll only) LD(I) LD(I) moving the data areas up to the first possible 4K word boundary following the end of the text. Use - N to turn it off. -i When the output file is executed, the program text and data areas will live in separate address spaces. The only difference between this option and -n is that here the data starts at location o. -m The names of all files and archive members used to create the output file are written to the standard output. -0 The name argument after instead of a.out. -t The name argument is taken to be a symbol name, and any references to or definitions of that symbol are listed, along with their types. There can be up to 16 occurrences of -tname on the command line. - V The num argument is taken as a decimal version number identifying the a.out that is produced. Num must be in the range 0-32767. The version stamp is stored in the a.out header; see a.out (4). -0 FILES Ilibllih?a lusr/libllib? .a a.out libraries more libraries output file SEE ALSO ar(t), asO), edt), a.out(4), ar(4). -2- is used as the name of the ld output file, LEX (I ) LEX(l) NAME lex - generate programs for simple lexical tasks SYNOPSIS lex [ -rctvn ] [ file ] ... DESCRIPTION Lex generates programs to be used in simple lexical analysis of text. The input files (standard input default) contain strings and expressions to be searched for, and C text to be executed when strings are found. A file lex.yy.c is generated which, when loaded with the library, copies the input to the output except when a string specified in the file is found; then the corresponding program text is executed. The actual string matched is left in yytext, an external character array. Matching is done in order of the strings in the file. The strings may contain square brackets to indicate character classes, as in labx -zl to indicate a, b, x, y, and z; and the operators ., +, and? mean respectively any non-negative number of, any positive number of, and either zero or one occurrences of, the previous character or character class. The character . is the class of all ASCII characters except new-line. Parentheses for grouping and vertical bar for alternation are also supported. The notation r{d,e} in a rule indicates between d and e instances of regular expression r. It has higher precedence than I, but lower than *, ?, +, and concatenation. The character" at the beginning of an expression permits a successful match only immediately after a new-line, and the character $ at the end of an expression requires a trailing new-line. The character / in an expression indicates trailing context; only the part of the expression up to the slash is returned in yytext, but the remainder of the expression must follow in the input stream. An operator character may be used as an ordinary symbol if it is within" symbols or preceded by \. Thus la -zA -zl + matches a string of letters. Three subroutines defined as macros are expected: inputO to read a character; unput(c) to replace a character read; and output(c) to place an output character. They are defined in terms of the standard streams, but you can override them. The program generated is named yylexO, and the library contains a mainO which calls it. The action REJECT on the right side of the rule causes this match to be rejected and the next suitable match executed; the function yymoreO accumulates additional characters into the same yytext; and the function yyless(p) pushes back the portion of the string matched beginning at p, which should be between yytext and yytext+yyleng. The macros input and output use files yyin and yyout to read from and write to, defaulted to stdin and stdout, respectively. Any line beginning with a blank is assumed to contain only C text and is copied; if it precedes % % it is copied into the external definition area of the lex.yy.c file. All rules should follow a % %, as in YACC. Lines preceding % % which begin with a non-blank character define the string on the left to be the remainder of the line; it can be called out later by surrounding it with {}. Note that curly brackets do not imply parentheses; only string substitution is done. EXAMPLE D %% if [a-z]+ O{D}+ {D}+ "++" "+" "I·" [0-9] printf("IF statement\n"); printf("tag, value %s\n",yytext); printf("octal number %s\n",yytext); printf("decimal number %s\n",yytext); printf("unary op\n"); printf("binary op\n"); { loop: - 1- LEX(I) LEX(I) while GnputO != '.'); switch (inputO) { case '/': break; case '.': unput('.'); default: go to loop; } The external names generated by lex all begin with the prefix yy or YY. The flags must appear before any files. The flag -r indicates RA TFOR actions, -c indicates C actions and is the default, -t causes the lex.yy.c program to be written instead to standard output, -v provides a one-line summary of statistics of the machine generated, - 0 will not print out the - summary. Multiple files are treated as a single file. If no files are specified, standard input is used. Certain table sizes for the resulting finite state machine can be set in the definitions section: %p n number of positions is n (default 2000) %0 n number of states is n (500) %t n n urn ber of parse tree nodes is n (I 000) %a n number of transitions is n (3000) The use of one or more of the above automatically implies the -v option, unless the - 0 option is used. SEE ALSO yacc(l). LEX-Lexical Analyzer Generator by M. E. Lesk and E. Schmidt. BUGS The -r option is not yet fully operational. - 2- LINE(I) LINE(I) NAME line - read one line SYNOPSIS line DESCRIPTION Line copies one line (up to a new-line) from the standard input and writes it on the standard output. It returns an exit code of 1 on EOF and always prints at least a new-line. It is often used within shell files to read from the user's terminal. SEE ALSO sh(I), read(2). - 1- LINT (1) LINT (1) '- NAME lint - a C program checker SYNOPSIS lint [ -abhlnpuvx ] file ... DESCRIPTION Lint attempts to detect features of the C program files which are likely to be \ bugs, non-portable, or wasteful. It also checks type usage more strictly than the compilers. Among the things which are currently detected are unreachable statements, loops not entered at the top, automatic variables declared and not used, and logical expressions whose value is constant. Moreover, the usage of functions is checked to find functions which return values in some places and not in others, functions called with varying numbers of arguments, and functions whose values are not used. It is assumed that all the files are to be loaded together; they are checked for mutual compatibility. By default, lint uses function definitions from the standard lint library llib-Ie.ln; function definitions from the portable lint library llib-port.ln are used when lint is invoked with the -p option. Any number of lint options may be used, in any order. The following options are used to suppress certain kinds of complaints: -a Suppress complaints about assignments of long values to variables that are not long. -b Suppress complaints about break statements that cannot be reached. (Programs produced by lex or yacc will often result in a large number of such complaints.) -h Do not apply heuristic tests that attempt to intuit bugs, improve style, and reduce waste. -u Suppress complaints about functions and external variables used and not defined, or defined and not used. (This option is suitable for running lint on a subset of files of a larger program.) -v Suppress complaints about unused arguments in functions. -x Do not report variables referred to by external declarations but never used. The following arguments alter lint's behavior: -Ix Include additional lint library llib-Ix.ln. You can include a lint version of the math library llib-Im.ln by inserting -1m on the command line. This argument does not suppress the default use of llib-Ie.ln. This option can be used to keep local lint libraries and is useful in the development of multi-file projects. -n Do not check compatibility against either the standard or the portable lint library. -p Attempt to check portability to other dialects (IBM and GCOS) of C. The -D, -U, and -I options of cd!) are also recognized as separate arguments. Certain conventional comments in the C source will change the behavior of lint: /*NOTREACHED*/ at appropriate points stops comments about unreachable code. /*VARARGSn*/ suppresses the usual - 1- checking for variable numbers of LINT( 1) LINT( 1) arguments in the following function declaration. The data types of the first n arguments are checked; a missing n is taken to be O. I*ARGSUSED*I turns on the -v option for the next function. I*LINTLIBRARY*I at the beginning of a file shuts off complaints about unused functions in this file. Lint produces its first output on a per source file basis. Complaints regarding included files are collected and printed after all source files have been processed. Finally, information gathered from all input files is collected and checked for consistency. At this point, if it is not clear whether a complaint stems from a given source file or from one of its included files, the source file name will be printed followed by a question mark. FILES /usr /lib/lint[ 12] lusr/lib/llib-lc.In programs declarations for standard functions (binary format; source is in lusr/lib/llib-ld / usr /li b/lli b-port.ln declarations for portable functions (binary format; source is in lusr llib/llib-port) I usr IIi b/lli b-Im.In declarations for standard math functions (binary format; source is in lusr llib/llib-lm) temporaries lusr/tmp/*lint* SEE ALSO ceO) . BUGS Exit (2) and other functions which do not return are not understood; this causes various lies. - 2- LIST(t) UH2U:S Only} LIST(t) NAME list - produce C source listing from 3B20S object file SYNOPSIS list [ - V ) [- h] source-file . . . [object-file] DESCRIPTION The list command produces a C source listing with line number information attached. If multiple C source files were used to create the object file, list will accept multiple file names. The object file is taken to be the last non-C source file argument. If no object file is specified the default object file, a.out, will be used. Line numbers will be printed for each breakpoint inserted by the compiler (generally, ea,ch executable C statement that begins a new line of source). Line numbering begins anew for each function. Line number 1 is always the line containing the left curly brace ({) that begins the function body. Line numbers will also be supplied for inner block redeclarations of local variables so that they can be distinguished by the symbolic debugger. The - V flag will supply version information of the list command. The -h flag will suppress heading output. CAVEATS Object files given to list must have symbolic debugging symbols. Since list does not use the C preprocessor, it may be unable to recognize function definitions whose syntax has been distorted by the use of C preprocessor macro substitutions. SEE ALSO as ( 1), cc C1 ), ld ( 1) . DIAGNOSTICS "list: name: cannot open" if name cannot be read. - 1- LOGIN (I) LOGIN (1) NAME login - sign on SYNOPSIS login [ name [ env-var ... ]] DESCRIPTION The login command is used at the beginning of each terminal session and allows you to identify yourself to the system. It may be invoked as a command or by the system when a connection is first established. Also, it is invoked by the system when a previous user has terminated the initial shell by typing a cntrl-d to indicate an "end-of-file." (See How to Get Started at the beginning of this volume for instructions on how to dial up initiallyJ If login is invoked as a command it must replace the initial command interpreter. This is accomplished by typing: exec login from the initial shell. Login asks for your user name (if not supplied as an argument), and, if appropriate, your password. Echoing is turned off (where possible) during the typing of your password, so it will not appear on the written record of the session. At some installations, an option may be invoked that will require you to enter a second "dialup" password. This will occur only for dial-up connections, and will be prompted by the message "dialup password:". Both passwords are required for a successful login. If you do not complete the login successfully within a certain period of time (e.g., one minute), you are likely to be silently disconnected. After a successful login, accounting files are updated, the procedure letclprofile is performed, the message-of-the-day, if any, is printed, the user-ID, the groupID, the working directory, and the command interpreter (usually sh is initialized, and the file .profile in the working directory is excuted, if it exists. These specifications are found in the /etc/passwd file entry for the user. The name of the command interpreter is - followed by the last component of the interpreter's pathname (i.e., -sh). If this field in the password file is empty, then the default command interpreter, Ibinlsh is used. (1» The basic environment (see environ (5» is initialized to: HOME=your-login-directory PATH=:/bin:/usr/bin SHELL=last -field -of-passwd -entry MAIL=lusr/mail/your-login-name TZ=timezone-specijication The environment may be expanded or modified by supplying additional arguments to login, either at execution time or when login requests your login name. The arguments may take either the form xxx or xxx =yyy. Arguments without an equal sign are placed in the environment as Ln=xxx where n is a number starting at 0 and is incremented each time a new variable name is required. Variables containing an = are placed into the environment without modification. If they already appear in the environment, then they replace the older value. There are two exceptions. The variables PATH and SHELL cannot be changed. This prevents people, logging into restricted shell environments, from spawning secondary shells which aren't restricted. Both login and getty understand simple single character quoting conventions. Typing a backslash in front of a character quotes it and allows the inclusion of such - 1- LOGIN(I) LOGIN (I) things as spaces and tabs. FILES /etc/utmp /etc/wtmp /usr /mail!your-name /etc/motd /etc/passwd /etc/profile .profile accounting accounting mailbox for user your-name message-of-the-da y password file system profile user's login profile SEE ALSO maiI(l), newgrp(l), sh(I), su(I), passwd(4), profile(4), environ(S). DIAGNOSTICS Login incorrect if the user name or the password cannot be matched. No shell, cannot open password file, or no directory: consult a UNIX System programming counselor. No utmp entry. You must exec "login" from the lowest level "sh". if you attempted to execute login as a command without using the shell's exec internal command or from other than the initial shell. - 2- LOGNAME(I) LOGNAME(I) NAME logname - get login name SYNOPSIS logname DESCRIPTION Logname returns the contents of the environment variable $LOGNAME, which is set when a user logs into the system. FILES /etc/profile SEE ALSO env(1), login(l), logname(3X), environ(S). - 1- LORDER(I) LORDER(l) NAME lorder - find ordering relation for an object library SYNOPSIS lorder file ... DESCRIPTION The input is one or more object or library archive files (see ar (1». The standard output is a list of pairs of object file names, meaning that the first file of the pair refers to external identifiers defined in the second. The output may be processed by tsort (1) to find an ordering of a library suitable for one-pass access by Id(I). Note that the link editor (except on the PDP -11) Id(1) is capable of multiple passes over an archive in the portable archive format (see ar(4» and does not require that lorder(I) be used when building an archive. The usage of the lorder(1) command may, however, allow for a slightly more efficient access of the archive during the link edit process. The following example builds a new library from existing ar cr library 'lorder *.0 I .0 files. tsort' FILES *symref, *symdef temporary files SEE ALSO ar(1), Id(I), tsort(1), ar(4). BUGS Object files whose names do not end with .0, even when contained in library archives, are overlooked. Their global symbols and references are attributed to some other file. - 1- LP( 1) LP(l) NAME lp, cancel - send/cancel requests to an LP line printer SYNOPSIS Ip [-c] [-ddest1 [-m] [-nnumbed [-ooption] [-s] [-Hitle] [-w] files cancel [ids] [printers] DESCRIPTION Lp arranges for the named files and associated information (collectively called a request) to be printed by a line printer. If no file names are mentioned, the standard input is assumed. The file name - stands for the standard input and may be supplied on the command line in conjunction with named files. The order in which files appear is the same order in which they will be printed. Lp associates a unique id with each request and prints it on the standard output. This id can be used later to cancel (see cancel) or find the status (see Ipstat(I)) of the request. The following options to lp may appear in any order and may be intermixed with file names: -c Make copies of the files to be printed immediately when lp is invoked. Normally, files will not be copied, but will be linked whenever possible. If the -c option is not given, then the user should be careful not to remove any of the files before the request has been printed in its entirety. It should also be noted that in the absence of the -c option, any changes made to the named files after the request is made but before it is printed will be reflected in the printed output. -ddest Choose dest as the printer or class of printers that is to do the printing. If dest is a printer, then the request will be printed only on that specific printer. If dest is a class of printers, then the request will be printed on the first available printer that is a member of the class. Under certain conditions (printer unavailability, file space limitation, etc.), requests for specific destinations may not be accepted (see accept (I M) and lpstat (1)). By default, dest is taken from the environment variable LPDEST (if it is set). Otherwise, a default destination (if one exists) for the computer system is used. Destination names vary between systems (see lpstat (1)). -m Send mail (see mail 0)) after the files have been printed. By default, no mail is sent upon normal completion of the print request. -nnumber Print number copies (default of 1) of the output. -ooption Specify printer-dependent or class-dependent options. Several such options may be collected by specifying the - 0 keyletter more than once. For more information about what is valid for options, see Models in Ipadmin(1M). -s Suppress messages from lp (1) such as "request id is ... ". -ttitle Print title on the banner page of the output. -w Write a message on the user's terminal after the files have been printed. If the user is not logged in, then mail will be sent instead. Cancel cancels line printer requests that were made by the lp (1) command. The command line arguments may be either request ids (as returned by Ip(1)) or printer names (for a complete list, use lpstat (1)). Specifying a request id cancels the associated request even if it is currently printing. Specifying a - 1- LP(I) LP(I) printer cancels the request which is currently printing on that printer. In either case, the cancellation of a request that is currently printing frees the printer to print its next available request. FILES /usr/spool/lp/* SEE ALSO enable(1), Ipstat(1), mail(1). accept(1M), Ipadmin(1M), Ipsched(1M) in the UNIX System Administrator's Manual. - 2- LPR(I) (Obsolescent) LPR(I) NAME lpr - line printer spooler SYNOPSIS Ipr [ option ... ] [ name ... ] DESCRIPTION Lpr causes the named files to be queued for printing on a line printer. If no names appear, the standard input is assumed; thus lpr may be used as a filter. The following options may be given (each as a separate argument and in any order) before any file name arguments: -c Makes a copy of the file to be sent before returning to the user. Removes the file after sending it. When printing is complete, reports that fact by mail(1). - n Does not report the completion of printing by mail (1) . This is the default option. -ffile Use file as a dummy file name to report back in the mail. (This is useful for distinguishing multiple runs, especially when lpr is being used as a filter). -r -m FILES /etc/passwd /usr/lib/lpd /usr/spoolllpd/* user's identification and accounting data. line printer daemon. spool area. SEE ALSO dpd(IC), dpr(IC), Ip(1). - 1- LPSTAT(I) \, LPSTAT(I) NAME lpstat - print LP status information SYNOPSIS Ipstat [options] DESCRIPTION Lpstat prints information about the current status of the LP line printer system. If no options are given, then /pstat prints the status of all requests made to /p(I) by the user. Any arguments that are not options are assumed to be request ids (as returned by /p). Lpstat prints the status of such requests. Options may appear in any order and may be repeated and intermixed with other arguments. Some of the keyletters below may be followed by an optional list that can be in one of two forms: a list of items separated from one another by a comma, or a list of items enclosed in double quotes and separated from one another by a comma and/or one or more spaces. For example: -u"userl, user2, user3" The omission of a list following such key letters causes all information relevant to the key letter to be printed, for example: lpstat -0 prints the status of all output requests. -a[/ist1 Print acceptance status (with respect to /p) of destinations for requests. List is a list of intermixed printer names and class names. -c[ list] Print class names and their members. List is a list of class names. -d -o[ list] Print the system default destination for /p. Print the status of output requests. List is a list of intermixed printer names, class names, and request ids. -p[ list] Print the status of printers. List is a list of printer names. -r Print the status of the LP request scheduler -s Print a status summary, including the status of the line printer scheduler, the system default destination, a list of class names and their members, and a list of printers and their associated devices. -t Print all status information. -u[ list] Print status of output requests for users. names. -v[ list] Print the names of printers and the pathnames of the devices associated with them. List is a list of printer names. FILES /usr/spooillp/* SEE ALSO enable(l), Ip(I). - 1- List is a list of login LS(I) LS(I) NAME Is - list contents of directories SYNOPSIS Is [ -Iogtasdrucifp ] names DESCRIPTION For each directory named, Is lists the contents of that directory; for each file named, Is repeats its name and any other information requested. By default, the output is sorted alphabetically. When no argument is given, the current directory is listed. When several arguments are given, the arguments are first sorted appropriately, but file arguments are processed before directories and their contents. There are several options: -I List in long format, giving mode, number of links, owner, group, size in bytes, and time of last modification for each file (see below). If the file is a special file, the size field will contain the major and minor device numbers, rather than a size. -0 The same as -I, except that the group is not printed. -g The same as -I, except that the owner is not printed. -t Sort by time of last modification (latest first) instead of by name. -a List all entries; in the absence of this option, entries whose names begin with a period (.) are not listed. -s Give size in blocks (including indirect blocks) for each entry. -d If argument is a directory, list only its name; often used with -I to get the status of a directory. -r Reverse the order of sort to get reverse alphabetic or oldest first, as appropriate. -u Use time of last access instead of last modification for sorting (with the - t option) and/or printing (with the -I option). -c Use time of last modification of the inode (mode, etc.) instead of last modification of the file for sorting (-t) and/or printing (-t). -i For each file, print the i-number in the first column of the report. -f Force each argument to be interpreted as a directory and list the name found in each slot. This option turns off -I, -t, -S, and -r, and turns on -a; the order is the order in which entries appear in the directory. -p Put a slash after each filename if that file is a directory. Especially useful for CRT terminals when combined with the prO) command as follows: Is -p I pr -5 -t -w80. The mode printed under the -I option consists of 11 characters that are interpreted as follows: The first character is: d b c p > if if if if if the the the the the entry entry entry entry entry is is is is is a directory; a block special file; a character special file; a fifo (a.k.a. "named pipe") special file; an ordinary file. The next 9 characters are interpreted as three sets of three bits each. The first set refers to the owner's permissions; the next to permissions of others in the user-group of the file; and the last to all others. Within each set, the three characters indicate permission to read, to - 1- LS(l) LS(l) write, and to execute the file as a program, respectively. For a directory, "execute" permission is interpreted to mean permission to search the directory for a specified file. The permissions are indicated as follows: r w x if if if if the the the the file is readable; file is writable; file is executable; indicated permission is not granted. The group-execute permission character is given as s if the file has setgroup-ID mode; likewise, the user-execute permission character is given as s if the file has set-user-ID mode. The last character of the mode (normally x or -) is t if the 1000 (octal) bit of the mode is on; see chmod(l) for the meaning of this mode. The indications of set-ID and 1000 bit of the mode are capitalized ( Sand T respectively) if the corresponding execute permission is not set. When the sizes of the files in a directory are listed, a total count of blocks, including indirect blocks, is printed. FILES /etc/passwd /etc/group to get user IDs for Is -I and Is -0. to get group IDs for Is -I and Is -g. SEE ALSO chmod(l), find(l). -2- M4(I) M4UJ NAME m4 - macro processor SYNOPSIS m4 [ options ] [ files ] DESCRIPTION M4 is a macro processor intended as a front end for Ratfor, C, and other languages. Each of the argument files is processed in order; if there are no files, or if a file name is -, the standard input is read. The processed text is written on the standard output. The options and their effects are as follows: -e Operate interactively. Interrupts are ignored and the output is unbuffered. Using this mode requires a special state of mind. -s Enable line sync output for the C preprocessor (#line ... ) - Bint Change the size of the push-back and argument collection buffers from the default of 4,096. - Hint Change the size of the symbol table hash array from the default of 199. The size should be prime. -Sint Change the size of the call stack from the default of 100 slots. Macros take three slots, and non-macro arguments take one. -Tint Change the size of the token buffer from the default of 512 bytes. To be effective, these flags must appear before any file names and before any -D or -U flags: - Dname[ = val] Defines name to valor to null in val's absence. -Uname undefines name. Macro calls have the form: name(arg 1,arg2, ... , argn) The ( must immediately follow the name of the macro. If the name of a defined macro is not followed by a (, it is deemed to be a call of that macro with no arguments. Potential macro names consist of alphabetic letters, digits, and underscore _, where the first character is not a digit. Leading unquoted blanks, tabs, and new-lines are ignored while collecting arguments. Left and right single quotes are used to quote strings. The value of a quoted string is the string stripped of the quotes. When a macro name is recognized, its arguments are collected by searching for a matching right parenthesis. If fewer arguments are supplied than are in the macro definition, the trailing arguments are taken to be null. Macro evaluation proceeds normally during the collection of the arguments, and any commas or right parentheses which happen to turn up within the value of a nested call are as effective as those in the original input text. After argument collection, the value of the macro is pushed back onto the input stream and rescanned. M4 makes available the following built-in macros. They may be redefined, but once this is done the original meaning is lost. Their values are null unless otherwise stated. define the second argument is installed as the value of the macro whose name is the first argument. Each occurrence of $n in the replacement text, where n is a digit, is replaced by the n-th argument. Argument 0 is the name of the macro; missing arguments - 1- M4(t) M4(t) are replaced by the null string; $# is replaced by the number of arguments; $* is replaced by a list of all the arguments separated by commas; $@ is like $*, but each argument is quoted (with the current quotes). undefine removes the definition of the macro named in its argument. defn returns the quoted definition of its argument(s). It is useful for renaming macros, especially built-ins. pushdef like define, but saves any previous definition. popdef removes current definition of its argument(s), exposing the previous one if any. ifdef if the first argument is defined, the value is the second argument, otherwise the third. If there is no third argument, the value is null. The word unix is predefined on the UNIX System versions of m4. shift returns all but its first argument. The other arguments are quoted and pushed back with commas in between. The quoting nullifies the effect of the extra scan that will subsequently be performed. changequote change quote symbols to the first and second arguments. The symbols may be up to five characters long. Changequote without arguments restores the original values (i.e., ' ,). changecom change left and right comment markers from the default # and new-line. With no arguments, the comment mechanism is effectively disabled. With one argument, the left marker becomes the argument and the right marker becomes new-line. With two arguments, both markers are affected. Comment markers may be up to five characters long. divert m4 maintains 10 output streams, numbered 0-9. The final output is the concatenation of the streams in numerical order; initially stream 0 is the current stream. The divert macro changes the current output stream to its (digit-string) argument. Output diverted to a stream other than 0 through 9 is discarded. undivert causes immediate output of text from diversions named as arguments, or all diversions if no argument. Text may be undiverted into another diversion. Undiverting discards the diverted text. divnum returns the value of the current output stream. dnl reads and discards characters up to and including the next newline. ifelse has three or more arguments. If the first argument is the same string as the second, then the value is the third argument. If not, and if there are more than four arguments, the process is repeated with arguments 4, 5, 6 and 7. Otherwise, the value is either the fourth string, or, if it is not present, null. incr returns the value of its argument incremented by 1. The value of the argument is calculated by interpreting an initial digit-string as a decimal number. decr returns the value of its argument decremented by 1. eval evaluates its argument as an arithmetic expression, using 32-bit arithmetic. Operators include +, -, *, t, %, '" (exponentiation), bitwise &, I, "', and -; relationals; parentheses. Octal and hex -2- M4(I) numbers may be specified as in C. The second argument specifies the radix for the result; the default is 10. The third argument may be used to specify the minimum number of digits in the result. len returns the number of characters in its argument. index returns the position in its first argument where the second argument begins (zero origin), or -1 if the second argument does not occur. substr returns a substring of its first argument. The second argument is a zero origin number selecting the first character; the third argument indicates the length of the substring. A missing third argument is taken to be large enough to extend to the end of the first string. translit transliterates the characters in its first argument from the set given by the second argument to the set given by the third. No abbreviations are permitted. include returns the contents of the file named in the argument. sinclude is identical to include, except that it says nothing if the file is inaccessible. syscmd executes the UNIX System command given in the first argument. No value is returned. sysval is the return code from the last call to syscmd. maketemp fills in a string of XXXXX in its argument with the current process 10. m4exit causes immediate exit from m4. Argument 1, if given, is the exit code; the default is O. m4wrap argument 1 will be pushed m4wrap('cleanupO ,) back at final EOF; example: errprint prints its argument on the diagnostic output file. dumpdef prints current names and definitions, for the named items, or for all if no arguments are given. traceon with no arguments, turns on tracing for all macros (including built-ins). Otherwise, turns on tracing for named macros. traceoff turns off trace globally and for any macros specified. Macros specifically traced by traceon can be untraced only by specific calls to traceoff. SEE ALSO cc(I), cpp(l). Ritchie. The M4 Macro Processor by B. W. Kernighan and D. M. _ '1 _ MACHID(l) MACHID(l) NAME pdp11, u3b, vax - provide truth value about your processor type SYNOPSIS pdp 11 u3b vax DESCRIPTION The following commands will return a true value (exit code of 0) if you are on a processor that the command name indicates. pdp11 True if you are on a PDP-11145 or PDP-1I/70. u3b True if you are on a 3B20S. vax True if you are on a VAX-ll/750 or VAX-ll/780. The commands that do not apply will return a false (non-zero) value. These commands are often used within make (1) makefiles and shell procedures to increase portability. SEE ALSO sh (1), test{l), true(l). - 1- MAIL(l) MAIL(l) NAME mail, rmail - send mail to users or read mail SYNOPSIS mail [ -epqr ] [ -f file ] mail [ - t ] persons rmail [ - t ] persons DESCRIPTION Mail without arguments prints a user's mail, message-by-message, in last-in, first-out order. For each message, the user is prompted with a ?, and a line is read from the standard input to determine the disposition of the message: + d p s [Jiles] w [Jiles] m [ persons] q EOT (control-d) x !command • Go on to next message. Same as . Delete message and go on to next message. Print message again. Go back to previous message. Save message in the named files (mbox is default). Save message, without its header, in the named files (mbox is default). Mail the message to the named persons (yourself is default). Put undeleted mail back in the mailfile and stop. Same as q. Put all mail back in the mailfile unchanged and stop. Escape to the shell to do command. Print a command summary. The optional arguments alter the printing of the mail: -e causes mail not to be printed. An exit value of 0 is returned if the user has mail; otherwise, an exit value of 1 is returned. causes all mail to be printed without prompting for disposition. -p causes mail to terminate after interrupts. Normally an interrupt only -q causes the termination of the message being printed. -r causes messages to be printed in first-in, first-out order. -fJile causes mail to use file (e.g., mbox) instead of the default mailfile. When persons are named, mail takes the standard input up to an end-of-file (or up to a line consisting of just a .) and adds it to each person's mailfile. The message is preceded by the sender's name and a postmark. Lines that look like postmarks in the message, (i.e., "From ... ") are preceded with a >. The -t option causes the message to be preceded by all persons the mail is sent to. A person is usually a user name recognized by login (1). If a person being sent mail is not recognized, or if mail is interrupted during input, the file dead.letter will be saved to allow editing and resending. To denote a recipient on a remote system, prefix person by the system name and exclamation mark (see uucpCI C». Everything after the first exclamation mark in persons is interpreted by the remote system. In particular, if persons contains additional exclamation marks, it can denote a sequence of machines through which the message is to be sent on the way to its ultimate destination. For example, specifying a!b!ede as a recipient's name causes the message to be sent to user b!ede on system a. System a will interpret that destination as a request to send the message to user ede on system b. This might be useful, for instance, if the sending system can access system a but not system b, and system a has access to system b. - 1- MAIL(l) MAIL(l) The mailfile may be manipulated in two ways to alter the function of mail. The other permissions of the file may be read-write, read-only, or neither read nor write to allow different levels of privacy. If changed to other than the default, the file will be preserved even when empty to perpetuate the desired permissions. The file may also contain the first line: Forward to person which will cause all mail sent to the owner of the mai/jile to be forwarded to person. This is especially useful to forward all of a person's mail to one machine in a multiple machine environment. Rmail only permits the sending of mail; uucp (1 C) uses rmail as a security precaution. When a user logs in, the presence of mail, if any, is indicated. Also, notification is made if new mail arrives while using mail. FILES letc/passwd lusr/mailluser $HOME/mbox $MAIL Itmp/ma* lusr Imaill *.lock dead.letter to identify sender and locate persons incoming mail for user; i.e., the mailfile saved mail variable containing path name of mailfile temporary file lock for mail directory unmailable text SEE ALSO 10gin(I), uucp(1C), write(1). BUGS Race conditions sometimes result in a failure to remove a lock file. After an interrupt, the next message may not be printed; printing may be forced by typing a p. - 2- MAKE(I) MAKE(I) NAME make - maintain, update, and regenerate groups of programs SYNOPSIS make [-f makefile] [-p] [-i] [-k] [-s] [-r] [-0] [-b] [-e] [-m] [-t] [-d] [-q] [names] DESCRIPTION The following is a brief description of all options and some special names: -f makefile Description file name. Makefile is assumed to be the name of a description file. A file name of - denotes the standard input. The contents of makefile override the built-in rules if they are present. -p Print out the complete set of macro definitions and target descriptions. -i Ignore error codes returned by invoked commands. This mode is entered if the fake target name .IGNORE appears in the description file. Abandon work on the current entry, but continue on other branches that do not depend on that entry. -k -s Silent mode. Do not print command lines before executing. This mode is also entered if the fake target name .SILENT appears in the description file. -r Do not use the built-in rules. -0 No execute mode. Print commands, but do not execute them. Even lines beginning with an @ are printed. -b Compatibility mode for old makefiles. -e Environment variables override assignments within makefiles. -m Print a memory map showing text, data, and stack. This option is a no-operation on systems without the getu system call. -t Touch the target files (causing them to be up-to-date) rather than issue the usual commands. -d Debug mode. Print out detailed information on files and times examined. -q Question. The make command returns a zero or non-zero status code depending on whether the target file is or is not up-to-date . •DEFAULT If a file must be made but there are no explicit commands or relevant built-in rules, the commands associated with the name .DEFAULT are used if it exists . •PRECIOUS .SILENT Dependents of this target will not be removed when quit or interru pt are hit. Same effect as the -s option . •IGNORE Same effect as the -i option. Make executes commands in Name is typically a program. s.makefile, and s.Makefile are input is taken. More than one makefile to update one or more target names. If no -f option is present, makefile, Makefile, tried in order. If makefile is -, the standard - makefile argument pair may appear. Make updates a target only if it depends on files that are newer than the target. All prerequisite files of a target are added recursively to the list of targets. Missing files are deemed to be out of date. - 1- MAKE(l) MAKE~l) Makefile contains a sequence of entries that specify dependencies. The first line of an entry is a blank-separated, non-null list of targets, then a :, then a (possibly null) list of prerequisite files or dependencies. Text following a ; and all following lines that begin with a tab are shell commands to be executed to update the target. The first line that does not begin with a tab or # begins a new dependency or macro definition. Shell commands may be continued across lines with the sequence. Everything printed by make (except the initial tab) is passed directly to the shell as is. Thus, echo a\ b will produce ab exactly the same as the shell would. Sharp (#) and new-line surround comments. The following makefile says that pgm depends on two files a.o and b.o, and that they in turn depend on their corresponding source files (a.c and b.C> and a common file iocl.h: pgm: a.o b.o cc a.o b.o a.o: incl.h a.c cc -c a.c b.o: incl.h b.c cc -c b.c -0 pgm Command lines are executed one at a time, each by its own shell. The first one or two characters in a command can be the following: -, @, - @, or @ -. If @ is present, printing of the command is suppressed. If - is present, make ignores an error. A line is printed when it is executed unless the -s option is present, or the entry .SILENT: is in makefile , or unless the initial character sequence contains a @. The - 0 option specifies printing without execution; however, if the command line has the string $(MAKE) in it, the line is always executed (see discussion of the MAKEFLAGS macro under Environment). The -t (touch) option updates the modified date of a file without executing any commands. Commands returning non-zero status normally terminate make. If the -i option is present, or the entry .IGNORE: appears in makefile, or the initial character sequence of the command contains -. the error is ignored. If the - k option is present, work is abandoned on the current entry, but continues on other branches that do not depend on that entry. The -b option allows old makefiles (those written for the old version of make) to run without errors. The difference between the old version of make and this version is that this version requires all dependency lines to have a (possibly null or implicit) command associated with them. The previous version of make assumed if no command was specified explicitly that the command was null. Interrupt and quit cause the target to be deleted unless the target is a dependency of the special name .PRECIOUS. Environment The environment is read by make. All variables are assumed to be macro definitions and processed as such. The environment variables are processed before any makefile and after the internal rules; thus, macro assignments in a makefile override environment variables. The -e option causes the environment to override the macro assignments in a makefile. - 2- MAKE(l) MAKE(l) The MAKEFLAGS environment variable is processed by make as containing any legal input option (except -f, -p, and -d) defined for the command line. Further, upon invocation, make "invents" the variable if it is not in the environment, puts the current options into it, and passes it on to invocations of commands. Thus, MAKEFLAGS always contains the current input options. This proves very useful for "super-makes". In fact, as noted above, when the - 0 option is used, the command $(MAKE) is executed anyway; hence, one can perform a make - 0 recursively on a whole software system to see what would have been executed. This is because the - 0 is put in MAKEFLAGS and passed to further invocations of $(MAKE). This is one way of debugging all of the makefiles for a software project without actually doing anything. Macros Entries of the form string1 - string2 are macro definitions. String2 is defined as all characters up to a comment character or an unescaped newline. Subsequent appearances of $ (string1 [:substl=[subst2]]) are replaced by string2. The parentheses are optional if a single character macro name is used and there is no substitute sequence. The optional :subst 1 =subst2 is a substitute sequence. If it is specified, all non-overlapping occurrences of subst1 in the named macro are replaced by subst2. Strings (for the purposes of this type of substitution) are delimited by blanks, tabs, new-line characters, and beginnings of lines. An example of the use of the substitute sequence is shown under Libraries. Internal Macros There are five internally maintained macros which are useful for writing rules for building targets. $- The macro $- stands for the file name part of the current dependent with the suffix deleted. It is evaluated only for inference rules. $@ The $@ macro stands for the full target name of the current target. It is evaluated only for explicitly named dependencies. $< The $< macro is only evaluated for inference rules or the .DEFAULT rule. It is the module which is out of date with respect to the target (i.e., the "manufactured" dependent file name). Thus, in the .c.o rule, the $ < macro would evaluate to the .c file. An example for making optimized .0 files from .c files is: .c.o: cc -c -0 $*.c or: .c.o: cc -c -0 $< $? The $? macro is evaluated when explicit rules from the makefile are evaluated. It is the list of prerequisites that are out of date with respect to the target; essentially, those modules which must be rebuilt. $% The $ % macro is only evaluated when the target is an archive library member of the form lib(file.o}. In this case, $@ evaluates to lib and $ % evaluates to the library member, file.o. Four of the five macros can have alternative forms. When an upper case D or F is appended to any of the four macros the meaning is changed to "directory part" for D and "file part" for F. Thus, $(@D) refers to the directory part of the string $@. If there is no directory part, ./ is generated. The only macro excluded from this alternative form is $? The reasons for this are debatable. Suffixes Certain names (for instance, those ending with .0) have inferable prerequisites - 3- MAKE(l) MAKE(l) such as .c, .s, etc. If no update commands for such a file appear in makefile, and if an inferable prerequisite exists, that prerequisite is compiled to make the target. In this case, make has inference rules which allow building files from other files by examining the suffixes and determining an appropriate inference rule to use. The current default inference rules are: .c .c- .sh .sh- .c.o .c-.o .c-.c .s.o .s-.o .y.o .y-.o .l.o r.o .y.c .y-.c .l.c .c.a .c-.a .s-.a .h-.h The internal rules for make are contained in the source file rules.c for the make program. These rules can be locally modified. To print out the rules compiled into the make on any machine in a form suitable for recompilation, the following command is used: make -fp - 2>/dev/null lfile/on/localsys Copy a directory structure from system A to the local system: cd I dir I onllocalsys net A "cd Idir/onl A; find. -print I cpio -oc" I cpio -icd Send a directory structure from the local system to system A (this uses the command's ability to read standard input): find. -print I cpio -oc I net A "cd Idir/onl A; cpio -icd" FILES Idev/pcl/*[O-7] PCL channel interfaces for system *. I usr I adml pcllog Activity log. SEE ALSO cpio(I), find(1), pcldaemon(1C), sh(1), pcl(7). DIAGNOSTICS uid unknown Your uid cannot be matched in the password file. command list too long A command and its arguments are restricted to less than 512 bytes. user is unknown at remote Your login name does not exist at the remote site. user is denied access at remote Your login name is not allowed to be used via net at the remote site. N.B. This applies in particular to super-users. home directory inaccessible Your remote home directory is unavailable, possibly unmounted. - 1- l ~VI!C only) NET (Ie) cannot open channel to system A connection can't be made to the requested system. connection broken A non-recoverable write error occurred. write error A recoverable write error occurred. The write will be retried until it completes successfully without losing data. cannot fork reader process Net is unable to create a reader process and a writer process. WARNINGS A successful invocation of net reads at least 2 blocks of the standard input, if present, even if command does not use standard input. The standard input must be explicitly closed (via < & -) or redirected (such as from /dev/nuII) if this feature is not desired. The use of net to invoke certain programs on the remote system may result in delayed transmission of output to the user. This is because the PCL is not a tty device. Data written to standard output by an invoked program will be treated as though it is being written to an ordinary file, and not to a user terminal. BUGS PCL channels are not "tty" files, so that commands that do "funny" things with your terminal (i.e., cu (I C), passwd (1), su (I), etc.), or that expect "tty" behaviour of the standard output file, won't work as expected. -2- NEWFORM(l) NEWFORM(l) NAME newform - change the format of a text file SYNOPSIS newform [-s] [-itabspec] [-otabspec] [-bn] [-en] [-pn] [-an] [-f] [-cchad [-In] [files] DESCRIPTION Newform reads lines from the named files, or the standard input if no input file is named, and reproduces the lines on the standard output. Lines are reformatted in accordance with command line options in effect. Except for -s, command line options may appear in any order, may be repeated, and may be intermingled with the optional files. Command line options are processed in the order specified. This means that option sequences like "-e15 -160" will yield results different from "-160 -e15". Options are applied to all files on the command line. -itabspec Input tab specification: expands tabs to spaces, according to the tab specifications given. Tabspec recognizes all tab specification forms described in tabs 0). In addition, tabspec may be - -, in which newform assumes that the tab specification is to be found in the first line read from the standard input (see fspec (4». If no tabspec is given, tabspec defaults to -8. A tabspec of -0 expects no tabs; if any are found, they are treated as -1. -otabspec Output tab specification: replaces spaces by tabs, according to the tab specifications given. The tab specifications are the same as for -itabspec. If no tabspec is given, tabspec defaults to -8. A tabspec of -0 means that no spaces will be converted to tabs on output. -In Set the effective line length to n characters. If n is not entered, -I defaults to 72. The default line length without the -I option is 80 characters. Note that tabs and backspaces are considered to be one character (use -i to expand tabs to spaces). -bn Truncate n characters from the beginning of the line when the line length is greater than the effective line length (see -In). Default is to truncate the number of characters necessary to obtain the effective line length. The default value is used when -b with no n is used. This option can be used to delete the sequence numbers from a COBOL program as follows: new form -11 -b7 file-name The -11 must be used to set the effective line length shorter than any existing line in the file so that the -b option is activated. -en Same as -bn except that characters are truncated from the end of the line. -ck Change the prefix/append character to k. Default character for k is a space. -pn Prefix n characters (see -ck) to the beginning of a line when the line length is less than the effective line length. Default is to prefix the number of characters necessary to obtain the effective line length. -an Same as -pn except characters are appended to the end of a line. -f Write the tab specification format line on the standard output before any other lines are output. The tab specification format line which is printed will correspond to the format specified in the last - 1- NEWFORM(I) NEWFORM(I) - 0 option. If no - 0 option is specified, the line which is printed will contain the default specification of -8. -s Shears off leading characters on each line up to the first tab and places up to 8 of the sheared characters at the end of the line. If more than 8 characters (not counting the first tab) are sheared, the eighth character is replaced by a • and any characters to the right of it are discarded. The first tab is always discarded. An error message and program exit will occur if this option is used on a file without a tab on each line. The characters sheared off are saved internally until all other options specified are applied to that line. The characters are then added at the end of the processed line. For example, to convert a file with leading digits, one or more tabs, and text on each line, to a file beginning with the text, all tabs after the first expanded to spaces, padded with spaces out to column 72 (or truncated to column 72), and the leading digits placed starting at column 73, the command would be: newform -s -i -1 -a -e file-name DIAGNOSTICS All diagnostics are fatal. usage: ... not - s format can't open file internal line too long Newform was called with a bad option. There was no tab on one line. Self explanatory. A line exceeds 512 characters after being expanded in the internal work buffer. tabspec in error A tab specification is incorrectly formatted, or specified tab stops are not ascending. tabspec indirection illegal A tabspec read from a file (or standard input) may not contain a tabspec referencing another file (or standard input). EXIT CODES o- normal execution 1 - for any error SEE ALSO csplit(I) , tabs(I), fspec(4). BUGS Newform normally only keeps track of physical characters; however, for the - j and - 0 options, newform will keep track of backspaces in order to line up tabs in the appropriate logical columns. Newform will not prompt the user if a tabspec is to be read from the standard input (by use of - j - - or - 0 - -). If the -f option is used, and the last - 0 option specified was -0 - - , and was preceded by either a - 0 - - or a -i - -, the tab specification format line will be incorrect. - 2- NEWGRP(I) NEWGRP(l) NAME newgrp - log in to a new group SYNOPSIS newgrp [ -] [ group] DESCRIPTION Newgrp changes the group identification of its caller, analogously to /oginO). The same person remains logged in, and the current directory is unchanged, but calculations of access permissions to files are performed with respect to the new group ID. Newgrp without an argument changes the group identification to the group in the password file; in effect it changes the group identification back to the caller's original group. An initial - flag causes the environment to be changed to the one that would be expected if the user actually logged in again. A password is demanded if the group has a password and the user himself does not, or if the group has a password and the user is not listed in /etc/group as being a member of that group. When most users log in, they are members of the group named other. FILES fetcfgroup fetcfpasswd SEE ALSO 10gin(1), group(4). BUGS There is no convenient way to enter a password into fetc/group. Use of group passwords is not encouraged, because, by their very nature, they encourage poor security practices. Group passwords may disappear in the future. - 1- NEWS(l) NEWS(l) NAME news - print news items SYNOPSIS news [ -a ] [ -n ] [ -s ] [ items DESCRIPTION News is used to keep the user informed of current events. By convention, these events are described by files in the directory lusr /news. When invoked without arguments, news prints the contents of all current files in /usr/news, most recent first, with each preceded by an appropriate header. News stores the "currency" time as the modification date of a file named .news_time in the user's home directory (the identity of this directory is determined by the environment variable $HOME); only files more recent than this currency time are considered "current." The -a option causes news to print all items, regardless of currency. In this case, the stored time is not changed. The -n option causes news to report the names of the current items without printing their contents, and without changing the stored time. The -s option causes news to report how many current items exist, without printing their names or contents, and without changing the stored time. It is useful to include such an invocation of news in one's .profile file, or in the system's /ete/profile. All other arguments are assumed to be specific news items that are to be printed. If a delete is typed during the printing of a news item, printing stops and the next item is started. Another delete within one second of the first causes the program to terminate. FILES fete/profile /usr/news/· $HOME/.news_time SEE ALSO profile (4) , environ (5). - 1- NICE(1) , NICE(l) NAME nice - run a command at low priority SYNOPSIS nice [ -increment] command [ arguments DESCRIPTION Nice executes command with a lower CPU scheduling pnorIty. If the increment argument On the range 1-19) is given, it is used; if not, an increment of lOis assumed. The super-user may run commands with priority higher than normal by using a negative increment, e.g., - -10. SEE ALSO nohup(1), nice(2). DIAGNOSTICS Nice returns the exit status of the subject command. BUGS An increment larger than 19 is equivalent to 19. - 1- NL(I) NL(I) NAME nl - line numbering filter SYNOPSIS oJ [-htype] [-btype] [-ftype] [-vstart#] [-iincd [-p] [-Inurn] [-ssep] [-wwidth] [-nformat] [-ddelim] file DESCRIPTION NI reads lines from the named file or the standard input if no file is named and reproduces the lines on the standard output. Lines are numbered on the left in accordance with the command options in effect. NI views the text it reads in terms of logical pages. Line numbering is reset at the start of each logical page. A logical page consists of a header, a body, and a footer section. Empty sections are valid. Different line numbering options are independently available for header, body, and footer (e.g. no numbering of header and footer lines while numbering blank lines only in the body). The start of logical page sections are signaled by input lines containing nothing but the following delimiter character{s): Line contents Start of \:\:\: \:\: \: header body footer Unless optioned otherwise, nl assumes the text being read is in a single logical page body. Command options may appear in any order and may be intermingled with an optional file name. Only one file may be named. The options are: -btype Specifies which logical page body lines are to be numbered. Recognized types and their meaning are: a, number all lines; t, number lines with printable text only; n, no line numbering; pstring, number only lines that contain the regular expression specified in string. Default type for logical page body is t (text lines numbered). -htype Same as -btype except for header. Default type for logical page header is n (no lines numbered). -ftype Same as -btype except for footer. Default for logical page footer is n (no lines numbered). -p Do not restart numbering at logical page delimiters. -vstart# Start# is the initial value used to number logical page lines. Default is 1. -iincr [ncr is the increment value used to number logical page lines. Default is 1. -ssep Sep is the character(s) used in separating the line number and the corresponding text line. Default sep is a tab. -wwidth Width is the number of characters to be used for the line number. Default width is 6. -nformat Format is the line numbering format. Recognized values are: In, left justified, leading zeroes supressed; rn, right justified, leading zeroes supressed; rz, right justified, leading zeroes kept. Default format is rn (right justified). -Inum Num is the number of blank lines to be considered as one. For example, -12 results in only the second adjacent blank being - 1- NL(I) NL(I) numbered (if the appropriate -ba, -ba, and/or -fa option is set). Default is 1. -dxx The delimiter characters specifying the start of a logical page section may be changed from the default characters (\:) to two user specified characters. If only one character is entered, the second character remains the default character (:). No space should appear between the -d and the delimiter characters. To enter a backslash, use two backslashes. EXAMPLE The command: nl -vl0 -il0 -d!+ filel file2 will number files 1 and 2 starting at line number 10 with an increment of ten. The logical page delimiters are !+. SEE ALSO pr(I) . - 2- NM(I) (not on PDP-I I) NM(I) NAME nm - print name list of common object file SYNOPSIS om [-0] [-x] [-h] [-y] [-0] [-e] [-f) [-u] [-V] file-names DESCRIPTION The nm command displays the symbol table of each common object file filename. File-name may be a relocatable or absolute common object file; or it may be an archive of relocatable or absolute common object files. For each symbol, the following information will be printed: Name The name of the symbol. Value Its value expressed as an offset or an address depending on its storage class. Class Its storage class. Type Its type and derived type. If the symbol is an instance of a structure or of a union then the structure or union tag will be given following the type (e.g. struct-tag). If the symbol is an array, then the array dimensions will be given following the type (eg., char[nHmJ). Note that the object file must have been compiled with the -g option of the ee(I) command for this information to appear. Size Its size in bytes, if available. Note that the object file must have been compiled with the -g option of the ec(I) command for this information to appear. Line The source line number at which it is defined, if available. Note that the object file must have been compiled with the -g option of the edt) command for this information to appear. Sectioo For storage classes static and external, the object file section containing the symbol (e.g., text, data or bss). The output of nm may be controlled using the following flags: -0 A symbol's value and size will be printed in octal instead of decimal. -x A symbol's value and size will be printed in hexadecimal instead of decimal. -h The output header data is not displayed. -y External symbols will be sorted by value before they are printed. -0 External symbols will be sorted by name before they are printed. -e Only static and external symbols are printed. -f Full output is produced. Redundant symbols Ctext, .data and .bss) , normally suppressed, are printed. -u Only undefined symbols are printed. -V Version of nm command executing is displayed on stderr output. Flags may be used in any order, either singly or in combination, and may appear anywhere in the command line. Therefore, both om name -e -y and nm -ye name print the static and external symbols in name, with external symbols sorted by value. FILES /usrltmp/nm????? ? SEE ALSO as(I), cc(I), Id(I), a.out(4), ar(4). - 1- (not on PDP-ll) NM(I) DIAGNOSTICS "nm: name: cannot open" if name cannot be read. "nm: name: bad magic" if name is not an appropriate common object file. "nm: name: no symbols" if the symbols have been stripped from name. - 2- NM(I) , NM(I) (PDP-ll only) NM(I) . NAME nm - print name list SYNOPSIS om [ -gooprsu ] [ file .,. ] DESCRIPTION Nm prints the name list (symbol table) of each object file in the argument list. If an argument is an archive, a listing for each object file in the archive will be produced. If no file is given, the symbols in a.out are listed. Each symbol name is preceded by its value (blanks if undefined) and one of the letters U (undefined), A (absolute), T (text segment symbol), D (data segment symbol), B (bss segment symbol), R (register symbol), F (file symbol), or C (common symbol). If the symbol is local (non-external) the type letter is in lower case. The output is sorted alphabetically. Options are: -g Print only global (external) symbols. -0 Sort numerically rather than alphabetically. -0 Prefix file or archive element name to each output line rather than only once. This option can be used to make piping to grep(1) more meaningful. -p Don't sort; print in symbol-table order. - r -s Sort in reverse order. -u Print only undefined symbols. Sort according to the size of the external symbol (computed from the difference between the value of the symbol and the value of the symbol with the next highest value). This difference is the value printed. This flag turns on -g and - 0 and turns off -u and -po SEE ALSO ar(I), a.out(4), ar(4). - 1- NOHUP(I) NOHUP(l) NAME nohup - run a command immune to hangups and quits SYNOPSIS nohup command [ arguments ] DESCRIPTION Nohup executes command with hangups and quits ignored. If output is not re-directed by the user, it will be sent to nohup.out. If nohup.out.is not writable in the current directory, output is redirected to $HOME/nohup.out. SEE ALSO nice(I), signaI(2). - 1- NROFF(l) NROFF(I) NAME nroff - format text SYNOPSIS nroff [ options ] [ files DESCRIPTION Nroff formats text contained in files {standard input by default} for printing on typewriter-like devices and line printers. Its capabilities are described in the NROFFITROFF User's Manual cited below. An argument consisting of a minus (-) is taken to be a file name corresponding to the standard input. The options, which may appear in any order, but must appear before the files, are: -olist -oN -sN -raN -j -q -z -mname -cname -kname -Tname -e -h -un Print only pages whose page numbers appear in the list of numbers and ranges, separated by commas. A range N - M means pages N through M; an initial - N means from the beginning to page N; and a final N - means from N to the end. {See BUGS below,} Number first generated page N. Stop every N pages. Nroff will halt after every N pages (default N- 1) to allow paper loading or changing, and will resume upon receipt of a line-feed or new-line (new-lines do not work in pipelines, e.g., with mm (1». This option does not work if the output of nroff is piped through cot( 1) . When nroff halts between pages, an ASCII BEL is sent to the terminal. Set register a (which must have a one-character name) to N. Read standard input after files are exhausted. Invoke the simultaneous input-output mode of the .rd request. Print only messages generated by .tm (terminal message) requests. Prepend to the input files the non-compacted {ASCII text} macro file lusrllib/tmac/tmac.name. Prepend to the input files the compacted macro files lusrllib/macros/cmp.[ntUdt].name and lusr Ilib/macros/ucmp.[ntJ.name. Compact the macros used in this invocation of nroff, placing the output in files [dt].name in the current directory (see the May 1979 Addendum to the NROFFITROFF User's Manual for details of compacting macro files). Prepare output for specified terminal. Known names are 37 for the (default) TELETYPE® Model 37 terminal, tn300 for the GE TermiNet 300 (or any terminal without half-line capability), 300s for the DASI 300s, 300 for the DASI 300, 450 for the DASI 450, Ip for a (generic) ASCII line printer, 382 for the DTC-382, 4000A for the Trendata 4000A, 832 for the Anderson Jacobson 832, X for a (generic) EBCDIC printer, and 2631 for the Hewlett Packard 2631 line printer. Produce equally-spaced words in adjusted lines, using the full resolution of the particular terminal. Use output tabs during horizontal spacing to speed output and reduce output character count. Tab settings are assumed to be every 8 nominal character widths. Set the emboldening factor (number of character overstrikes) for the third font position (bold) to n, or to zero if n is missing. - 1- NROFF(l) NROFF(I) \ FILES /usr!lib/suftab /tmp/ta$# / usr!li b/ tmac/ tmac.· /usr !lib/macros/· /usr/lib/term/· suffix hyphenation tables temporary file standard macro files and pointers standard macro files terminal driving tables for nroff SEE ALSO NROFF/TROFF User's Manual A TROFF Tutorial col(I), cw(1), eqn(I), greek(I), mm(1), tbl(I), troff(I), mm(5). BUGS Nroff believes in Eastern Standard Time; as a result, depending on the time of the year and on your local time zone, the date that nroff generates may be off by one day from your idea of what the date is. When nroff is used with the -olist option inside a pipeline (e.g., with one or more of ew(I), eqn(I), and tbl(1», it may cause a harmless "broken pipe" diagnostic if the last page of the document is not specified in list. - 2- NSCSTAT (I C) NSCSTAT(IC) NAME nscstat - query the operation status of the NSC network SYNOPSIS oscstat [ netname ... 1 [-ludqrbpa1 [-0 names 1 DESCRIPTION Nscstat, without arguments, gives a short operational status report of the NSC network from the viewpoint of the local node. This includes the status of the NSC network and the total number of files queued for transmission. A list of network names may be specified. If no network names are given, the options specified are performed for all known networks. Nscstat recognizes the following arguments: -I Output a long listing. This option indicates the status of the printed node (on-line or off-line), the total number of files queued waiting transmission to this node, and the time when the first job was queued for transmission. -p Report the last time the system received a poke from remote systems. -r Report the last time the system received a request to transfer from remote systems. -b Report the last time the current system had to notify remote systems that it was too busy to handle its request. -u List the status of all nodes that are on-line (up). -d List the status of all nodes that are off-line (down). -q List the status of all nodes that have files queued for transmission. -a List the status of all nodes configured on the network. -n names Name specifies that status is requested for this node only. If more than one network is specified, this option is disabled. Each of the above arguments may be used singly or together with several others. When used together, the output is the intersection of the sets of nodes matching each option. If a node name list is specified, status for that node will only be reported if it is in the intersection set of the specified options. EXAMPLE To get a long listing of all nodes that are currently off-line and have files queued for transmission: nscstat -ldq FILES lusr/nsc/rvchan list of nodes currently configured on the network lusr/nsc/cons/· nodes that are considered on-line lusr/nsc/jobs/C. jobs queued for transmission lusr I nsclconslon -line/. whether the NSC network is active or not on this network BUGS Nscstat tries to interpret the specified options intelligently. If none of the options specified apply to any of the specified nodes, no detailed status will be reported. - 1- NSCTORJE(IC) NSCTORJE(IC) c NAME nsctorje - re-route jobs from the NSC network to RJE SYNOPSIS nsctorje [-d names] DESCRIPTION Nsctorje will resubmit jobs queued on the NSC local network (via nusend(IC) \ across the RJE link (if it exists). Nsctorje submits a nusend(IC) command to re-route each queued job. By default, jobs will be re-routed if either the remote host is marked down locally or if the NSC network on the local host is inactive. Nsctorje recognizes the following options: -d names re-route all jobs queued only to the remote machine name. SEE ALSO nusend (I C). nscmon(IM), rje(8) in the UNIX System Administrator's Manual. FILES lusr Insc/NORJE I usr I nscl rvchan lusr/asp/udest file indicating that no RJE connection exists on this machine nusend(IC) network configuration file nodes accessible through RJE BUGS Any file larger than 190,000 bytes will not be re-routed across the RJE link. It will remain queued on the NSC network until the remote node becomes available. - 1- NUSEND(IC) NUSEND(IC) NAME nusend - send files to another UNIX System on the NSC network SYNOPSIS nusend -d dest [-n netname1 [-a accd [-m] [-e] [-s] [-c] [-x] [-u destused [[ -f destfile] srcfile] [-!cmd [cmdfile]] ..• DESCRIPTION Nusend sends copies of the named files or command to another UNIX system via the NSC network. If the file name - is given, the standard input is read at that point. -d dest Destination. Dest can be anyone of the UNIX systems on the NSC local network. See lusr/nsc/rvchan for an up-to-date list of valid NSC destinations. -n netname Network name. Netname can be anyone of the networks known to the local system (see nscmon (I M) for the definition of a network. This option is only needed when sending to your own system. See lusr/nsc/nets for the up-to-date list of valid networks). -a acct Use acct as the account number for the job. By default, the account number is read from the password file. -s Silent. Suppress the one-line message which contains the submitted job name. -c Copy. Make a copy of the file. Default is to set up a pointer to the file in the user's directory. If any changes are made to the file before transmission, the changes will be sent to the destination unless the -c option is used. -x Generate checksums on all data tranmissions. Mail will normally be sent to the receiving login (s) to report the receipt of the file(s). Mail will be sent to both sending and receiving logins if there were errors in transmission. The default may be overridden with the following switches: -m Report by mail(1) when the file transfer is complete. The mail is sent from the remote system via nusend. -e Report by mail (1) only when an error occurred during the transfer. No other mail will be sent. Normally, the login name under which the new file will appear on the destination system is the same as the login name of the person who issues the command. The following options, each as a separate argument, may be interspersed with file name arguments: -u Use the next argument as the destination user's login name for all succeeding files. -f Use the next argument as the destination file name for the succeeding file. Srcfile must be specified. The destination path name is assumed to be relative to the destination login directory if there is no leading I. In either case, the target directory must be mode 777, or if the file already exists, the file must be writable by others. By default, files are delivered to directory rje under the destination login directory. Rje must have been previously created in mode 777 for everything to work. The name of the destination file is ordinarily the same as the last component of the original file. When the standard input is sent, - 1- NUSEND(lC) NUSEND(lC) the destination file name is normally taken to be pipe.end. If - is used, the standard input is taken. -!cmd Cmd is sent to the remote machine for execution. A file name or can be used as standard input to the command. If no file is specified, Idev/null is used. EXAMPLES Assuming XXAAA, XXBBB and XXCCC are machines on the NSC network, then: To send files file], file2, and file3 to XXAAA (assuming the source and destination log ins are the same): nus end -d XXAAA filel file2 file3 To send file cprog.c to login name dave on XXBBB and to get confirmation mail returned: nus end -d XXBBB -m -u dave cprog.c To send file myfile to XXCCC and rename it to yourfile (assuming the source and destination logins are the same): nusend -d XXCCC -f your file myfile To send file a.out from XXAAA to login name debbie on XXBBB via remote execution: nusend -d XXAAA .RS -!'nusend -d XXBBB -u debbie 'logdir debbie'/a.out' FILES /etc/passwd /usr/nsc/jobs/C. /usr/nsc/rvchan /usr/nsc/nets I usr I nscllog/ n usend account number for NSC job job queue area table of known destinations table of known networks usage log SEE ALSO mail(1), nscstat(1C). -2- 00(1) 00(1) NAME od - octal dump SYNOPSIS od [ -bcdosx ] [ file ] [ [ + ]offset[ . ][ b ] ] DESCRIPTION Od dumps file in one or more formats as selected by the first argument. If the first argument is missing, - 0 is default. The meanings of the format options are: -b Interpret bytes in octal. -c Interpret bytes in ASCII. Certain non-graphic characters appear as C escapes: null=\O, backspace=\b, form-feed=\f, new-line=\n, return=\r, tab=\t; others appear as 3-digit octal numbers. -d Interpret words in unsigned decimal. -0 Interpret words in octal. -s Interpret 16-bit words in signed decimal. -x Interpret words in hex. The file argument specifies which file is to be dumped. If no file argument is specified, the standard input is used. The offset argument specifies the offset in the file where dumping is to commence. This argument is normally interpreted as octal bytes. If. is appended, the offset is interpreted in decimal. If b is appended, the offset is interpreted in blocks of 512 bytes. If the file argument is omitted, the offset argument must be preceded by +. Dumping continues until end-of-file. SEE ALSO dump(I). - 1- PACK(I) t"ACK\lJ NAME pack, pcat, unpack - compress and expand files SYNOPSIS pack [ - ] name pcat name ... unpack name ... DESCRIPTION Pack attempts to store the specified files in a compressed form. Wherever possible (and useful), each input file name is replaced by a packed file name.z with the same access modes, access and modified dates, and owner as those of name. If pack is successful, name will be removed. Packed files can be restored to their original form using unpack or pcat. Pack uses Huffman (minimum redundancy) codes on a byte-by-byte basis. If the - argument is used, an internal flag is set that causes the number of times each byte is used, its relative frequency, and the code for the byte to be printed on the standard output. Additional occurrences of - in place of name will cause the internal flag to be set and reset. The amount of compression obtained depends on the size of the input file and the character frequency distribution. Because a decoding tree forms the first part of each .z file, it is usually not worthwhile to pack files smaller than three blocks, unless the character frequency distribution is very skewed, which may occur with printer plots or pictures. Typically, text files are reduced to 60-75% of their original size. Load modules, which use a larger character set and have a more uniform distribution of characters, show little compression, the packed versions being about 90% of the original size. Pack returns a value that is the number of files that it failed to compress. No packing will occur if: the file appears to be already packed; the file name has more than 12 characters; the file has links; the file is a directory; the file cannot be opened; no disk storage blocks will be saved by packing; a file called name.z already exists; the .z file cannot be created; an I/O error occurred during processing. The last segment of the file name must contain no more than 12 characters to allow space for the appended .z extension. Directories cannot be compressed. Pcat does for packed files what cat (1) does for ordinary files. The specified files are unpacked and written to the standard output. Thus to view a packed file named name.z use: pcat name.z or just: pcat name To make an unpacked copy, say nnn, of a packed file named name.z (without destroying name .z) use the command: pcat name >nnn Pcat returns the number of files it was unable to unpack. Failure may occur if: - 1- PACK(I) PACK(t) the file name (exclusive of the .z) has more than 12 characters; the file cannot be opened; the file does not appear to be the output of pack. Unpack expands files created by pack. For each file name specified in the command, a search is made for a file called name.z (or just name, if name ends in .z). If this file appears to be a packed file, it is replaced by its expanded version. The new file has the .z suffix stripped from its name, and has the same access modes, access and modification dates, and owner as those of the packed file. Unpack returns a value that is the number of files it was unable to unpack. Failure may occur for the same reasons that it may in pcat, as well as for the following: a file with the "unpacked" name already exists; if the unpacked file cannot be created. -2- PASSWD(I) PASSWD(I) NAME passwd - change login password SYNOPSIS passwd name DESCRIPTION This command changes (or installs) a password associated with the login name. The program prompts for the old password (if any) and then for the new one (twice). The caller must supply these. New passwords should be at least four characters long if they use a sufficiently rich alphabet and at least six characters long if monocase. Only the first eight characters of the password are significant. Only the owner of the name or the super-user' may change a password; the owner must prove he knows the old password. Only the super-user can create a null password. The password file is not changed if the new password is the same as the old password, or if the password has not "aged" sufficiently; see passwd (4). FILES letc/passwd SEE ALSO login(l), crypt(3C), passwd(4). - 1- PASTE (I) PASTE(l) NAME paste - merge same lines of several files or subsequent lines of one file SYNOPSIS paste file 1 file2 ... paste -dlist filel file2 paste -s (-dlistl filel file2 DESCRIPTION In the first two forms, paste concatenates corresponding lines of the given input files file] ,file2, etc. It treats each file as a column or columns of a table and pastes them together horizontally (parallel merging). If you will, it is the counterpart of cat (1) which concatenates vertically, i.e., one file after the other. In the last form above, paste subsumes the function of an older command with the same name by combining subsequent lines of the input file (serial merging). In all cases, lines are glued together with the tab character, or with characters from an optionally specified list. Output is to the standard output, so it can be used as the start of a pipe, or as a filter, if - is used in place of a file name. The meanings of the options are: -d Without this option, the new-line characters of each but the last file (or last line in case of the -s option) are replaced by a tab character. This option allows replacing the tab character by one or more alternate characters (see below). list One or more characters immediately following -d replace the default tab as the line concatenation character. The list is used circularly, i. e. when exhausted, it is reused. In parallel merging G. e. no -s option), the lines from the last file are always terminated with a new-line character, not from the list. The list may contain the special escape sequences: \0 (new-line), \t (tab), \ \ (backs lash) , and \0 (empty string, not a null character). Quoting may be necessary, if characters have special meaning to the shell (e.g. to get one backslash, use -d"\\\\" ). -s Merge subsequent lines rather than one from each input file. Use tab for concatenation, unless a list is specified with -d option. Regardless of the list, the very last character of the file is forced to be a new-line. May be used in place of any file name, to read a line from the standard input. (There is no prompting). EXAMPLES Is Is I I paste -d" " paste - - - - paste -s -d"\t\n" file list directory in one column list directory in four columns combine pairs of lines into lines SEE ALSO grep(I), cut(1), pr(1): pr -t -m ... works similarly, but creates extra blanks, tabs and newlines for a nice page layout. DIAGNOSTICS line too long Output lines are restricted to 511 characters. too many files Except for -s option, no more than 12 input files may be specified. - 1- PR(l) PR(l) NAME pr - print files SYNOPSIS pr [ options ] [ files ] DESCRIPTION Pr prints the named files on the standard output. If file is -, or if no files are specified, the standard input is assumed. By default, the listing is separated into pages, each headed by the page number, a date and time, and the name of the file. By default, columns are of equal width, separated by at least one space; lines which do not fit are truncated. If the -s option is used, lines are not truncated and columns are separated by the separation character. If the standard output is associated with a terminal, error messages are withheld until pr bas completed printing. The below options may appear singly or be combined in any order: +k Begin printing with page k (default is 1). -k Produce k-column output (default is 1). The options -e and -i are assumed for multi-column output. -a -m Print multi-column output across the page. Merge and print all files simultaneously, one per column (overrides the -k, and -a options). -d Double-space the output. -eck Expand input tabs to character positions k+l, 2*k+l, 3*k+l, etc. If k is 0 or is omitted, default tab settings at every eighth position are assumed. Tab characters in the input are expanded into the appropriate number of spaces. If c (any non-digit character) is given, it is treated as the input tab character (default for c is the tab character). -ick In output, replace white space wherever possible by inserting tabs to character positions k+l, 2*k+l, 3*k+l, etc. If k is 0 or is omitted, default tab settings at every eighth position are assumed. If c (any non-digit character) is given, it is treated as the output tab character (default for c is the tab character). -nck Provide k-digit line numbering (default for k is 5). The number occupies the first k+ 1 character positions of each column of normal output or each line of -m output. If c (any non-digit character) is given, it is appended to the line number to separate it from whatever follows (default for c is a tab). -wk Set the width of a line to k character positions (default is 72 for equal-width multi-column output, no limit otherwise). -ok Offset each line by k character positions (default is O). The number of character positions per line is the sum of the width and offset. -Ik Set the length of a page to k lines (default is 66). -h Use the next argument as the header to be printed instead of the file name. -p Pause before beginning each page if the output is directed to a terminal (pr will ring the bell at the terminal and wait for a carriage return). -f Use form-feed character for new pages (default is to use a sequence of line-feeds). Pause before beginning the first page if the standard - 1- PR(I) PR (I) output is associated with a terminal. -r Print no diagnostic reports on failure to open files. -t Print neither the five-line identifying header nor the five-line trailer normally supplied for each page. Quit printing after the last line of each file without spacing to the end of the page. -sc Separate columns by the single character c instead of by the appropriate number of spaces (default for c is a tab). EXAMPLES Print filel and file2 as a double-spaced, three-column listing headed by "file list": pr -3dh "file list" filel file2 Write filel on file2, expanding tabs to columns 10, 19, 28, 37, ... : pr -e9 -t < file 1 > file2 FILES /dev/tty. to suspend messages SEE ALSO cat{I). -2- PROF(1) PROF(t) NAME prof - display profile data SYNOPSIS prof [-tcao] [-ox] [-g] [-z] [-h] [-s] [-m mdata] [prog] DESCRIPTION Prof interprets the profile file produced by the monitor (3C) function. The symbol table in the object file prog (a.out by default) is read and correlated with the profile file (moo. out by default). For each external text symbol the percentage of time spent executing between the address of that symbol and the address of the next is printed, together with the number of times that function was called and the average number of milliseconds per call. The mutually exclusive options t, c, a, and the output lines: 0 determine the type of sorting of -t Sort by decreasing percentage of total time (default). -c Sort by decreasing number of calls. -a Sort by increasing symbol address. -0 Sort lexically by symbol name. The mutually exclusive options each symbol monitored: 0 and x specify the printing of the address of -0 Print each symbol address Gn octal} along with the symbol name. -x Print each symbol address Gn hexadecimal} along with the symbol name. The following options may be used in any combination: -g Include non-global symbols (static functions). -z Include all symbols in the profile range (see monitor(3C», even if associated with zero number of calls and zero time. -h Suppress the heading normally printed on the report. (This is useful if the report is to be processed further') Print a summary of several of the monitoring parameters and statistics on the standard error output. -s -m mdata Use file mdata instead of moo. out for profiling data. For the number of calls to a function to be tallied, the -p option of cd!) must have been given when the file containing the function was compiled. This option to the cc command also arranges for the object file to include a special profiling start-up function that calls monitor(3C) at the beginning and end of execution. It is the call to monitor at the end of execution that causes the moo.out file to be written. Thus, only programs that call exit (2) or return from main will cause the mOD.out file to be produced. FILES mon.out for profile a.out for namelist SEE ALSO cd!), nm(!), exit(2), profil(2), monitor(3C). - 1- PROF(I) PROF(I) BUGS There is a limit of 300 functions that may have call counters established during program execution. If this limit is exceeded, other data will be overwritten and the mOD.out file will be corrupted. The number of call counters used will be reported automatically by the prof command whenever the number exceeds 250. - 2- PRS(I) PRS(I) NAME prs - print an sees file SYNOPSIS prs [-d[dataspec]] [-r[SID]] [-e1 [-I] [-a] files DESCRIPTION Prs prints, on the standard output, parts or all of an sees file (see sccsfile (4» in a user supplied format. If a directory is named, prs behaves as though each file in the directory were specified as a named file, except that non-SeeS files (last component of the path name does not begin with s.), and unreadable files are silently ignored. If a name of - is given, the standard input is read; each line of the standard input is taken to be the name of an sees file or directory to be processed; non-SeeS files and unreadable files are silently ignored. Arguments to prs, which may appear in any order, consist of keyletter arguments, and file names. All the described keyletter arguments apply independently to each named file: -d[dataspec] Used to specify the output data specification. The dataspec is a string consisting of sees file data keywords (see DATA KEYWORDS) interspersed with optional user supplied text. -r[SID] Used to specify the sees IDentification (SID) string of a delta for which information is desired. If no SID is specified, the SID of the most recently created delta is assumed. -e Requests information for all deltas created earlier than and including the delta designated via the -r keyletter. -I Requests information for all deltas created later than and including the delta designated via the -r keyletter. -a Requests printing of information for both removed, i.e., delta type = R, (see rmdeH 1) and existing, i.e., delta type = D, deltas. If the -a keyletter is not specified, information for existing deltas only is provided. DATA KEYWORDS Data keywords specify which parts of an sees file are to be retrieved and output. All parts of an sees file (see sccsfile (4» have an associated data keyword. There is no limit on the number of times a data keyword may appear in a dataspec. The information printed by prs consists of: (1) the user supplied text; and (2) appropriate values (extracted from the sees file) substituted for the recognized data keywords in the order of appearance in the dataspec. The format of a data keyword value is either Simple (S), in which keyword substitution is direct, or Multi-line (M), in which keyword substitution is followed by a carriage return. User supplied text is any text other than recognized data keywords. A tab is specified by \t and carriage return/new-line is specified by \n. - 1- PRS(l) PRS(l) TABLE 1. Keyword :Dt: :DL: :Li: :Ld: :Lu: :DT: :1: :R: :L: :B: :S: :D: :Dy: :Dm: :Dd: :T: :Th: :Tm: :Ts: :P: :DS: :DP: :DI: :Dn: :Dx: :Dg: :MR: :C: :UN: :FL: :Y: :MF: :MP: :KF: :BF: :J: :LK: :Q: :M: :FB: :CB: :Ds: :ND: :FD: :BD: :GB: :W: :A: :Z: :F: :PN: sees Files Data Keywords Data Item Delta information Delta line statistics Lines inserted by Delta Lines deleted by Delta Lines unchanged by Delta Delta type SCCS ID string (SID) Release number Level number Branch number Sequence number Date Delta created Year Delta created Month Delta created Day Delta created Time Delta created Hour Delta created Minutes Delta created Seconds Delta created Programmer who created Delta Delta sequence number Predecessor Delta seq-no. Seq-no. of deltas incl., excl., ignored Deltas included (seq #) Deltas excluded (seq #) Deltas ignored (seq #) MR numbers for delta Comments for delta User names Flag list Module type flag MR validation flag MR validation pgm name Keyword error/warning flag Branch flag Joint edit flag Locked releases User defined keyword Module name Floor boundary Ceiling boundary Default SID Null delta flag File descriptive text Body Gotten body A form of what (I) string A form of what (I) string what (I) string delimiter SCCS file name SCCS file path name * :Dt: = File Section Delta Table Value Format See below* S :Li:I:Ld:/:Lu: S nnnnn S nnnnn S nnnnn S D or R S :R:.:L:.:B:.:S: S nnnn S nnnn S nnnn S nnnn S :Dy:/:Dm:/:Dd: S nn S nn S nn S :Th:::Tm:::Ts: S nn S nn S nn S logname S nnnn S nnnn S :Dn:/:Dx:/:Dg: S :DS: :DS: ... S :DS: :DS: ... S :DS: :DS: ... S text M text M User Names text M Flags text M text S yes or no S text S yes or no S yes or no S yes or no S S :R: ... text S text S :R: S :R: S :1: S yes or no S Comments text M Body text M text M N/A :Z::M:\t:I: S :Z::Y: :M: :I::Z: N/A S @(#) S N/A N/A text S N/A text S :DT: :1: :D: :T: :P: :DS: :DP: - ") - PRS(I) PRS(I) EXAMPLES prs -d"Users and/or user IDs for :F: are:\n:UN:" sofile may produce on the standard output: Users and/or user IDs for sofile are: xyz 131 abc prs -d"Newest delta for pgm :M:: :1: Created :D: By :P:" -r sofile may produce on the standard output: Newest delta for pgm mainoc: 307 Created 77/12/1 By cas As a special case: prs sofile may produce on the standard output: D 1.1 77/1211 00:00:00 cas 1 000000/00000/00000 MRs: b178-12345 b179-54321 COMMENTS: this is the comment line for So file initial delta for each delta table entry of the "D" type. The only keyletter argument allowed to be used with the special case is the -a keyletter. FILES Itmp/pr????? SEE ALSO admin(I), delta(I), get(I), help(I), sccsfile(4). Source Code Control System User's Guide in the UNIX System User's Guide. DIAGNOSTICS Use help (1) for explanations. PS(I) PS(I) NAME ps - report process status SYNOPSIS ps [ options ] DESCRIPTION Ps prints certain information about active processes. Without options, information is printed about processes associated with the current terminal. Otherwise, the information that is displayed is controlled by the following options: -e Print information about all processes. Print information about all processes, except process group leaders. -a Print information about all processes, except process group leaders and processes not associated with a terminal. -f Generate a luI/listing. (Normally, a short listing containing only process ID, terminal ("tty") identifier, cumulative execution time, and the command name is printed.) See below for meaning of columns in a full listing. -I Generate a long listing. See below. -c corefile Use the file corefile in place of Idev/mem. -s swapdev Use the file swapdev in place of Idev/swap. This is useful when examining a corefile; a swapdev of Idev/oull will cause the user block to be zeroed out. - 0 namelist The argument will be taken as the name of an alternate namelist (/unix is the default). -t tlist Restrict listing to data about the processes associated with the terminals given in tlist, where tlist can be in one of two forms: a list of terminal identifiers separated from one another by a comma, or a list of terminal identifiers enclosed in double quotes and separated from one another by a comma and/or one or more spaces. -p plist Restrict listing to data about processes whose process ID numbers are given in plist, where plist is in the same format as tlist. -u ulist Restrict listing to data about processes whose user ID numbers or login names are given in ulist, where ulist is in the same format as tlist. In the listing, the numerical user ID will be printed unless the -f option is used, in which case the login name will be printed. -g glist Restrict listing to data about processes whose process groups are given in glist, where glist is a list of process group leaders and is in the same format as tlist. -d The column headings and the meaning of the columns in a ps listing are given below; the letters f and 1 indicate the option (full or long) that causes the corresponding heading to appear; all means that the heading always appears. Note that these two options only determine what information is provided for a process; they do not determine which processes will be listed. F O} S O} Flags (octal and additive) associated with the process: 01 in core; 02 system process; 04 locked in core (e.g., for physical IIO); being swapped; 10 20 being traced by another process; 40 another tracing flag. The state of the process: - 1- PS(t) PS(t) o non-existent; sleeping; waiting; running; interll1ediate; terll1inated; stopped; X growing. The user ID nUll1ber of the process owner; the login nall1e is printed under the -f option. The process ID of the process; it is possible to kill a process if you know this datull1. The process ID of the parent process. Processor utilization for scheduling. Starting till1e of the process. The priority of the process; higher nUll1bers ll1ean lower priority. Nice value; used in priority cOll1putation. The ll1ell1ory address of the process (a pointer to the segll1ent table array on the 3B20S), if resident; otherwise, the disk address. The size in blocks of the core ill1age of the process. The event for which the process is waiting or sleeping; if blank, the process is running. The controlling terll1inal for the process. The cUll1ulative execution till1e for the process. The cOll1ll1and nall1e; the full cOll1ll1and nall1e and its argull1ents are printed under the -f option. S W R I Z T UID (f,O PID (all) PPID C STIME PRI (f,O (f,O NI ADDR (1) (1) sz (1) (1) WCHAN TrY TIME CMD (f) (1) (all) (all) (all) A process that has exited and has a parent, but has not yet been waited for by the parent, is ll1arked . Under the -f option, ps tries to deterll1ine the cOll1ll1and nall1e and argull1ents given when the process was created by exall1ining ll1ell1ory or the swap area. Failing this, the cOll1ll1and nall1e, as it would appear without the -f option, is printed in square brackets. FILES /unix / dev / ll1ell1 /dev/swap /etc/passwd /etc/ps_data /dev systell1 nall1elist. ll1ell1ory. the default swap device. supplies UID inforll1ation. internal data structure. searched to find terll1inal ("tty") nall1es. SEE ALSO kill(!), nice(1). BUGS Things can change while ps is running; the picture it gives is only a close approxill1ation to reality. SOll1e data printed for defunct processes are irrelevant. - 2- PTX(1) PTX(1) NAME ptx - permuted index SYNOPSIS ptx [ options ] [ input [ output ] ] DESCRIPTION Ptx generates the file output that can be processed with a text formatter to produce a permuted index of file input (standard input and output default). It has three phases: the first does the permutation, generating one line for each keyword in an input line. The keyword is rotated to the front. The permuted file is then sorted. Finally, the sorted lines are rotated so the keyword comes at the middle of each line. Ptx output is in the form: .xx "tail" "before keyword" "keyword and after" "head" where .xx is assumed to be an nroff or troff(I) macro provided by the user, or provided by the mptx (S) macro package. The before keyword and keyword and after fields incorporate as much of the line as will fit around the keyword when it is printed. Tail and head, at least one of which is always the empty string, are wrapped-around pieces small enough to fit in the unused space at the opposite end of the line. The following options can be applied: -f Fold upper and lower case letters for sorting. -t Prepare the output for the phototypesetter. -w n Use the next argument, n, as the length of the output line. The default line length is 72 characters for nroff and 100 for troff. -g n Use the next argument, n, as the number of characters that ptx will reserve in its calculations for each gap among the four parts of the line as finally printed. The default gap is 3. -0 only Use as keywords only the words given in the only file. -i ignore Do not use as keywords any words given in the ignore file. If the -i and - 0 options are missing, use /usrllib/eign as the ignore file. -b break Use the characters in the break file to separate words. Tab, newline, and space characters are always used as break characters. Take any leading non-blank characters of each input line to be a reference identifier (as to a page or chapter), separate from the text of the line. Attach that identifier as a Sth field on each output line. The index for this manual was generated using ptx. -r FILES Ibin/sort lusr Ilibl eign lusr/lib/tmac/tmac.ptx SEE ALSO nroff(I), troff(I), mm(S), mptx(S). BUGS Line length counts do not account for overstriking or proportional spacing. Lines that contain tildes (-) are botched, because ptx uses that character internally. - 1- PWD(1) PWD(1) NAME pwd - working directory name SYNOPSIS pwd DESCRIPTION Pwd prints the path name of the working (current) directory. SEE ALSO cd(l). DIAGNOSTICS "Cannot open .. " and "Read error in .. " indicate possible file system trouble and should be referred to a UNIX System programming counselor. - 1- RATFOR(I) RATFOR(I) NAME ratfor - rational Fortran dialect SYNOPSIS ratfor [ options ] [ files ] DESCRIPTION Ratfor converts a rational dialect of Fortran into ordinary irrational Fortran. Ratfor provides control flow constructs essentially identical to those in C: statement grouping: { statement; statement; statement} decision-making: . if (condition) statement [ else statement] switch (integer value) { case integer: statement [ default: ] statement loops: while (condition) statement for (expression; condition; expression) statement do limits statement repeat statement [ until (condition) break next and some syntactic sugar to make programs easier to read and write: free form input: multiple statements/line; automatic continuation comments: # this is a comment. translation of relationals: >, > =, etc., become .GT., .GE., etc. return expression to caller from function: return (expression) define: define name replacement include: include file The option - h causes quoted strings to be. turned into 27" constructs. The -C option copies comments to the output and attempts to format it neatly. Normally, continuation lines are marked with a & in column 1; the option -6x makes the continuation character x and places it in column 6. Ratfor is best used with j77 (1) . SEE ALSO eft (1), t77 (1). B. W. Kernighan and P. J. Plauger, Software Tools, Addison-Wesley, 1976. - 1- REGCMP(I) REGCMP(I) NAME regcmp - regular expression compile SYNOPSIS regcmp [ - ] files DESCRIPTION Regcmp, in most cases, precludes the need for calling regcmp (3X) from C programs. This saves on both execution time and program size. The command regcmp compiles the regular expressions in file and places the output in file.i. If the - option is used, the output will be placed in file.c. The format of entries in file is a name (C variable) followed by one or more blanks followed by a regular expression enclosed in double quotes. The output of regcmp is C source code. Compiled regular expressions are represented as extern char vectors. File.i files may thus be included into C programs, or file.c files may be compiled and later loaded. In the C program which uses the regcmp output, regex(abc,line) will apply the regular expression named abc to line. Diagnostics are self-explanatory. EXAMPLES name "([A-Za-z][A-Za-zO-9 J.)$O" telno "\ ({O, 1}([2-9][Ol][ 1-9]) $O\){O, I} ." "([2-9][O-9]{2})$I[ - ]{O,l}" "([O-9]{4}) $2" In the C program that uses the regcmp output, reg ex (telno, line, area, exch, rest) will apply the regular expression named telno to line. SEE ALSO regcmp(3X) . - 1- 1 RJESTAT(lC) RJESTAT(IC) NAME rjestat - RJE status report and interactive status console SYNOPSIS rjestat [host 1... [-shost ] [ -chost cmd 1. .. DESCRIPTION Rjestat provides a method of determining the status of an RJE link and of simulating an IBM remote console (with UNIX System features added). When invoked with no arguments, rjestat reports the current status of all the RJE links connected to to the UNIX System. The options are: host Print the st~tus of the line to host. Host is the pseudonym for a particular IBM system. It can be any name that corresponds to one in the first column of the RJE configuration file. -shost After all the arguments have been processed, start an interactive status console to host. -chost cmd Interpret cmd as if it were entered in status console mode to host. See below for the proper format of cmd. In status console mode, rjestat prompts with the host pseudonym followed by : whenever it is ready to accept a command. Commands are terminated with a new-line. A line that begins with! is sent to the UNIX System shell for execution. A line that begins with the letter q terminates rjestat. All other input lines are assumed to have the form: ibmcmd [ redirect ] Ibmcmd is any IBM JES or HASP command. Only the super-user or rje login can send commands other than display or inquiry commands. Redirect is a pipeline or a redirection to a file (e.g., "> file" or " I grep ... "). The IBM response is written to the pipeline or file. If redirect is not present, the response is written to the standard output of rjestat. An interrupt signal (DEL or BREAK) will cancel the command in progress and cause rjestat to return to the command input mode. EXAMPLE The following command reports the status of all the card readers attached to host A, remote 5. JES2 is assumed. rjestat -cA '$du,rmt5 I grep RD' DIAGNOSTICS The message "RJE error: ... " indicates that rjestat found an inconsistency in the RJE system. This may be transient but should be reported to the site administrator. FILES lusr/rje/lines RJE configuration file resp host response file that exists in the RJE subsystem directory (e.g., lusr Irjel). SEE ALSO send(1C). OSIVS2 HASP II Version 4 Operator's Guide, IBM SRL #GC27-6993. Operator's Library: OSIVS2 Reference (JES2) , IBM SRL #GC38-021D. - 1- RM(1) RM(1) NAME rm, rmdir - remove files or directories SYNOPSIS rm [ -fri ] file rmdir dir ... DESCRIPTION Rm removes the entries for one or more files from a directory. If an entry was the last link to the file, the file is destroyed. Removal of a file requires write permission in its directory, but neither read nor write permission on the file itself. If a file has no write permission and the standard input is a terminal, its permissions are printed and a line is read from the standard input. If that line begins with y the file is deleted, otherwise the file remains. No questions are asked when the -f option is given or if the standard input is not a terminal. If a designated file is a directory, an error comment is printed unless the optional argument -r has been used. In that case, rm recursively deletes the entire contents of the specified directory, and the directory itself. If the -i (interactive) option is in effect, rm asks whether to delete each file, and, under -r, whether to examine each directory. Rmdir removes entries for the named directories, which must be empty. SEE ALSO unlink(2). DIAGNOSTICS Generally self-explanatory. It is forbidden to remove the file merely to avoid the antisocial consequences of inadvertently doing something like: rm -r 00 0* - 1- RMDEL(l) RMDEL(l) NAME rmdel - remove a delta from an sees file SYNOPSIS rmdel -rSID files DESCRIPTION Rmdel removes the delta specified by the SID from each named sees file. The delta to be removed must be the newest (most recent) delta in its branch in the delta chain of each named sees file. In addition, the specified must not be that of a version being edited for the purpose of making a delta G. e., ·if a p-file (see get (1» exists for the named sees file, the specified must not appear in any entry of the p-file). If a directory is named, rmdel behaves as though each file in the directory were specified as a named file, except that non-sees files (last component of the path name does not begin with s.) and unreadable files are silently ignored. If a name of - is given, the standard input is read; each line of the standard input is taken to be the name of an sees file to be processed; non-SeeS files and unreadable files are silently ignored. The exact permissions necessary to remove a delta are documented in the Source Code Control System User's Guide. Simply stated, they are either (1) if you make a delta you can remove it; or (2) if you own the file and directory you can remove a delta. FILES x-file z-file (see delta (1» (see delta (1» SEE ALSO delta(1), get(1), help(l), prs(1), sccsfile(4). Source Code Control System User's Guide in the UNIX System User's Guide. DIAGNOSTICS Use help (1) for explanations. - 1- SACT(1) SACT(1) t NAME sact - print current SCCS file editing activity SYNOPSIS sact files DESCRIPTION Sact informs the user of any impending deltas to a named sees file. This \ situation occurs when get(1) with the -e option has been previously executed without a subsequent execution of delta (1). If a directory is named on the command line, sact behaves as though each file in the directory were specified as a named file, except that non-SeCS files and unreadable files are silently \ ignored. If a name of - is given, the standard input is read with each line being taken as the name of an sees file to be processed. The output for each named file consists of five fields separated by spaces. Field 1 specifies the SID of a delta that currently exists in the sees file to which changes will be made to make the new delta. Field 2 specifies the SID for the new delta to be created. Field 3 contains the logname of the user who will make the delta (i.e. executed a get for editing). Field 4 contains the date that get -e was executed. Field 5 contains the time that get -e was executed. SEE ALSO delta (1), get (1), unget (1) . DIAGNOSTICS Use he/p(1) for explanations. - 1- SADP(1) SADP(I) NAME sadp - disk access profiler SYNOPSIS sadp [ -th ] [ -d device[ -drive] ] s [ n ] DESCRIPTION Sadp reports disk access location and seek distance, in tabular or histogram form. It samples disk activity once every second during an interval of s seconds. This is done repeatedly if n is specified. Cylinder usage and disk distance are recorded in units of eight cylinders. Valid values of device are rp06, rm05, and disk. Drive specifies the disk drives and it may be: a drive number in the range supported by device, two numbers separated by a minus (indicating an inclusive range), or a list of drive numbers separated by commas. Up to eight disk drives may be reported. The -d option may be omitted, if only one device is present. The -t flag causes the data to be reported in tabular form. The - h flag produces a histogram on the printer of the data. Default is -t. EXAMPLE The command: sadp -d rp06 -0 900 4 will generate 4 tabular reports, each describing cylinder usage and seek distance of rp06 disk drive 0 during a 15 minute interval. FILES Idev/kmem - 1- SAG(lG) SAG(lG) NAME sag - system activity graph SYNOPSIS sag [ options ] DESCRIPTION Sag graphically displays the system activity data stored in a binary data file by a previous sar(!) run. Any of the sar data items may be plotted singly, or in combination; as cross plots, or versus time. Simple arithmetic combinations of data may be specified. Sag invokes sar and finds the desired data by stringmatching the data column header (run sar to see what's available). These options are passed thru to sar: -s time Select data later than time in the form hh l:mm1. Default is 08:00. -e time Select data up to time. Default is 18:00. -i sec Select data at intervals as close as possible to sec seconds. -f file Use file as the data source for sar. Default is the current daily data file lusr/adm/sa/sadd. Other options: -T term Produce output suitable for terminal term. See tplot(1 G) for known terminals. If term is vpr, output is processed by vpr -p and queued to a Versatec printer. Default for term is $TERM. -x spec x axis specification with spec in the form: "name lop name] ... [10 hi)" -y spec y axis specification with spec in the same form as above. Name is either a string that will match a column header in the sar report, with an optional device name in square brackets, e.g., r+w/sldsk-1], or an integer value. Op is + - • or I surrounded by blanks. Up to five names may be specified. Parentheses are not recognized. Contrary to custom, + and have precedence over • and I. Evaluation is left to right. Thus A I A + B * 100 is evaluated (A/(A+B»*100, and A + B I C + D is (A+B)/(C+D). Lo and hi are optional numeric scale limits. If unspecified, they are deduced from the data. A single spec is permitted for the x axis. If unspecified, time is used. Up to 5 spec's separated by ; may be given for -yo Enclose the -x and -y arguments in "" if blanks or \ are included. The -y default is: -y "% usr 0 100; %usr + %sys 0 100; %usr + %sys + %wio 0 100" EXAMPLES To see today's CPU utilization: sag To see activity over 15 minutes of all disk drives: TS='date +%H:%M' sar -0 tempfile 60 15 TE='date +%H:%M' sag -f tempfile -s $TS -e $TE -y "r+w/s[dsk]" FILES lusr/adm/sa/sadd daily data file for day dd. SEE ALSO sar(1), tplot(1G). - 1- SAR(t) SAR(t) NAME sar - system activity reporter SYNOPSIS sar [ -ubdycwaqvmA] [ -0 file] t [ n ] sar [ -ubdycwaqvmA] [ -s time] [ -e time] [-i sec1 [ -f file] DESCRIPTION Sar, in the first instance, samples cumulative activity counters in the operating system at n intervals of t seconds. If the - 0 option is specified, it saves the samples in file in binary format. The default value of n is 1. In the second instance, with no sampling interval specified, sar extracts data from a previously recorded file, either the one specified by -f option or, by default, the standard system activity daily data file lusr/adm/sa/sadd for the current day dd. The starting and ending times of the report can be bounded via the -s and -e time arguments of the form hh[:mm[:ss)). The -i option selects records at sec second intervals. Otherwise, all intervals found in the data file are reported. In either case, subsets of data to be printed are specified by option: Report CPU utilization (the default): %usr, %sys, %wio, %idle - portion of time running in user mode, running in system mode, idle with some process waiting for block 110, and otherwise idle. -b Report buffer activity: bread/s, bwrit/s - transfers per second of data between system buffers and disk or other block devices; lread/s, lwrit/s - accesses of system buffers; %rcache, %wcache - cache hit ratios, e. g., 1 - bread/lread; pread/s, pwrit/s - transfers via raw (physical) device mechanism. -d Report activity for each block device, e. g., disk or tape drive: %busy, avque - portion of time device was busy servicing a transfer request, average number of requests outstanding during that time; r+w/s, blks/s - number of data transfers from or to device, number of bytes transferred in 512 byte units; avwait, avserv - average time in ms. that transfer requests wait idly on queue, and average time to be serviced (which for disks includes seek, rotational latency and data transfer times). -y Report TTY device activity: rawch/s, canch/s, outch/s - input character rate, input character rate processed by canon, output character rate; rcvin/s, xmtin/s, mdmin/s - receive, transmit and modem interrupt rates. -c Report system calls: scall/s - system calls of all types; sread/s, swrit/s, fork/s, exec/s - specific system calls; rchar/s, wchar/s - characters transferred by read and write system calls. -w Report system swapping and switching activity: swpin/s, swpot/s, bswin/s, bswot/s - number of transfers and number of 512 byte units transferred for swapins (including initial loading of some programs) and swapouts; pswch/s - process switches. -a Report use of file access system routines: iget/s, namei/s, dirblk/s. -q Report average queue length while occupied, and % of time occupied: runq-sz, %runocc - run queue of processes in memory and runnable; swpq-sz, %swpocc - swap queue of processes swapped out but ready to run. -u - 1- SAR(l) SAR(I) -v Report status of text, process, inode and file tables: text-sz, proc-sz, inod-sz, file-sz - entries/size for each table, evaluated once at sampling point; text-ov, proc-ov, inod-ov, file-ov - overflows occurring between sampling points. -m Report message and semaphore activities: msg/s, sema/s - primitives per second. - A Report all data. Equivalent to -udqbwcayvm. EXAMPLES To see today's CPU activity so far: sar To watch CPU activity evolve for 10 minutes and save data: sar -0 temp 60 10 To later review disk and tape activity from that period: sar -d -f temp FILES /usr/adm/sa/sadd daily data file, where dd are digits representing the day of the month. SEE ALSO sag(IG). sar(IM) in the UNIX System Administrator's Manual. - 2- seAT(I) SCAT(I) NAME scat - concatenate and print files on synchronous printer SYNOPSIS scat [ -u ] [ -s ] file ... DESCRIPTION Scat reads each file in sequence and writes it on the standard output, which is assumed to be a synchronous printer device. Thus: scat file> /dev/spO prints the file, and: cat filel file2 > /dev/spO concatenates file] and file2 and places the result on the printer. If no input file is given, or if the argument - is encountered, scat reads from the standard input file. Output is buffered in 512-byte blocks unless the -u option is specified. The -s option makes scat silent about non-existent files. SEE ALSO cp(I), pr(I), stty(I). WARNINGS Scat uses synchronous printers in line mode with the wrap around option enabled. This means that the maximum line length is 79 characters; longer lines will be wrapped back to the beginning of the next line each time the end of a printer line is reached. - 1- SCC(l) see(l) (DEC only) NAME scc - C compiler for stand-alone programs SYNOPSIS see [ +[ lib ] ] [ option ] ... [ file ] ... DESCRIPTION See prepares the named files for stand-alone execution. The option and file arguments may be anything that can legally be used with the ee command; it should be noted, though, that the -p (profiling) option, as well as any object module that contains system calls, will cause the executable not to run. See defines the compiler constant, STANDALONE, so that sections of C programs may be compiled conditionally when the executable will be run standalone. The first argument specifies an auxiliary library that defines the device configuration of the PDP-II computer for which the stand-alone executable is being prepared. Lib may be one of the following: A RP04/05/06 disk and TUI6 magnetic tape, or equivalent on the PDPII plus RM05 and RM80 disks, and TU78 and TSII tapes, or equivalent on the V AX B RKIl1RK05 disk, RPIlIRP03 disk, and TMI1/TUI6 magnetic tape, or equivalent If no + lib argument is specified, +A is assumed. If the + argument is specified alone, no configuration library is loaded unless the user supplies his own. FILES llib/crt2.o execution start-off stand-alone library lusr Ilib/lib2.a lusr llib/lib2A.a +A configuration library lusr/libllib2B.a +B configuration library SEE ALSO cc(I), Id(I), a.out(4). - I - (PDP-II only) (PDP-II only) l SCCSDIFF(1) SCCSDIFF(1) NAME sccsdiff - compare two versions of an sees file SYNOPSIS sccsdiff -rSID 1 -rSID2 [-p] [-sn] files DESCRIPTION Sccsdiff compares two versions of an secs file and generates the differences between the two versions. Any number of sces files may be specified, but arguments apply to all files. -rSID? -p -sn sees file that are to be compared. Versions are passed to bdiff{I) in the order given. SID1 and SID2 specify the deltas of an pipe output for each file through pr(1). n is the file segment size that bdiff will pass to diff(l). This is useful when diff fails due to a high system load. FILES /tmp/get????? Temporary files SEE ALSO bdiff(l), get(1), help(1), pr(1). Source Code Control System UNIX System User's Guide. DIAGNOSTICS ''file: No differences" If the two versions are the same. Use help (1) for explanations. - 1- SDB(1) (not on PDP-II) SDB(I) NAME sdb - symbolic debugger SYNOPSIS sdb [-w] [ - W] [ objfil [ corfil [ directory ] ] ] DESCRIPTION Sdb is a symbolic debugger which can be used with C and F77 programs. It may be used to examine their object files and core files and to provide a controlled environment for their execution. . Objfil is normally an executable program file which has been compiled with the -g (debug) option; if it has not been compiled with the -g option, or if it is not an executable file, the symbolic capabilities of sdb will be limited, but the file can still be examined and the program debugged. The default for objfil is a.out. Corfil is assumed to be a core image file produced after executing objfil; the default for corfU is core. The core file need not be present. A - in place of corfil will force sdb to ignore any core image file. Source files used in constructing objfil must be in directory to be located. It is useful to know that at any time there is a current line and current file. If corfil exists then they are initially set to the line and file containing the source statement at which the process terminated. Otherwise, they are set to the first line in main O. The current line and file may be changed with the source file examination commands. By default, warnings are provided if the source files used in producing objfil cannot be found, or are newer than objfil. This checking feature and the accompanying warnings may be disabled by the use of the -W flag. Names of variables are written just as they are in C or F77. Variables local to a procedure may be accessed using the form procedure:variable. If no procedure name is given, the procedure containing the current line is used by default. It is also possible to refer to structure members as variable.member, pointers to structure members as variable- > member and array elements as variablelnumberl. Pointers may be dereferenced by using the form pointerlOI. Combinations of these forms may also be used. F77 common variables may be referenced by using the name of the common block instead of the structure name. Blank common variables may be named by the form .variable. A number may be used in place of a structure variable name, in which case the number is viewed as the address of the structure, and the template used for the structure is that of the last structure referenced by sdb. An unqualified structure variable may also be used with various commands. Generally, sdb will interpret a structure as a set of variables. Thus, sdb will display the values of all the elements of a structure when it is requested to display a structure. An exception to this interpretation occurs when displaying variable addresses. An entire structure does have an address, and it is this value sdb displays, not the addresses of individual elements. Elements of a multidimensional array may be referenced as variablelnumberHnumber1. .. , or as variablelnumber,number, ... 1. In place of number, the form number;number may be used to indicate a range of values, • may be used to indicate all legitimate values for that subscript, or subscripts may be omitted entirely if they are the last subscripts and the full range of values is desired. As with structures, sdb displays all the values of an array or of the section of an array if trailing subscripts are omitted. It displays only the address of the array itself or of the section specified by the user if SUbscripts are omitted. A multidimensional parameter in an F77 program cannot be displayed as an array, but it is actually a pointer, whose value is the location of - 1- (not on PDP-I 1) SDB(I) SDB(I) the array. The array itself can be accessed symbolically from the calling function. A particular instance of a variable on the stack may be referenced by using the form procedure:variable,number. All the variations mentioned in naming variables may be used. Number is the occurrence of the specified procedure on the stack, counting the top, or most current, as the first. If no procedure is specified, the procedure currently executing is used by default. It is also possible to specify a variable by its address. All forms of integer constants which are valid in C may be used, so that addresses may be input in decimal, octal or hexadecimal. Line numbers in the source program are referred to as file-name:number or procedure:number. In either case the number is relative to the beginning of the file. If no procedure or file name is given, the current file is used by default. If no number is given, the first line of the named procedure or file is used. While a process is running under sdb all addresses refer to the executing program; otherwise they refer to objfil or corfil. An initial argument of -w permits overwriting locations in objfil. Addresses. The address in a file associated with a written address is determined by a mapping associated with that file. Each mapping is represented by two triples (bI, eI, II) and (b2, e2,12) and the file address corresponding to a written address is calculated as follows: bi address < el file address==ad-!ress+lI-bi otherwise b2address < e2 file address ==address +12 -b2, otherwise, the requested address is not legal. In some cases (e.g. for programs with separated I and D space) the two segments for a file may overlap. The initial setting of both mappings is suitable for normal a.out and core files. If either file is not of the kind expected then, for that file, bi is set to 0, ei is set to the maximum file size, and 11 is set to 0; in this way the whole file can be examined with no address translation. In order for sdb to be used on large files, all appropriate values are kept as signed 32 bit integers. Commands. The commands for examining data in the program are: t Print a stack trace of the terminated or halted program. T Print the top line of the stack trace. variable / elm Print the value of variable according to length I and format m. A numeric count c indicates that a region of memory, beginning at the address implied by variable, is to be displayed. The length specifiers are: b one byte h two bytes (half word) I four bytes (long word) - 2" SDB(l) (not on PDP-l1) SDB(l) Legal values for mare: c character d decimal u decimal, unsigned o octal x hexadecimal f 32 bit single precision floating point g 64 bit double precision floating point s Assume variable is a string pointer and print characters starting at the address pointed to by the variable. a Print characters starting at the variable's address. This format may not be used with register variables. p pointer to procedure disassemble machine-language instruction with addresses printed numerically and symbolically. I disassemble machine-language instruction with addresses just printed numerically. The length specifiers are only effective with the formats c, d, u, 0 and x. Any of the specifiers, c, I, and m, may be omitted. If all are omitted, sdb choses a length and a format suitable for the variable's type as declared in the program. If m is specified, then this format is used for displaying the variable. A length specifier determines the output length of the value to be displayed, sometimes resulting in truncation. A count specifier c tells sdb to display that many units of memory, beginning at the address of variable. The number of bytes in one such unit of memory is determined by the length specifier I, or if no length is given, by the size associated with the variable. If a count specifier is used for the s or a command then that many characters are printed. Otherwise successive characters are printed until either a null byte is reached or 128 characters are printed. The last variable may be redisplayed with the command .r The sh (1) metacharacters • and ? may be used within procedure and variable names, providing a limited form of pattern matching. If no procedure name is given, variables local to the current procedure and global variables are matched, while if a procedure name is specified then only variables local to that procedure are matched. To match only global variables, the form :pattern is used. linen umber ?1m variable:? 1m Print the value at the address from a.out or I space given by linenumber or variable (procedure name), according to the format 1m. The default format is 'i'. variable = 1m linenumber = 1m number=lm Print the address of variable or linenumber, or the value of number, in the format specified by 1m. If no format is given, then Ix is used. The last variant of this command provides a convenient way to convert between decimal, octal and hexadecimal. variable !value Set variable to the given value. The value may be a number, a character constant or a variable. The value must be well defined; expressions which produce more than one value, such as structures, are not allowed. Character constants are denoted 'character. Numbers are viewed as integers unless a decimal point or exponent is used. In this case, they are treated as having the type double. Registers are viewed as integers. The -3- (not on PDP-II) .SOB(I) SOB(I) variable may be an expression which indicates more than one variable, such as an array or structure name. If the address of a variable is given, it is regarded as the address of a variable of type int. C conventions are used in any type conversions necessary to perform the indicated assignment. x Print the machine registers and the current machine-language instruction. X Print the current machine-language instruction. The commands for examining source files are: e procedure efile-name e directory! e directory file-name The first two forms set the current file to the file containing procedure or to file-name. The current line is set to the first line in the named procedure or file. Source files are assumed to be in directory. The default is the current working directory. The latter two forms change the value of directory. If no procedure, file name, or directory is given, the current procedure name and file name are reported. /regular expression/ Search forward from the current line for a line containing a string matching regular expression as in ed (1). The trailing / maybe elided. ?regular expression? Search backward from the current line for a line containing a string rna tching regular expression as in ed (1) . The trailing ? rna y be elided. p Print the current line. z Print the current line followed by the next 9 lines. Set the current line to the last line printed. w Window. Print the 10 lines around the current line. number Set the current line to the given line number. Print the new current line. count + Advance the current line by count lines. Print the new current line. countRetreat the current line by count lines. Print the new current line. The commands for controlling the execution of the source program are: count r args count R Run the program with the given arguments. The r command with no arguments reuses the previous arguments to the program while the R command runs the program with no arguments. An argument beginning with < or > causes redirection for the standard input or output respectively. If count is given, it specifies the number of breakpoints to be ignored. linen umber c count linenumber C count Continue after a breakpoint or interrupt. If count is given, it specifies the number of breakpoints to be ignored. C continues with the signal which caused the program to stop reactivated and c ignores it. If a linen umber is specified then a temporary breakpoint is placed at the line and execution is continued. The breakpoint is deleted when the command finishes. -4- (not on PDP-II) SOB(I) SOB (I) linen umber g count Continue after a breakpoint with execution resumed at the given line. If count is given, it specifies the number of breakpoints to be ignored. s count S count Single step the program through count lines. If no count is given then the program is run for one line. S is equivalent to s except it steps through procedure calls. i I Single step by one machine-language instruction. I steps with the signal which caused the program to stop reactivated and i ignores it. variable$m count address:m count Single step (as with s) until the specified location is modified with a new value. If count is omitted, it is effectively infinity. Variable must be accessible from the current procedure. Since this command is done by software, it can be very slow. level v Toggle verbose mode, for use when single stepping with S, s or m. If level is omitted, then just the current source file andlor subroutine name is printed when either changes. If level is 1 or greater, each C source line is printed before it is executed; if level is 2 or greater, each assembler statement is also printed. A v turns verbose mode off if it is on for any level. k Kill the program being debu~ged. proced ure (arg 1,arg2, .. J procedure (arg 1,arg2, .. J / m Execute the named procedure with the given arguments. Arguments can be integer, character or string constants or names of variables accessible from the current procedure. The second form causes the value returned by the procedure to be printed according to format m. If no format is given, it defaults to d. linen umber b commands Set a breakpoint at the given line. If a procedure name without a line number is given (e.g. "proc:"), a breakpoint is placed at the first line in the procedure even if it was not compiled with the -g option. If no linenumber is given, a breakpoint is placed at the current line. If no commands are given, execution stops just before the breakpoint and control is returned to sdb. Otherwise the commands are executed when the breakpoint is encountered and execution continues. Multiple commands are specified by separating them with semicolons. If k is used as a command to execute at a breakpoint, control returns to sdb, instead of continuing execution. 8 Print a list of the currently active breakpoints. linen umber d Delete a breakpoint at the given line. If no linen umber is given then the breakpoints are deleted interactively: Each breakpoint location is printed and a line is read from the standard input. If the line begins with a y or d then the breakpoint is deleted. D Delete all breakpoints. Print the last executed line. -5- SOB (I) (not on PDP-II) SOB (1) linen umber a Announce. If linen umber is of the form proc:number, the command effectively does a linenumber b I. If linenumber is of the form proc:, the command effectively does a proc: b T. Miscellaneous commands: !command The command is interpreted by sh (1). new-line If the previous command printed a source line then advance the current line by one line and print the new current line. If the previous command displayed a memory location then display the next memory location. control-D Scroll. Print the next 10 lines of instructions, source or data depending on which was printed last. < filename Read commands from filename until the end of file is reached, and then continue to accept commands from standard input. When sdb is told to display a variable by a command in such a file, the variable name is displayed along with the value. This command may not be nested; < may not appear as a command in a file. M Print the address maps. M [?/)[*) b e It f Record new values for the address map. The arguments? and / specify the text and data maps respectively. The first segment, (b1, e1, fl), is changed unless * is specified, in which case the second segment, (b1, e1, f1), of the mapping is changed. If fewer than three values are given, the remaining map parameters are left unchanged. string Print the given string. The C escape sequences of the form \character are recognized, where character is a nonnumeric character. q Exit the debugger. The following commands also exist and are intended only for debugging the debugger: V Q Y Print the version number. Print a list of procedures and files being debugged. Toggle debug output. FILES a.out core SEE ALSO ccO), f77(1), shO), a.out(4), core(4). WARNINGS On the VAX-ll/780, C variables are identified internally with an underscore prepended. User variables which differ by only an initial underscore cannot be distinguished, as sdb recognizes both internal and external names. Data which are stored in text sections are indistinguishable from functions. Line number information in optimized functions is unreliable, and some information may be missing. BUGS If a procedure is called when the program is not stopped at a breakpoint (such -6- SDB(t) (not on PDP-l 1) SDB(1) as when a core image is being debugged), all variables are initialized before the procedure is started. This makes it impossible to use a procedure which formats data from a core image. The default type for printing F77 parameters is incorrect. Their address is printed instead of their value. Tracebacks containing F77 subprograms with multiple entry points may print too many arguments in the wrong order, but their values are correct. The range of an F77 array subscript is assumed to be 1 to n, where n is the dimension corresponding to that subscript. This is only significant when the· user omits a subscript, or uses. to indicate the full range. There is no problem in general with arrays having subscripts whose lower bounds are not 1. On the 3B20S there is no hardware trace mode and single stepping is implemented by setting pseudo breakpoints where possible. This is slow. The entry point to an optimized function cannot be found on the 3B20S. Setting a breakpoint at the beginning of an optimized function may cause the middle of some instruction within the function to be overwritten. This problem can be circumvented by disassembling the first few instructions of the function, and manually setting a breakpoint at the first instruction after the stack pointer is adjusted. -7- SDIFF(I ) SDIFF(I) NAME sdiff - side-by-side difference program SYNOPSIS sdiff [ options ... ] file 1 file2 DESCRIPTION Sdiff uses the output of diff(1) to produce a side-by-side listing of two files indicating those lines that are different. Each line of the two files is printed with a blank gutter between them if the lines are identical, a < in the gutter if the line only exists in file1 , a > in the gutter if the line only exists in file2, and a I for lines that are different. For example: x y a b c d a < < d > c The following options exist: -w n Use the next argument, n, as the width of the output line. The default line length is 130 characters. -I Only print the left side of any lines that are identical. -s -0 Do not print identical lines. output Use the next argument, output, as the name of a third file that is created as a user controlled merging of file1 and file2. Identical lines of file 1 and file2 are copied to output. Sets of differences, as produced by diff(1), are printed; where a set of differences share a common gutter character. After printing each set of differences, sdi./J prompts the user with a % and waits for one of the following user-typed commands: append the left column to the output file r append the right column to the output file s turn on silent mode; do not print identical lines v turn off silent mode e I call the editor with the left column e r call the editor with the right column e b call the editor with the concatenation of left and right e call the editor with a zero length file q exit from the program On exit from the editor, the resulting file is concatenated on the end of the output file. ) SEE ALSO diff(I), ed (1). SECt) SECt) NAME se - screen editor for video terminals SYNOPSIS se [-Tlterm]] [-ifile] [-ofile] [-s] [file] DESCRIPTION Se is an interactive screen editor for use on asynchronous, ASCII CRT terminals. If the file argument is given, se will read the file into its buffer so that it can be edited. If no file is specified, the buffer will be empty and there will be no current file name. Options to se are: -T Causes se to print a list of the terminal types it understands and exit immediately, ignoring all other options. -Tterm Specifies the terminal type being used. If no -T option is specified, se will check the environment variables SETERM and TERM On that order) to determine the terminal type specified (the first non-null value it finds is the one used). If no terminal type is specified or if the terminal type specified is unknown to se, se will print a diagnostic followed by a list of terminal types it understands and then exit. -ifile Causes a sequence of se commands to be read from the named file. The file is read to end of file. If more than one -i option is given, the files are read in the order specified on the command line. When all -i options have been processed, commands are read from the standard input. A maximum of five files may be specified. -ofile Causes a copy of all commands given to this invocation of se to be piaced in fiie. This fiie may then be used with the -i option. -s Reduce the number of messages printed on the status line. This is intended for the expert user. Other than the order of multiple -i options, the order of the options and the filename on the command line is not important. During editing, se displays the contents of the file on the screen. As the file is edited, the screen is updated to reflect changes made in the file contents. If the entire contents of the file will not fit on the screen, se displays a portion of it. The limits of the file are indicated on the screen by the TOP OF FILE and BOTTOM OF FILE messages. The top line of the display is used for a status line. The status line contains (from left to right): the last command entered (or being entered), error messages and the name of the file being edited. The current position in the file is indicated by the position of the cursor on the screen. The cursor can be moved to different file positions by cursor movement commands or find commands. The cursor is not restricted to text already present. If text is inserted or overwritten to the right of the end of the line, the line will be padded with blanks. Se operates in command mode: each character typed is interpreted as part of an se command. As each command is recognized, the appropriate action is performed. To add new text to the file, the insert command is used. During insert, characters typed are interpreted as text to be added to the file. The text is added before the current cursor position. For example, if the cursor is positioned on the first r in the word edr-formatter and the insert command is given, typing ito and ending the insert yields editor-formatter. - 1- I SE(t) SECt) COMMAND SYNTAX Most se commands are of the form: [count] [text-identified command The count is an optional field, an integer between 1 and 32,767. The default value for count is one. The optional text-identifier specifies the block of text of interest. Valid text-identifiers are described below; the default value for textidentifiers is dependent on the command. If more than one count or textidentifier is used, all but the last will be ignored. Commands are specified below. TEXT IDENTIFIERS The valid text-identifiers (text-id) are: Text-id w F I S (or s) e / Text Represented Character Word File Line Screen Previously defined region Region found by last find command In general, a text-id block is identified as that in which the cursor is positioned. A text-id may also be identified by a cursor positioned on the white space following the text-id. CURSOR KEYS The cursor keys on the terminal keyboard are used to move the cursor around the screen and through the file. For terminals with no cursor keys, the ctrl +z, ctrl +x, ctrl +c, ctrl +v keys may be used instead of -, !, land - respectively. NOTATION In the list of se commands below, the following notations apply: [] {} text-id chars position-cursor items within brackets are optional one of the items within the braces must be used identifies a block of text any string of characters a sequence of cursor-moves or find commands (see below) TEXT COMMANDS Commands longer than one character (for example, READ) may be invoked by typing an unique initial substring followed by a RETURN (newline). If the substring is not unique the RETURN is ignored. The BREAK key causes se to stop its current action and return to its command level. cursor moves [count] cursor key [count] [text-id] cursor key Move the cursor count lines up {f) or down (!> or count characters to the left (-) or the right ( -) . Screen scroll will occur if the top or bottom of screen is encountered. The cursor will wrap at line beginning and end as expected. Move the cursor the specified amount of text-id blocks. If the text-id is character (.) (default), the action is the same as for plain cursor key use (see above). For all other text-ids, - means beginning of, - means end of, 1 means previous, and 1 means next. For example, Sl means go to -2- SECt) SECt) the next screen. space-bar The space-bar moves the cursor one character to the right (equivalent to .-). RETURN The RETURN key moves the cursor to the beginning of the next line. TAB The TAB key moves the cursor to the next tab position (set every 8 columns). HOME For terminals that have a HOME key, it moves the cursor to the top left corner of the screen (equivalent to S-). Define Region b [position-cursor] ctrl +d Define an arbitrary linear region. Any command that changes the file being edited will cause the current region to be undefined. Copy text [count1 [text-id] c [position-cursor] ctrl +d Copy text-id block (default is one character) at new cursor position. Delete text [count1 [text-id] d Delete text -id block (default is one character). Refresh document display DISPLAY Rewrites display from the file. Useful to restore contents of screen from the effects of line noise etc. Edit file EDIT [filename] { ctrl +d, RETURN} Start editing the specified file. If no file name has been specified, use the current file. If the contents of the current file have been altered since the last WRITE command, the user is first queried as to whether to save those changes. Find string occurrence [text-id] f chars { ctrl +d, RETURN} Search text-id (default is entire file) for chars and position cursor there. The cursor is not moved if chars are not found. The chars are interpreted as a regular expression (see regexp (5) ) . Find all and execute command automatically [count] hext-id] g chars { ctrl +d, RETURN} command Search text-id (default is entire file) for all occurrences of chars; position-cursor at first occurrence and execute command. Continue to next occurrence and apply the same command, and so on. The command may not be another global command. The chars are interpreted as a regular expression (see regexp(5». Find all and execute command interactively [count1 hext-id] G chars { ctrl +d, RETURN} command Search text-id (default is entire file) for first occurrence of chars; position-cursor at first occurrence and wait for command; execute -3- SE(l) SE(l) command and continue to next occurrence where a new command may be input, and so on. The command may not be another global command. The chars are interpreted as a regular expression (see regexp(5». Insert text [text-id] i chars ctrl +d Insert text at the current cursor position. If the text-id is I, a blank line is inserted and the cursor positioned at the beginning of that line. Use of cursor-keys (no preceding count or text-id) positions the cursor at the next character to be inserted. The back-space key will cause the previous character to be deleted. Move text [count] [text-id] m [position-cursor] ctrl +d Reposition text-id block (default is one character) at new position. It is an error if the new position is within the text to be moved. Overwrite text o chars ctrl +d Performs one-to-one character replacement beginning at cursor position. Use of cursor-keys (no preceding count or text-id) positions the cursor at the next character to be overwritten. The back-space key will cause the previous character to be deleted. Leave the editor q Exits from se. If the contents of the current file have been altered since the last WRITE command, the user is first queried as whether to save those changes. Get text READ [filename] { ctrl +d, RETURN} Insert text from filename at cursor posltIon. If no filename is specified, the current filename is used. The cursor position is unchanged. Replace text leount] [text-id] r chars ctr) +d Replace text-id block (default is one character) with text. Undo last command UNDO Undoes last text-modifying UNDO may not be undone. command. An Save text [count] [text-id] WRITE [filename] { ctrl +d, RETURN} Save text from text-id (default is entire file) in the named file. If filename is not specified, text is saved in the file currently being edited. Note that existing text in the file is replaced. Process through the UNIX System leount1 [text-id] X UNIX System command { etrl +d, RETURN} Passes text -id block (default is no text) to the UNIX System-command as standard input and replaces text-id block with the standard output -4- SE(t) SECt) from the UNIX System-command. Request help ? Display a listing of available se text-ids, commands and their syntax. Escape from editor [countl [text-id1 ! UNIX System command { ctrl +d, RETURN} If the text-id or count is specified, it is given as standard input to the UNIX System command. Otherwise, standard input is the same as for se. No changes are made to the file being edited. Repeat last command Ditto repeats the last command. This means the command plus preceding text-id and count. " Go to line N# Move to line N, where N is an integer between and 32,767. Erase input Cause se to ignore any partially typed command (including count, modifier, and multi-character command). @ TERMINAL REQUIREMENTS Se can run on any terminal with suitable cursor addressing. In order to use cursor keys, they must emit characters to the host computer. Performance may be degraded if the terminal does not have: - character insert and delete line insert and delete erase to end of line and page If the terminal type specified is not suitable (i.e. it has no cursor addressing), se prints a diagnostic and exits immediately. The environment variable TERMINFO modifies the search for the specified terminal type in the terminal description file. If present, it should contain one of two kinds of values: an alternate file name for the terminal description file (in this case, the first character must be a/). This file will be used to search for a description of the specified terminal instead of the default terminal description file. the description for a specific ter:ninal (this should be the entry from the terminal description file with the escaped new lines removed). This description will be treated as though it had been prepended to the default terminal description file. Using TERMINFO in this manner allows the redefinition of a specific terminal description or the inclusion of a description for a terminal that is not included in the default terminal description file. If the description contained in TERMINFO is that of the terminal to be used with se, start-up time for se can be reduced considerably since the terminal description file need not be searched. FILES Itmp/se# Itmp/sei# I usr IIi bl se. term temporary; # is the process number. record of keystrokes; # is the process number. terminal description file DIAGNOSTICS Error messages are displayed on the message line on the screen during editing. -5 - SE(l) SE(l) WARNING Regular expressions span more than one line, thus abc. *xyz may match the entire file. Some terminals need persuasion to make the cursor keys emit characters. For example, HP2621 cursor keys only emit characters when the function labels are displayed and the SHIFT key is held down and the cursor key struck. SEE ALSO regexp(5). -6- SED (1 ) SED(t) NAME sed - stream editor SYNOPSIS sed [ -n ] [ -e script ] [ -{ sfile ] [ files ] DESCRIPTION Sed copies the named files (standard input default) to the standard output, edited according to a script of commands. The -f option causes the script to be taken from file sfile; these options accumulate. If there is just one -e option and no -f options, the flag -e may be omitted. The -n option suppresses the default output. A script consists of editing commands, one per line, of the following form: [ address [ , address ] ] function [ arguments ] In normal operation, sed cyclically copies a line of input into a pattern space (unless there is something left after a D command), applies in sequence all commands whose addresses select that pattern space, and at the end of the script copies the pattern space to the standard output (except under -n) and deletes the pattern space. Some of the commands use a hold space to save all or part of the pattern space for subsequent retrieval. An address is either a decimal number that counts input lines cumulatively across files, a $ that addresses the last line of input, or a context address, i.e., a /regular expression/ in the style of ed(O modified thus: In a context address, the construction \?regular expression?, where? is any character, is identical to /regular expression!. Note that in the context address \xabc\xdefx, the second x stands for itself, so that the regular expression is abcxdef. The escape sequence \n matches a new-line embedded in the pattern space. A period. matches any character except the terminal new-line of the pattern space. A command line with no addresses selects every pattern space. A command line with one address selects each pattern space that matches the address. A command line with two addresses selects the inclusive range from the first pattern space that matches the first address through the next pattern space that matches the second. (If the second address is a number less than or equal to the line number first selected, only one line is selected.) Thereafter the process is repeated, looking again for the first address. Editing commands can be applied only to non-selected pattern spaces by use of the negation function! (below). In the following list of functions the maximum number of permissible addresses for each function is indicated in parentheses. The text argument consists of one or more lines, all but the last of which end with \ to hide the new-line. Backslashes in text are treated like backslashes in the replacement string of an s command, and may be used to protect initial blanks and tabs against the stripping that is done on every script line. The rfile or wfile argument must terminate the command line and must be preceded by exactly one blank. Each wfile is created before processing begins. There can be at most 10 distinct wfile arguments. (Oa\ - 1- SED(I) SED(I) text Append. Place text on the output before reading the next input line. (2) b label Branch to the : command bearing the label. If label is empty, branch to the end of the script. (2) c\ text (2) d (2) D (2) g (2)G (2) h (2) H (1) i\ Change. Delete the pattern space. With 0 or 1 address or at the end of a 2-address range, place text on the output. Start the next cycle. Delete the pattern space. Start the next cycle. Delete the initial segment of the pattern space through the first new-line. Start the next cycle. Replace the contents of the pattern space by the contents of the hold space. Append the contents of the hold space to the pattern space. Replace the contents of the hold space by the contents of the pattern space. Append the contents of the pattern space to the hold space. text Insert. Place text on the standard output. List the pattern space on the standard output in an unambiguous form. Non-printing characters are spelled in two-digit ASCII and long lines are folded. (2) n Copy the pattern space to the standard output. Replace the pattern space with the next line of input. (2) N Append the next line of input to the pattern space with an embedded new-line. (The current line number changes.) Print. Copy the pattern space to the standard output. Copy the initial segment of the pattern space through the first new-line to the standard output. (1) q Quit. Branch to the end of the script. Do not start a new cycle. (2) r rfile Read the contents of rfile. Place them on the output before reading the next input line. (2) s/regular expression/replacement /flags Substitute the replacement string for instances of the regular expression in the pattern space. Any character may be used instead of I. For a fuller description see ed(I). Flags is zero or more of: g Global. Substitute for all nonoverlapping instances of the regular expression rather than just the first one. Print the pattern space if a replacement was made. p w wfile Write. Append the pattern space to wfile if a replacement was made. (2) t label Test. Branch to the: command bearing the label if any substitutions have been made since the most recent reading of an input line or execution of a t. If label is empty, branch to the end of the script. (2) w wfile Write. Append the pattern space to wfile. (2) x Exchange the contents of the pattern and hold spaces. (2) y/stringl /string2/ Transform. Replace all occurrences of characters in stringl with the corresponding character in string2. The lengths of stringl and string2 must be equal. (2)! function Don't. Apply the function (or group, if function is () only to lines not selected by the address (es) . (2)1 -2- SED(t) SED(I) (0): label This command does nothing; it bears a label for. and t commands to branch to. (1)Place the current line number on the standard output as a line. (2) ( Execute the following commands through a matching } only when the pattern space is selected. (0) An empty command is ignored. SEE ALSO awk(t), ed(I), grep(t). -3- SEND(lC) SEND(IC) NAME send, gath - gather files and/or submit RJE jobs SYNOPSIS gatb [-ib] file ... send argument DESCRIPTION Gath Gath concatenates the named files and writes them to the standard output. Tabs are expanded into spaces according to the format specification for each file (see jspec(4». The size limit and margin parameters of a format specification are also respected. Non-graphic characters other than tabs are identified by a diagnostic message and excised. The output of gath contains no tabs unless the -b flag is set, in which case the output is written with standard tabs (every eighth column). Any line of any of the files which begins with - is interpreted by gath as a control line. A line beginning ,,- " (tilde,space) specifies a sequence of files to. be included at that point. A line beginning -! specifies a UNIX System command; that command is executed, and its output replaces the -! line in the gath output. Setting the -i flag prevents control lines from being interpreted and causes them to be output literally. A file name of - at any point refers to standard input, and a control line consisting of -. is a logical EOF. Keywords may be defined by specifying a replacement string which is to be substituted for each occurrence of the keyword. Input may be collected directly from the terminal, with several alternatives for prompting. In fact, all of the special arguments and flags recognized by the send command are also recognized and treated identically by gath. Several of them only make sense in the context of submitting an RJE job. Send Send is a command-level interface to the RJE subsystems. It allows the user to collect input from various sources in order to create a run stream consisting of card images, and submit this run stream for transmission to an IBM host computer. Output from the IBM system may be returned to the user in either ASCII text form or EBCDIC punch format (see pnch (4)). Possible sources of input to send are: ordinary files, standard input, the terminal, and the output of a command or shell file. Each source of input is treated as a virtual file, and no distinction is made based upon its origin. Typical input is an ASCII text file of the sort that is created by the editor ed(l). An optional format specification appearing in the first line of a file (see jspec (4)) determines the settings according to which tabs are expanded into spaces. In addition, lines that begin with - are normally interpreted as commands controlling the execution of send. They may be used to set or reset flags, to define keyword substitutions, and to open new sources of input in the midst of the current source. Other text lines are translated one-for-one into card images of the run stream. The run stream that results from this collection is treated as one job by the RJE subsystems. Send prints the card count of the run stream, and the queuer that is invoked prints the name of the temporary file that holds the job while it is awaiting transmission. The initial card of a job submitted to a host must have a / / in the first column. Any cards preceding this card will be excised. If a host computer is not specified before the first card of the runstream is ready to be sent, send will select a reasonable default. All cards beginning with /*$ will be excised from the runstream, because they are HASP command cards. - 1- SEND(IC) SEND(tC) The arguments that preted according to with \ causes it to matching against an send accepts are described below. An argument is interthe first pattern that it matches. Preceding a character loose any special meaning it might otherwise have when argument pattern. Close the current source. Open standard input as a new source. + Open the terminal as a new source. :spec: Establish a default format specification for included sources, e.g., :m6t -12: :message Print message on the terminal. -:prompt Open standard input and, if it is a terminal, print prompt. +:prompt -flags +flags =-flags Open the terminal and print prompt. Set the specified flags, which are described below. Reset the specified flags. Restore the specified flags to their state at the previous level. !command Execute the specified UNIX System command via the one-line shell, with input redirected to Idev/null as a default. Open the standard output of the command as a new source. $line Collect contiguous arguments of this form and write them as consecutive lines to a temporary file; then have the file executed by the shell. Open the standard output of the shell as a new source. @directory The current directory for the send process is changed to directory. The original directory will be restored at the end of the current source. -comment Ignore this argument. ?:keyword Prompt for a definition of keyword from the terminal unless keyword has an existing definition. ? keyword ... "xx Define the keyword as a two digit hexadecimal character code unless it already has a non null replacement. ? keyword - string Define the keyword in 'terms of a replacement string unless it already has a non null replacement. -:keyword Prompt for a 'd~finition of keyword from the terminal. keyword - "xx Define k(!YWOI'd as a two-digit hexadecimal character code. in terms- of a replacement string. keyword-sUint Define keyword IwSI" The • . machine. tlla." the job sOOuld ,be submitted to. It ,ca. heart)' that co.respot'lds to one 'in the DIst· column of- the RJE con~ralion file file-name Open the specified file as 'namo:' Uusr/rj_lliaft) . - 2- ait~w source of input. SEND(IC> SEND(1C> When commands are executed via $ or ! the shell environment (see environ(S» will contain the values of all send keywords that begin with $ and have the syntax of a shell variable. The flags recognized by send are described in terms of the special processing that occurs when they ate set: -I List card images on standard output. translated back to ASCII. -q Do not output card images. EBCDIC characters are -f Do not fold lower case to upper. -t Trace progress on diagnostic output, by announcing the opening of input sources. -k Ignore the keywords that are active at the previous level and erase any keyword definitions that have been made at the current level. -r Process included sources in raw mode; pack arbitrary 8-bit bytes one per column (80 columns per card) until an EOF. -i Do not interpret control lines in included sources; treat them as text. -s Make keyword substitutions before detecting and interpreting control lines. -y Suppress error diagnostics and submit job anyway. -g Gather mode, qualifying -I flag; list text lines before converting them to card images. -h Write listing with standard tabs. -p Prompt with • when taking input from the terminal. -m When input returns to the terminal from a lower level, repeat the prompt, if any. -a Make -k flag propagate to included sources, thereby protecting them from keyword substitutions. -c List control lines on diagnostic output. -d Extend the current set of keyword definitions by adding those active at the end of included sources. This flag guarantees that the job will be transmitted in the order of submission (relative to otboF jobs sent with this flag). Control lines are input lines,that begin with -. In the default mode +ir, they are interpret~'as commaAds' to send. Normally they are detected immediately and read literall,. The, -s fla;g forces keyword substitutions to be made before control li~ are intercepted and interpreted. This can lead to unexpected resuJts iJ a control line uses a keyword which is defined within an immediately preceding -$ sequence. Arguments appearing in control lines are handled exactly like the command arguments to send, except that they are processed at a nested ~vel of input. The two possible formats for a control line are: "-argument" and ,,- argument ...". In the first case, where the - is not followed by a space, the remainder' of tho line is take. as a sia&le argwnent to send. In the second cue, the. line. is. to obtaia a. sequence of arguments delimited by SJI8Ci8. 1ft thia ca&e. the- quot~! and • may' be empm.yed to pass embedded -x pel" spaces. ,.lAe intelplotilltioA 0# the ar,.aent ... is chosen so that an input line COB- , MsAJtg'-or-. &: trea.k4a5 a ~f-EQF.T_:fQl1owjllg example iUustra.' SENO(tC) SEND(IC) some of the above conventions: send - argument ... This sequence of three lines is equivalent to the command synopsis at the beginning of this description. In fact, the - is not even required. By convention, the send command reads standard input if no other input source is specified. Send may therefore be employed as a filter with side-effects. The execution of the send command is controlled at each instant by a current environment, which includes the format specification for the input source, a default format specification for included sources, the settings of the mode flags, and the active set of keyword definitions. This environment can be altered dynamically. When a control line opens a new source of input, the current environment is pushed onto a stack, to be restored when input resumes from the old source. The initial format specification for the new source is taken from the first line of the file. If none is provided, the established default is used or, in its absence, standard tabs. The initial mode settings and active keywords are copied from the old environment. Changes made while processing the new source will not affect the environment of the old source, with one exception: if -d mode is set in the old environment, the old keyword context will be augmented by those definitions that are active at the end of the new source. When send first begins execution, all mode flags are reset, and the values of the shell environment variables become the initial values for keywords of the same name with a $ prefixed. The initial reset state for all mode flags is the + state. In general, special processing associated with a mode N is invoked by flag -Nand is revoked by flag +N. Most mode settings have an immediate effect on the processing of the current source. Exceptions to this are the -r and -i flags, which apply only to included source, causing it to be processed in an uninterpreted manner. A keyword is an arbitrary 8-bit ASCII string for which a replacement has been defined. The replacement may be another string or the hexadecimal code for a single 8-bit byte. At any instant, a given set of keyword definitions is active. Input text lines are scanned, in one pass from left to right, and longest matches are attempted between substrings of the line and the active set of keywords. Characters that do not match are output, subject to folding and the standard translation. Keywords are replaced by the specified hexadecimal code or replacement string, which is then output character by character. The expansion of tabs and length checking, according to the format specification of an input source, are delayed until substitutions have been made in a line. All of the keywords definitions made in the current source may be deleted by setting the -k flag. It then becomes possible to reuse them. Setting the -k flag also causes keyword definitions active at the previous source level to be ignored. Se~ting the +k flag causes keywords at the previous level to be ignored but does not delete the definitions made at the current level. The = k argument reactivates the definitions of the previous level. When keywords are redefined, the previous definition at the same level of source input is lost, however the definition at the previous level is only hidden, to be reactivated upon return to that level unless a -d flag causes the current definition to be retained. -4- SEND(IC) SEND(iC) Conditional prompts for keywords, ?:A,/p which have already been defined at some higher level to be null or have a replacement will simply cause the definitions to be copied down to the current level; new definitions will not be solicited. Keyword substitution is an elementary macro facility that is easily explained and that appears useful enough to warrant its inclusion in the send command. More complex replacements are the function of a general macro processor (m4(I), perhaps). To reduce the overhead of string comparison, it is recommended that keywords be chosen so that their initial characters are unusual. For example, let them aU be upper case. Send performs two types of error checking on input text lines. Firstly, only ASCII graphics and tabs are permitted in input text. Secondly, the length of a text line, after substitutions have been made, may not exceed 80 bytes. The length of each line may be additionally constrained by a size parameter in the format specification for an input source. Diagnostic output provides the location of each erroneous line, by line number and input source, a description of the error, and the card image that results. Other routine errors that are announced are the inability to open or write files, and abnormal exits froID.the shell. Normally, the occurrence of any error causes send, before invoking the queuer, to prompt for positive affirmation that the suspect run stream should be submitted. Before submitting a job to a host, send translates 8-bit ASCII characters into their EBCDIC equivalents. The conversion for 8-bit ASCII characters in the octal range 040-176 is based on the character set described in "Appendix H" of IBM System1370 Principles of Operation (IBM SRL GA22-7000). Each 8-bit ASCII character in the range 040-377 possesses an EBCDIC equivalent into which it is mapped, with five exceptions: - into ..... , 0345 into -, 0325 into ¢, 0313 into I, 0177 (DEL) is illegal. In listings requested from send and in printed output returned by the subsystem, the reverse translation is made with the qualification that EBCDIC characters that do not have valid 8-bit ASCII equivalents are translated into ". Additional control over the translation process is afforded by the -f flag and hexadecimal character codes. As a default, send folds lower-case letters into upper case. Setting the -f flag inhibits any folding. Nonstandard character codes are obtained as a special case of keyword substitution. SEE ALSO m4(I), rjestat(IC), sh(I), fspec(4), pnch(4), ascii(5), environ(5). UNIX Remote Job Entry User's Guide in the UNIX System User's Guide. BUGS Standard input is read in blocks, and unused bytes are returned via lseek (2). If standard input is a pipe, multiple arguments of the form - and -:prompt should not be used, nor should the logical EOF (-.). -5- SH(I) SH(I) NAME sh, rsh - shell, the standard/restricted command programming language SYNOPSIS sh [ -ceiknrstuvx ] [ args ] rsh [ -ceiknrstuvx ] [ args ] DESCRIPTION Sh is a command programming language that executes commands read from a terminal or a file. Rsh is a restricted version of the standard command interpreter sh; it is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. See Invocation below for the meaning of arguments to the shell. Commands. A simple-command is a sequence of non-blank words separated by blanks (a blank is a tab or a space). The first word specifies the name of the command to be executed. Except as specified below, the remaining words are passed as arguments to the invoked command. The command name is passed as argument 0 (see exec(2». The value of a simple-command is its exit status if it terminates normally, or (octal) 200+status if it terminates abnormally (see signal (2) for a list of status values). A pipeline is a sequence of one or more commands separated by I (or, for historical compatibility, by A). The standard output of each command but the last is connected by a pipe (2) to the standard input of the next command. Each command is run as a separate process; the shell waits for the last command to terminate. A list is a sequence of one or more pipelines separated by;, &, & &, or I I. and optionally terminated by ; or &. Of these four symbols, ; and & have equal precedence, which is lower than that of & & and II. The symbols & & and II also have equal precedence. A semicolon (;) causes sequential execution of the preceding pipeline; an ampersand (&) causes asynchronous execution of the preceding pipeline (i.e., the shell does not wait for that pipeline to finish). The symbol & & (I I) causes the list following it to be executed only if the preceding pipeline returns a zero (non-zero) exit status. An arbitrary number of new-lines may appear in a list, instead of semicolons, to delimit commands. A command is either a simple-command or one of the following. Unless otherwise stated, the value returned by a command is that of the last simplecommand executed in the command. for name [ in word ... ] do list done Each time a for command is executed, name is set to the next word taken from the in word list. If in word ... is omitted, then the for command executes the do list once for each positional parameter that is set (see Parameter Substitution below). Execution ends when there are no more words in the list. case word in [ pattern [ I pattern ] ... ) list ;; ] ... esac A case command executes the list associated with the first pattern that matches word. The form of the patterns is the same as that used for file-name generation (see File Name Generation below). if list then list [ elif list then list ] ... [ else list ] fi The list following if is executed and, if it returns a zero exit status, the list following the first then is executed. Otherwise, the list following elif is executed and, if its value is zero, the list following the next then is executed. Failing that, the else list is executed. If no else list or then list is executed, then the if command returns a zero exit status. - 1- 8H(I) 8H(I) while list do list done A while command repeatedly executes the while list and, if the exit status of the last command in the list is zero, executes the do list; otherwise the loop terminates. If no commands in the do list are executed, then the while command returns a zero exit status; until may be used in place of while to negate the loop termination test. (list> Execute list in a sub-shell. {list;} list is simply executed. The following words are only recognized as the first word of a command and when not quoted: if then else elif fi case esac for while until do done { } Comments. A word beginning with # causes that word and all the following characters up to a new-line to be ignored. Command Substitution. The standard output from a command enclosed in a pair of grave accents (,,) may be used as part or all of a word; trailing new-lines are removed. Parameter Substitution. The character $ is used to introduce substitutable parameters. Positional parameters may be assigned values by set. Variables may be set by writing: name =value [ name = value ] ... Pattern-matching is not performed on value. $ {parameterl A parameter is a sequence of letters, digits, or underscores (a name), a digit, or any of the characters ., @, #, ?, -, $, and!. The value, if any, of the parameter is substituted. The braces are required only when parameter is followed by a letter, digit, or underscore that is not to be interpreted as part of its name. A name must begin with a letter or underscore. If parameter is a digit then it is a positional parameter. If parameter is • or @, then all the positional parameters, starting with $1, are substituted (separated by spaces). Parameter $0 is set from argument zero when the shell is invoked. $ {parameter: -word} If parameter is set and is non-null then substitute its value; otherwise substitute word. $ {parameter: = word} If parameter is not set or is null then set it to word; the value of the parameter is then substituted. Positional parameters may not be assigned to in this way. $ {parameter: ?word} If parameter is set and is non-null then substitute its value; otherwise, print word and exit from the shell. If word is omitted, then the message "parameter null or not set" is printed. ${parameter: +word} If parameter is set and is non-null then substitute word; otherwise substitute nothing. In the above, word is not evaluated unless it is to be used as the substituted string, so that, in the following example, pwd is executed only if d is not set or is null: -2- SH(I) SH(I) echo ${d:-'pwd'} If the colon (:) is omitted from the above expressions, then the shell only checks whether parameter is set or not. The following parameters are automatically set by the shell: # The number of positional parameters in decimal. Flags supplied to the shell on invocation or by the set command. ? The decimal value returned by the last synchronously executed command. $ The process number of this shell. The process number of the last background command invoked. The following parameters are used by the shell: HOME The default argument (home directory) for the cd command. PATH The search path for commands (see Execution below). The user may not change PATH if executing under rsh. CDPATH MAIL PSt PS2 IFS The search path for the cd command. If this variable is set to the name of a mail file, then the shell informs the user of the arrival of mail in the specified file. Primary prompt string, by default "$ ". Secondary prompt string, by default "> ". Internal field separators, normally space, tab, and new-line. The shell gives default values to PATH, PSt, PS2, and IFS, while HOME and MAIL are not set at all by the shell (although HOME is set by login (1». Blank Interpretation. After parameter and command substitution, the results of substitution are scanned for internal field separator characters (those found in IFS) and split into distinct arguments where such characters are found. Explicit null arguments ("" or ,,) are retained. Implicit null arguments (those resulting from parameters that have no values) are removed. File Name Generation. Following substitution, each command word is scanned for the characters ., ?, and [. If one of these characters appears then the word is regarded as a pattern. The word is replaced with alphabetically sorted file names that match the pattern. If no file name is found that matches the pattern, then the word is left unchanged. The character. at the start of a file name or immediately following a I, as well as the character I itself, must be matched explicitly. • ? [ ... 1 Matches any string, including the null string. Matches any single character. Matches anyone of the enclosed characters. A pair of charac- : ters separated by - matches any character lexically between the pair, inclusive. If the first character following the opening , "[ " is a "!" then any character not enclosed is matched. Quoting. The following characters have a special meaning to the shell and cause termination of a word unless quoted: ; & ( ) I " < > new-line space tab A character may be quoted (i.e., made to stand for itself) by preceding it with a \. The pair \new-Iine is ignored. All characters enclosed between a pair of' single quote marks ("), except a single quote, are quoted. Inside double quote marks (""), parameter and command substitution occurs and \ quotes the characters \, " ", and $. "$-" is equivalent to "$1 $2 ... ", whereas "$@" is equivalent to "$1" "$2" .... -3- SH(I) SH(I) Prompting. When used interactively, the shell prompts with the value of PSt before reading a command. If at any time a new-line is typed and further input is needed to complete a command, then the secondary prompt (i.e., the value of PS2) is issued. Input/Output. Before a command is executed, its input and output may be redirected using a special notation interpreted by the shell. The following may appear anywhere in a simple-command or may precede or follow a command and are not passed on to the invoked command; substitution occurs before word or digit is used: word »word « [ - lword < & digit < & - Use file word as standard input (file descriptor 0). Use file word as standard output (file descriptor 1). If the file does not exist then it is created; otherwise, it is truncated to zero length. Use file word as standard output. If the file exists then output is appended to it (by first seeking to the end-of-file); otherwise, the file is created. The shell input is read up to a line that is the same as word, or to an end-of-file. The resulting document becomes the standard input. If any character of word is quoted, then no interpretation is placed upon the characters of the document; otherwise, parameter and command substitution occurs, (unescaped) \new-line is ignored, and \ must be used to quote the characters \, $, " and the first character of word. If - is appended to «, then all leading tabs are stripped from word and from the document. The standard input is duplicated from file descriptor digit (see dup (2». Similarly for the standard output using >. The standard input is closed. Similarly for the standard output using >. If one of the above is preceded by a digit, then the file descriptor created is that specified by the digit (instead of the default 0 or 1). For example: ... 2>&1 creates file descriptor 2 that is a duplicate of file descriptor 1. If a command is followed by & then the default standard input for the command is the empty file /dey/null. Otherwise, the environment for the execution of a command contains the file descriptors of the invoking shell as modified by input/output specifications. Redirection of output is not allowed in the restricted shell. Environment. The environment (see environ (5» is a list of name-value pairs that is passed to an executed program in the same way as a normal argument list. The shell interacts with the environment in several ways. On invocation, the shell scans the environment and creates a parameter for each name found, giving it the corresponding value. Executed commands inherit the same environment. If the user modifies the values of these parameters or creates new ones, none of these affects the environment unless the export command is used to bind the shell's parameter to the environment. The environment seen by any executed command is thus composed of any unmodified name-value pairs originally inherited by the shell, plus any modifications or additions, all of which must be noted in export commands. The environment for any simple-command may be augmented by prefixing it with one or more assignments to parameters. Thus: -4 - SH(l) SH(l) TERM=450 cmd args (export TERM; TERM=450; cmd args) and are equivalent (as far as the above execution of cmd is concerned). If the -k flag is set, all keyword arguments are placed in the environment, even if they occur after the command name. The following first prints a = b c and then c: echo a=b c set -k echo a=b c Signals. The INTERRUPT and QUIT signals for an invoked command are ignored if the command is followed by &; otherwise signals have the values inherited by the shell from its parent, with the exception of signal 11 (but see also the trap command below). Execution. Each time a command is executed, the above substitutions are carried out. Except for the Special Commands listed below, a new process is created and an attempt is made to execute the command via exec (2). The shell parameter PATH defines the search path for the directory containing the command. Alternative directory names are separated by a colon (:). The default path is :lbin:/usrlbin (specifying the current directory, Ibin, and lusrlbin, in that order). Note that the current directory is specified by a null path name, which can appear immediately after the equal sign or between the colon delimiters anywhere else in the path list. If the command name contains a I then the search path is not used; such commands will not be executed by the restricted shell. Otherwise, each directory in the path is searched for an executable file. If the file has execute permission but is not an a.out file, it is assumed to be a file containing shell commands. A sub-shell (i.e., a separate process) is spawned to read it. A parenthesized command is also executed in a sub-shell. Special Commands. The following commands are executed in the shell process and, ex.cept as specified, no input/output redirection is permitted for such commands: . file No effect; the command does nothing. A zero exit code is returned . Read and execute commands from file and return. The search path specified by PATH is used to find the directory containing file. break [ n ] Exit from the enclosing for or while loop, if any. If n is specified then break n levels. continue [ n ] Resume the next iteration of the enclosing for or while loop. If n is specified then resume at the n-th enclosing loop. cd [ arg ] Change the current directory to argo The shell parameter HOME is the default argo The shell parameter CDPATH defines the search path for the directory containing argo Alternative directory names are separated by a colon (:). The default path is (specifying the current directory). Note that the current directory is specified by a null path name, which can appear immediately after the equal sign or between the colon delimiters anywhere else in the path list. If arg begins with a I then the search path is not used. Otherwise, each directory in the path is searched for argo The cd command may not be executed by rsh. -5- SH(I) SH(I) eval [ arg ... ] The arguments are read as input to the shell and the resulting command (s) executed. exec [ arg ... ] The command specified by the arguments is executed in place of this shell without creating a new process. Input/output arguments may appear and, if no other arguments are given, cause the shell input/output to be modified. exit [ n ] Causes a shell to exit with the exit status specified by n. If n is omitted then the exit status is that of the last command executed (an endof-file will also cause the shell to exit.) export [ name ... ] The given names are marked for automatic export to the environment of subsequently-executed commands. If no arguments are given, then a list of all names that are exported in this shell is printed. oewgrp [ arg ... ] Equivalent to exec oewgrp arg .... read [ name ... ] One line is read from the standard input and the first word is assigned to the first name, the second word to the second name, etc., with leftover words assigned to the last name. The return code is 0 unless an end-of-file is encountered. readooly [ name ... ] The given names are marked readonly and the values of the these names may not be changed by subsequent assignment. If no arguments are given, then a list of all readonly names is printed. set [ - -ekotuvx [ arg ... ] ] -e Exit immediately if a command exits with a non-zero exit status. -k All keyword arguments are placed in the environment for a command, not just those that precede the command name. -0 Read commands but do not execute them. -t Exit after reading and executing one command. -u Treat unset variables as an error when substituting. -v Print shell input lines as they are read. -x Print commands and their arguments as they are executed. Do not change any of the flags; useful in setting $1 to -. Using + rather than - causes these flags to he turned off. These flags can also be used upon invocation of the shell. The current set of flags may be found in $ -. The remaining arguments are positional parameters and are assigned, in order, to $1, $2, .... If no arguments are given then the values of all names are printed. shift [ n ] The positional parameters from $0 + 1 ... are renamed $1 .... If n is not given, it is assumed to be 1. test Evaluate conditional expressions. See test (1) for usage and description. times Print the accumulated user and system times for processes run from the shell. trap [ arg ] [ n ] ... arg is a command to be read and executed when the shell receives signal (s) n. (Note that arg is scanned once when the trap is set and once when the trap is taken.) Trap commands are executed in order of signal number. Any attempt to set a trap on a signal that was ignored on entry to the current shell is ineffective. An attempt to trap on -6- 8H(I) 8H(I) signal 11 (memory fault) produces an error. If arg is absent then all trap(s) n are reset to their original values. If arg is the null string then this signal is ignored by the shell and by the commands it invokes. If n is 0 then the command arg is executed on exit from the shell. The trap command with no arguments prints a list of commands associated with each signal number. ulimit [ -fp] [ n ] imposes a size limit of n -f imposes a size limit of n blocks on files written by child processes (files of any size may be read). With no argument, the current limit is printed. -p changes the pipe size to n (UNIX System/RT only). If no option is given, -f is assumed. umask [ nnn ] . The user file-creation mask is set to nnn (see umask (2». If nnn is omitted, the current value of the mask is printed. wait [ n ] Wait for the specified process and report its termination status. If n is not given then all currently active child processes are waited for and the return code is zero. Invocation. If the shell is invoked through exec (2) and the first character of argument zero is -, commands are initially read from fetefprofile and then from SHOMEf.profile, if such files exist. Thereafter, commands are read as described below, which is also the case when the shell is invoked as fbinfsh. The flags below are interpreted by the shell on invocation only; Note that unless the -e or -s flag is specified, the first argument is assumed to be the name of a file containing commands, and the remaining arguments are passed as positional parameters to that command file: -e string If the -e flag is present then commands are read from string. -s If the -s flag is present or if no arguments remain then commands are read from the standard input. Any remaining arguments specify the positional parameters. Shell output is written to file descriptor 2. -i If the -i flag is present or if the shell input and output are attached to a terminal, then this shell is interactive. In this case TERMINATE is ignored (so that kill 0 does not kill an interactive shell) and INTERRUPT is caught and ignored (so that wait is interruptible). In all cases, QUIT is ignored by the shell. -r If the -r flag is present the shell is a restricted shell. The remaining flags and arguments are described under the set command above. Rsh Only. Rsh is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. The actions of rsh are identical to those of sh, except that the following are disallowed: changing directory (see cd (1) ) , setting the value of SPATH, specifying path or command names containing f, redirecting output (> and > > ). The restrictions above are enforced after .profile is interpreted. When a command to be executed is found to be a shell procedure, rsh invokes sh to execute it. Thus, it is possible to provide to the end-user shell procedures that have access to the full power of the standard shell, while imposing a - 7- SH(l) SH(l) limited menu of commands; this scheme assumes that the end-user does not have write and execute permissions in the same directory. The net effect of these rules is that the writer of the .profile has complete control over user actions, by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands (i.e., lusr/rbin) that can be safely invoked by rsh. Some systems also provide a restricted editor red. EXIT STATUS Errors detected by the shell, such as syntax errors, cause the shell to return a non-zero exit status. If the shell is being used non-interactively then execution of the shell file is abandoned. Otherwise, the shell returns the exit status of the last command executed (see also the exit command above). FILES letc/profile $HOME/.profile Itmp/sh· /dev/null SEE ALSO cd(I), env(I), 10gin(I), newgrp(l), test(I), umask(l), dup(2), exec(2), fork (2) , pipe(2) , signal(2), ulimit(2) , umask(2) , wait(2), a.out(4), profile(4), environ (5). BUGS The command readonly (without arguments) produces the same output as the command export. If « is used to provide standard input to an asynchronous process invoked by &, the shell gets mixed up about naming the input document; a garbage file Itmp/sh. is created and the shell complains about not being able to find that file by another name. -8- SIZE(I) (not on PDP-l 1) SIZE (I ) NAME size - print section sizes of common object files SYNOPSIS size [-0] [-x] [-V] files DESCRIPTION The size command produces section size information for each section in the common object files. The size of the text, data and bss (uninitialized data) sections are printed along with the total size of the object file. If an archive file is input to the size command the information for all archive members is displayed. Numbers will be printed in decimal unless either the - 0 or the -x option is used, in which case they will be printed in octal or in hexadecimal, respectively. The -V flag will supply the version information on the size command. SEE ALSO asO), cc(l), ld'(l), a.out(4), ar(4). DIAGNOSTICS size: name: cannot open if name cannot be read. size: name: bad magic if name is not an appropriate common object file. - 1- SIZE(t) (PDP-ll only) SIZE (I ) NAME size - print sizes of object files SYNOPSIS size [ object ... ] DESCRIPTION Size prints the (decimal) number of bytes required by the text, data, and bss portions, and their sum in octal and decimal, of each object-file argument. If no file is specified, a.out is used. SEE ALSO a.out(4). - 1- SLEEP(I) SLEEP(I) NAME sleep - suspend execution for an interval SYNOPSIS sleep time DESCRIPTION Sleep suspends execution for time seconds. It is used to execute a command after a certain amount of time as in: (sleep 105; command) & or to execute a command every so often, as in: while true do command sleep 37 done SEE ALSO alarm (2), sleepOC). BUGS Time must be less than 65536 seconds. - 1- SNO(I) SNO(I) NAME sno - SNOBOL interpreter SYNOPSIS sno [ files ] DESCRIPTION Sno is a SNOBOL compiler and interpreter (with slight differences). Sno obtains input from the concatenation of the named files and the standard input. All input through a statement containing the label end is considered program and is compiled. The rest is available to syspit. Sno differs from SNOBOL in the following ways: There are no unanchored searches. To get the same effect: a •• b unanchored search for b. a .x. b = x c unanchored assignment There is no back referencing. x = "abc" a .x. x is an unanchored search for abc. Function declaration is done at compile time by the use unique) label define. Execution of a function call begins ment following the define. Functions cannot be defined and the use of the name define is preempted. There is no automatic variables other than parameters. Examples: of the (nonat the stateat run time, provision for define f( ) define f(a, b, c) All labels except define (even end) must have a non-empty statement. Labels, functions and variables must all have distinct names. In particular, the non-empty statement on end cannot merely name a label. If start is a label in the program, program execution will start there. If not, execution begins with the first executable statement; define is not an executable statement. There are no builtin functions. Parentheses for arithmetic are not needed. Normal precedence applies. Because of this, the arithmetic operators / and • must be set off by spaces. The right side of assignments must be non-empty. Either' or " may be used for literal quotes. The pseudo-variable sysppt is not available. SEE ALSO awk(1). SNOBOL, a String Manipulation Language, by D. J. Farber, R. E. Griswold, and I. P. Polonsky, JACM 11 (1964), pp. 21-30. - 1- SORT(I) SORT (I) NAME sort - sort and/or merge files SYNOPSIS sort [-cmubdfinrtx] [+posl [-pos2J1 ... [-0 output] [names] DESCRIPTION Sort sorts lines of all the named files together and writes the result on the standard output. The name - means the standard input. If no input files are named, the standard input is sorted. The default sort key is an entire line. Default ordering is lexicographic by bytes in machine collating sequence. The ordering is affected globally by the following options, one or more of which may appear. b Ignore leading blanks (spaces and tabs) in field comparisons. d "Dictionary" order: only letters, digits and blanks are significant in comparisons. Fold upper case letters onto lower case. f Ignore characters outside the ASCII range 040-0176 in non-numeric comparisons. n An initial numeric string, consIstmg of optional blanks, optional minus sign, and zero or more digits with optional decimal point, is sorted by arithmetic value. Option n implies option b. r Reverse the sense of comparisons. tx "Tab character" separating fields is x. The notation +pos1 -pos2 restricts a sort key to a field beginning at pos1 and ending just before pos2. Pos1 and pos2 each have the form m.n, optionally followed by one or more of the flags bdfinr, where m tells a number of fields to skip from the beginning of the line and n tells a number of characters to skip further. If any flags are present they override all the global ordering options for this key. If the b option is in effect n is counted from the first nonblank in the field; b is attached independently to pos2. A missing .n means .0; a missing -pos2 means the end of the line. Under the -tx option, fields are strings separated by x; otherwise fields are non-empty non-blank strings separated by blanks. When there are multiple sort keys, later keys are compared only after all earlier keys compare equal. Lines that otherwise compare equal are ordered with all bytes significant. These option arguments are also understood: c Check that the input file is sorted according to the ordering rules; give no output unless the file is out of sort. m Merge only, the input files are already sorted. D Suppress all but one in each set of equal lines. Ignored bytes and bytes ,~outside keys do not participate in thi~ comparison. o The next argument is the name of an output file to use instead of the standard output. This file may be the same as one of the inputs.. EXAMPLES PriD1 in alpJiatictieai ordel" aU the unique spellings in a list of WOlds (ca.pitalized words ~. ftoor,uweapitali:ied): ~Sort -D< +0(, +0 ' mt -1 - .. SORT(I) SORT(1) Print the password file (passwd(4» sorted by user 10 (the third colonseparated field): sort -t: +2n /etc/passwd Print the first instance of each month in an already sorted file of (month-day) entries (the options -um with just one input file make the choice of a unique representative from a set of equal lines predictable): sort -urn +0 -1 dates FILES /usrltmp/stm??? SEE ALSO comm(1), join(1), uniq (0. DIAGNOSTICS Comments and exits with non-zero status for various trouble conditions and for disorder discovered under option -c. BUGS Very long lines are silently truncated. - 2- SPELL(I) SPELL(I) NAME spell, hashmake, spellin, hashcheck - find spelling errors SYNOPSIS spell [ -v ] [ -b ] [ -x ] [ -I ] [ +local file ] [ files ] lusr /Iib/speU/hasbmake lusr/lib/spell/spellin n lusr /Iib/spell/hashcheck spellingJist DESCRIPTION Spell collects words from the named files and looks them up in a spelling list. Words that neither occur among nor are derivable (by applying certain inflections, prefixes, and/or suffixes) from words in the spelling list are printed on the standard output. If no files are named, words are collected from the standard input. Spell ignores most troff(1), tbl( 1), and eqn (1) constructions. Under the -v option, all words not literally in the spelling list are printed, and plausible derivations from the words in the spelling list are indicated. Under the - b option, British spelling is checked. Besides preferring centre, colour, programme, speciality, travelled, etc., this option insists upon -ise in words like standardise, Fowler and the OED to the contrary notwithstanding. Under the -x option, every plausible stem is printed with = for each word. By default, spell Oike deroff(1» follows chains of included files (.so and .nx troff( 1) requests), unless the names of such included files begin with lusr /lib. Under the -I option, spell will follow the chains of all included files. Under the +localJile option, words found in localJile are removed from spell's output. LocalJile is the name of a user-provided file that contains a sorted list of words, one per line. With this option, the user can specify a set of words that are correct spellings Gn addition to spell's own spelling list} for each job. The spelling list is based on many sources, and while more haphazard than an ordinary dictionary, is also more effective with respect to proper names and popular technical words. Coverage of the specialized vocabularies of biology, medicine, and chemistry is light. Pertinent auxiliary files may be specified by name arguments, indicated below with their default settings (see FILES). Copies of all output are accumulated in the history file. The stop list filters out misspellings (e.g., thier=thy-y+ier) that would otherwise pass. Three routines help maintain and check the hash lists used by spell: hash make . Reads a list of words from the standard input and writes the corresponding nine-digit hash code on the standard output. spellin Reads n hash codes from the standard input and writes a compressed spelling list on the standard output. hashcheck Reads a compressed spelling_list and recreates the nine-digit hash codes for all the words in it; it writes these codes on the standard output. FILES D_SPELL=/usrllib/spell/hlisdabl S_SPELL=/usrllib/spell/hstop H_SPELL=/usrllib/spell/spellhist hashed spelling lists, American & British hashed stop list history file - 1- SPELL(l) lusr/lib/spell/spellprog SPELL(l) program SEE ALSO deroff(t), eqn(l), sed(l), sort(l), tbl(l), tee(l), troff(1). BUGS The spelling list's coverage is uneven; new installations will probably wish to monitor the output for several months to gather local additions; typically, these are kept in a separate local file that is added to the hashed spelling_list via spellin. The British spelling feature was done by an American. - 2- SPLINE(IG) SPLINE(IG) NAME spline - interpolate smooth curve SYNOPSIS spline [ options ] DESCRIPTION Spline takes pairs of numbers from the standard input as abscissas and ordinates of a function. It produces a similar set, which is approximately equally spaced and includes the input set, on the standard output. The cubic spline output (R. W. Hamming, Numerical Methods for Scientists and Engineers, 2nd ed., pp. 349ff) has two continuous derivatives, and sufficiently many points to look smooth when plotted, for example by graph (1 G). The following options are recognized, each as a separate argument: -a Supply abscissas automatically (they are missing from the input); spacing is given by the next argument, or is assumed to be 1 if next argument is not a number. -k The constant k used in the boundary value computation: y~ = kyi', y~' .... kY~'-1 is set by the next argument (default k = 0). -n Space output points so that approximately n intervals occur between the lower and upper x limits (default n = 100). -p Make output periodic, i.e., match derivatives at ends. First and last input values should normally agree. -x Next 1 (or 2) arguments are lower (and upper) x limits. Normally, these limits are calculated from the data. Automatic abscissas start at lower limit (default 0). SEE ALSO graph{IG). DIAGNOSTICS When data is not strictly monotone in x, spline reproduces the input without interpolating extra points. BUGS A limit of 1,000 input points is enforced silently. - 1- SPLIT (1 ) SPLIT(I) NAME split - split a file into pieces SYNOPSIS split [ -n ] [ file [ name] ] DESCRIPTION Split reads file and writes it in n-line pieces (default 1000 lines) onto a set of output files. The name of the first output file is name with aa appended, and so on lexicographically, up to zz (a maximum of 676 files). Name cannot be longer than 12 characters. If no output name is given, x is default. If no input file is given, or if - is given in its stead, then the standard input file is used. SEE ALSO bfs(I), csplit(I). - 1- STAT(tG) STAT(tG) NAME stat - statistical network useful with graphical commands SYNOPSIS node-name [options) [files) DESCRIPTION Stat is a collection of command level functions (nodes) that can be interconnected using sh (1) to form a statistical network. The nodes reside in /usr Ibin/graf (see graphics (I G». Data is passed through the network as sequences of numbers (vectors), where a number is of the form: [sign) (digits) (digits) [e[sign)digits) evaluated in the usual way. Brackets and parentheses surround fields. All fields are optional, but at least one of the fields surrounded by parentheses must be present. Any character input to a node that is not part of a number is taken as a delimiter. Stat nodes are divided into four classes. Transformers, which map input vector elements into output vector elements; Summarizers, which calculate statistics of a vector; Translators, which convert among formats; and Generators, which are sources of definable vectors. Below is a list of synopses for stat nodes. Most nodes accept options indicated by a leading minus (-). In general, an option is specified by a character followed by a value, such as c5. This is interpreted as c := 5 (c is assigned 5). The following keys are used to designate the expected type of the value: c characters, integer, f floating point or integer, file file name, and string string of characters, surrounded by quotes to include a Shell argument delimiter. Options without keys are flags. All nodes except generators accept files as input, hence it is not indicated in the synopses. Transformers: abs -[ -ci) - absolute value columns (similarly for -c options that follow) af ceil [ -ci tv) - arithmetic function titled output, verbose [ -ci) - round up to next integer cusum [ -cil - cumulative sum exp [ -ci) - exponential floor [ -cil - round down to next integer gamma [ - cil - gamma list [ -ci dstring) - list vector elements delimiter(s) log [ -ci bf) - logarithm base - 1- STAT(lG) STAT(IG) mod [ -ci mf] - modulus modulus pair [ -ci Ffile xi] - pair elements File containing base vector, x group size power [ -ci pf] - raise to a power power root [ -ci rf] - take a root root round [ -ci pi si ] - round to nearest integer, .5 rounds to 1 places after decimal point, significant digits siline [ -ci ifnisf] - generate a line given slope and intercept intercept, number of positive integers, slope [ -ci] - sine sin subset [ -af bf ci Ffile ii V nl np pf si t;] - generate a subset above, below, File with master vector, interval, leave, master contains element numbers to leave, master contains element numbers to pick, pick, start, terminate Summarizers: bucket [ -ai ci Ffile Iif ii V n;] - break into buckets average size, File containing bucket boundaries, high, interval, low, number cor [ - Ffile] - correlation coefficient File containing base vector [ - h I 0 ox oy ]- find high and low values high only, low only, option form, option form with x prepended, option form with y prepended hilo Ireg [ - Ffile i 0 s ] - linear regression File containing base vector, intercept only, option form for siline, slope only mean [ -ff ni pf] - (trimmed) arithmetic mean fraction, number, percent point [ -ff ni pf s ] - point from empirical cumulative density function fraction, number, percent, sorted input prod - internal product qsort [ -ci] - quick sort rank total - vector rank - sum total var - variance Translators: bar [ -a b f g ri wi xf xa yf ya yV yhf ] - build a bar chart suppress axes, bold, suppress frame, suppress grid. region, width in percent, x origin, suppress x-axis label, y origin, suppress y-axis label, y-axis lower bound, y-axis laigh bound hist [ - a b f g ri xf xa yf ya yV yhf ) - build a histogram suppress axes, bold, suppress frame, suppress grid, region, x origin, suppress x-axis label, y origin, suppress y ...xis label, yaxis lower bound, y-axis high bound - 2- STAT(IG) STAT(IG) label l _: Ffile h p ri x xu y yr] - label the axis of a GPS file . bar chart input, retain case, label File, histogram input, plot input, rotation, x-axis, upper x-axis, y-axis, right y-axis pie [ -b 0 p pni ppi ri v xi yi ] - build a pie chart bold, values outside pie, value as percentage(:=100), value as percentage(:=i), draw percent of pie, region, no values, x origin, y origin Unlike other nodes, input is lines of the form [< i e f cc >] value [label] ignore (don't draw) slice, explode slice, fill slice, color slice c= ( black, red, green, blue) plot [-a b cstringd f Ffile g m ri xfxa xifxhf xVxnixt yfya yifyhf yVyniyt ] - plot a graph suppress axes, bold, plotting characters, disconnected, suppress frame, File containing x vector, suppress grid, mark points, region, x origin, suppress x-axis label, x interval, x high bound, x low bound, number of ticks on x-axis, suppress xaxis title, y origin, suppress y-axis label, y interval, y high bound, y low bound, number of ticks on y-axis, suppress y-axis title title [ -b c istring vstring ustring ] - title a vector or a GPS title bold, retain case, lower title, upper title, vector title Generators: gas [ -ci ifni sftf] - generate additive sequence interval, number, start, terminate prime [-ci hi Ii ni ] - generate prime numbers high, low, number rand [ -ci hf V mf ni si] - generate random sequence high, low, multiplier, number, seed RESTRICTIONS Some nodes have a limit on the size of the input vector. SEE ALSO graphics (1 G), gps(4). -3- STLOGIN(I) STLOGIN (I) NAME stlogin - sign on to synchronous terminal SYNOPSIS stlogin [ delay I DESCRIPTION The stlogin command is used at the beginning of each terminal session and allows you to identify yourself to the system. It is invoked by the system when a synchronous terminal requests service on a connected synchronous line. You can direct your synchronous terminal to request service by first hitting the LOCAL key and then hitting the SIR key. Stlogin asks for your user name and your password. If you have a password, both must be entered before the SIR key is hit. The password field is not displayed on the screen as you enter it. At some installations, an option may be invoked that will require you to enter a second "external" password. This will occur only for dial-up connections, and will be prompted by the message "External security:". Both passwords are required for a successful login. If password aging has been invoked by the super-user on your behalf, your password may have expired. In this case, you will be shunted into passwd(1) to change it, after which you may attempt to login again. If you do not complete the login successfully within the period specified by delay (e.g., 60 seconds), you are likely to be silently disconnected. After a successful login, accounting files are updated, you will be informed of the existence (if any) of mail, and the profiles (i.e., /etc/profile and $HOME/.profile) (if any) are executed (see profile (4». Stlogin initializes the user and group IDs and the working directory, then executes a command interpreter (usually sh (1» according to specifications found in the /etc/passwd file. Argument 0 of the command interpreter is - followed by the last component of the interpreter's path name. The environment (see environ (5» is initialized to: HOME=your-login-directory PATH=:/bin:/usr/bin LOGNAME=your-login-name FILES /etc/utmp /etc/wtmp /usr/mail/your-name /etc/motd /etc/passwd / etc/ profile $HOME/. profile accounting accounting mailbox for user your-name message-of-the-da y password file system profile personal profile SEE ALSO mail(I), newgrp(I), passwd(I), sh(1), su(I), passwd(4), profile(4), environ(S). DIAGNOSTICS Login incorrect if the user name or the password is incorrect. No shell, cannot open password file, no directory: consult a UNIX System programming counselor. Your password has expired. Choose a new one. if password aging is implemented. - 1- STRIP(l) (not on PDP-l 1) STRIP(l) NAME strip - strip symbol and line number information from a common object file SYNOPSIS strip [-11 [-x] [-r] [-s] [-V] file-names DESCRIPTION The strip command strips the symbol table and line number information from common object files, including archives. Once this has been done, no symbolic debugging access will be available for that file; therefore, this command is normally run only on production modules that have been debugged and tested. The amount of information stripped from the symbol table can be controlled by using any of the following options: -I Strip line number information only; do not strip any symbol table information. -x Do not strip static or external symbol information. -r Reset the relocation indexes into the symbol table. -s Reset the line number indexes into the symbol table (do not remove). reset the relocation indexes into the symbol table. - V Version of strip command executing. If there are any relocation entries in the object file and any symbol table information is to be stripped, strip will complain and terminate without stripping file-name unless the -r flag is used. If the strip command is executed on a common archive file (see ar(4» the archive symbol table will be removed. The archive symbol table must be restored by executing the ar(O command with the s option before the archive can be link edited by the Id(I) command. Strip(I) will instruct the user with appropriate warning messages when this situation arises. The purpose of this command is to reduce the file storage overhead taken by the object file. FILES /usr Itmp/strp?????? SEE ALSO as(I), cc(I), Id(I), ar(4), a.out(4). DIAGNOSTICS strip: name: cannot open if name cannot be read. strip: name: bad magic if name is not an appropriate common object file. strip: name: relocation entries present; cannot strip if name contains relocation entries and the -r flag is not used, the symbol table information cannot be stripped. - 1- STRIP(I) (PDP-ll only) STRIP(I) NAME strip - remove symbols and relocation bits SYNOPSIS strip name ... DESCRIPTION Strip removes the symbol table and relocation bits ordinarily attached to the output of the assembler and link editor. This is useful to save space after a program has been debugged. The effect of strip is the same as use of the -s option of [d(I). If name is an archive file, strip will remove the local symbols from any a.out format files it finds in the archive. Certain libraries, such as those residing in nib, have no need for local symbols. By deleting them, the size of the archive is decreased and link editing performance is increased. FILES Itmp/stm. temporary file SEE ALSO ld(l), ar(4), a.out(4). - 1- STSTAT(I) STSTAT(I) NAME ststat - report synchronous terminal facilities status SYNOPSIS ststat [ options ] DESCRIPTION Ststat prints certain information about synchronous terminal facilities. The information that is displayed is controlled by options: -a Use all print options. (This is shorthand notation for -g, -I, -p, and -t.) -c corefile Use the file corefile in place of Idev/kmem. -g Print information about gen paramaters. (Number of synchronous lines, number of printer ports, number of terminal ports, number of message headers, and sizes of receive and transmit buffer areas.) -I Print information about synchronous lines. (For each synchronous line, whether or not the protocol script is running and whether or not it has established communications with a controller on the line.) - 0 namelist The argument will be taken as the name of an alternate name list Uuoix is the default). -p Print printer port status information. (For each assigned printer port, give the assigned path name and the synchronous line number and device code for the assigned printer.) If none of the print options -a, -g, -I, or -t are specified, -p is supplied as a default. -t Print terminal port status information. (For each active terminal port, give the path name of the terminal device and tell whether an open is waiting to be assigned to a terminal, open to an active terminal, or open to a device that has hung up.) FILES /dev /dev/kmem /unix searched to find terminal ("tty") names memory system namelist SEE ALSO st(IM), st(7). DIAGNOSTICS Can't read system namelist. Unable to find system name entries in the namelist file. No synchronous terminal lines in namelist. Synchronous terminals are not configured in the system in the namelist file. Can't open corefile. Unable to open the specified corefile file. Can't read corefile. A read failed on the corefile file. /dev/????? The name of an active terminal port could not be found in the Idev directory. BUGS Things can change while ststat is running; the picture it gives is only a close apporoximation to reality. - 1- STTY(I) STTY(I) NAME stty - set the options for a terminal SYNOPSIS stty [ -a ] [ -g ] [ options ] DESCRIPTION Stty sets certain terminal 110 options for the device that is the current standard input; without arguments, it reports the settings of certain options; with the -a option, it reports all of the option settings; with the -g option, it reports current settings in a form that can be used as an argument to another stty command. Detailed information about the modes listed in the first five groups below may be found in termio (7) for asynchronous lines, or in stermio (7) for synchronous lines in the UNIX System Administrator's Manual. Options in the last group are implemented using options in the previous groups. Note that many combinations of options make no sense, but no sanity checking is performed. The options are selected from the following: Control Modes parenb (-parenb) enable (disable) parity generation and detection. select odd (even) parity. parodd (-parodd) es5 es6 es7 es8 select character size (see termio (7». o hang up phone line immediately. 50 75 110 134 150200 300 600 1200 1800 2400 4800 9600 exta extb Set terminal baud rate to the number given, if possible. (All speeds are not supported by all hardware interfaces.) hupel (- hupeI) hang up (do not hang up) a DATA-PHONE® data set connection on last close. hup (-hup) same as hupel (- hupeI) . estopb (-estopb) use two (one) stop bits per character. eread (- eread) enable (disable) the receiver. eloeal (-eloeaI) assume a line without (with) modem control. Input Modes ignbrk (- ignbrk) ignore (do not ignore) break on input. brkint (- brkint) signal (do not signal) INTR on break. ignpar (-ignpar) ignore (do not ignore) parity errors. parmrk (- parmrk) mark (do not mark) parity errors (see termio (7». inpek (- inpek) enable (disable) input parity checking. istrip (-istrip) strip (do not strip) input characters to seven bits. inler (- inler) map (do not map) NL to CR on input. igner (- igner) ignore (do not ignore) CR on input. iernl (- iernI) map (do not map) CR to NL on input. iuele (- iuele) map (do not map) upper-case alphabetics to lower case on input. ixon (-ixon) enable (disable) START/STOP output control. Output is stopped by sending an ASCII DC3 and started by sending an ASCII DC 1. ixany (-ixany) allow any character (only DCI) to restart output. ixoff (-ixoff) request that the system send (not send) START/STOP characters when the input queue is nearly empty/full. Output Modes opost (- opost) post-process output (do not post-process output; ignore all other output modes). oleue (- oleue) map (do not map) lower-case alphabetics to upper case on output. onler (-onler) map (do not map) NL to CR-NL on output. - 1- STTY(1) STTYO) ocrnl (- ocrnI) onocr (-onocr) onlret (- onlret) ofiU (- ofin) ofdel (-ofde I) crO crl cr2 cr3 nlO nll tabO tab 1 tab2 tab3 bsO bsl flO fft vtO vtl Local Modes isig (- isig) icanon (- icanon) xcase (-xcase) echo (-echo) echoe (- eehoe) echok (- eehok) lfke (-lfke) echonl (- eehonl) noflsh (- noflsh) stwrap (-stwrap) stflush (-stflush) stappl (- stappI) Control Assignments control-character c map (do not map) CR to NL on output. do not (do) output CRs at column zero. on the terminal NL performs (does not perform) the CR \ function. use fill characters (use timing) for delays. fill characters are DELs (NULs). select style of delay for carriage returns (see termio (7». select style of delay for line-feeds (see termio (7». select style of delay for horizontal tabs (see termio (7) or stermio (7». select style of delay for backspaces (see termio (7». select style of delay for form-feeds (see termio (7». select style of delay for vertical tabs (see termio (7». enable (disable) the checking of characters against the special control characters INTR and QUIT. enable (disable) canonical input (ERASE and KILL processing) . canonical (unprocessed) upperllower-case presentation. echo back (do not echo back) every character typed. echo (do not echo) ERASE character as a backspacespace-backspace string. Note: this mode will erase the ERASEed character on many CRT terminals; however, it does not keep track of column position and, as a result, may be confusing on escaped characters, tabs, and backspaces. echo (do not echo) NL after KILL character. the same as eehok (-eehok); obsolete. echo (do not echo) NL. disable (enable) flush after INTR or QUIT. disable (enable) truncation of lines longer than 79 characters on a synchronous line. enable (disable) flush on a synchronous line after every write (2). use application mode (use line mode) on a synchronous line. set control-character to c, where control-character is erase, kill, intr, quit, eof, eol, etab, min, or time (etab is used with -stappl; see stermio (7», (min and time are used with -icanon; see termio (7». If c is preceded by an (escaped from the shell) caret (A), then the value used is the corresponding CTRL character (e.g., "Ad" is a CfRL-d); "A?" is interpreted as DEL and ,,'" "is interpreted as undefined. set line discipline to i (0 < i < 127 ). line i Combination Modes evenp or parity enable parenb and es7. oddp enable parenb, cs7, and parodd. -parity, -evenp, or -oddp disable parenb, and set es8. raw (-raw or cooked) enable (disable) raw input and output (no ERASE, KILL, INTR, QUIT, EOT, or output post processing). nl (-nO unset (set) icrnl, onler. In addition - nl unsets inler, igner, oernl, and onlret. - 2- STTY(t) STTY(l) lease (-lease) LCASE (- LCASE) tabs (-tabs or tab3) ek set (unset) xease, iucie, and olcue. same as lease (-lease). preserve (expand to spaces) tabs when printing. reset ERASE and KILL characters back to normal # and sane term resets all modes to some reasonable values. set all modes suitable for the terminal type term, where term is one of tty33, tty37, vt05, tn300, ti700, or tek. @. SEE ALSO ta bs (I), ioctl(2). stermio(7), termio(7) in the UNIX System Adminstrator's Manual. -3- SU(l) SU(l) NAME su - become super-user or another user SYNOPSIS su [ - ] [ name [ arg ... ] ] DESCRIPTION Su allows one to become another user without logging off. The default user name is root (i.e., super-user). To use SU, the appropriate password must be supplied (unless one is already super-user). If the password is correct, su will execute a new shell with the user ID set to that of the specified user. To restore normal user ID privileges, type an EOF to the new shell. Any additional arguments are passed to the shell, permitting the super-user to run shell procedures with restricted privileges (an arg of the form -c string executes string via the shell). When additional arguments are passed. Ibin/sh is always used. When no additional arguments are passed, su uses the shell specified in the password file. An initial - flag causes the environment to be changed to the one that would be expected if the user actually logged in again. This is done by invoking the shell with an argO of -su causing the .profile in the home directory of the new user ID to be executed. Otherwise, the environment is passed along with the possible exception of SPATH, which is set to Ibin:/etc:/usr/bin for root. Note that the .profile can check argO for -sh or -su to determine how it was invoked. FILES letc/passwd $HOME/.profile system's password file user's profile SEE ALSO env (I), login (I), sh (1), environ (5) . - 1- SUM(1) SUM(I) NAME sum - print checksum and block count of a file SYNOPSIS sum [ -r ] file DESCRIPTION Sum calculates and prints a 16-bit checksum for the named file, and also prints the number of blocks in the file. It is typically used to look for bad spots, or to validate a file communicated over some transmission line. The option -r causes an alternate algorithm to be used in computing the checksum. SEE ALSO wc(I). DIAGNOSTICS "Read error" is indistinguishable from end of file on most devices; check the block count. - 1- SYNC(l) SYNC (I) NAME sync - update the super block SYNOPSIS sync DESCRIPTION Sync executes the sync system primitive. If the system is to be stopped, sync must be called to insure file system integrity. It will flush all previously unwritten system buffers out to disk, thus assuring that all file modifications up to that point will be saved. See sync(2) for details. SEE ALSO sync(2). - 1- TABS(t) TABSO) NAME tabs - set tabs on a terminal SYNOPSIS tabs [ tabspec ] [ +mn ] [ -Ttype ] DESCRIPTION Tabs sets the tab stops on the user's terminal according to the tab specification tabspec, after clearing any previous settings. The user must of course be logged in on a terminal with remotely-settable hardware tabs. Users of GE TermiNet terminals should be aware that they behave in a different way than most other terminals for some tab settings: the first number in a list of tab settings becomes the left margin on a TermiNet terminal. Thus, any list of tab numbers whose first element is other than 1 causes a margin to be left on a TermiNet, but not on other terminals. A tab list beginning with 1 causes the same effect regardless of terminal type. It is possible to set a left margin on some other terminals, although in a different way (see below). Four types of tab specification are accepted for tabspec: "canned," repetitive, arbitrary, and file. If no tabspec is given, the default value is -8, i.e., UNIX System "standard" tabs. The lowest column number is 1. Note that for tabs, column 1 always refers to the leftmost column on a terminal, even one whose column markers begin at 0, e.g., the DASI 300, DASI 300s, and DASI 450. -code -a -a2 -c -c2 -c3 -f Gives the name of one of a set of "canned" tabs. The legal codes and their meanings are as follows: 1,10,16,36,72 Assembler, IBM S/370, first format 1,10,16,40,72 Assembler, IBM S/370, second format 1,8,12,16,20,55 COBOL, normal format 1,6,10,14,49 COBOL compact format (columns 1-6 omitted). Using this code, the first typed character corresponds to card column 7, one space gets you to column 8, and a tab reaches column 12. Files using this tab setup should include a format specification as follows: <:t-c2 m6 s66 d:> 1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67 COBOL compact format (columns 1-6 omitted), with more tabs than -c2. This is the recommended format for COBOL. The appropriate format specification is: <:t-c3 m6 s66 d:> 1,7,11,15,19,23 FORTRAN -p 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61 PLII -s 1,10,55 SNOBOL -u 1,12,20,44 UNIVAC 1100 Assembler In addition to these "canned" formats, three other types exist: -n A repetitive specification requests tabs at columns 1+n, 1+2*n, etc. Note that such a setting leaves a left margin of n columns on TermiNet terminals only. Of particular importance is the value -8: this represents the UNIX System "standard" tab setting, and is the most likely tab setting to be found at a terminal. It is required for use with the nroJf -h option for high-speed output. Another special case is the - 1- TABS (I) TABS (I) value -0, implying no tabs at all. n} ,n2,... The arbitrary format permits the user to type any chosen set of numbers, separated by commas, in ascending order. Up to 40 numbers are allowed. If any number (except the first one) is preceded by a plus sign, it is taken as an increment to be added to the previous value. Thus, the tab lists 1,10,20,30 and 1,10,+10,+10 are considered identical. - -file If the name of a file is given, tabs reads the first line of the file, searching for a format specification. If it finds one there, it sets the tab stops according to it, otherwise it sets them as -8. This type of specification may be used to make sure that a tabbed file is printed with correct tab settings, and would be used with the pr(1) command: tabs - - file; pr file I I Any of the following may be used also; if a given flag occurs more than once, the last value given takes effect: -Ttype Tabs usually needs to know the type of terminal in order to set tabs and always needs to know the type to set margins. Type is a name listed in term (5). If no -T flag is supplied, tabs searches for the $TERM value in the environment (see environ (5». If no type can be found, tabs tries a sequence that will work for many terminals. +mn The margin argument may be used for some terminals. It causes all tabs to be moved over n columns by making column n +} the left , margin. If +m is given without a value of n, the value assumed is 10. For a TermiNet, the first value in the tab list should be 1, or the margin will move even further to the right. The normal (leftmost) margin on most terminals is obtained by +mO. The margin for most terminals is reset only when the +m flag is given explicitly. Tab and margin setting is performed via the standard output. DIAGNOSTICS illegal tabs illegal increment unknown tab code can't open file indirection when arbitrary tabs are ordered incorrectly. when a zero or missing increment is found in an arbitrary specifica tion. when a "canned" code cannot be found. if - -file option used, and file can't be opened. if - -file option used and the specification in that file points to yet another file. Indirection of this form is not permitted. SEE ALSO nroff(1), environ (5), term (5). BUGS There is no consistency among different terminals regarding ways of clearing tabs and setting the left margin. It is generally impossible to usefully change the left margin without also setting tabs. Tabs clears only 20 tabs (on terminals requiring a long sequence), but is willing to set 40. - 2- TAlLO) TAlLO) NAME tail - deliver the last part of a file SYNOPSIS tail [ ± [numbedUbc[f] ] ] [ file ] DESCRIPTION Tail copies the named file to the standard output beginning at a designated place. If no file is named, the standard input is used. Copying begins at distance +number from the beginning, or -number from the end of the input (if number is null, the value lOis assumed). Number is counted in units of lines, blocks, or characters, according to the appended option I, b, or c. When no units are specified, counting is by lines. With the -f ("follow") option, if the input file is not a pipe, the program will not terminate after the line of the input file has been copied, but will enter an endless loop, wherein it sleeps for a second and then attempts to read and copy further records from the input file. Thus it may be used to monitor the growth of a file that is being written by some other process. For example, the command: tail -f fred will print the last ten lines of the file fred, followed by any lines that are appended to fred between the time tail is initiated and killed. As another example, the command: tail -15cf fred will print the last 15 characters of the file fred, followed by any lines that are appended to fred between the time tail is initiated and killed. SEE ALSO dd(l). BUGS Tails relative to the end of the file are treasured up in a buffer, and thus are limited in length. Various kinds of anomalous behavior may happen with character special files. - 1- TAR (I) TARO) NAME tar - tape file archiver SYNOPSIS tar [ key ] [ files ] DESCRIPTION Tar saves and restores files on magnetic tape. Its actions are controlled by the key argument. The key is a string of characters containing at most one function letter and possibly one or more function modifiers. Other arguments to the command are files (or directory names) specifying which files are to be dumped or restored. In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of that directory. The function portion of the key is specified by one of the following letters: r x t u c The named files are written on the end of the tape. The c function implies this function. The named files are extracted from the tape. If a named file matches a directory whose contents had been written onto the tape, this directory is (recursively) extracted. The owner, modification time, and mode are restored (if possible). If no files argument is given, the entire content of the tape is extracted. Note that if several files with the same name are on the tape, the last one overwrites all earlier ones. The names of the specified files are listed each time that they occur on the tape. If no files argument is given, all the names on the tape are listed. The named files are added to the tape if they are not already there, or have been modified since last written on that tape. Create a new tape; writing begins at the beginning of the tape, instead of after the last file. This command implies the r function. The following characters may be used in addition to the letter that selects the desired function: 0, .•• ,7 v w f b m This modifier selects the drive on which the tape is mounted. The default is 1. Normally, tar does its work silently. The v (verbose) option causes it to type the name of each file it treats, preceded by the function letter. With the t function, v gives more information about the tape entries than just the name. causes tar to print the action to be taken, followed by the name of the file, and then wait for the user's confirmation. If a word beginning with y is given, the action is performed. Any other input means "no". causes tar to use the next argument as the name of the archive instead of Idev/mt? If the name of the file is -, tar writes to the standard output or reads from the standard input, whichever is appropriate. Thus, tar can be used as the head or tail of a pipeline. Tar can also be used to move hierarchies with the command: cd fromdir; tar cf - • I (cd todir; tar xf -) causes tar to use the next argument as the blocking factcr for tape records. The default is 1, the maximum is 20. This option should only be used with raw magnetic tape archives (see f above). The block size is determined automatically when reading tapes (key letters x and t). tells tar to complain if it cannot resolve all of the links to the files being dumped. If I is not specified, no error messages are printed. tells tar to not restore the modification times. The modification time of the file will be the time of extraction. - 1- TAR (I) TARO) FILES /dev/mt? Itmp/tar* DIAGNOSTICS Complaints about bad key characters and tape read/write errors. Complaints if enough memory is not available to hold the link tables. BUGS There is no way to ask for the n-th occurrence of a file. Tape errors are handled ungracefully. The u option can be slow. The b option should not be used with archives that are going to be updated. The current magnetic tape driver cannot backspace raw magnetic tape. If the archive is on a disk file, the b option should not be used at all, because updating an archive stored on disk can destroy it. The current limit on file-name length is 100 characters. - 2- TBL(I) , TBL(I) NAME tbl - format tables for nroff or troff SYNOPSIS tbl [ -TX ] [ files ] DESCRIPTION Tbl is a preprocessor that formats tables for nroff or troff{l). The input files are copied to the standard output, except for lines between .TS and .TE command lines, which are assumed to describe tables and are re-formatted by tbl. (The .TS and .TE command lines are not altered by tbl) . .TS is followed by global options. The available global options are: center expand box doublebox aUbox tab (x) center the table (default is left-adjust); make the table as wide as the current line length; enclose the table in a box; enclose the table in a double box; enclose each item of the table in a box; use the character x instead of a tab to separate items in a line of input data. The global options, if any, are terminated with a semi-colon (;). Next come lines describing the format of each line of the table. Each such format line describes one line of the actual table, except that the last format line (which must end with a period) describes all remaining lines of the table. Each column of each line of the table is described by a single key-letter, optionally followed by specifiers that determine the font and point size of the corresponding item, that indicate where vertical bars are to appear between columns, that determine column width, inter-column spacing, etc. The available key-letters are: c r I n s a center item within the column; right-adjust item within the column; left-adjust item within the column; numerically adjust item in the column: units positions of numbers are aligned vertically; span previous item on the left into this column; center longest line in this column and then left-adjust all other lines in this column with respect to that centered line; span down previous entry in this column; replace this entry with a horizontal line; replace this entry with a double horizontal line. The characters B and I stand for the bold and italic fonts, respectively; the character I indicates a vertical line between columns. The format lines are followed by lines containing the actual data for the table, followed finally by .TE. Within such data lines, data items are normally separated by tab characters. If a data line consists of only _ or ==, a single or double line, respectively, is drawn across the table at that point; if a single item in a data line consists of only _ or ==, then that item is replaced by a single or double line. Full details of all these and other features of tbl are given in the reference manual cited below. The -TX option forces tbl to use only full vertical line motions, making the output more suitable for devices that cannot generate partial vertical line motions (e.g., line printers). - 1- TBL(I) TBL(I) If no file names are given as arguments (or if - is specified as the last argument), tbl reads the standard input, so it may be used as a filter. When it is used with eqn (1) or neqn, tbl should come first to minimize the volume of data passed through pipes. EXAMPLE If we let - represent a tab (which should be typed as a genuine tab), then the input: .TS center box; cB s s cIlcIs " Icc Inn. I Household Population Town-Households -Number-Size Bedminster-789-3.26 Bernards Twp.-3087-3.74 Bernardsville-20 18 - 3.30 Bound Brook-3425-3.04 Bridgewater-7897 -3.81 Far Hills-240-3.19 .TE yields: Household Population Households Town Number Size Bedminster 789 3.26 Bernards Twp. 3.74 3087 Bernardsville 2018 3.30 Bound Brook 3425 3.04 Bridgewater 7897 3.81 Far Hills 240 3.19 SEE ALSO TBL - A Program to Format Tables in the UNIX System Document Processing Guide. cw(1), eqn(1), mm(1), mmt(1), nroff(l), troff(1), mm(5), mv(5). BUGS See BUGS under nroff(1). - 2- TCO) TC(I) NAME tc - phototypesetter simulator SYNOPSIS tc [ -t ] [ -sn ] [ -pI ] [ file ] DESCRIPTION Tc interprets its input (standard input default) as device codes for a Wang Laboratories, Inc. Cf AfT phototypesetter. The standard output of tc is intended for a Tektronix 4014 terminal with ASCII and APL character sets. The sixteen typesetter sizes are mapped into the 4014's four sizes; the entire TROFF character set is drawn using the 4014's character generator, with overstruck combinations where necessary. Typical usage is: troff -t files I tc At the end of each page, tc waits for a new-line (empty line) from the keyboard before continuing on to the next page. In this wait state, the command e will suppress the screen erase before the next page; sn will cause the next n pages to be skipped; and !cmd will send cmd to the shell. The command line options are: -t Don't wait between pages (for directing output into a file). -sn Skip the first n pages. -pi Set page length to I; I may include the scale factors p (points), i (inches), c (centimeters), and P (picas); default is picas. SEE ALSO 4014(1), sh(1), tplot(IG), troff(I). BUGS Font distinctions are lost. - 1- , TEE(l) TEE (I ) NAME tee - pipe fitting SYNOPSIS tee [ -i ] [ -a ] [ file ] DESCRIPTION Tee transcribes the standard input to the standard output and makes copies in the files. The -i option ignores interrupts; the -a option causes the output to be appended to the files rather than overwriting them. - 1- TEST(I) TEST (I) NAME test - condition evaluation command SYNOPSIS test expr [ expr ) DESCRIPTION Test evaluates the expression expr and, if its value is true, returns a zero (true) exit status; otherwise, a non-zero (false) exit status is returned; test also returns a non-zero exit status if there are no arguments. The following primitives are used to construct expr: -r file true if file exists and is readable. -w file true if file exists and is writable. -x file true if file exists and is executable. -f file true if file exists and is a regular file. -dfile true if file exists and is a directory. -cfile true if file exists and is a character special file. -bfile true if file exists and is a block special file. -pfile true if file exists and is a named pipe (fifo). -ufile true if file exists and its set-user-ID bit is set. -gfile true if file exists and its set-group-ID bit is set. -kfile true if file exists and its sticky bit is set. -s file true if file exists and has a size greater than zero. -t [fildes ] true if the open file whose file descriptor number is fildes C1 by default) is associated with a terminal device. - z s1 -0 s1 true if the length of string s 1 is zero. s1 true if the length of the string s1 is non-zero. = s2 true if strings s 1 and s2 are identical. s1 ! = s2 true if strings s1 and s2 are not identical. s1 true if s1 is not the null string. n1 -eq n2 true if the integers n1 and n2 are algebraically equal. Any of the comparisons -ne, -gt, -ge, -It, and -Ie may be used in place of -eq. These primaries may be combined with the following operators: unary negation operator. -a binary and operator. -0 binary or operator (-a has higher precedence than -0). ( expr ) parentheses for grouping. Notice that all the operators and flags are separate arguments to test. Notice also that parentheses are meaningful to the shell and, therefore, must be escaped. SEE ALSO find (1) , sh (1). - 1- TEST(I) TEST (I) WARNING In the second form of the command (i.e., the one that uses [J, rather than the word test), the square brackets must be delimited by blanks. Some UNIX systems do not recognize the second form of the command. -2- TIME(l) TIME(l) NAME time - time a command SYNOPSIS time command DESCRIPTION The command is executed; after it is complete, time prints the elapsed time during the command, the time spent in the system, and the time spent in execution of the command. Times are reported in seconds. The execution time can depend on what kind of memory the program happens to land in; the user time in MOS is often half what it is in core. The times are printed on standard error. SEE ALSO timex (1), times (2) . - 1- TIMEX(I) TIMEX(I) NAME timex - time a command; report process data and system activity SYNOPSIS timex [ options] command DESCRIPTION The given command is executed; the elapsed time, user time and system time spent in execution are reported in seconds. Optionally, process accounting data for the command and all its children can be listed or summarized, and total system activity during the execution interval can be reported. The output of timex is written on standard error. Options are: -p List process accounting records for command and all its children. Suboptions f, h, k, m, r, and t modify the data items reported, as defined in acctcom (1). The number of blocks read or written and the number of characters transferred are always reported. -0 Report the total number of blocks read or written and total characters transferred by command and all its children. -s Report total system activity (not just that due to command) that occurred during the execution interval of command. All the data items listed in sar (1) are reported. SEE ALSO acctcom (1), sar( 1) . WARNING Process records associated with command are selected from the accounting file /usr/adm/pacct by inference, since process genealogy is not available. Background processes having the same user-id, terminal-id, and execution time window will be spuriously included. EXAMPLES A simple example: timex -ops sleep 60 A terminal session of arbitrary complexity can be measured by timing a subshell: timex -opskmt sh session commands EOT - 1- TOC(IG) TOC(IG) NAME toe - graphical table of contents routines SYNOPSIS dtoc [directory] ttoe mm-file vtoe [-cdhnimsvn] [TTOC file] DESCRIPTION All of the commands listed below reside in lusr Ibinl graf (see graphics (1 G) ) . dtoe ttoe vtoe Dtoc makes a textual table of contents, TTOC, of all subdirectories beginning at directory (directory defaults to .). The list has one entry per directory. The entry fields from left to right are level number, directory name, and the number of ordinary readable files in tpe directory. Dtoc is useful in making a visual display of all or parts of a file system. The following will make a visual display of all the readable directories under I: dtoe I I vtoe I td Output is the table of contents generated by the .TC macro of mm(I) translated to TTOC format. The input is assumed to be a mm file that uses the .H family of macros for section headers. If no file is given, the standard input is assumed. Vtoc produces a GPS describing a hierarchy chart from a TTOC. The output drawing consists of boxes containing text connected in a tree structure. If no file is given, the standard input is assumed. Each TTOC entry describes one box and has the form: id [line-weight,line-style] "text" [mark] where: id is an alternating sequence of numbers and dots. The id specifies the position of the entry in the hierarchy. The id O. is the root of the tree. line-weight is either: n, normal-weight; or m, medium-weight; or b, bold-weight. line-style is either: so, solid-line; do, dotted-line; dd, dot-dash line; da, dashed-line; or Id, long-dashed text is a character string surrounded by quotes. The characters between the quotes become the contents of the box. To include a quote within a box it must be esca ped (\"). mark is a character string (surrounded by quotes if it contains spaces), with included dots being escaped. The string is put above the top right corner of the box. To include either a quote or a dot within a mark it must be escaped. Entry example: 1.1 b,da "ABC" DEF Entries may span more than one line by escaping the new-line (\new-line) . - 1- TOC(tG) TOC(IG) Comments are surrounded by the /.,./ pair. They may appear anywhere in a TTOC. Options: c Use text as entered, (default is all upper case). d Connect the boxes with diagonal lines. hn Horizontal interbox space is n% of box width. Suppress the box id. m Suppress the box mark. s Do not compact boxes horizontally. vn Vertical inter box space is n% of box height. SEE ALSO graphics(IG), gps(4). - 2- TOUCH(l) TOUCH(l) NAME touch - update access and modification times of a file SYNOPSIS touch [ -amc ] [ mmddhhmm[yy] ] files DESCRIPTION Touch causes the access and modification times of each argument to be updated. If no time is specified (see date (1» the current time is used. The -a and -m options cause touch to update only the access or modification times respectively (default is -am). The -c option silently prevents touch from creating the file if it did not previously exist. The return code from touch is the number of files for which the times could not be successfully modified (including files that did not exist and were not created). SEE ALSO date(1), utime(2). - 1- TPLOT(lG) TPLOT(lG) NAME tplot - graphics filters SYNOPSIS tplot [ -Tterminal [ -e raster ] ] DESCRIPTION These commands read plotting instructions (see plot(4» from the standard input and in general produce, on the standard output, plotting instructions suitable for a particular terminal. If no terminal is specified, the environment parameter $TERM (see environ (5» is used. Known terminals are: 300 300S 450 4014 ver DASI 300. DASI 300s. DASI 450. Tektronix 4014. Versatec D1200A. This version of plot places a scan-converted image in lusr/tmp/raster$$ and sends the result directly to the plotter device, rather than to the standard output. The -e option causes a previously scan-converted file raster to be sent to the plotter. FILES lusr !lib/OOO lusr Ilib/t300s lusr lliblt450 lusr/lib/t4014 lusr/lib/vplot lusr/tmp/raster$$ SEE ALSO plot(3X), plot(4), term(5). - 1- TR(l) TR(l) NAME tr - translate characters SYNOPSIS tr [ -cds ] [ string1 [ string2 ) DESCRIPTION Tr copies the standard input to the standard output with substitution or deletion of selected characters. Input characters found in string! are mapped into the corresponding characters of string2. Any combination of the options -cds may be used: -c Complements the set of characters in string] with respect to the universe of characters whose ASCII codes are 001 through 377 octal. -d Deletes all input characters in string!. -s Squeezes all strings of repeated output characters that are in string2 to single characters. The following abbreviation conventions may be used to introduce ranges of characters or repeated characters into the strings: [a -zl Stands for the string of characters whose ASCII codes run from character a to character z, inclusive. [a.nl Stands for n repetitions of a. If the first digit of n is 0, n is considered octal; otherwise, n is taken to be decimal. A zero or missing n is taken to be huge; this facility is useful for padding string2. The escape character \ may be used as in the shell to remove special meaning from any character in a string. In addition, \ followed by 1, 2, or 3 octal digits stands for the character whose ASCII code is given by those digits. The following example creates a list of all the words in file! one per line in file2, where a word is taken to be a maximal string of alphabetics. The strings are quoted to protect the special characters from interpretation by the shell; 012 is the ASCII code for newline. tr -cs "[A-Z][a-z)" "[\012*)" file2 SEE ALSO ed(I), sh(I), ascii(5). BUGS Won't handle ASCII NUL in string! or string2; always deletes NUL from input. - 1- TROFF(I) TROFF(I) NAME troff - typeset text SYNOPSIS troff [ options ] [ files ] DESCRIPTION Troff formats text contained in files (standard input by default) for a Wang Laboratories, Inc., CI A/T phototypesetter. Its capabilities are described in the NROFFITROFF User's Manual cited below. An argument consisting of a minus (-) is taken to be a file name corresponding to the standard input. The options, which may appear in any order, but must appear before the files, are: -olist Print only pages whose page numbers appear in the list of numbers and ranges, separated by commas. A range N - M means pages N through M; an initial - N means from the beginning to page N; and a final N - means from N to the end. (See BUGS below') -oN Number first generated page N. -sN Stop every N pages. Troff will stop the phototypesetter every N pages, produce a trailer to allow changing cassettes, and resume when the typesetter's start button is pressed. -raN Set register a (which must have a one-character name) to N. -i Read standard input after files are exhausted. -q Invoke the simultaneous input-output mode of the .rd request. -z Print only messages generated by .tm (terminal message) requests. -mname Prepend to the input files the non-compacted {ASCII text} macro file lusr Ilib/tmac/tmac.name. -cname Prepend to the input files the compacted macro files lusrlIib/macros/cmp.[ntUdt1.name and lusr IIib/macros/ucmp.[nt].name. -kname Compact the macros used in this invocation of troff, placing the output in files [dt].name in the current directory (see the May 1979 Addendum to the NROFFITROFF User's Manual for details of compacting macro files). -t Direct output to the standard output instead of the phototypesetter. -f Refrain from feeding out paper and stopping phototypesetter at the end of the run. -w Wait until phototypesetter is available, if it is currently busy. -b Report whether the phototypesetter is busy or available. No text processing is done. -a Send a printable ASCII approximation of the results to the standard output. -pN Print all characters in point size N while retaining all prescribed spacings and motions, to reduce phototypesetter elapsed time. -g Prepare output for the Murray Hill Computation Center phototypesetter and direct it to the standard output (this option is not usable on most systems). This option is not compatible with the -s option; furthermore, when this option is invoked, all .fp (font position) requests Of any) in the troff input must come before the first break, and no .tI requests may come before the first break. -Tname Use font-width tables for device name (the font tables are found in lusrlIib/fontlnamel.). Currently, no names are supported. FILES lusr/lib/suftab /tmp/ta$# suffix hyphenation tables temporary file - 1- TROFF(I) TROFF(l) lusr/lib/tmac/tmac.* standard macro files and pointers lusrllib/macros/* standard macro files lusrllib/font/* font width tables for troff SEE ALSO NROFFITROFF User's Manual and A TROFF Tutorial in the UNIX System Document Processing Guide. cw(I), eqn(I), mmt(I), nroff(I), tbl(I), tc(I), mm(5), mv(?). BUGS Troff believes in Eastern Standard Time; as a result, depending on the time of the year and on your local time zone, the date that troff generates may be off by one day from your idea of what the date is. When troff is used with the -olist option inside a pipeline (e.g., with one or more of cw(I), eqn(I), and tbl(I», it may cause a harmless "broken pipe" diagnostic if the last page of the document is not specified in list. - 2- TROUBLE(l) TROUBLE(l) NAME trouble - log a trouble report SYNOPSIS trouble DESCRIPTION The trouble command is a front end for the Piscataway Change Management Tracking System (CMTS). It is used to log trouble reports on, or request enhancements to the UNIX System. Trouble reports will be forwarded to Piscataway via uucp(IC}, where they are transformed into Modification Requests (MRs). The command will prompt for the following mandatory fields: Name: The originator's name (F. M. Last, F. Last, or First Last); (3 to 6 letter ID, if they are in the names file) Location: The external or internal mailing address Phone: The telephone number (aaaa, aaa-bbb-cccc, 8aaa-bbbb, or aaa-bbb-cccc xdddd) Type: sw (software), hdw (hardware), doc (documentation), enh (enhancement), unk (unknown) The product under discussion (usually unix) System: The CPU on which the trouble was found; na if not Machine: applicable Release: The product release number; na if not applicable Severity: 1 (out of commission, no circumvention), 2 (severity I if not fixed by due date (mo/da/yr», 3 (needed), 4 (can be deferred) Date required: The due date for a severity 2 trouble report Trouble Area: The command or area in which the trouble was found A one-line summary of the problem Abstract: The exact description of the problem; ed(I) is the Description: entry mechanism, so an a (append) must first be typed. Once the description has been entered and edited, a w (write) followed by a q (quit) is required. Since nroff is used to format these reports, all examples can be enclosed within the .ES and .EE formatter macros that are supplied by trouble. In addition, any backslashes should be entered using the \e construct. A response of ? will cause the expected format of the response to be displayed. Unless the description states otherwise, the trouble report may be selected to appear in the MINI-SYSTEM NEWSLETTER. FILES lusr/lib/troubleltr.a lusr/lib/trouble/instruct lusrllib/trouble/trsh lusr/lib/trouble/trxmit lusr/lib/trouble/names archived trouble reports instructions trouble report shell re-transmission shell letter ID data base SEE ALSO uucp(IC}. - 1- TRUE (I) TRUE(l) NAME true, false - provide truth values SYNOPSIS true false DESCRIPTION True does nothing, successfully. False does nothing, unsuccessfully. They are typically used in input to sh (1) such as: while true do command done SEE ALSO sh(1). DIAGNOSTICS True has exit status zero, false nonzero. - 1- TSORT(t) TSORl'(t) NAME tsort - topological sort SYNOPSIS tsort [ file ] DESCRIPTION Tsort produces on the standard output a totally ordered list of items consistent with a partial ordering of items mentioned in the input file. If no file is specified, the standard input is understood. The input consists of pairs of items (nonempty strings) separated by blanks. Pairs of different items indicate ordering. Pairs of identical items indicate presence, but not ordering. SEE ALSO 10rder(1) . DIAGNOSTICS Odd data: there is an odd number of fields in the input file. BUGS Uses a quadratic algorithm; not worth fixing for the typical use of ordering a library archive file. - 1- TTY (I) TTY (I) NAME tty - get the terminal's name SYNOPSIS tty [ -I ] [ -s ] DESCRIPTION Tty prints the path name of the user's terminal. The -I option prints the synchronous line number to which the user's terminal is connected, if it is on an active synchronous line. The -s option inhibits printing of the terminal's path name, allowing one to test just the exit code. EXIT CODES 2 o 1 if invalid options were specified, if standard input is a terminal, otherwise. DIAGNOSTICS "not on an active synchronous line" if the standard input is not a synchronous terminal and -I is specified. "not a tty" if the standard input is not a terminal and -s is not specified. - 1- UMASK(t) UMASK(t) NAME umask - set file-creation mode mask SYNOPSIS umask [ 000 ] DESCRIPTION The user file-creation mode mask is set to 000. The three octal digits refer to read/write/execute permissions for owner, group, and others, respectively (see chmod (2) and umask (2». The value of each specified digit is subtracted from the corresponding "digit" specified by the system for the creation of a file (see creat (2». For example, umask 022 removes group and others write permission (files normally created with mode 777 become mode 755; files created with mode 666 become mode 644). If 000 is omitted, the current value of the mask is printed. Umask is recognized and executed by the shell. SEE ALSO chmod (1), sh (1), chmod (2), crea t (2), umask (2) . - 1- UNAME(l) UNAME(l) NAME uname - print name of current UNIX System SYNOPSIS uname [ - sorvma ] DESCRIPTION Uname prints the current system name of the UNIX System on the standard output file. It is mainly useful to determine what system one is using. The options cause selected information returned by uname (2) to be printed: -s print the system name (default). -0 print the nodename (the nodename may be a name that the system is known by to a communications network). -r print the operating system release. -v print the operating system version. -m print the machine hardware name. -a print all the above information. Arguments not recognized default the command to the -s option. SEE ALSO uname(2). - 1- UNGET(l) UNGET(t) NAME unget - undo a previous get of an sees file SYNOPSIS unget [-rSIO] [-s] [-0] files DESCRIPTION Unget undoes the effect of a get -e done prior to creating the intended new delta. If a directory is named, unget behaves as though each file in the directory were specified as a named file, except that non-Sees files and unreadable files are silently ignored. If a name of - is given, the standard input is read with each line being taken as the name of an secs file to be processed. Keyletter arguments apply independently to each named file. -rSID Uniquely identifies which delta is no longer intended. (This would have been specified by get as the "new delta"). The use of this keyletter is necessary only if two or more outstanding gets for editing on the same sees file were done by the same person (login name). A diagnostic results if the specified SID is ambiguous, or if it is necessary and omitted on the command line. -s Suppresses the printout, on the standard output, of the intended delta's SID. -0 Causes the retention of the gotten file which would normally be removed from the current directory. SEE ALSO delta(1), get(1), sact(1). DIAGNOSTICS Use help (1) for explanations. - 1- UNIQO) UNIQ(t) NAME uniq - report repeated lines in a file SYNOPSIS uniq [ -ude [ +n ] [ -n ] ] [ input [ output ] ] DESCRIPTION Uniq reads the input file comparing adjacent lines. In the normal case, the second and succeeding copies of repeated lines are removed; the remainder is written on the output file. Input and output should always be different. Note that repeated lines must be adjacent in order to be found; see sort (I). If the -u flag is used, just the lines that are not repeated in the original file are output. The -d option specifies that one copy of just the repeated lines is to be written. The normal mode output is the union of the -u and -d mode outputs. The -c option supersedes -u and -d and generates an output report in default style but with each line preceded by a count of the number of times it occurred. The n arguments specify skipping an initial portion of each line in the comparison: - n +n The first n fields together with any blanks before each are ignored. A field is defined as a string of non-space, non-tab characters separated by tabs and spaces from its neighbors. The first n characters are ignored. Fields are skipped before characters. SEE ALSO comm(I), sort(I). - 1- UNITS(1) UNITS (1) NAME units - conversion program SYNOPSIS units DESCRIPTION Units converts quantities expressed in various standard scales to their equivalents in other scales. It works interactively in this fashion: You have: inch You want: em • 2.540000e+OO /3.937008e-Ol A quantity is specified as a multiplicative combination of units optionally preceded by a numeric multiplier. Powers are indicated by suffixed positive integers, division by the usual sign: You have: 15 Ibs force/in2 You want: atm • 1.02068ge+OO / 9.79729ge-Ol Units only does multiplicative scale changes; thus it can convert Kelvin to Rankine, but not Celsius to Fahrenheit. Most familiar units, abbreviations, and metric prefixes are recognized, together with a generous leavening of exotica and a few constants of nature including: pi ratio of circumference to diameter, c speed of light, e charge on an electron, g acceleration of gravity, force same as g, mole Avogadro's number, water pressure head per unit height of water, au astronomical unit. Pound is not recognized as a unit of mass; Ib is. Compound names are run together, (e.g. lightyear) . British units that differ from their u.s. counterparts are prefixed thus: brgaUon. For a complete list of units, type: cat lusr/lib/unittab FILES lusrllib/unittab - 1- UUCP(tC) UUCP(tC) NAME uucp, uulog, uuname - unix to unix copy SYNOPSIS uucp [ options ] source-files destination-file uulog [ options ] uuname [ -I ] DESCRIPTION Uucp. Uucp copies files named by the source-file arguments to the destination-file argument. A file name may be a path name on your machine, or may have the form: system-name!path-name where system-name is taken from a list of system names which uucp knows about. The system-name may also be a list of names such as system-name!system-name! ... !system-name!path-name in which case an attempt is made to send the file via the specified route, and only to a destination in PUBDIR (see below). Care should be taken to insure that intermediate nodes in the route are willing to foward information. The shell metacharacters ?, • and l. . .1 appearing in path-name will be expanded on the appropriate system. Path names may be one of: (1) a full path name; (2) a path name preceded by -user where user is a login name on the specified system and is replaced by that user's login directory; (3) a path name preceded by - /user where user is a login name on the specified system and is replaced by that user's directory under PUBDIR; (4) anything else is prefixed by the current directory. If the result is an erroneous path name for the remote system the copy will fail. If the destination-file is a directory, the last part of the source-file name is used. Uucp preserves execute permissions across the transmission and gives 0666 read and write permissions (see chmod (2) ) . The following options are interpreted by uucp: -d Make all necessary directories for the file copy (default). -f Do not make intermediate directories for the file copy. -c Use the source file when copying out rather than copying the file to the spool directory (default). -C Copy the source file to the spool directory. -mfile Report status of the transfer in file. If file is omitted, send mail to the requester when the copy is completed. -nuser Notify user on the remote system that a file was sent. -esys Send the uucp command to system sys to be executed there. (Note: this will only be successful if the remote machine allows the uucp command to be executed by /usr /Iib/uucp/uuxqtJ - 1- I I UUCP(lC) UUCP(lC) Uucp returns on the standard output a string which is the job number of the request. This job number can be used by uustat to obtain status or terminate the job. Uulog. Uulog queries a summary log of uucp and uux (I C) transactions in the file lusr Ispool/uucp/LOGFILE. The options cause uulog to print logging information: -ssys Print information about work involving system sys. -uuser Print information about work done for the specified user. Uuname. Uuname lists the uucp names of known systems. The -I option returns the local system name. FILES /usr/spool/uucp spool directory / usr I spool! uucppu blic public directory for receiving and sending (PUBDIR) other data and program files /usr/lib/uucp/· SEE ALSO mail( 1), uux (I C). WARNING The domain of remotely accessible files can (and for obvious security reasons, usually should) be severely restricted. You will very likely not be able to fetch files by path name; ask a responsible person on the remote system to send them to you. For the same reasons you will probably not be able to send files to arbitrary path names. As distributed, the remotely accessible files are those whose names begin lusrlspool/uucppublic (equivalent to -nuucp or just -). BUGS All files received by uucp will be owned by uucp. The -m option will only work sending files or receiving a single file. Receiving multiple files specified by special shell characters? • l. .. J will not activate the -m option. - 2- UUSTAT(lC) UUSTAT(1C) NAME uustat - uucp status inquiry and job control SYNOPSIS uustat [ options ] DESCRIPTION Uustat will display the status of, or cancel, previously specified uucp commands, or provide general status on uucp connections to other systems. The following options are recognized: -iiohn -kjohn -rjohn -chour -uuser -ssys -ohour -yhour -mmch -Mmch -0 -q Report the status of the uucp request john. If all is used for john, the status of all uucp requests is reported. If john is omitted, the status of the current user's uucp requests is reported. Kill the uucp request whose job number is john. The killed uucp request must belong to the person issuing the uustat command unless one is the super-user. Rejuvenate john. That is john is touched so that its modification time is set to the current time. This prevents uuclean from deleting the job until the jobs modification time reaches the limit imposed by uuclean. Remove the status entries which are older than hour hours. This administrative option can only be initiated by the user uucp or the super-user. Report the status of all uucp requests issued by user. Report the status of all uucp requests which communicate with remote system sys. Report the status of all uucp requests which are older than hour hours. Report the status of all uucp requests which are younger than hour hours. Report the status of accessibility of machine mch. If mch is specified as all, then the status of all machines known to the local uucp are provided. This is the same as the -m option except that two times are printed. The time that the last status was obtained and the time that the last successful transfer to that system occurred. Report the uucp status using the octal status codes listed below. If this option is not specified, the verbose description is printed with each uucp request. List the number of jobs and other control files queued for each machine and the time of the oldest and youngest file queued for each machine. If a lock file exists for that system, its date of creation is listed. When no options are given, uustat outputs the status of all uucp requests issued by the current user. Note that only one of the options -j, -m, -k, -c, -r, can be used with the rest of the other options. For example, the command: uustat -uhdc -smhtsa -y72 will print the status of all uucp requests that were issued by user hdc to communicate with system mhtsa within the last 72 hours. The meanings of the job request status are: job-number user remote-system command-time status-time status where the status may be either an octal number or a verbose description. The octal code corresponds to the following description: - 1- UUSTAT(lC) UUSTAT UUTO(lC> NAME uuto, uupick - public UNIX System-to-UNIX System file copy SYNOPSIS uuto [ options ] source-files destination uupick [ -s system ] DESCRIPTION Uuto sends source-files to destination. Uuto uses the uucp(1C) facility to send files, while it allows the local system to control the file access. A sourcefile name is a path name on your machine. Destination has the form: system!user where system is taken from a list of system names that uucp knows about (see uuname). Logname is the login name of someone on the specified system. Two options are available: Copy the source file into the spool directory before transmission. Send mail to the sender when the copy is complete. -p -m The files (or sub-trees if directories are specified) are sent to PUBDIR on system, where PUBDIR is a public directory defined in the uucp source. Specifically the files are sent to PUBD IR/ receive/ user! mysystem/files. The destined recipient is notified by mail (1) of the arrival of files. Uupick accepts or rejects the files transmitted to the user. Specifically, uupick searches PUBDIR for files destined for the user. For each entry (file or directory) found, the following message is printed on the standard output: from system: [file file-name] [dir dirname] ? Uupick then reads a line from the standard input to determine the disposition of the file: Go on to next entry. d m [ dir ] Delete the entry. Move the entry to named directory dir (current directory is default). a [ dir ] Same as m except moving all the files sent from system. p Print the content of the file. q Stop. Same as q. EOT (control-d) !command Escape to the shell to do command. * Print a command summary. Uupick invoked with the -ssystem option will only search the PUBDIR for files sent from system. FILES PUBDIR/usr/spool/uucppublic public directory SEE ALSO mail(1), uuc1ean(1M), uucp(1C), uustat(1C), uux(1C). - 1- uux(1C) uux(1C) NAME uux - unix to unix command execution SYNOPSIS uux [ options ] command-string DESCRIPTION Uux will gather zero or more files from various systems, execute a command on a specified system and then send standard output to a file on a specified system. Note that, for security reasons, many installations will limit the list of commands executable on behalf of an incoming request from uux. Many sites will permit little more than the receipt of mail (see mai/(l) via uux. The command-string is made up of one or more arguments that look like a Shell command line, except that the command and file names may be prefixed by system-name!. A null system-name is interpreted as the local system. File names may be one of (1) a full path name; (2) a path name preceded by -xxx where xxx is a login name on the specified system and is replaced by that user's login directory; (3) anything else is prefixed by the current directory. As an example, the command uux "!diff usg!/usr/dan/fl pwba!/a4/dan/fl > !fl.diff" will get the f1 files from the "usg" and "pwba" machines, execute a diff command and put the results in fl.diff in the local directory. Any special shell characters such as < >; I should be quoted either by quoting the entire command-string, or quoting the special characters as individual arguments. Uux will attempt to get all files to the execution system. For files which are output files, the file name must be escaped using parentheses. For example, the command uux a!uucp b!/usr/file \(c!/usr/file\) will send a uucp command to system "a" to get /usr/file from system "b" and send it to system "c". Uux will notify you if the requested command on the remote system was disallowed. The response comes by remote mail from the remote machine. The following options are interpreted by uux: The standard input to uux is made the standard input to the command -string. -0 Send no notification to user. -mfile Report status of the transfer in file. If file is omitted, send mail to the requester when the copy is completed. Uux returns an ASCII string on the standard output which is the job number. This job number can be used by uustat to obtain the status or terminate a job. FILES /usr /lib/uucp/ spool /usr/lib/uucp/* spool directory other data and programs SEE ALSO uuclean(1M), uucp(1C). - 1- uux(Ic) UUX(IC) BUGS Only the first command of a shell pipeline may have a system-name!. All other commands are executed on the system of the first command. The use of the shell metacharacter • will probably not do what you want it to do. The shell tokens < < and > > are not implemented. -2- VAL(I) VAL (I ) NAME val - validate sees file SYNOPSIS val val [-s] [-rSID] [-mnamel [-ytype] files DESCRIPTION Val determines if the specified file is an sees file meeting the characteristics specified by the optional argument list. Arguments to val may appear in any order. The arguments consist of keyletter arguments, which begin with a -, and named files. Val has a special argument, -, which causes reading of the standard input until an end-of-file condition is detected. Each line read is independently processed as if it were a command line argument list. Val generates diagnostic messages on the standard output for each command line and file processed and also returns a single 8-bit code upon exit as described below. The keyletter arguments are defined as follows. The effects of any keyletter argument apply independently to each named file on the command line. -s The presence of this argument silences the diagnostic message normally generated on the standard output for any error that is detected while processing each named file on a given command line. -rSID The argument value SID (Sees IDentification String) is an sees delta number. A check is made to determine if the SID is ambiguous (e. g., rl is ambiguous because it physically does not exist but implies 1.1, 1.2, etc. which may exist) or invalid (e. g., rI.O or r1.1.0 are invalid because neither case can exist as a valid delta number). If the SID is valid and not ambiguous, a check is made to determine if it actually exists. -mname The argument value name is compared with the %M% keyword in file. sees -ytype The argument value type is compared with the %Y% keyword in file. sees The 8-bit code returned by val is a disjunction of the possible errors, i. e., can be interpreted as a bit string where (moving from left to right) set bits are interpreted as follows: bit bit bit bit bit bit bit bit 0= 1= 2= 3= 4567= missing file argument; unknown or duplicate key letter argument; corrupted sees file; can't open file or file not sees; SID is invalid or ambiguous; SID does not exist; %Y%, -y mismatch; %M%, -m mismatch; Note that val can process two or more files on a given command line and in turn can process multiple command lines (when reading the standard input). In these cases an aggregate code is returned - a logical OR of the codes generated for each command line and file processed. SEE ALSO admin(I), delta(I), get(I), prs(I). - 1- VAL (I) VAL(I) DIAGNOSTICS Use helpO) for explanations. BUGS Val can process up to 50 files on a single command line. Any number above 50 will produce a core dump. -2- VC(l) VC(l) NAME vc - version control SYNOPSIS vc [-a] [-t] [-cchar] [-s] [keyword==value ... keyword==value] DESCRIPTION The vc command copies lines from the standard input to the standard output under control of its arguments and control statements encountered in the standard input. In the process of performing the copy operation, user declared keywords may be replaced by their string value when they appear in plain text and/or control statements. The copying of lines from the standard input to the standard output is conditional, based on tests On control statements) of keyword values specified in control statements or as vc command arguments. A control statement is a single line beginning with a control character, except as modified by the -t keyletter (see below). The default control character is colon (:), except as modified by the -c keyletter (see below). Input lines beginning with a backslash (\) followed by a control character are not control lines and are copied to the standard output with the backslash removed. Lines beginning with a backslash followed by a non-control character are copied in their entirety. A keyword is composed of 9 or less alphanumerics; the first must be alphabetic. A value is any ASCII string that can be created with ed(I); a numeric value is an unsigned string of digits. Keyword values may not contain blanks or tabs. Replacement of keywords by values is done whenever a keyword surrounded by control characters is encountered on a version control statement. The -a key letter (see below) forces replacement of keywords in all lines of text. An un interpreted control character may be included in a value by preceding it with \. If a literal \ is desired, then it too must be preceded by \. Keyletter arguments -a Forces replacement of keywords surrounded by control characters with their assigned value in all text lines and not just in vc statements. -t All characters from the beginning of a line up to and including the first tab character are ignored for the purpose of detecting a control statement. If one is found, all characters up to and including the tab are discarded. -cchar Specifies a control character to be used in place of :. -s Silences warning messages (not error) that are normally printed on the diagnostic output. Version Control Statements :dcl keyword [ , •.• , keyword] Used to declare keywords. All keywords must be declared. :asg keyword-value Used to assign values to keywords. An asg statement overrides the assignment for the corresponding keyword on the vc command line and all previous asg's for that keyword. Keywords declared, but not assigned values have null values. :if condition :end - 1- VC(l) VCO) Used to skip lines of the standard input. If the condition is true all lines between the if statement and the matching end statement are copied to the standard output. If the condition is false, all intervening lines are discarded, including control statements. Note that intervening if statements and matching end statements are recognized solely for the purpose of maintaining the proper if-end matching. The syntax of a condition is: ::::::::::== ::== [ "not" ] I "I" I "&" "(" ")" I "-" I "!-" I "<" I">" I The available operators and their meanings are: !& I > < () not equal not equal and or grea ter than less than used for logical groupings may only occur immediately after the if, and when present, inverts the value of the entire condition The> and < operate only on unsigned integer values (e. g.: 012 > 12 is false). All other operators take strings as arguments (e. g.: 012 !== 12 is true). The precedence of the operators (from highest to lowest) is: == !== > < all of equal precedence & I Parentheses may be used to alter the order of precedence. Values must be separated from operators or parentheses by at least one blank or tab. ::text Used for keyword replacement on lines that are copied to the standard output. The two leading control characters are removed, and keywords surrounded by control characters in text are replaced by their value before the line is copied to the output file. This action is independent of the -a keyletter. :on :off Turn on or off keyword replacement on all lines. :ctl char Change the control character to char. :msg message Prints the given message on the diagnostic output. :err message Prints the given message followed by: ERROR: err statement on line ... (915) on the diagnostic output. Vc halts execution, and returns an exit code of 1. -2- YCO) YC(l) DIAGNOSTICS Use he/p(I) for explanations. EXIT CODES 0- normal 1 - any error -3- VPR(1) (DEC only) VPR(1) NAME vpr - Versatec printer spooler SYNOPSIS vpr [ options ] [ files ] DESCRIPTION Vpr causes the named files to be queued for printing on a Versatec printer. If no names appear, the standard input is assumed; thus vpr may be used as a filter. The following options may be given (each as a separate argument and in any order) before any file name arguments: Make a copy of the file to be sent before returning to the user. Remove the file after sending it. When printing is complete, report that fact by rnai/(l). -0 Do not report the completion of printing by rnail(l). This is the default option. -ffile Use file as a dummy file name to report back in the mail. (This is useful for distinguishing multiple runs, especially when vpr is being used as a filter). -p [ -e raster] Use the plot filter vplot to output files produced by graph (lG). The -e option will cause a previously scan converted file raster to be sent to the Versate:c. - c -r -m EXAMPLES Two common uses are: pr [ options ] file I vpr and graph [ options] file I vpr -p FILES / etc/ passwd /usr/spool/vpd/* /usrllib/vpd /usrllib/vpd.pr /usr/lib/vplot user's identification and accounting data spool area line printer daemon print filter plot filter SEE ALSO dpr(lC), lpr(l), tplot(lG). - 1- WAIT(l) WAIT(I) NAME wait - await completion of process SYNOPSIS wait DESCRIPTION Wait until all processes started with & have completed, and report on abnormal terminations. Because the wait (2) system call must be executed in the parent process, the shell itself executes wait, without creating a new process. SEE ALSO sh(I) . BUGS Not all the processes of a 3- or more-stage pipeline are children of the shell, and thus can't be waited for. - 1- WC(O WC(O NAME wc - word count SYNOPSIS we [ -Iwe ] [ names DESCRIPTION We counts lines, words and characters in the named files, or in the standard input if no names appear. It also keeps a total count for all named files. A word is a maximal string of characters delimited by spaces, tabs, or new-lines. The options I, w, and e may be used in any combination to specify that a subset of lines, words, and characters are to be reported. The default is -Iwe. When names are specified on the command line, they will be printed along with the counts. - 1- WHAT(t) WHAT(l) NAME what - identify sees files SYNOPSIS what files DESCRIPTION What searches the given files for all occurrences of the pattern that get (1) substitutes for %Z% (this is @(#) at this printing) and prints out what follows until the first ", >, new-line, \, or null character. For example, if the C program in file f.c contains char ident[] - "@(#)identification information"; and f.c is compiled to yield f.o and a.out, then the command what f.c f.o a.out will print f.c: identification information f.o: identification information a.out: identification information What is intended to be used in conjunction with the command get(1), which automatically inserts identifying information, but it can also be used where the information is inserted manually. SEE ALSO get(1), help(l). DIAGNOSTICS Use help (1) for explanations. BUGS It's possible that an unintended occurrence of the pattern @(#) could be found just by chance, but this causes no harm in nearly all cases. - 1- WHO(t) WHO(I) NAME who - who is on the system SYNOPSIS who [ - uTlpdbrtas] [ file ] who am i DESCRIPTION Who can list the user's name, terminal line, login time, elapsed time since activity occurred on the line, and the process-ID of the command interpreter (shell) for each current UNIX System user. It examines the letc/utmp file to obtain its information. If file is given, that file is examined. Usually, file will be letc/wtmp, which contains a history of all the logins since the file was last created. Who with the am i option identifies the invoking user. Except for the default -s option, the general format for output entries is: name [state] line time activity pid [commend [exid With options, who can list logins, logoffs, reboots, and changes to the system clock, as well as other processes spawned by the init process. These options are: -u This option lists information about those users who are currently logged in. The name is the user's login name. The line is the name of the line as found in the directory Idev. The time is the time that the user logged in. The activity is the number of hours and minutes since activity last occurred on that particular line. A dot (.) indicates that the terminal has seen activity in the last minute and is therefore "current". If more than twenty-four hours have elapsed or the line has not been used since boot time, the entry is marked old. This field is useful when trying to determine whether a person is working at the terminal or not. The pid is the process-ID of the user's shell. The comment is the comment field associated with this line as found in letc/inittab (see inittab (4». This can contain information about where the terminal is located, the telephone number of the dataset, type of terminal if hard-wired, etc. -T This option causes the state of the terminal line to be printed. The state describes whether someone elae can write to that terminal. A + appears if the terminal is writable by anyone; a - appears if it is not. Root can write to all lines having a + or a - in the state field. If a bad line is encountered, a ? is printed. -I This option lists only those lines on which the system is waiting for someone to login. The name field is LOGIN in such cases. Other fields are the same as for user entries except that the state field doesn't exist. -p This option lists any other process which is currently active and has been previously spawned by init. The name field is the name of the program executed by init as found in letc/inittab. The state, line, and activity fields have no meaning. The comment field shows the id field of the line from letc/inittab that spawned this process. See inittab(4). -d This option displays all processes that have expired and not been respawned by in it . The exit field appears for dead processes and contains the termination and exit values (as returned by wait (2», of the dead process. This can be useful in determining why a process terminated. -b This option indicates the time and date of the last reboot. -r This option indicates the current run-level of the init process. Following the run-level and date information are three fields which indicate the - 1- WHO(1) WHO(l) current state, the number of times that state was previously entered, and the previous state. -t This option indicates the last change to the system clock (via the date (I) command) by root. See su (I) . -a This option processes /etc/utmp or the named file with all options turned on. -s This option is the default and lists only the name, line and time fields. FILES letc/utmp letc/wtmp letc/inittab SEE ALSO init(IM) in the UNIX System Administrator's Manual. date(I), 10gin(I), mesg(l), su(I), wait(2), inittab(4), utmp(4). - 2- WRITE(I) WRITE(I) NAME write - write to another user SYNOPSIS write user [ line 1 DESCRIPTION Write copies lines from your terminal to that of another user. called, it sends the message: When first Message from yourname (tty??) [ date 1••• to the person you want to talk to. When it has successfully completed the connection it also sends two bells to your own terminal to indicate that what you are typing is being sent. The recipient of the message should write back at this point. Communication continues until an end of file is read from the terminal or an interrupt is sent. At that point write writes EOT on the other terminal and exits. If you want to write to a user who is logged in more than once, the line argument may be used to indicate which line or terminal to send to (e.g., ttyOO); otherwise, the first instance of the user found in /etc/utmp is assumed and the following message posted: user is logged on more than one place. You are connected to "terminal". Other locations are: terminal Permission to write may be denied or granted by use of the mesg(J) command. Writing to others is normally allowed by default. Certain commands, in particular nroff(I) and pr(l) disallow messages in order to prevent interference with their output. However, if the user has super-user permissions, messages can be forced onto a write inhibited terminal. If the character! is found at the beginning of a line, write calls the shell to execute the rest of the line as a command. The following protocol is suggested for using write: when you first write to another user, wait for them to write back before starting to send. Each person should end a message with a distinctive signal (i.e., (0) for "over") so that the other person knows when to reply. The signal (00) (for "over and out") is suggested when conversation is to be terminated. FILES letc/utmp to find user Ibin/sh to execute! SEE ALSO mail(l), mesg(I) , nroff(I), pr(l), sh(l), who(l). DIAGNOSTICS "user not logged in" if the person you are trying to write to is not logged in. - 1- XARGS(l) XARGS(I) NAME xargs - construct argument list(s) and execute command SYNOPSIS xargs [flags] [ command [initial-arguments] ] DESCRIPTION Xargs combines the fixed initial-arguments with arguments read from standard input to execute the specified command one or more times. The number of arguments read for each command invocation and the manner in which they are combined are determined by the flags specified. Command, which may be a shell file, is searched for, using one's $PATH. If command is omitted, ibiD/echo is used. Arguments read in from standard input are defined to be contiguous strings of characters delimited by one or more blanks, tabs, or new-lines; empty lines are always discarded. Blanks and tabs may be embedded as part of an argument if escaped or quoted: Characters enclosed in quotes (single or double) are taken literally, and the delimiting quotes are removed. Outside of quoted strings a backslash (\) will escape the next character. Each argument list is constructed starting with the initial-arguments, followed by some number of arguments read from standard input (Exception: see -i flag). Flags -i, -I, and -D determine how arguments are selected for each command invocation. When none of these flags are coded, the initialarguments are followed by arguments read continuously from standard input until an internal buffer is full, and then command is executed with the accumulated args. This process is repeated until there are no more args. When there are flag conflicts (e.g., -I vs. -D), the last flag has precedence. Flag values are: -Inumber Command is executed for each non-empty number lines of arguments from standard input. The last invocation of command will be with fewer lines of arguments if fewer than number remain. A line is considered to end with the first new-line unless the last character of the line is a blank or a tab; a trailing blank/tab signals continuation through the next non-empty line. If number is omitted I is assumed. Option -x is forced. -ireplstr Insert mode: command is executed for each line from standard input, taking the entire line as a single arg, inserting it in initial-arguments for each occurrence of replstr. A maximum of 5 arguments in initialarguments may each contain one or more instances of replstr. Blanks and tabs at the beginning of each line are thrown away. Constructed arguments may not grow larger than 255 characters, and option -x is also forced. {} is assumed for replstr if not specified. -Dnumber Execute command using as many standard input arguments as possible, up to number arguments maximum. Fewer arguments will be used if their total size is greater than size characters, and for the last invocation if there are fewer than number arguments remaining. If option -x is also coded, each number arguments must fit in the size limitation, else xargs terminates execution. -t Trace mode: The command and each constructed argument list are echoed to file descriptor 2 just prior to - 1- XARGS(l) XARGS(l) their execution. -p Prompt mode: The user is asked whether to execute command each invocation. Trace mode (-t) is turned on to print the command instance to be executed, followed by a ? .. prompt. A reply of y (optionally followed by anything) will execute the command; anything else, including just a carriage return, skips that particular invocation of command. -x Causes xargs to terminate if any argument list would be greater than size characters; -x is forced by the options -i and -I. When neither of the options -i, -I, or - 0 are coded, the total length of all arguments must be within the size limit. -ssize The maximum total size of each argument list is set to size characters; size must be a positive integer less than or equal to 470. If -s is not coded, 470 is taken as the default. Note that the character count for size includes one extra character for each argument and the count of characters in the command name. -eeo/str Eo/str is taken as the logical end-of-file string. Underbar (_) is assumed for the logical EOF string if -e is not coded. -e with no eo/str coded turns off the logical EOF string capability (underbar is taken literally). Xargs reads standard input until either end-of-file or the logical EOF string is encountered. Xargs will terminate if either it receives a return code of -1 from, or if it cannot execute, command. When command is a shell program, it should explicitly exit {see sh (1» with an appropriate value to avoid accidentally returning with -1. EXAMPLES The following will move all files from directory $1 to directory $2, and echo each move command just before doing it: Is $1 I xargs -i -t mv $1I{} $2/{} The following will combine the output of the parenthesized commands onto one line, which is then echoed to the end of file log: Oogname; date; echo $0 $.) I xargs > > log The user is asked which files in the current directory are to be archived and archives them into arch (1.) one at a time, or (2.) many at a time. 1. Is 2. Is I xargs -p -1 ar r arch xargs -p -1 I xargs ar r arch The following will execute diff(1) with successive pairs of arguments originally typed as shell arguments: echo $. I xargs -n2 diff DIAGNOSTICS Self explanatory. - 2- YACC(I) YACC(I) NAME yacc - yet another compiler-compiler SYNOPSIS yacc [ - vdlt ] grammar DESCRIPTION Yacc converts a context-free grammar into a set of tables for a simple automaton which executes an LR(I) parsing algorithm. The grammar may be ambiguous; specified precedence rules are used to break ambiguities. The output file, y.tab.c, must be compiled by the C compiler to produce a program yyparse. This program must be loaded with the lexical analyzer program, yylex, as well as main and yyerror, an error handling routine. These routines must be supplied by the user; lex(I) is useful for creating lexical analyzers usable by yacc. If the -v flag is given, the file y.output is prepared, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar. If the -d flag is used, the file y.tab.h is generated with the #define statements that associate the yacc-assigned "token codes" with the user-declared "token names". This allows source files other than y.tab.c to access the token codes. If the -I flag is given, the code produced in y.tab.c will not contain any #line constructs. This should only be used after the grammar and the associated actions are fully debugged. Runtime debugging code is always generated in y.tab.c under conditional compilation control. By default, this code is not included when y.tab.c is compiled. However, when yacc's -t option is used, this debugging code will be compiled by default. Independent of whether the -t option was used, the runtime debugging code is under the control of YYDEBUG, a pre-processor symbol. If YYDEBUG has a non-zero value, then the debugging code is included. If its value is zero, then the code will not be included. The size and execution time of a program produced without the runtime debugging code will be smaller and slightly faster. FILES y.output y.tab.c y.tab.h defines for token names yacc.tmp, yacc.debug, yacc.acts temporary files /usr/lib/yaccparparser prototype for C programs SEE ALSO lex(I) . YACC- Yet Another Compiler Compiler in the UNIX System Support Tools Guide. DIAGNOSTICS The number of reduce-reduce and shift-reduce conflicts is reported on the standard error output; a more detailed report is found in the y.output file. Similarly, if some rules are not reachable from the start symbol, this is also reported. BUGS Because file names are fixed, at most one yacc process can be active in a given directory at a time. - 1- INTRO(2) INTRO(2) NAME intro - introduction to system calls and error numbers SYNOPSIS #include < errno.h > DESCRIPTION This section describes all of the system calls. Most of these calls have one or more error returns. An error condition is indicated by an otherwise impossible returned value. This is almost always -1; the individual descriptions specify the details. An error number is also made available in the external variable ermo. Ermo is not cleared on successful calls, so it should be tested only after an error has been indicated. All of the possible error numbers are not listed in each system call description because many errors are possible for most of the calls. The following is a complete list of the error numbers and their names as defined in < errno.h > . EPERM Not owner Typically this error indicates an attempt to modify a file in some way forbidden except to its owner or super-user. It is also returned for attempts by ordinary users to do things allowed only to the super-user. 2 ENOENT No such file or directory This error occurs when a file name is specified and the file should exist but doesn't, or when one of the directories in a path name does not exist. 3 ESRCH No such process No process can be found corresponding to that specified by pid in kill or ptrace. 4 EINTR Interrupted system call An asynchronous signal (such as interrupt or quit), which the user has elected to catch, occurred during a system call. If execution is resumed after processing the signal, it will appear as if the interrupted system call returned this error condition. 5 EIO I/O error Some physical I/O error. This error may in some cases occur on a call following the one to which it actually applies. 6 ENXIO No such device or address I/O on a special file refers to a subdevice which does not exist, or beyond the limits of the device. It may also occur when, for example, a tape drive is not on-line or no disk pack is loaded on a drive. 7 E2BIG Arg list too long An argument list longer than 5,120 bytes is presented to a member of the exec family. 8 ENOEXEC Exec format error A request is made to execute a file which, although it has the appropriate permissions, does not start with a valid magic number (see a.out(4». 9 EBADF Bad file number Either a file descriptor refers to no open file, or a read (respectively write) request is made to a file which is open only for writing (respectively reading). 10 ECHILD No child processes A wait, was executed by a process that had no existing or unwaited-for child processes. - 1- INTRO(2) INTRO(2) 11 EAGAIN No more processes A fork, failed because the system's process table is full or the user is not allowed to create any more processes. 12 ENOMEM Not enough space During an exec, brk, or sbrk, a program asks for more space than the system is able to supply. This is not a temporary condition; the maximum space size is a system parameter. The error may also occur if the arrangement of text, data, and stack segments requires too many segmentation registers, or if there is not enough swap space during a fork. 13 EACCES Permission denied An attempt was made to access a file in a way forbidden by the protection system. 14 EFAULT Bad address The system encountered a hardware fault in attempting to use an argument of a system call. 15 ENOTBLK Block device required A non-block file was mentioned where a block device was required, e.g., in mount. 16 EBUSY Mount device busy An attempt to mount a device that was already mounted or an attempt was made to dismount a device on which there is an active file (open file, current directory, mounted-on file, active text segment). It will also occur if an attempt is made to enable accounting when it is already enabled. 17 EEXIST File exists An existing file was mentioned in an inappropriate context, e.g., link. 18 EXDEV Cross-device link A link to a file on another device was attempted. 19 ENODEV No such device An attempt was made to apply an inappropriate system call to a device; e.g., read a write-only device. 20 ENOTDIR Not a directory A non-directory was specified where a directory is required, for example in a path prefix or as an argument to chdir(2). 21 EISDIR Is a directory An attempt to write on a directory. 22 EINV AL Invalid argument Some invalid argument (e.g., dismounting a non-mounted device; mentioning an undefined signal in signal, or kill; reading or writing a file for which lseek has generated a negative pointer). Also set by the math functions described in the (3M) entries of this manual. 23 ENFILE File table overflow The system's table of open files is full, and temporarily no more opens can be accepted. 24 EMFILE Too many open files No process may have more than 20 file descriptors open at a time. 25 ENOTTY Not a typewriter 26 ETXTBSY Text file busy An attempt to execute a pure-procedure program which is currently open for writing (or reading). Also an attempt to open for writing a - 2- INTRO(2) INTRO (2) pure-procedure program that is being executed. 27 EFBIG File too large The size of a file exceeded the maximum file size (1,082,201,088 bytes) or ULIMIT; see ulimit(2). 28 ENOSPC No space left on device During a write to an ordinary file, there is no free space left on the device. 29 ESPIPE Illegal seek An lseek was issued to a pipe. 30 EROFS Read-only file system An attempt to modify a file or directory was made on a device mounted read-only. 31 EMLINK Too many links An attempt to make more than the maximum number of links (1000) to a file. 32 EPIPE Broken pipe A write on a pipe for which there is no process to read the data. This condition normally generates a signal; the error is returned if the signal is ignored. 33 EDOM Math argument The argument of a function in the math package OM) is out of the domain of the function. 34 ERANGE Result too large / The value of a function in the math package (3M) is not representable within machine precision. 35 ENOMSG No message of desired type An attempt was made to receive a message of a type that does not exist on the specified message queue; see msgop (2). 36 EIDRM Identifier Removed This error is returned to processes that resume execution due to the removal of an identifier from the file system's name space (see msgctl(2), semctl(2), and shmctl(2». DEFINITIONS Process ID Each active process in the system is uniquely identified by a positive integer called a process 10. The range of this ID is from 0 to 30,000. Parent Process ID A new process is created by a currently active process; see fork (2). The parent process ID of a process is the process ID of its creator. Process Group ID Each active process is a member of a process group that is identified by a positive integer called the process group ID. This ID is the process 10 of the group leader. This grouping permits the signaling of related processes; see kill (2). Tty Group ID Each active process can be a member of a terminal group that is identified by a positive integer called the tty group ID. This grouping is used to terminate a group of related process upon termination of one of the processes in the group; see exit (2) and signal (2) . Real User ID and Real Group ID Each user allowed on the system is identified by a positive integer called a real user ID. - 3- \ INTRO(2) INTRO(2) Each user is also a member of a group. The group is identified by a positive integer called the real group 10. An active process has a real user 10 and real group 10 that are set to the real user ID and real group 10, respectively, of the user responsible for the creation of the process. Effective User ID and Effective Group ID An active process has an effective user 10 and an effective group ID that are used to determine file access permissions (see below). The effective user ID and effective group 10 are equal to the process's real user 10 and real group 10 respectively, unless the process or one of its ancestors evolved from a file that had the set-user-ID bit or set-group 10 bit set; see exec(2). Super-user A process is recognized as a super-user process and is granted special privileges if its effective user 10 is O. Special Processes The processes with a process ID of 0 and a process 10 of 1 are special processes and are referred to as procO and procl. ProcO is the scheduler. Procl is the initialization process (in it) . Procl is the ancestor of every other process in the system and is used to control the process structure. File Name. Names consisting of 1 to 14 characters may be used to name an ordinary file, special file or directory. These characters may be selected from the set of all character values excluding \0 (null) and the ASCII code for / (slash). Note that it is generally unwise to use *, ?, I, or ) as part of file names because of the special meaning attached to these characters by the shell. See sh (1). Although permitted, it is advisable to avoid the use of unprintable characters in file names. Path Name and Path Prefix A path name is a null-terminated character string starting with an optional slash (/), followed by zero or more directory names separated by slashes, optionally followed by a file name. More precisely, a path name is a null-terminated character string constructed as follows: ::= I l/ ::= 1/ < rtprefix> ::= / I < rtprefix > / where is a string of 1 to 14 characters other than the ASCII slash and null, and is a string of 1 to 14 characters (other than the ASC II slash and null) that names a directory. If a path name begins with a slash, the path search begins at the root directory. Otherwise, the search begins from the current working directory. A slash by itself names the root directory. Unless specifically stated otherwise, the null path name is treated as if it named a non-existent file. Directory. Directory entries are called links. By convention, a directory contains at least two links, . and .. , referred to as dot and dot-dot respectively. Dot refers to the directory itself and dot-dot refers to its parent directory. - 4 - INTRO (2) INTRO(2) Root Directory and Current Working Directory. Each process has associated with it a concept of a root directory and a current working directory for the purpose of resolving path name searches. A process's root directory need not be the root directory of the root file system. File Access Permissions. Read, write, and execute/search permissions on a file are granted to a process if one or more of the following are true: The process's effective user ID is super-user. The process's effective user 10 matches the user ID of the owner of the file and the appropriate access bit of the "owner" portion (0700) of the file mode is set. The process's effective user 10 does not match the user ID of the owner of the file, and the process's effective group ID matches the group of the file and the appropriate access bit of the "group" portion (070) of the file mode is set. The process's effective user 10 does not match the user ID of the owner of the file, and the process's effective group 1D does not match the group ID of the file, and the appropriate access bit of the "other" portion (07) of the file mode is set. Otherwise, the corresponding permissions are denied. Message Queue Identifier A message queue identifier (msqid) is a unique positive integer created by a msgget (2) system call. Each msqid has a message queue and a data structure associated with it. The data structure is referred to as msqid_ds and contains the following members: struct ushort ushort ushort ushort time t time t time t ipcyerm msgyerm; msg_qnum; msg_q bytes; msgJspid; msgJrpid; msg_stime; msgJtime; msg_ctime; /* /* /* /* /* /* /* /* /* /* operation permission struct */ number of msgs on q */ max number of bytes on q */ pid of last msgsnd operation */ pid of last msgrcv operation */ last msgsnd time */ last msgrcv time */ last change time */ Times measured in secs since */ 00:00:00 GMT, Jan. 1, 1970 */ Msgyerm is a ipcyerm structure that specifies the message operation permission (see below). This structure includes the following members: ushort ushort ushort ushort ushort cuid; cgid; uid; gid; mode; /* /* /* /* /* creator user id */ creator group id */ user id */ group id */ r/w permission */ Msg_qnum is the number of messages currently on the queue. Msg_qbytes is the maximum number of bytes allowed on the queue. MsgJspid is the process id of the last process that performed a msgsnd operation. MsgJrpid is the process id of the last process that performed a msgrcv operation. Msg_stime is the time of the last msgsnd operation, msgJtime is the time of the last msgrcv operation, and msg_ctime is the time of the last msgctl (2) operation that changed a member of the above structure. Message Operation Permissions. In the msgop (2) and msgct[(2) system call descriptions, the pernllSSlOn required for an operation is given as "{token}", where "token" is the type of - "- INTRO(2) INTRO(2) permission needed interpreted as follows: 00400 00200 00060 00006 Read by user Write by user Read, Write by group Read, Write by others Read and Write permissions on a msqid are granted to a process if one or mqre of the following are true: The process's effective user 10 is super-user. The process's effective user 10 matches msgyerm.lc1uid in the data structure associated with msqid and the appropriate bit of the "user" portion (0600) of msgyerm.mode is set. The process's effective user 10 does not match msgyerm.lc1uid and the process's effective group 10 matches msgyerrn.lc1gid and the appropriate bit of the "group" portion (060) of msgyerm.rnode is set. The process's effective user 10 does not match msgyerm.lc1uid and the process's effective group ID does not match msgyerm.lc1gid and the appropriate bit of the "other" portion (06) of msgyerm.rnode is set. Otherwise, the corresponding permissions are denied. Semaphore Identifier A semaphore identifier (semi d) is a unique positive integer created by a semget (2) system call. Each semid has a set of semaphores and a data structure associated with it. The data structure is referred to as semid ds and contains the following members: struct ushort time t time t ipcyerm sem--'perm; sem_nsems; sem_otime; sem_ctime; 1* 1* 1* 1* I* 1* operation permission struct >t cval *1 # awaiting semval = 0 *1 Semval is a non-negative integer. Sempid is equal to the process process that performed a semaphore operation on this semaphore. count of the number of processes that are currently suspended semaphore's semval to become greater than its current value. - 6 - ID of the last Semncnt is a awaiting this Semzcnt is a INTRO(2) INTRO(2) count of the number of processes that are currently suspended awaiting this semaphore's semval to become zero. Semaphore Operation Permissions. In the semop (2) and semct/(2) system call descriptions, the permISSIon required for an operation is given as "{token}", where "token" is the type of permission needed interpreted as follows: Read by user Alter by user Read, Alter by group Read, Alter by others 00400 00200 00060 00006 Read and Alter permissions on a semid are granted to a process if one or more of the following are true: The process's effective user ID is super-user. The process's effective user ID matches semjlerm-lc]uid in the data structure associated with semid and the appropriate bit of the "user" portion (0600) of sem jlerm.mode is set. The process's effective user ID does not match semjlerm-lc]uid and the process's effective group ID matches sem-,erm-lc]gid and the appropriate bit of the "group" portion (060) of semjlerm.mode is set. The process's effective user ID does not match semjlerm-lc]uid and the process's effective group ID does not match semjlerm-lc]gid and the appropriate bit of the "other" portion (06) of sem-,erm.mode is set. Otherwise, the corresponding permissions are denied. Shared Memory Identifier A shared memory identifier (shmid) is a unique positive integer created by a shmget (2) system call. Each shmid has a segment of memory (referred to as a shared memory segment) and a data structure associated with it. The data structure is referred to as shmid_ds and contains the following members: struct int ushort ushort short time t time t time t ipcyerm shmyerm; shm_segsz; shm_cpid; shmJpid; shm_nattch; shm_atime; shm_dtime; shm_ctime; /* /* /* /* /* /* /* operation permission struct */ size of segment */ creator pid */ pid of last operation */ number of current attaches */ last attach time */ last detach time */ l'" last change time */ / * Times measured in secs since */ /* 00:00:00 GMT, Jan. 1, 1970 */ Shmjlerm is a ipcyerm structure that specifies the shared memory operation permission (see below). This structure includes the following members: l. creator user id */ /* creator group id */ /* user id */ /* group id */ /* r/w permission */ Shm_segsz specifies the size of the shared memory segment. Shm_cpid is the process id of the process that created the shared memory identifier. ShmJpid is the process id of the last process that performed a shmop (2) operation. Shm_oattch is the number of processes that currently have this segment attached. Shm_atime is the time of the last shmat operation, shm_dtime is the time of the last shmdt operation, and shm_ctime is the time of the last ushort ushort ushort ushort ushort cuid; cgid; uid; gid; mode; -7- INTRO(2) INTRO(2) shmctl (2) operation that changed one of the members of the above structure. Shared Memory Operation Permissions. In the shmop (2) and shmct[(2) system call descriptions, the permission required for an operation is given as "{token}", where "token" is the type of permission needed interpreted as follows: 00400 00200 00060 00006 Read by user W ri te by user Read, Write by group Read, Write by others Read and Write permissions on a shmid are granted to a process if one or more of the following are true: The process's effective user 10 is super-user. The process's effective user 10 matches shmyerm.lcJuid in the data structure associated with shmid and the appropriate bit of the "user" portion (0600) of shmyerm.mode is set. The process's effective user 10 does not match shmyerm-lcluid and the process's effective group ID matches shmyerm-lcJgid and the appropriate bit of the "group" portion (060) of shmyerm.mode is set. The process's effective user 10 does not match shmyerm.lcluid and the process's effective group 10 does not match shmyerm.lcJgid and the appropriate bit of the "other" portion (06) of shmyerm.mode is set. Otherwise, the corresponding permissions are denied. SEE ALSO intro(3) . -8- ACCESS (2) ACCESS (2) NAME access - determine accessibility of a file SYNOPSIS iot access (path, arnode) char ·path; iot arnode; DESCRIPTION Path points to a path name naming a file. Access checks the named file for accessibility according to the bit pattern contained in amode, using the real user ID in place of the effective user ID and the real group ID in place of the effective group ID. The bit pattern contained in amode is constructed as follows: 04 02 01 00 read write execute (search) check existence of file Access to the file is denied if one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] Read, write, or execute (search) permission is requested for a null path name. [ENOENT] The named file does not exist. [ENOENT] Search permission is denied on a component of the path prefix. [EACCES] Write access is requested for a file on a read-only file system. [EROFS] Write access is requested for a pure procedure (shared text) file that is being executed. [ETXTBSY] Permission bits of the file mode do not permit the requested access. [EACCES] Path points outside the process's allocated address space. [EFAUL T] The owner of a file has permission checked with respect to the "owner" read, write, and execute mode bits, members of the file's group other than the owner have permissions checked with respect to the "group" mode bits, and all others have permissions checked with respect to the "other" mode bits. RETURN VALUE If the requested access is permitted, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO chmod (2), stat (2) . - 1- ACCT(2) ACCT(2) NAME acct - enable or disable process accounting SYNOPSIS int acct (path) char ·path; DESCRIPTION Aeet is used to enable or disable the system's process accounting routine. If the routine is enabled, an accounting record will be written on an accounting file for each process that terminates. Termination can be caused by one of two things: an exit call or a signal; see exit (2) and signal (2). The effective user I D of the calling process must be super-user to use this call. Path points to a path name naming the accounting file. The accounting file format is given in acet (4). The accounting routine is enabled if path is non-zero and no errors occur during the system call. It is disabled if path is zero and no errors occur during the system call. Aeet will fail if one or more of the following are true: The effective user ID of the calling process is not super-user. [EPERM] An attempt is being made to enable accounting when it enabled. [EBUSY] IS already A component of the path prefix is not a directory. [ENOTDIR] One or more components of the accounting file's path name do not exist. [ENOENT] A component of the path prefix denies se~rch permission. [EACCES] The file named by path is not an ordinary file. [EACCES] Mode permission is denied for the named accounting file. [EACCES] The named file is a directory. [EISDIR] The named file resides on a read-only file system. [EROFS] Path points to an illegal address. [EFAUL T] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO acct(4). - 1- ALARM (2) ALARM (2) NAME alarm - set a process's alarm clock SYNOPSIS unsigned alarm (sec) unsigned sec; DESCRIPTION Alarm instructs the calling process's alarm clock to send the signal SIGALRM to the calling process after the number of real time seconds specified by sec have elapsed; see signal(2). Alarm requests are not stacked; successive calls reset the calling process's alarm clock. If sec is 0, any previously made alarm request is canceled. RETURN VALUE Alarm returns the amount of time previously remaining in the calling process's alarm clock. SEE ALSO pause(2), signaJ(2). - 1- BRK(2) BRK(~J NAME brk, sbrk - change data segment space allocation SYNOPSIS iot brk (eodds) char *eodds; char *sbrk Goer) iot iocr; DESCRIPTION Brk and sbrk are used to change dynamically the amount of space allocated fl the calling process's data segment; see exec(2). The change is made by rese_ ting the process's break value and allocating the appropriate amount of space. The break value is the address of the first location beyond the end of the dat..!:L segment. The amount of allocated space increases as the break value increase The newly allocated space is set to zero. Brk sets the break value to endds and changes the allocated space accordingly. Sbrk adds incr bytes to the break value and changes the allocated spar. accordingly. Incr can be negative, in which case the amount of allocated spa~ is decreased. Brk and sbrk will fail without making any change in the allocated space if or more of the following are true: o~o Such a change would result in more space being allocated than 'is allowed by a system-imposed maximum (see ulimi(2». [ENOMEM] I Such a change would result in the break value being greater than equal to the start address of any attached shared memory segment (s' shmop(2». 1 RETURN VALUE Upon successful completion, brk returns a value of 0 and sbrk returns the 0 break value. Otherwise, a value of -1 is returned and errno is set to indica,_ the error. SEE ALSO exec(2) . - 1- CHDIR(2) CHDIR(2) "TAME chdir - change working directory SYNOPSIS int chdir (path) char .path; )ESCRIPTION Path points to the path name of a directory. Chdir causes the named directory to become the current working directory, the starting point for path searches for path names not beginning with I. Chdir will fail and the current working directory will be unchanged if one or more of the following are true: A component of the path name is not a directory. [ENOTDIR] The named directory does not exist. [ENOENT] Search permission is denied for any component of the path name. [EACCES] Path points outside the process's allocated address spate. [EFAULT] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and erma is set to indicate the error. >:iEE ALSO chroot(2) . - 1- CHMOD(2) CHMOD(2) NAME chmod - change mode of file SYNOPSIS int chmod (path, mode) char .path; int mode; DESCRIPTION Path points to a path name naming a file. Chmod sets the access permission portion of the named file's mode according to the bit pattern contained in mode. Access permission bits are interpreted as follows: 04000 02000 01000 00400 00200 00100 00070 00007 Set user ID on execution. Set group ID on execution. Save text image after execution Read by owner Write by owner Execute (or search if a directory) by owner Read, write, execute (search) by group Read, write, execute (search) by others The effective user ID of the process must match the owner of the file or be super-user to change the mode of a file. If the effective user 10 of the process is not super-user, mode bit 01000 (save text image on execution) is cleared. If the effective user 10 of the process is not super-user or the effective group ID of the process does not match the group 10 of the file, mode bit 02000 (set group ID on execution) is cleared. If an executable file is prepared for sharing then mode bit 01000 prevents the system from abandoning the swap-space image of the program-text portion of the file when its last user terminates. Thus, when the next user of the file executes it, the text need not be read from the file system but can simply be swapped in, saving time. Chmod will fail and the file mode will be unchanged if one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] The named file does not exist. [ENOENT] Search permission is denied on a component of the path prefix. [EACCES] The effective user ID does not match the owner of the file and the effective user ID is not super-user. [EPERM] The named file resides on a read-only file system. [EROFS] Path points outside the process's allocated address space. [EFAUL T] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO chown (2), mknod (2) . - 1- CHOWN(2) CHOWN(2) NAME chown - change owner and group of a file SYNOPSIS int chown (path, owner, group) char ·path; int owner, group; DESCRIPTION Path points to a path name naming a file. The owner ID and group I D of the named file are set to the numeric values contained in owner and group respectively. Only processes with effective user ID equal to the file owner or super-user may change the ownership of a file. If chown is invoked by other than the super-user, the set-user-ID and setgroup-ID bits of the file mode, 04000 and 02000 respectively, will be cleared. Chown will fail and the owner and group of the named file will remaIn unchanged if one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] The named file does not exist. [ENOENT] Search permission is denied on a component of the path prefix. [EACCES] The effective user ID does not match the owner of the file and the effective user ID is not super-user. [EPERM] The named file resides on a read-only file system. [EROFS] Path points outside the process's allocated address space. [EFAUL T] RETURN VALUE U pan successful completion, a value of a is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO chmod(2). - 1- CHROOT(2) CHROOT(2) NAME chroot - change root directory SYNOPSIS iot chroot (path) char .path; DESCRIPTION Path points to a path name naming a directory. Chroot causes the named directory to become the root directory, the starting point for path searches for path names beginning with I. The effective user ID of the process must be super-user to change the root directory. The .. entry in the root directory is interpreted to mean the root directory itself Thus, .. can not be used to access files outside the subtree rooted at the ro01 directory. Chroot will fail and the root directory will remain unchanged if one or more oi the following are true: Any component of the path name is not a directory. [ENOTDIR] The named directory does not exist. [ENOENT] The effective user ID is not super-user. [EPERM] Path points outside the process's allocated address space. [EFAULT] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO chdir(2). - 1- CLOSE(2) CLOSE(2) 'NAME close - close a file descriptor SYNOPSIS iot close (tildes) iot fildes; DESCRIPTION Fildes is a file descriptor obtained from a creal, open, dup, fcntl, or pipe system call. Close closes the file descriptor indicated by fildes. Close will fail if fildes is not a valid open file descriptor. [EBADF] . RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ,SEE ALSO crea t (2), du p (2), exec(2), fcnt1(2), open (2), pipe (2) . - 1- CREAT(2) CREAT(2) NAME creat - create a new file or rewrite an existing one SYNOPSIS int creat (path, nBode) char .path; int nBode; DESCRIPTION Creal creates a new ordinary file or prepares to rewrite an existing file named by the path name pointed to by path. If the file exists, the length is truncated to 0 and the mode and owner are unchanged. Otherwise, the file's owner ID is set to the process's effective user ID, the file's group ID is set to the process's effective group ID, and the loworder 12 bits of the file mode are set to the value of mode modified as follows: All bits set in the process's file mode creation mask are cleared. See umask(2). The "save text image after execution bit" of the mode is cleared. See chmod(2). Upon successful completion, a non-negative integer, namely the file descriptor, is returned and the file is open for writing, even if the mode does not permit writing. The file pointer is set to the beginning of the file. The file descriptor is set to remain open across exec system calls. See !cntl(2). No process may have more than 20 files open simultaneously. A new file may be created with a mode that forbids writing. Creal will fail if one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] A component of the path prefix does not exist. [ENOENT] Search permission is denied on a component of the path prefix. [EACCES] The path name is null. [ENOENT] The file does not exist and the directory in which the file is to be created does not permit writing. [EACCES] The named file resides or would reside on a read-only file system. [EROFS] The file is a pure procedure (shared text) file that is being executed. [ETXTBSY] The file exists and write permission is denied. [EACCES] The named file is an existing directory. [EISDIR] Twenty (20) file descriptors are currently open. [EM FI LE] Path points outside the process's allocated address space. [EFAULT] RETURN VALUE Upon successful completion, a non-negative integer, namely the file descriptor, is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO , close (2), du p (2), lseek (2), open (2), read (2), umask (2), write (2) . - 1- DUP(2) DUP(2) NAME dup - duplicate an open file descriptor SYNOPSIS int dup (tildes) int tildes; DESCRIPTION Fildes is a file descriptor obtained from a creat, open, dup, fcnt I, or pipe system call. Dup returns a new file descriptor having the following in common with the original: Same open file (or pipe). Same file pointer. (i.e., both file descriptors share one file pointer.) Same access mode (read, write or read/write). The new file descriptor is set to remain open across exec system calls. See fcntt(2). The file descriptor returned is the lowest one available. Dup will fail if one or more of the following are true: Fildes is not a valid open file descriptor. [EBADF] Twenty (20) file descriptors are currently open. [EM FI LE] RETURN VALUE Upon successful completion a non-negative integer, namely the file descriptor, is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO creat(2), close(2), exec(2), fcntI(2), open(2), pipe(2). - 1- EXEC (2) EXEC(2) NAME execl, execv, execle, execve, execlp, execvp - execute a file SYNOPSIS int exeel (path, argO, argl, ..., argn, 0) char *path, *argO, *argl, ... , *argn; int execv (path, argv) char *path, *argv[ 1; int exeele (path, argO, argl, ... , argn, 0, envp) char *path, *argO, *argl, ... , *argn, *envp[ 1; int execve (path, argv, envp) char *path, *argv[ 1, *envp[ 1; int exeelp (file, argO, argl, ... , argn, 0) char *file, *argO, *argl, ... , *argn; int execvp (file, argv) char *file, *argv[ 1; DESCRIPTION Exec in all its forms transforms the calling process into a new process. The new process is constructed from an ordinary, executable file called the new process file. This file consists of a header (see a.out (4», a text segment, and a data segment. The data segment contains an initialized portion and an uninitialized portion (bss). There can be no return from a successful exec because the calling process is overlaid by the new process. When a C program is executed, it is called as follows: main (argc, argv, envp) int argc; char "argv, .. envp; where argc is the argument count and argv is an array of character pointers to the arguments themselves. As indicated, argc is conventionally at least one and the first member of the array points to a string containing the name of the file. Path points to a path name that identifies the new process file. File points to the new process file. The path prefix for this file is obtained by a search of the directories passed as the environment line "PATH =" (see environ (5». The environment is supplied by the shell (see sh (I». ArgO, argJ, ... , argn are pointers to null-terminated character strings. These strings constitute the argument list available to the new process. By convention, at least argO must be present and point to a string that is the same as path (or its last component). Argv is an array of character pointers to null-terminated strings. These strings constitute the argument list available to the new process. By convention, argv must have at least one member, and it must point to a string that is the same as path (or its last component). Argv is terminated by a null pointer. Envp is an array of character pointers to null-terminated strings. These strings constitute the environment for the new process. Envp is terminated by a null pointer. For execl and execv, the C run-time start-off routine places a pointer to the calling process's environment in the global cell: extern char **environ; and it is used to pass the calling process's environment to the new process. File descriptors open in the calling process remain open in the new process, except for those whose close-on-exec flag is set; see fcnt! (2). For those file ; descriptors that remain open, the file pointer is unchanged. - 1- EXEC (2) EXEC (2) Signals set to terminate the calling process will be set to terminate the new process. Signals set to be ignored by the calling process will be set to be ignored by the new process. Signals set to be caught by the calling process will be set to terminate new process; see signaf(2). If the set-user-ID mode bit of the new process file is set (see chmod (2», exec sets the effective user ID of the new process to the owner 1D of the new process file. Similarly, if the set-group-ID mode bit of the new process file is set, the effective group 1D of the new process is set to the group ID of the new process file. The real user ID and real group ID of the new process remain the same as those of the calling process. The shared memory segments attached to the calling process will not be attached to the new process (see shmop (2». Profiling is disabled for the new process; see profil (2). The new process also inherits the following attributes from the calling process: nice value (see nice (2» process ID parent process ID process group ID semadj values (see semop (2» tty group ID (see exit (2) and signal (2» trace flag (see ptrace (2) request 0) time left until an alarm clock signal (see alarm (2» current working directory root directory file mode creation mask (see umask (2» file size limit (see ulimit (2» utime, slime, cutime, and cstime (see times (2» Exec will fail and return to the calling process if one or more of the following are true: One or more components of the new process file's path name do not exist. [ENOENT] A component of the new process file's path prefix is not a directory. [ENOTDIR] Search permission is denied for a directory listed in the new process file's path prefix. [EACCES] The new process file is not an ordinary file. [EACCES] The new process file mode denies execution permission. [EACCES] The exec is not an execlp or execvp, and the new process file has the appropriate access permission but an invalid magic number in its header. [ENOEXEC] The new process file is a pure procedure (shared text) file that is currently open for writing by some process. [ETXTBSY] The new process requires more memory than is allowed by the systemimposed maximum MAXMEM. [ENOMEM] The number of bytes in the new process's argument list is greater than the system-imposed limit of 5120 bytes. [E2BIG] The new process file is not as long as indicated by the size values in its header. [EFAULT] Path, argv, or envp point to an illegal address. [EFAUL T] -2- EXEC (2) EXEC (2) RETURN VALUE If exec returns to the calling procesS an error has occurred; the return value will be -1 and errno will be set to indicate the error. SEE ALSO exit(2), fork(2), environ(5). -3- EXIT (2) EXIT(2) NAME exit, _exit - terminate process SYNOPSIS void exit (status) int status; void exit (status) int status; DESCRIPTION Exit terminates the calling process with the following consequences: All of the file descriptors open in the calling process are closed. If the parent process of the calling process is executing a wait, It IS notified of the calling process's termination and the low order eight bits (i.e., bits 0377) of status are made available to it; see wait (2). If the parent process of the calling process is not executing a wait, the calling process is transformed into a zombie process. A zombie process is a process that only occupies a slot in the process table, it has no other space allocated either in user or kernel space. The process table slot that it occupies is partially overlaid with time accounting information (see #include int fcntl (fildes, cund, arg) int fildes, cund, arg; DESCRIPTION Fcntl provides for control over open files. Fildes is an open file descriptor obtained from a creat, open, dup,jcntl, or pipe system call. The cmds available are: Return a new file descriptor as follows: Lowest numbered available file descriptor greater than or equal to argo Same-open file (or pipe) as the original file. Same file pointer as the original file (i.e., both file descriptors share one file pointer). Same access mode (read, write or read/write). Same file status flags (i.e., both file descriptors share the same file status flags). The close-on-exec flag associated with the new file descriptor is set to remain open across exec (2) system calls. F_GETFD Get the close-on-exec flag associated with the file descriptor jildes. If the low-order bit is 0 the file will remain open across exec, otherwise the file will be closed upon execution of exec. Set the close-on-exec flag associated with jildes to the low-order bit of arg (0 or 1 as above). F_GETFL Get jile status flags. Set jile status flags to argo Only certain flags can be set; see jcntl (5). Fcntl will fail if one or more of the following are true: Fildes is not a valid open file descriptor. [EBADF] I Cmd is F_DUPFD and 20 file descriptors are currently open. [EMFILE] Cmd is F_DUPFD and arg is negative or greater than 20. [EINVAL] RETURN VALUE Upon successful completion, the value returned depends on cmd as follows: F_DUPFD A new file descriptor. F_G ETFD Value of flag (only the low-order bit is defined). F SETFD Value other than -1. F_GETFL Value of file flags. F SETFL Value other than -1. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO close (2), exec(2), open (2), fcntl (5). - 1- FORK (2) FORK(2) NAME fork - create a new process SYNOPSIS int fork () DESCRIPTION Fork causes creation of a new process. The new process (child process) is an exact copy of the calling process (parent process). This means the child process inherits the following attributes from the parent process: environment close-on-exec flag (see exec (2» signal handling settings (i.e., SIG_DFL, SIG_ING, function address) set-user-ID mode bit set-group-ID mode bit profiling on/off status nice value (see nice (2» all attached shared memory segments (see shmop (2» process group ID tty group I D (see exit (2) and signal (2» trace flag (see ptrace (2) request 0) time left until an alarm clock signal (see alarm (2» current working directory root directory file mode creation mask (see umask (2» file size limit (see ulimit (2» The child process differs from the parent process in the following ways: The child process has a unique process I D. The child process has a different parent process ID (i.e., the process ID of the parent process). The child process has its own copy of the parent's file descriptors. Each of the child's file descriptors shares a common file pointer with the corresponding file descriptor of the parent. All semadj values are cleared (see semop (2». Process locks, text locks and data locks are not inherited by the child (see plock (2». The child process's utime, stime, cutime, and cstime are set to O. Fork will fail and no child process will be created if one or more of the following are true: The system-imposed limit on the total number of processes under execution would be exceeded. [EAGAIN] The system-imposed limit on the total number of processes under execution by a single user would be exceeded. [EAGAIN] RETURN VALUE Upon successful completion, fork returns a value of 0 to the child process and returns the process ID of the child process to the parent process. Otherwise, a value of -1 is returned to the parent process, no child process is created, and errno is set to indicate the error. SEE ALSO exec(2), times (2), wait (2). - 1- GETPID(2) GETPID(2) NAME getpid, getpgrp, getppid - get process, process group, and parent process IDs SYNOPSIS int getpid () int getpgrp () int getppid () DESCRIPTION Getpid returns the process 10 of the calling process. Getpgrp returns the process group ID of the calling process. Getppid returns the parent process ID of the calling process. SEE ALSO exec(2), fork (2) , intro(2), setpgrp(2), signa1(2). I - 1- GETUID(2) GETUID(2) NAME getuid, geteuid, getgid, getegid - get real user, effective user, real group, and effective group IDs SYNOPSIS int getuid () int geteuid () int getgid () int getegid () DESCRIPTION Getuid returns the real user ID of the calling process. Geteuid returns the effective user ID of the calling process. Getgid returns the real group ID of the calling process. Getegid returns the effective group ID of the calling process. SEE ALSO intra (2), setuid (2). I - 1- IOCTL(2) IOCTL(2 c NAME ioctl - control device SYNOPSIS ioctl (fildes, request, arg) DESCRIPTION Ioctl performs a variety of functions on character special files (devices). Thl writeups of various devices in Section 7 discuss how ioctl applies to them. Ioctl will fail if one or more of the following are true: Fildes is not a valid open file descriptor. [EBADF] Fildes is not associated with a character special device. [ENOTTY] Request or arg is not valid. See Section 7. [EINVAL] RETURN VALUE If an error has occurred, a value of -1 is returned and errno is set to indicat~ the error. SEE ALSO termio(7) in the UNIX System Administrator's Manual. I - 1- KILL(2) KILL(2) NAME kill - send a signal to a process or a group of processes YNOPSIS iot kill (pid, sig) iot pid, sig; mSCRIPTION Kill sends a signal to a process or a group of processes. The process or group of processes to which the signal is to be sent is specified by pid. The signal that is to be sent is specified by sig and is either one from the list given in signal (2), or O. If sig is 0 (the null signal), error checking is performed but no signal is actually sent. This can be used to check the validity of pid. The real or effective user 10 of the sending process must match the real or effective user ID of the receiving process unless, the effective user ID of the sending process is super-user. The processes with a process ID of 0 and a process ID of 1 are special processes (see intro (2» and will be referred to below as procO and procl respectively. If pid is greater than zero, sig will be sent to the process whose process ID is equal to pid. Pid may equal 1. If pid is 0, sig will be sent to all processes excluding procO and procl whose process group 10 is equal to the process group I D of the sender. If pid is -1 and the effective user ID of the sender is not super-user, sig will be sent to all processes excluding procO and procl whose real user ID is equal to the effective user 10 of the sender. If pid is -1 and the effective user ID of the sender is super-user, sig will be sent to all processes excluding procO and procl. If pid is negative but not -1, sig will be sent to all processes whose process group ID is equal to the absolute value of pid. Kill will fail and no signal will be sent if one or more of the following are true: Sig is not a valid signal number. [EINV AL] No process can be found corresponding to that specified by pid. [ESRCH] The user ID of the sending process is not super-user, and its real or effective user ID does not match the real or effective user ID of the receiving process. [EPERM] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO kill (1), getpid (2), setpgrp (2), signal(2). - 1- I LINK (2) LINK (2) NAME link - link to a file SYNOPSIS int link (pathl, path2) char ·pathl, ·path2; DESCRIPTION PathI points to a path name naming an existing file. Path2 points to a path name naming the new directory entry to be created. Link creates a new link (directory entry) for the existing file. Link will fail and no link will be created if one or more of the following are true: A component of either path prefix is not a directory. [ENOTDIR] A component of either path prefix does not exist. [ENOENT] A component of either path prefix denies search permission. [EACCES] The file named by pathI does not exist. [ENOENT] The link named by path2 exists. [EEXIST] The file named by path I is a directory and the effective user I D is not super-user. [EPERM] The link named by path2 and the file named by path] are on different logical devices (file systems). [EXDEV] Path2 points to a null path name. [ENOENT] I The requested link requires writing in a directory with a mode that denies write permission. [EACCES] The requested link requires writing in a directory on a read-only file system. [EROFS] Path points outside the process's allocated address space. [EFAULT] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO unlink(2). - 1- LSEEK(2) LSEEK(2) NAME lseek - move read/write file pointer SYNOPSIS long Iseek (fildes, offset, whence) int fildes; long offset; int whence; DESCRIPTION Fildes is a file descriptor returned from a creat, open, dup, or fcntl system call. Lseek sets the file pointer associated with fildes as follows: If whence is 0, the pointer is set to offset bytes. If whence is 1, the pointer is set to its current location plus offset. If whence is 2, the pointer is set to the size of the file plus offset. Upon successful completion, the resulting pointer location as measured in bytes from the beginning of the file is returned. Lseek will fail and the file pointer will remain unchanged if one or more of the following are true: Fildes is not an open file descriptor. [EBADF] Fildes is associated with a pipe or fifo. [ESPIPE] Whence is not 0, 1 or 2. [EINVAL and SIGSYS signail The resulting file pointer would be negative. [EINV All Some devices are incapable of seeking. The value of the file pointer associated with such a device is undefined. RETURN VALUE Upon successful completion, a non-negative integer indicating the file pointer value is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO creat (2), dup(2), fcntI(2), open (2). - 1- I MAUS(2) (PDP-II only) MAUS(2) NAME rna us - multiple-access-user-space (shared memory) operations SYNOPSIS #include < sys/fcntl.h > int getmaus (path, oftag) char *path; int oftag; int freemaus (mausdes) int mausdes; char *enabmaus (mausdes) int mausdes; int dismaus (saddr) char *saddr; char *switmaus (mausdes, saddr) int mausdes; char *saddr; DESCRIPTION MAUS (Multiple Access User Space) is a dedicated portion of physical memory that is subdivided into logical subsections. These subsections can be attached to the calling process's data segment or released from its data segment with the following calls. I Path points to a path name naming a special file that is one of the MAUS logical subsections. Getmaus opens a rna us descriptor for the named file and sets the file status flag according to the value of oflag. Oflag is one of the following: O_RDONLY Open for reading only. O_WRONLY Open for writing only. o Open for reading and writing. RDWR No process may have more than eight (8) rna us descriptors open simultaneously. The named file is opened unless one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] The named file does not exist. [ENOENT] The named file is not a maus special file. [EINY AU A component of the path prefix denies search permission. [EACCES] Oflag permission is denied for the named file. [EACCES] Eight (8) rna us descriptors are currently open. [EMFILE] The MAUS area associated with the special file does not exist. r [ENXIO] Path points to an illegal address. [EFAULT] Freemaus closes the maus descriptor specified by mausdes. Note that if a maus descriptor has been enabled (see enabmaus below) it may still be closed: a MAUS file remains attached to a process's data segment until a dismaus (see' below) is used to free it. I Freemaus will fail if mausdes is not a valid open maus descriptor. [EBADF] Enabmaus attaches the MAUS file associated with mausdes to the data seg-!, ment of the calling process. The file is attached starting at the first available - 1- MAUS(2) (PDP-II only) MAUS(2) 8k-byte boundary address beyond the current break value (see brk (2)). Note that multiple enabmaus calls can be made with the same maus descriptor. Each call will attach the file at a different 8k-byte boundary address. Enabmaus will fail and not attach the MAUS file if one or more of the following are true: Mausdes is not a valid open maus descriptor. [EBADF] No more 8k-byte boundary starting addresses are available. [ENOMEM] Dismaus frees from the calling process's data segment the MAUS file that starts at the data segment address given by {saddr - (saddr modulus 8192)). Dismaus will fail and not free the MAUS file if {saddr - (saddr modulus 8192)) is not the data segment starting address ofa MAUS file. [EINVAU Switmaus attaches the MAUS file associated with mausdes to the data segment of the calling process. The file is attached starting at the address given by {saddr - (saddr modulus 8192)). Switmaus will fail if one or more of the following are true: Mausdes is not a valid open maus descriptor. [EBADF] The value of {saddr - (saddr modulus 8192)) is not a legal 8k-byte boundary address above the current break value. [EINV AU RETURN VALUES Upon successful completion, the return value is as follows: Getmaus returns a non-negative integer, namely a maus descriptor. Freemaus returns a value of O. Enabmaus returns the data segment starting address of the attached MAUS file. Dismaus and switmaus return the maus descriptor previously associated with the data segment starting address given by {saddr - (saddr modulus 8192)) if one exists. Otherwise, a value of -2 is returned. On other than successful completion, a value of -1 is returned with ermo set to indicate the error. - 2 - I MKNOD(2) MKNOD(2) NAME mknod - make a directory, or a special or ordinary file SYNOPSIS int mknod (path, mode, dev) char *path; int mode, dev; DESCRIPTION Mknod creates a new file named by the path name pointed to by path. The mode of the new file is initialized from mode. Where the value of mode is interpreted as follows: 0170000 file type; one of the following: 0010000 fifo special 0020000 character special 0040000 directory 0060000 block special 0100000 or 0000000 ordinary file 0004000 set user I D on execution 0002000 set group ID on execution 0001000 save text image after execution 0000777 access permissions; constructed from the following 0000400 read by owner 0000200 write by owner 0000100 execute (search on directory) by owner 0000070 read, write, execute (search) by group 0000007 read, write, execute (search) by others I The file's owner ID is set to the process's effective user !D. The file's group ID is set to the process's effective group ID. Values of mode other than those above are undefined and should not be used. The low-order 9 bits of mode are modified by the process's file mode creation mask: all bits set in the process's file mode creation mask are cleared. See umask (2). If mode indicates a block or character special file, dev is a configuration dependent specification of a character or block 110 device. If mode does not indicate a block special or character special device, dev is ignored. Mknod may be invoked only by the super-user for file types other than FIFO special. Mknod will fail and the new file will not be created if one or more of the following are true: The process's effective user ID is not super-user. [EPERM] A component of the path prefix is not a directory. [ENOTDIR] A component of the path prefix does not exist. [ENOENT] The directory in which the file is to be created is located on a read-only file system. [EROFS] The named file exists. [EEXIST] Path points outside the process's allocated address space. [EFAULT] RETURN VALUE Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO mkdir(I), chmod(2), exec(2), umask(2), fs(4). - 1- MOUNT(2) MOUNT(2) NAME mount - mount a file system SYNOPSIS iot mouot (spec, dir, rwftag) char *spec, *dir; iot rwflag; DESCRIPTION Mount requests that a removable file system contained on the block special file identified by spec be mounted on the directory identified by dir. Spec and dir are pointers to path names. Upon successful completion, references to the file dir will refer to the root directory on the mounted file system. The low-order bit of rwflag is used to control write permission on the mounted file system; if 1, writing is forbidden, otherwise writing is permitted according to individual file accessibility. Mount may be invoked only by the super-user. Mount will fail if one or more of the following are true: The effective user 10 is not super-user. [EPERM] Any of the named files does not exist. [ENOENT] A component of a path prefix is not a directory. [ENOTDIR] Spec is not a block special device. [ENOTBLK] The device associated with spec does not exist. [ENXIO] Dir is not a directory. [ENOTDIR] Spec or dir points outside the process's allocated address space. [EFAULT] Dir is currently mounted on, is someone's current working directory or is otherwise busy. [EBUSY] The device associated with spec is currently mounted. [EBUSY] RETURN VALUE Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO umount(2). - 1- MSGCTL(2) MSGCTL(2) NAME msgctl - message control operations SYNOPSIS #include #include #include int msgctl (msqid, cmd, bur) int msqid, cmd; struct msqid_ds *buf; DESCRIPTION Msgctl provides a variety of message control operations as specified by cmd. The following cmds are available: IPC_STAT Place the current value of each member of the data structure associated with msqid into the structure pointed to by buf. The contents of this structure are defined in intro (2). {READ} Set the value of the following members of the data structure associated with msqid to the corresponding value found in the structure pointed to by buf: msgyerm.uid msgyerm.gid msgyerm.mode /* only low 9 bits */ msg_qbytes I This cmd can only be executed by a process that has an effective user ID equal to either that of super user or to the value of msgyerm.uid in the data structure associated with msqid. Only super user can raise the value of msg_qbytes. IPC_RMID Remove the message queue identifier specified by msqid from the system and destroy the message queue and data structure associated with it. This cmd can only be executed by a process that has an effective user ID equal to either that of super user or to the value of msgyerm.uid in the data structure associated with msqid. Msgctl will fail if one or more of the following are true: Msqid is not a valid message queue identifier. [EINVAL] Cmd is not a valid command. [EINVAL] Cmd is equal to IPC_STAT and {READ} operation permission is denied to the calling process (see intro(2». [EACCES] Cmd is equal to IPC_RMID or (PC_SET and the effective user ID of the calling process is not equal to that of super user and it is not equal to the value of msgyerm.uid in the data structure associated with msqid. [EPERM] Cmd is equal to IPC_SET, an attempt is being made to increase to the value of msg_qbytes, and the effective user ID of the calling process is not equal to that of super user. [EPERM] Buf points to an iIlegal address. [EF AU LT] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO msgget (2), msgop (2) . - 1- MSGGET(2) MSGGET(2) NAME msgget - get message queue SYNOPSIS #include #include #include int msgget (key, msgflg) key_t key; int msgflg; DESCRIPTION Msgget returns the message queue identifier associated with key. A message queue identifier and associated message queue and data structure (see intra (2)) are created for key if one of the following are true: Key is equal to IPC_PRIVATE. Key does not already have a message queue identifier associated with it, and (msgffg & IPC_CREAT) is "true". Upon creation, the data structure associated with the new message queue identifier is initialized as follows: Msgyerm.cuid, msgyerm.uid, msgyerm.cgid, and msgyerm.gid are set equal to the effective user ID and effective group ID, respectively, of the calling process. The low-order 9 bits of msgyerm.mode are set equal to the low-order 9 bits of msgffg. Msg_qnum, msgJspid, msgJrpid, msg_stime, and msgJtime are set equal to O. Msg_ctime is set equal to the current time. Msg_qbytes is set equal to the system limit. Msgget will fail if one or more of the following are true: A message queue identifier exists for key but operation permission (see intra (2)) as specified by the low-order 9 bits of msgffg would not be granted. [EACCES] A message queue identifier does not exist for key and (msgffg & IPC_CREAT) is "false". [ENOENT] A message queue identifier is to be created but the system imposed limit on the maximum number of allowed message queue identifiers system wide would be exceeded. [ENOSPC] A message queue identifier exists for key but ( (msgffg & IPC_CREAT) & (msgffg & IPC_EXCL) ) is "true". [EEXIST] RETURN VALUE Upon successful completion, a non-negative integer, namely a message queue identifier is returned. Otherwise, a value of -1 is returned and errna is set to indicate the error. SEE ALSO msgctl (2), msgop (2). - 1- I MSGOP(2) MSGOP(2) NAME msgop - message operations SYNOPSIS #include #include #include int msgsnd (msqid, msgp, msgsz, msgflg) int msqid; struct msgbuf *msgp; int msgsz, msgflg; int msgrcv (msqid, msgp, msgsz, msgtyp, msgflg) int msqid; struct msgbuf *msgp; int msgsz; long msgtyp; int msgflg; DESCRIPTION Msgsnd is used to send a message to the queue associated with the message queue identifier specified by msqid. {WRITE) Msgp points to a structure containing the message. This structure is composed of the following members: long char I mtype; mtext[]; /* message type */ /* message text */ Mtype is a positive integer that can be used by the receiving process for message selection (see msgrcv below). Mtext is any text of length msgsz bytes. Msgsz can range from 0 to a system imposed maximum. Msgflg specifies the action to be taken if one or more of the following are true: The number of bytes already on the queue is equal to msg_qbytes (see intra (2) ). The total number of messages on all queues system wide is equal to the system imposed limit. These actions are as follows: If (msgflg & IPC_NOWAIT) is "true", the message will not be sent and the calling process will return immediately. If (msgflg & IPC_NOWAIT) is "false", the calling process will suspend execution until one of the following occurs: The condition responsible for the suspension no longer exists, in which case the message is sent. Msqid is removed from the system (see msgctf(2». When this occurs, errna is set equal to EIDRM, and a value of -1 is returned. The calling process receives a signal that is to be caught. In this case the message is not sent and the calling process resumes execution in the manner prescribed in signal (2». Msgsnd will fail and no message will be sent if one or more of the following are true: Msqid is not a valid message queue identifier. [EINVALl Opera tion permission is denied to the calling process (see intra (2». [EACCES] - 1- MSGOP(2) MSGOP(2) Mtype is less than 1. [EINVAU The message cannot be sent for one of the reasons cited above and (msgflg & IPC_NOWAIT) is "true". [EAGAINI Msgsz is less than zero or greater than the system imposed limit. [EINVAU Msgp points to an illegal address. [EFAUL Tl Upon successful completion, the following actions are taken with respect to the data structure associated with msqid (see intra (2)). Msg_qnum is incremented by 1. MsgJspid is set equal to the process ID of the calling process. Msg_stime is set equal to the current time. Msgrcv reads a message from the queue associated with the message queue identifier specified by msqid and places it in the structure pointed to by msgp. (READ) This structure is composed of the following members: long char mtype; mtexdl; /* message type */ /* message text */ Mtype is the received message's type as specified by the sending process. Mtext is the text of the message. Msgsz specifies the size in bytes of mtext. The received message is truncated to msgsz bytes if it is larger than msgsz and (msgflg & MSG_NOERROR) is "true". The truncated part of the message IS lost and no indication of the truncation is given to the calling process. Msgtyp specifies the type of message requested as follows: If msgtyp is equal to 0, the first message on the queue is received. If msgtyp is greater than 0, the first message of type msgtyp is received. If msgtyp is less than 0, the first message of the lowest type that is less than or equal to the absolute value of msgtyp is received. Msgflg specifies the action to be taken if a message of the desired type is not on the queue. These are as follows: If (msgflg & IPC _NOW AIT) is "true", the calling process will return immediately with a return value of -1 and errna set to ENOMSG. If (msgflg & IPC_NOWAIT) is "false", the calling process will suspend execution until one of the following occurs: A message of the desired type is placed on the queue. Msqid is removed from the system. When this occurs, errna is set equal to EIDRM, and a value of -1 is returned. The calling process receives a signal that is to be caught. In this case a message is not received and the calling process resumes execution in the manner prescribed in signal (2)). M sgrcv will fail and no message will be received if one or more of the following are true: Msqid is not a valid message queue identifier. [EINV AU Operation permission is denied to the calling process. [EACCESI M sgsz is less than 0. [EINV ALl Mtext is greater than msgsz and (msgflg & MSG_NOERROR) is "false". [E2BIG] - 2- MSGOP(2) MSGOP(2) The queue does not contain a message of the desired type and (msgtyp & IPC_NOWAIT) is "true". [ENOMSG] Msgp points to an illegal address. [EFAULT] Upon successful completion, the following actions are taken with respect to the data structure associated with msqid (see intro (2». Msg_qnum is decremented by 1. Msg_lrpid is set equal to the process 10 of the calling process. MsgJtime is set equal to the current time. RETURN VALUES If msgsnd or msgrcv return due to the receipt of a signal, a value of -I is returned to the calling process and errno is set to EINTR. If they return due to removal of msqid from the system, a value of -I is returned and errno is set to EIORM. Upon successful completion, the return value is as follows: M sgsnd returns a value of O. Msgrcv returns a value equal to the number of bytes actually placed into mtext. Otherwise, a value of '-1 is returned and errno is set to indicate the error. SEE ALSO msgctl (2), msgget (2) . -3- NICE(2) NICE(2) NAME nice - change priority of a process SYNOPSIS int nice Gocr> int iocr; DESCRIPTION Nice adds the value of incr to the nice value of the calling process. A process's nice value is a positive number for which a more positive value results in lower CPU priority. A maximum nice value of 39 and a minimum nice value of 0 are imposed by the system. Requests for values above or below these limits result in the nice value being set to the corresponding limit. Nice will fail and not change the nice value if incr is negative and the effective user 10 of the calling process is not super-user. [EPERM] RETURN VALUE Upon successful completion, nice returns the new nice value minus 20. Otherwise, a value of -1 is returned and erma is set to indicate the error. SEE ALSO nice( 1), exec (2) . - 1- OPEN (2) OPEN (2) NAME open - open for reading or writing SYNOPSIS #include iot open (path, oflag [ , mode ] ) char ·path; iot oflag, mode; DESCRIPTION Path points to a path name naming a file. Open opens a file descriptor for the named file and sets the file status flags according to the value of oflag. Oflag values are constructed by or-ing flags from the following list (only one of the first three flags below may be used): O_RDONLY Open for reading only. O_WRONLY Open for writing only. O_RDWR Open for reading and writing. ° NDELAY This flag may affect subsequent reads and writes. See read (2) and write (2). When opening a FIFO with O_RDONLY or O_WRONLY set: If 0 N DELA Y is set: An open for reading-only will return without delay. An open for writing-only will return an error if no process currently has the file open for reading. If 0 _NDELA Y is clear: An open for reading-only will block until a process opens the file for writing. An open for writing-only will block until a process opens the file for reading. When opening a file associated with a communication line: If 0 NDELA Y is set: ° The open will return without waiting for carrier. If _NDELA Y is clear: The open will block until carrier is present. If set, the file pointer will be set to the end of the file prior to each write. If the file exists, this flag has no effect. Otherwise, the file's owner ID is set to the process's effective user ID, the file's group ID is set to the process's effective group ID, and the loworder 12 bits of the file mode are set to the value of mode modified as follows (see creat (2) ) : All bits set in the process's file mode creation mask are cleared. See umask (2). The "save text image after execution bit" of the mode is cleared. See chmod (2). If the file exists, its length is truncated to 0 and the mode and owner are unchanged. If 0 EXCL and 0_CREA T are set, open will fail if the file exists. - 1- OPEN (2) OPEN (2) Upon successful completion a non-negative integer, the file descriptor, is returned. The file pointer used to mark the current position within the file is set to the beginning of the file. The new file descriptor is set to remain open across exec system calls. See !cntf(2). No process may have more than 20 file descriptors open simultaneously. The named file is opened unless one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] O_CREAT is not set and the named file does not exist. [ENOENT] A component of the path prefix denies search permission. [EACCES] Oflag permission is denied for the named file. [EACCES] The named file is a directory and oflag is write or read/write. [EISDIR] The named file resides on a read-only file system and oflag is write or read/write. [EROFS] Twenty (20) file descriptors are currently open. [EMFILE] The named file is a character special or block special file, and the device associated with this special file does not exist. [ENXIO] The file is a pure procedure (shared text) file that is being executed and oflag is write or read/write. [ETXTBSY] Path points outside the process's allocated address space. [EFAULT] O_CREAT and O_EXCL are set, and the named file exists. [EEXIST] is set, the named file is a FIFO, O_WRONLY is set, and no process has the file open for reading. [ENXIO] O_NDELAY RETURN VALUE Upon successful completion, a non-negative integer, namely a' file descriptor, is returned. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO close(2), creat(2), dup(2), fcntl(2), lseek(2), read(2), write(2). -2- PAUSE(2) PAUSE(2) NAME pause - suspend process until signal SYNOPSIS pause () DESCRIPTION Pause suspends the calling process until it receives a signal. The signal must be one that is not currently set to be ignored by the calling process. If the signal causes termination of the calling process, pause will not return. If the signal is caught by the calling process and control is returned from the signal catching-function (see signal (2», the calling process resumes execution from the point of suspension; with a return value of -I from pause and erma set to EINTR. SEE ALSO alarm (2), kill (2), signal (2), wait (2) . I - 1- PIPE (2) PIPE (2) NAME pipe - create an interprocess channel SYNOPSIS int pipe (tildes) int fildes[2]; DESCRIPTION Pipe creates an I/O mechanism called a pipe and returns two file descriptors, fildes[O] and fildes[ 11. Fildes[O] is opened for reading and fildes[ 1] is opened for writing. Writes up to 5120 bytes of data are buffered by the pipe before the writing process is blocked. A read on file descriptor fildes[O] accesses the data written to fildes[ 1] on a first-in-first-out basis. No process may have more than 20 file descriptors open simultaneously. Pipe will fail if 19 or more file descriptors are currently open. [EM FI LE] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errna is set to indicate the error. SEE ALSO sh(I), read(2), write(2). - 1- PLOCK (2) PLOCK(2) NAME plock - lock process, text, or data in memory SYNOPSIS #include < sys/lock.h > int plock (op) int op; DESCRIPTION Plock allows the calling process to lock its text segment (text lock), its data segment (data lock), or both its text and data segments (process lock) into memory. Locked segments are immune to all routine swapping. Plock also allows these segments to be unlocked. The effective user ID of the calling process must be super-user to use this call. Op specifies the following: PROCLOCK - lock text & data segments into memory (process lock) TXTLOCK - lock text segment into memory (text lock) DATLOCK - lock data segment into memory (data lock) UNLOCK - remove locks Plock will fail and not perform the requested operation if one or more of the following are true: The effective user ID of the calling process is not super-user. [EPERM] Op is equal to PROCLOCK and a process lock, a text lock, or a data lock already exists on the calling process. [EINV ALl Op is equal to TXTLOCK and a text lock, or a process lock already exists on the calling process. [EINV ALl Op is equal to DATLOCK and a data lock, or a process lock already exists on the calling process. [EINV ALl Op is equal to UNLOCK and no type of lock exists on the calling process. [EINVALl RETURN VALUE Upon successful completion, a value of 0 is returned to the calling process. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO exec(2), exit (2), fork(2). - 1- PROFIL(2) PROFIL (2) NAME profil - execution time profile SYNOPSIS void profil (buff, bufsiz, offset, scale) char • buff; iot bufsiz, offset, scale; DESCRIPTION Buff points to an area of core whose length Gn bytes) is given by bufsiz. After this call, the user's program counter (pc) is examined each clock tick (60th second); offset is subtracted from it, and the result multiplied by scale. If the resulting number corresponds to a word inside buff, that word is incremented. The scale is interpreted as an unsigned, fixed-point fraction with binary point at the left: 0177777 (octal) gives a 1-1 mapping of pc's to words in buff; 077777 (octal) maps each pair of instruction words together. 02(8) maps all instructions onto the beginning of buff (producing a non-interrupting core clock). Profiling is turned off by giving a scale of 0 or 1. It is rendered ineffective by giving a buJsiz of o. Profiling is turned off when an exec is executed, but remains on in child and parent both after a fork. Profiling will be turned off if an update in buff would cause a memory fault. RETURN VALUE Not defined. SEE ALSO prof(l), monitor(3C). - 1- PTRACE(2) PTRACE(2) NAME ptrace - process trace SYNOPSIS int ptrace (request, pid, addr, data); int request, pid, addr, data; DESCRIPTION Ptrace provides a means by which a parent process may control the execution of a child process. Its primary use is for the implementation of breakpoint debugging; see sdb(l). The child process behaves normally until it encounters a signal (see signa!(2) for the list), at which time it enters a stopped state and its parent is notified via wait (2). When the child is in the stopped state, its parent can examine and modify its "core image" using ptraee. Also, the parent can cause the child either to terminate or continue, with the possibility of ignoring the signal that caused it to stop. The request argument determines the precise action to be taken by ptrace and is one of the following: o I This request must be issued by the child process if it is to be traced by its parent. It turns on the child's trace flag that stipulates that the child should be left in a stopped state upon receipt of a signal rather than the state specified by June; see signal(2). The pid, addr, and data arguments are ignored, and a return value is not defined for this request. Peculiar results will ensue if the parent does not expect to trace the child. The remainder of the requests can only be used by the parent process. For each, pid is the process 10 of the child. The child must be in a stopped state before these requests are made. 1, 2 With these requests, the word at location addr in the address space of the child is returned to the parent process. If I and D space are separated (as on PDP-II s), request 1 returns a word from I space, and request 2 returns a word from D space. If I and D space are not separated (as on the 3B20S and VAX111780), either request 1 or request 2 may be used with equal results. The data argument is ignored. These two requests will fail if addr is not the start address of a word, in which case a value of -1 is returned to the parent process and the parent's errno is set to EIO. 3 With this request, the word at location addr in the child's USER area in the system's address space (see < sys/user.h > ) is returned to the parent process. Addresses in this area range from o to 1024 on the PDP-lIs and 0 to 2048 on the 3B20S and VAX. The data argument is ignored. This request will fail if addr is not the start address of a .word or is outside the USER area, in which case a value of -1 is returned to the parent process and the parent's errno is set to EIO. 4, 5 With these requests, the value given by the data argument is written into the address space of the child at location addr. If I and D space are separated (as on PDP-lIs), request 4 writes a word into I space, and request 5 writes a word into D space. If I and D space are not separated (as on the 3820S and VAX), either request 4 or request 5 may be used with equal results. Upon successful completion, the value written into the address space of the child is returned to the parent. These two requests will fail if addr is a location in a pure procedure space and another process - 1- PTRACE(2) PTRACE(2) is executing in that space, or addr is not the start address of a word. Upon failure a value of -1 is returned to the parent process and the parent's ermo is set to EIO. 6 With this request, a few entries in the child's USER area can be written. Data gives the value that is to be written and addr is the location of the entry. The few entries that can be written are: the general registers (i.e., registers 0-11 on the 3 B20S, registers 0-7 on PDP-II s, and registers 0-15 on the VAX) the condition codes of the Processor Status Word on the 3B20S. the floating point status register and six floating point registers on PDP-lIs certain bits of the Processor Status Word on PDP-lls (i.e, bits 0-4, and 8-11) certain bits of the Processor Status Longword on the VAX (i.e., bits 0-7, 16-20, and 30-31) 7 This request causes the child to resume execution. If the data argument is 0, all pending signals including the one that caused the child to stop are canceled before it resumes execution. If the data argument is a valid signal number, the child resumes execution as if it had incurred that signal and any other pending signals are canceled. The addr argument must be equal to 1 for this request. Upon successful completion, the value of data is returned to the parent. This request will fail if data is not 0 or a valid signal number, in which case a value of -1 is returned to the parent process and the parent's ermo is set to EIO. 8 This request causes the child to terminate with the same consequences as exit (2). 9 This request sets the trace bit in the Processor Status Word of the child (i.e., bit 4 on PDP-lIs; bit 30 on the VAX) and then executes the same steps as listed above for request 7. The trace bit causes an interrupt upon completion of one machine instruction. This effectively allows single stepping of the child. On the 3B20S there is no trace bit and this request returns an error. Note: the trace bit remains set after an interrupt on PDP-lIs but is turned off after an interrupt on the VAX. To forestall possible fraud, ptrace inhibits the set-user-id facility on subsequent exec (2) calls. If a traced process calls exec, it will stop before executing the first instruction of the new image showing signal SIGTRAP. GENERAL ERRORS Ptrace will in general fail if one or more of the following are true: Request is an illegal number. [EIO] Pid identifies a child that does not exist or has not executed a ptrace with request O. [ESRCH] SEE ALSO sd b (1), exec(2), signaI(2), wait (2) . - 2- READ(2) READ (2) NAME read - read from file SYNOPSIS int read (fildes, buf, nbyte) int fildes; char *buf; unsigned nbyte; DESCRIPTION Fildes is a file descriptor obtained from a creat, open, dup, fent!, or pipe system call. Read attempts to read nbyte bytes from the file associated with fildes into the buffer pointed to by buf. On devices capable of seeking, the read starts at a position in the file given by the file pointer associated with fildes. Upon return from read, the file pointer is incremented by the number of bytes actually read. Devices that are incapable of seeking always read from the current position. The value of a file pointer associated with such a file is undefined. Upon successful completion, read returns the number of bytes actually read and placed in the buffer; this number may be less than nbyte if the file is associated with a communication line (see ioct! (2) and termio (7)), or if the number of bytes left in the file is less than nbyte bytes. A value of 0 is returned when an end-of-file has been reached. When attempting to read from an empty pipe (or FI FO): If °_N DELA Y is set, the read will return a O. If O_NDELAY is clear, the read will block until data is written to the file or the file is no longer open for writing. When attempting to read a file associated with a tty that has no data currently available: IfO_NDELAY is set, the read will return a ° o. If _N DELA Y is clear, the read will block until data becomes available. Read will fail if one or more of the following are true: Fildes is not a valid file descriptor open for reading. [EBADFl Buf points outside the allocated address space. [EFAUL Tl RETURN VALUE Upon successful completion a non-negative integer is returned indicating the number of bytes actually read. Otherwise, a -1 is returned and errno is set to indicate the error. SEE ALSO creat(2), dup(2), fcntl(2), ioctI(2), open(2), pipe(2), termio(7). - 1- SEMCTL(2) SEMCTL(2) NAME semctl - semaphore control operations SYNOPSIS #include #include #include int semetl (semid, semnum, emd, arg) int semid, emd; int semnum; union semun { int val; struet semid ds *buf; ushort arrayT J; arg; DESCRIPTION Semet! provides a variety of semaphore control operations as specified by emd. The following emds are executed with respect to the semaphore specified by semid and semnum: GETVAL Return the value of semval (see intra (2». {READ} SETVAL Set the value of semval to arg.va!. {ALTER} When this cmd is successfully executed the semadj value corresponding to the specified semaphore in all processes is cleared. GETPID Return the value of sempid. (READ} GETNCNT Return the value of semncnt. (READ} GETZCNT Return the value of semzcnt. (READ} The following emds return and set, respectively, every semval in the set of semaphores. GETALL Place semvals into array pointed to by arg.array. {READ} SETALL Set semvals according to the array pointed to by arg.array. (ALTER} When this cmd is successfully executed the semadj values corresponding to each specified semaphore in all processes are cleared. The following emds are also available: IPC STAT Place the current value of each member of the data structure associated with semid into the structure pointed to by arg.buf. The contents of this structure are defined in intra (2). {READ} fPC SET Set the value of the following members of the data structure associated with semid to the corresponding value found in the structure pointed to by arg.buf: sem j>erm.uid sem j>erm.gid semj>erm.mode 1* only low 9 bits *1 This cmd can only be executed by a process that has an effective user ID equal to either that of super user or to the value of semj>erm.uid in the data structure associated with semid. - 1- SEMCTL(2) SEMCTL(2) IPC_RMID Remove the semaphore identifier specified by semid from the system and destroy the set of semaphores and data structure associated with it. This cmd can only be executed by a process that has an effective user ID equal to either that of super user or to the value of semyerm.uid in the data structure associated with semid. Semell will fail if one or more of the following are true: Semid is not a valid semaphore identifier. [EINV All Semnum is less than zero or greater than sem_Dsems. [EINVALl Cmd is not a valid command. [EINVALl Operation permission is denied to the calling process (see inlro(2». [EACCES] Cmd is SETVAL or SETALL and the value to which semval is to be set is greater than the system imposed maximum. [ERANGE] Cmd is equal to IPC_RMID or IPC_SET and the effective user ID of the calling process is not equal to that of super user and it is not equal to the value of semyerm.uid in the data structure associated with semid. [EPERM] Arg.bufpoints to an illegal address. [EFAULT] RETURN VALUE I Upon successful completion, the value returned depends on cmd as follows: GETV AL The value of semval. GETPID The value of sempid. GETNCNT The value of semncnt. GETZCNT The value of semzcnt. All others A value of O. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO semget (2), semop (2) . SEMGET(2) SEMGET(2) NAME semget - get set of semaphores SYNOPSIS #include #include < sys/ipc.h > #include int semget (key, nsems, semftg) key_t key; int nsems, semftg; DESCRIPTION Semget returns the semaphore identifier associated with key. A semaphore identifier and associated data structure and set containing nsems semaphores (see intro are created for key if one of the following are true: (2» Key is equal to IPC_PRIVATE. Key does not already have a semaphore identifier associated with it, and (semflg & IPC_CREAT) is "true". Upon creation, the data structure associated with the new semaphore identifier is initialized as follows: Semyerm.cuid, semyerm.uid, semyerm.cgid, and semyerm.gid are set equal to the effective user ID and effective group ID, respectively, of the calling process. The low-order 9 bits of semyerm.mode are set equal to the low-order 9 bits of semflg. Sem_nsems is set equal to the value of nsems. Sem_otime is set equal to 0 and sem_ctime is set equal to the current time. Semget will fail if one or more of the following are true: Nsems is either less than or equal to zero or greater than the system imposed limit. [EINV AU A semaphore identifier exists for key but operation permission (see intro (2» as specified by the low-order 9 bits of semflg would not be granted. [EACCES] A semaphore identifier exists for key but the number of semaphores in the set associated with it is less than nsems and nsems is not equal to zero. [EINV AU A semaphore identifier does not exist for key and (semflg & IPC_CREAT) is "false". [ENOENT] A semaphore identifier is to be created but the system imposed limit on the maximum number of allowed semaphore identifiers system wide would be exceeded. [ENOSPC] A semaphore identifier is to be created but the system imposed limit on the maximum number of allowed semaphores system wide would be exceeded. [ENOSPC] A semaphore identifier exists for key but { (semflg & IPC_CREAT) & ( semflg & IPC_EXCL) ) is "true". [EEXIST] - 1- SEMGET(2) SEMGET(2) RETURN VALUE Upon successful completion, a non-negative integer, namely a semaphore identifier is returned. Otherwise, a value of -1 is returned and errna is set to indicate the error. SEE ALSO semctl (2), semop(2). - 2- SEMOP(2) SEMOP(2) NAME semop - semaphore operations SYNOPSIS #include #include #include int semop (semid, sops, nsops) int semid; struct sembuf (*sops) []; int nsops; DESCRIPTION Semop is used to atomically perform an array of semaphore operations on the set of semaphores associated with the semaphore identifier specified by semid. Sops is a pointer to the array of semaphore-operation structures. Nsops is the number of such structures in the array. The contents of each structure includes the following members: short short short sem_num; sem_op; sem_flg; 1* semaphore number */ 1* semaphore operation */ 1* operation flags *1 Each semaphore operation specified by sem_op is performed on the corresponding semaphore specified by semid and sem_num. Sem_op specifies one of three semaphore operations as follows: If sem_op is a negative integer, one of the following will occur: {ALTER} If semval (see intro (2» is greater than or equal to the a bsolute value of sem_op, the absolute value of sem_op is subtracted from semval. Also, if (sem.flg & SEM_UNDO) is "true", the absolute value of sem op is added to the calling for the specified semaprocess's semadj value (see exit phore. (2» If semval is less than the absolute value of sem_op and (sem.flg & IPC_NOWAIT) is "true", semop will return immediately. If semval is less than the absolute value of sem _op and (sem.flg & IPC_NOWAIT) is "false", semop will increment the semncnt associated with the specified semaphore and suspend execution of the calling process until one of the following occurs: Semval becomes greater than or equal to the absolute value of sem_op. When this occurs, the value of semncnt associated with the specified semaphore is decremented, the absolute value of sem_op is subtracted from semval and, if (sem.flg & SEM_UNDO) is "true", the absolute value of sem_op is added to the calling process's semadj value for the specified semaphore. The semid for which the calling process is awaiting action is removed from the system (see semell (2». When this occurs, errno is set equal to EIDRM, and a val~e of -1 is returned. The calling process receives a signal that is to be caught. When this occurs, the value of semncnt associated with the specified semaphore is decremented, and the calling process - 1- SEMOP(2) SEMOP(2) resumes execution in the manner prescribed in signal (2). If sem_op is a positive integer, the value of sem_op is added to semval and, if (semJlg & SEM_UNDO) is "true", the value of sem_op is subtracted from the calling process's semadj value for the specified semaphore. {ALTER} If sem_op is zero, one of the following will occur: {READ} If semval is zero, semop will return immediately. If semval is not equal to zero and (semJlg & IPC_NOWAIT) is "true", semop will return immediately. If semval is not equal to zero and (semJlg & IPC_NOWAIT) is "false", semop will increment the semzcnt associated with the specified semaphore a~d suspend execution of the calling process until one of the following occurs: Semval becomes zero, at which time the value of semzcnt associated with the specified semaphore is decremented. The semid for which the calling process is awaiting action is removed from the system. When this occurs, errno is set equal to EIDRM, and a value of -1 is returned. The calling process receives a signal that is to be caught. When this occurs, the value of semzcnt associated with the specified semaphore is decremented, and the calling process resumes execution in the manner prescribed in signal (2). Semop will fail if one or more of the following are true for any of the semaphore operations specified by sops: Semid is not a valid semaphore identifier. [EINVAL] Sem num is less than zero or greater than or equal to the number of sema-phores in the set associated with semid. [EFBIG] Nsops is greater than the system imposed maximum. [E2BIG] Operation permission is denied to the calling process (see intro (2)). [EACCES] The operation would result in suspension of the calling process but (semJlg & IPC_NOWAIT) is "true". [EAGAIN] The limit on the number of individual processes requesting an SEM_UNDO would be exceeded. [ENOSPC] The number of individual semaphores for which the calling process requests a SEM_UNDO would exceed the limit. [EINV AL] An operation would cause a semval to overflow the system imposed limit. [ERANGE] An operation would cause a semadj value to overflow the system imposed limit. [ERANGE] Sops points to an illegal address. [EFAULT] Upon successful completion, the value of sempid for each semaphore specified in the array pointed to by sops is set equal to the process ID of the calling process. RETURN VALUE If semop returns due to the receipt of a signal, a value of -1 is returned to the calling process and errno is set to EINTR. If it returns due to the removal of a semid from the system, a value of -1 is returned and errno is set to EIDRM. - 2- SEMOP(2) SEMOP(2) Upon successful completion, the value of semval at the time of the call for the last operation in the array pointed to by sops is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO exec(2), exit (2), fork (2), semctI(2), semget (2). -3- SETPGRP(2) SETPGRP(2) NAME setpgrp - set process group 10 SYNOPSIS int setpgrp () DESCRIPTION Setpgrp sets the process group 10 of the calling process to the process 10 of the calling process and returns the new process group I D. RETURN VALUE Setpgrp returns the value of the new process group 10. SEE ALSO exec(2), fork (2), getpid (2), intro (2), kilI(2), signal (2). - 1- SETUID (2) SETUID(2) NAME setuid, setgid - set user and group IDs SYNOPSIS int setuid (uid) int uid; int setgid (gid) int gid; DESCRIPTION Setuid (setgid) is used to set the real user (group) 1D and effective user (group) 1D of the calling process. If the effective user ID of the calling process is super-user, the real user (group) ID and effective user (group) ID are set to uid (gid). If the effective user ID of the calling process is not super-user, but its real user (group) ID is equal to uid (gid) , the effective user (group) 1D is set to uid (gid) . Setuid (setgid) will fail if the real user (group) ID of the calling process is not equal to uid (gid) and its effective user ID is not super-user. [EPERMl RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -\ is returned and errna is set to indicate the error. SEE ALSO getuid(2), intro(2). I - 1- SHMCTL(2) SHMCTL(2) NAME shmctl - shared memory control operations SYNOPSIS #include #include < sys/ipc.h > #include int shmctI (shmid, cmd, bur) int shmid, cmd; struct shmid_ds -buf; DESCRIPTION Shmctl provides a variety of shared memory control operations as specified by cmd. The following cmds are available: IPC_STAT Place the current value of each member of the data structure associated with shmid into the structure pointed to by buf. The contents of this structure are defined in intra (2). {READ} Set the value of the following members of the data structure associated with shmid to the corresponding value found in the structure pointed to by buf: shm yermo uid shmyerm.gid shmyerm.mode 1* only low 9 bits *1 This cmd can only be executed by a process that has an effective user ID equal to either that of super user or to the value of shmj)erm.uid in the data structure associated with shmid. I Remove the shared memory identifier specified by shmid from the system and destroy the shared memory segment and data structure associated with it. This cmd can only be executed by a process that has an effective user ID equal to either that of super user or to the value of shmj)erm.uid in the data structure associated with shmid. Shmctl will fail if one or more of the following are true: Shmid is not a valid shared memory identifier. [EINVALl Cmd is not a valid command. [EINV AU Cmd is equal to fPC_STAT and {READ} operation permission is denied to the calling process (see intra (2». [EACCES] Cmd is equal to IPC_RMfD or fPC_SET and the effective user ID of the calling process is not equal to that of super user and it is not equal to the value of shmj)erm.uid in the data structure associated with shmid. [EPERM] Bul points to an illegal address. [EFAULT] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errna is set to indicate the error. SEE ALSO shmget(2), shmop(2). - 1- SHMGET(2) SHMGET(2) NAME shmget - get shared memory segment SYNOPSIS #include #include < sys/ipc.h > #include int shmget (key, size, shmflg) key_t key; int size, shmflg; DESCRIPTION Shmget returns the shared memory identifier associated with key. A shared memory identifier and associated data structure and shared memory segment of size size bytes (see intro (2» are created for key if one of the following are true: Key js equal to IPC_PRIVATE. Key does not already have a shared memory identifier associated with it, and (shmflg & IPC_CREAT) is "true". Upon creation, the data structure associated with the new shared memory identifier is initialized as follows: Shmjlerm.cuid, shmjlerm.uid, shmjlerm.cgid, and shmjlerm.gid are set equal to the effective user 10 and effective group 10, respectively, of the calling process. The low-order 9 bits of shmjlerm.mode are set equal to the low-order 9 bits of shmflg. Shm_segsz is set equal to the value of size. ShmJpid, shm_nattch, shm_atime, and shm_dtime are set equal to O. Shm_ctime is set equal to the current time. S hmget will fail if one or more of the following are true: Size is less than the system imposed minimum or greater than the system imposed maximum. [EINV AU A shared memory identifier exists for key but operation permission (see intro (2» as specified by the low-order 9 bits of shmflg would not be granted. [EACCES] A shared memory identifier exists for key but the size of the segment associated with it is less than size and size is not equal to zero. [EINVAU A shared memory identifier does not exist for key and (shmflg & IPC_CREAT) is "false". [ENOENT] A shared memory identifier is to be created but the system imposed limit on the maximum number of allowed shared memory identifiers system wide would be exceeded. [ENOSPC] A shared memory identifier and associated shared memory segment are to be created but the amount of available physical memory is not sufficient to fill the request. [ENOMEM] A shared memory identifier exists for key but ( (shmflg IPC_CREAT) & (shmflg & IPC_EXCL) ) is "true". [EEXIST] - 1- & I SHMGET(2) SHMGET(2) RETURN VALUE Upon successful completion, a non-negative integer, namely a shared memory identifier is returned. Otherwise, a value of -I is returned and errno is set to indicate the error. SEE ALSO shmctl (2), shmop (2) . I - 2 - SHMOP(2) SHMOP(2) NAME shmop - shared memory operations SYNOPSIS #include #include #include char *shmat (shmid, shmaddr, shmflg) int shmid; char *shmaddr int shmflg; int shmdt (shmaddr) char *shmaddr DESCRIPTION Shmat attaches the shared memory segment associated with the shared memory identifier specified by shmid to the data segment of the calling process. The segment is attached at the address specified by one of the following criteria: If shmaddr is equal to zero, the segment is attached at the first available address as selected by the system. If shmaddr is not equal to zero and Cshmflg & SHM_RND) is "true", the segment is attached at the address given by (shmaddr - (shmaddr modulus SHMLBA». If shmaddr is not equal to zero and (shmflg & SHM_RND) is "false", the segment is attached at the address given by shmaddr. The segment is attached for reading if (shmflg & SHM_RDONLY) is "true" {READ}, otherwise it is attached for reading and writing {READ/WRITE}. Shmat will fail and not attach the shared memory segment if one or more of the following are true: Shmid is not a valid shared memory identifier. [EINV AU Operation permission is denied to the calling process (see intra (2». [EACCES] The available data space is not large enough to accommodate the shared memory segment. [ENOMEM] Shmaddr is not equal to zero, and the value of (shmaddr - (shmaddr modulus SHMLBA» is an illegal address. [EINVAU Shmaddr is not equal to zero, (shmflg & SHM_RND) is "false", and the value of shmaddr is an illegal address. [EINVAU The number of shared memory segments attached to the calling process would exceed the system imposed limit. [EMFILE] Shmdt detaches from the calling process's data segment the shared memory segment located at the address specified by shmaddr. Shmdt will fail and not detach the shared memory segment if shmaddr is not the data segment start address of a shared memory segment. [EINV AU RETURN VALUES Upon successful completion, the return value is as follows: - 1- I SHMOP(2) SHMOP(2) Shmat returns the data segment start address of the attached shared memory segment. Shmdt returns a value of O. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO exec(2), exit (2), fork (2), shmctl (2), shmget (2). I - 2- SIGNAL(2) SIGNAL(2) NAME signal - specify what to do upon receipt of a signal SYNOPSIS #include int (-signal (sig, fune}) ( ) int sig; int (-fune) ( ) ; DESCRIPTION Signal allows the calling process to choose one of three ways in which it is possible to handle the receipt of a specific signal. Sig specifies the signal and Junc specifies the choice. Sig can be assigned anyone of the following except SIGKILL: SIGHUPOI SIGINT SIGQUIT SIGILL SIGTRAP SIGIOT SIGEMT07* SIGFPE SIGKILL09 SIGBUS 10* SIGSEGV SIGSYS SIGPIPE SIGALRM SIGTERM SIGUSRI SIGUSR2 SIGCLD 18 SIGPWR hangup 02 interrupt 03 * quit 04* illegal instruction (not reset when caught) 05* trace trap (not reset when caught) 06* lOT instruction EMT instruction 08* floating point exception kill (cannot be caught or ignored) bus error 11 * segmentation violation 12 * bad argument to system call 13 write on a pipe with no one to read it 14 alarm clock 15 software termination signal 16 user defined signal 1 17 user defined signal 2 death of a child (see WARNING below) 19 power fail (see WARNING below) See below for the significance of the asterisk (-) in the above list. Func is assigned one of three values: SIG_DFL, SIG_IGN, or a function address. The actions prescribed by these values of are as follows: terminate process upon receipt of a signal Upon receipt of the signal sig, the receiving process is to be terminated with all of the consequences outlined in exit (2) plus a "core image" will be made in the current working directory of the receiving process if sig is one for which an asterisk appears in the above list and the following conditions are met: SIG_DFL - The effective user ID and the real user ID of the receiving process are equal. An ordinary file named core exists and is writable or can be created. If the file must be created, it will have the following properties: a mode of 0666 modified by the file creation mask (see umask (2» a file owner ID that is the same as the effective user ID of the receiving process a file group ID that is the same as the effective group ID of the receiving process - 1• 2 SIGNAL (2) SIGNAL(2) ignore signal The signal sig is to be ignored. SIG IGN - Note: the signal SIGKILL cannot be ignored. Junction address - catch signal Upon receipt of the signal sig, the receiving process is to execute the signal-catching function pointed to by June. The signal number sig will be passed as the only argument to the signal-catching function. Before entering the signal-catching function, the value of June for the caught signal will be set to SIG_DFL unless the signal is SIGILL, SIGTRAP, or SIGPWR. Upon return from the signal-catching function, the receiving process will resume execution at the point it was interrupted. When a signal that is to be caught occurs during a read, a write, an open, or an ioetl system call on a slow device (like a terminal; but not a file), during a pause system call, or during a wait system call that does not return immediately due to the existence of a previously stopped or zombie process, the signal catching function will be executed and then the interrupted system call will return a -1 to the calling process with ermo set to EINTR. Note: the signal SIGKILL cannot be caught. A call to signal cancels a pending signal sig except for a pending SIGKILL signal. Signal will fail if one or more of the following are true: I Sig is an illegal signal number, including SIGKILL. [EINV All Fune points to an illegal address. [EFAUL Tl RETURN VALUE Upon successful completion, signal returns the previous value of June for the specified signal sig. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO kill(l), kiII(2), pause(2), ptrace(2), wait(2), setjmp(3C). WARNING Two other signals that behave differently than the signals described above exist in this release of the system; they are: SIGCLD SIGPWR 18 19 death of a child (reset when caught) power fail (not reset when caught) There is no guarantee that, in future releases of the UN IX System, these signals will continue to behave as described below; they are included only for compatibility with other versions of the UNIX System. Their use in new programs is strongly discouraged. For these signals, June is assigned one of three values: SIG_DFL, SIG_IGN, or a Junction address. The actions prescribed by these values of are as follows: SIC _ DFL - ignore signal The signal is to be ignored. SIC _IGN - ignore signal The signal is to be ignored. Also, if sig is SIGCLD, the calling process's child processes will not create zombie processes when they terminate; see exit (2). -2 - SIGNAL (2) SIGNAL(2) Junction address - catch signal If the signal is SIGPWR, the action to be taken is the same as that described above for June equal to function address. The same is true if the signal is SIGCLD except, that while the process is executing the signal-catching function any received SIGCLD signals will be queued and the signal-catching function will be continually reentered until the queue is empty. The SIGCLD affects two other system calls (wait (2), and exit (2)) in the following ways: wait If the June value of SIGCLD is set to SIG_IGN and a wait is executed, the wait will block until all of the calling process's child processes terminate; it will then return a value of -1 with errno set to ECHILD. exit If in the exiting process's parent process the June value of SIGCLD is set to SIG_IGN, the exiting process will not create a zombie process. When processing a pipeline, the shell makes the last process in the pipeline the parent of the proceeding processes. A process that may be piped into in this manner (and thus become the parent of other processes) should take care not to set SIGCLD to be caught. -3- STAT (2) STAT (2) NAME stat, fstat - get file status SYNOPSIS #iuclude #iuclude iut stat (path, buf) char *path; struct stat *buf; iut fstat (fildes, bur> jut tildes; struct stat *buf; DESCRIPTION Path points to a path name naming a file. Read, write or execute permission of the named file is not required, but all directories listed in the path name leading to the file must be searchable. Stat obtains information about the named file. Similarly, Jstat obtains information about an open file known by the file descriptor fildes, obtained from a successful open, creal, dup, Jcntl, or pipe system call. BuJ is a pointer to a stat structure into which information is placed concerning the file. I The contents of ushort ino t dey t dev t short ushort ushort off t time t time t time t the structure pointed to by buJ include the following members: st_mode; /* File mode; see mknod(2) */ stjno; /* Inode number */ st_dev; /* 10 of device containing */ /* a directory entry for this file */ stJdev; /* 10 of device */ /* This entry is defined only for */ /* character special or block special files 4 st_nlink; /* Number of links */ st_uid; /* User ID of the file's owner */ /* Group ID of the file's group */ st~id; st_size; / * File size in bytes */ st_atime; /* Time of last access 4 st_mtime; /* Time of last data modification */ st_ctime; /* Time of last file status change */ /* Times measured in seconds since */ /* 00:00:00 GMT, Jan. 1, 1970 */ st atime Time when file data was last accessed. Changed by the following system calls: creat(2), mknod(2) , pipe (2) , utime(2), and read(2). st_mtime Time when data was last modified. Changed by the following system calls: creat (2), mknod (2), pipe (2), utime(2), and write (2). st ctime Time when file status was last changed. Changed by the following system calls: chmod (2), chown (2), creat (2), link (2), mknod (2), pipe (2), unlink (2), utime (2), and write (2). Stat will fail if one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] The named file does not exist. [ENOENT] Search permission is denied for a component of the path prefix. [EACCES] - 1- STAT (2) STAT(2) Bul or path points to an invalid address. [EFAUL T] Fstat will fail if one or more of the following are true: Fildes is not a valid open file descriptor. [EBADF] Bul points to an invalid address. [EFAULT] RETURN VALUE Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and erma is set to indicate the error. SEE ALSO chmod (2), chown (2), creat (2), link (2), mknod (2), time(2), unlink (2). - 2- STIME(2) STIME(2) NAME stime - set time SYNOPSIS int stime (tp) long *tp; DESCRIPTION Stime sets the system's idea of the time and date. Tp points to the value of time as measured in seconds from 00:00:00 GMT January 1, 1970. Stime will fail if the effective user ID of the calling process is not super-user. [EPERM] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO time(2). I - 1- SYNC(2) SYNC(2) NAME sync - update super-block SYNOPSIS void sync ( ) DESCRIPTION Sync causes all information in memory that should be on disk to be written out. This includes modified super blocks, modified i-nodes, and delayed block I/O. It should be used by programs which examine a file system, for example fsck, df, etc. It is mandatory before a boot. The writing, although scheduled, is not necessarily complete upon return from sync. - 1- SYS3B (2) (3B20S only) SYS3B(2) NAME sys3b - 3B20S specific system calls SYNOPSIS void sys3b (cmd, argll, arg2]) int cmd, arg 1, arg2; DESCRIPTION This system call provides for 3B20S specific actions. Most require super-user privileges as the effects can be dangerous. The cmd values available are: Reboot the processor. bootstrap code. 2 This call causes an immediate entry into the System print! interface. Argl is taken as a pointer to a null terminated string to be copied into the operating system circular print buffer. 3 Attach to an address translation buffer. 4 System namelist interface. The value of argl is used to return the address of various data elements in the system. S Override for system Maintenance Reset Function (MRF) action. If argl is non-zero, it is taken as the indicator for handling a processor MRF. If zero, the current setting is returned. 6 Send a Processor Recovery Message (PRM). Argl is used as a pointer to a 16 byte string to be converted to a PRM and transmitted to the Emergency Action Interface (EAI). 7 Modify the System Status Register (SSR). Bits set in argl are set or cleared in the SSR if arg2 is non-zero or zero, respectively. 8 Read EAI Input Parameter Buffer. Argl is used as a location in user space where the current Input Parameter Buffer is to be placed. 9 Change default Field Test Set utility-id. 10 Change the floating point flag bits in the extended processor status word. SEE ALSO fts(} M), ipb(} M), prm(I M), reboot 0 M), setmrf(I M), ssr(1 M), in the UNIX System Administrator's Manual. - 1- TIME (2) TIME(2) NAME time - get time SYNOPSIS long time «long .) 0) long time (tloC> long .tloc; DESCRIPTION Time returns the value of time in seconds since 00:00:00 GMT, January I, 1970. If tloc (taken as an integer) is non-zero, the return value is also stored in the location to which tloc points. Time will fail if tloc points to an illegal address. [EFAUL T] RETURN VALUE Upon successful completion, time returns the value of time. Otherwise, a value of -I is returned and ermo is set to indicate the error. SEE ALSO stime(2). - I - TIMES(2) TIMES (2) NAME times - get process and child process times SYNOPSIS #include < sys/types.h > #include long times (buffed struct tms * buffer; DESCRIPTION Times fills the structure pointed to by buffer with time-accounting information. The following is this contents of the structure: struct tms { time _t time _t time t time t tms _utime; tms _stime; tms _cutime; tms _cstime; }; This information comes from the calling process and each of its terminated child processes for which it has executed await. All times are in 60ths of a second on DEC processors, lOOths of a second on WECo processors. Tms _utime is the CPU time used while executing instructions in the user space of the calling process. Tms _stime is the CPU time used by the system on behalf of the calling process. Tms cutime processes. IS the sum of the tms utimes and tms cutimes of the child Tms cstime processes. IS the sum of the tms stimes and tms cstimes of the child Times will fail if buffer points to an illegal address. [EFAUL T] RETURN VALUE Upon successful completion, times returns the elapsed real time, in 60ths (100ths) of a second, since an arbitrary point in the past (e.g., system start-up time). This point does not change from one invocation of times to another. If times fails, a -1 is returned and errna is set to indicate the error. SEE ALSO exec(2), fork (2), time(2), wait(2). - 1- ULlMIT(2) ULlMIT(2) NAME ulimit - get and set user limits SYNOPSIS long ulimit (cmd, newlimit> int cmd; long newlimit; DESCRIPTION This function provides for control over process limits. The cmd values available are: Get the process's file size limit. The limit is in units of 512-byte blocks and is inherited by child processes. Files of any size can be read. 2 Set the process's file size limit to the value of newlimit. Any process may decrease this limit, but only a process with an effective user I D of superuser may increase the limit. Ulimit will fail and the limit will be unchanged if a process with an effective user I D other than super-user attempts to increase its file size limit. [EPERM] 3 Get the maximum possible break value. See brk (2). RETURN VALUE Upon successful completion, a non-negative value is returned. value of -I is returned and errna is set to indicate the error. SEE ALSO brk (2), write(2). - 1- Otherwise, a UMASK(2) UMASK(2) NAME umask - set and get file creation mask SYNOPSIS int umask (cmask) int cmask; DESCRIPTION Umask sets the process's file mode creation mask to cmask and returns the previous value of the mask. Only the low-order 9 bits of cmask and the file mode creation mask are used. RETURN VALUE The previous value of the file mode creation mask is returned. SEE ALSO mkdir( 1), sh (I ), chmod (2), crea t (2), mknod (2), open (2) . I - 1- UMOUNT(2) UMOUNT(2) NAME umount - unmount a file system SYNOPSIS int umount (spec) char • spec; DESCRIPTION Umount requests that a previously mounted file system contained on the block special device identified by spec be unmounted. Spec is a pointer to a path name. After unmounting the file system, the directory upon which the file system was mounted reverts to its ordinary interpretation. Umount may be invoked only by the super-user. Umount will fail if one or more of the following are true: The process's effective user ID is not super-user. [EPERM] Spec does not exist. [ENXIO] Spec is not a block special device. [ENOTBLK] Spec is not mounted. [EINVALJ A file on spec is busy. [EBUSY] Spec points outside the process's allocated address space. [EFAUL T] RETURN VALUE Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and ermo is set to indicate the error. SEE ALSO mount(2). I - 1- UNAME(2) UNAME(2) NAME uname - get name of current UN IX system SYNOPSIS #include < sys/utsname.h > int una me (name) struct utsname *name; DESCRIPTION Uname stores information identifying the current UN IX system in the structure pointed to by name. Uname uses the char char char char char structure defined in whose members are: sysname[9]; nodename[ 9]; release[ 9]; version[9]; machine[ 9]; Uname returns a null-terminated character string naming the current UN IX system in the character array sysname. Similarly, nodename contains the name that the system is known by on a communications network. Release and version further identify the operating system. Machine contains a standard name that identifies the hardware that the UNIX System is running on. Uname will fail if name points to an invalid address. [EFAUL T] RETURN VALUE Upon successful completion, a non-negative value is returned. Otherwise, -1 is returned and ermo is set to indicate the error. I SEE ALSO uname(l) . - 1- UNLINK(2) UNLINK (2) NAME unlink - remove directory entry SYNOPSIS int unlink (path) char .path; DESCRIPTION Unlink removes the directory entry named by the path name pointed to be path. The named file is unlinked unless one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR] The named file does not exist. [ENOENT] Search permission is denied for a component of the path prefix. [E~CCES] Write permission is denied on the directory containing the link to be removed. [EACCES] The named file is a directory and the effective user I D of the process is not super-user. [EPERM] The entry to be unlinked is the mount point for a mounted file system. [EBUSY] The entry to be unlinked is the last link to a pure procedure (shared text) file that is being executed. [ETXTBSY] The directory entry to be unlinked is part of a read-only file system. [EROFS] Path points outside the process's allocated address space. [EFAUL T] When all links to a file have been removed and no process has the file open, the space occupied by the file is freed and the file ceases to exist. If one or more processes have the file open when the last link is removed, the removal is postponed until all references to the file have been closed. RETURN VALUE Upon successful completion, a value bf 0 is returned. Otherwise, a value of -1 is returned and erma is set to indicate the error. SEE ALSO rm (I), close (2), link (2), open (2). - 1- USTAT(2) USTAT(2) NAME ustat - get file system statistics SYNOPSIS #include #include int ustat (dev, bur) int dev; struct ustat *buf; DESCRIPTION Ustat returns information about a mounted file system. Dev is a device number identifying a device containing a mounted file system. Buf is a pointer to a ustat structure that includes to following elements: daddr t ino t char char f tfree; ftinode; f-fname[61; (fpack[6]; /* /* /* /* Total free blocks */ Number of free inodes */ Filsys name */ Filsys pack name */ Ustat will fail if one or more of the following are true: Dev is not the device number of a device containing a mounted file system. [EINV All Bul points outside the process's allocated address space. [EFAUL Tl RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. I SEE ALSO stat(2), fs(4). - 1- UTIME (2) UTIME(2) NAME utime - set file access and modification times SYNOPSIS #ioclude iot utime (path, times) char .path; struct utimbuf .times; DESCRIPTION Path points to a path name naming a file. modification times of the named file. Utime sets the access and If times is NULL, the access and modification times of the file are set to the current time. A process must be the owner of the file or have write permission to use utime in this manner. If times is not NULL, times is interpreted as a pointer to a utimbuf structure and the access and modification times are set to the values contained in the designated structure. Only the owner of the file or the super-user may use utime this way. The times in the following structure are measured in seconds since 00:00:00 GMT, Jan. I, 1970. struct utimbuf time t actime; time t mod time; /* access time */ /* modification time */ Utime will fail if one or more of the following are true: The named file does not exist. [ENOENT] A component of the path prefix is not a directory. [ENOTDIR] Search permission is denied by a component of the path prefix. [EACCES] The effective user ID is not super-user and not the owner of the file and times is not NULL. [EPERM] The effective user ID is not super-user and not the owner of the file and times is NULL and write access is denied. [EACCES] The file system containing the file is mounted read-only. [EROFS] Times is not NULL and points outside the process's allocated address space. [EFAULT] Path points outside the process's allocated address space. [EF AUL T] RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -I is returned and errno is set to indicate the error. SEE ALSO stat(2) . - 1- WAIT (2) WAIT(2) NAME wait - wait for child process to stop or terminate SYNOPSIS int wait (statJoC> int *stat Joe; int wait «int *)0) DESCRIPTION Wait suspends the calling process until it receives a signal that is to be caught (see signal (2», or until anyone of the calling process's child processes stops in a trace mode (see ptrace (2» or terminates. If a child process stopped or terminated prior to the call on wait, return is immediate. If stat _lac (taken as an integer) is non-zero, 16 bits of information called status are stored in the low order 16 bits of the location pointed to by stat _lac. Status can be used to differentiate between stopped and terminated child processes and if the child process terminated, status identifies the cause of termination and pass useful information to the parent. This is accomplished in the following manner: If the child process stopped, the high order 8 bits of status will contain the number of the signal that caused the process to stop and the low order 8 bits will be set equal to 0177. If the child process terminated due to an exit call, the low order 8 bits of status will be zero and the high order 8 bits will contain the low order 8 bits of the argument that the child process passed to exit; see exit(2). If the child process terminated due to a signal, the high order 8 bits of status will be zero and the low order 8 bits will contain the number of the signal that caused the termination. In addition, if the low order seventh bit (i.e., bit 200) is set, a "core image" will have been produced; see signal (2). If a parent process terminates without waiting for its child processes to terminate, the parent process ID of each child process is set to 1. This means the initialization process inherits the child processes; see intra (2). Wait will fail and return immediately if one or more of the following are true: The calling process has no existing unwaited-for child processes. [ECHILD] Stat_lac points to an illegal address. [EFAULT] RETURN VALUE If wait returns due to the receipt of a signal, a value of -1 is returned to the calling process and errno is set to EINTR. If wait returns due to a stopped or terminated child process, the process ID of the child is returned to the calling process. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO exec(2), exit (2), fork(2), pause(2), signaI(2). WARNING See WARNING in signaf(2). - 1- WRITE(2) WRITE(2) NAME write - write on a file SYNOPSIS int write (fildes, buf, nbyte) int fildes; char .buf; unsigned nbyte; DESCRIPTION Fildes is a file descriptor obtained from a creat, open, dup, fentl, or pipe system call. Write attempts to write nbyte bytes from the buffer pointed to by buf to the file associated with the fildes. On devices capable of seeking, the actual writing of data proceeds from the position in the file indicated by the file pointer. Upon return from write, the file pointer is incremented by the number of bytes actually written. On devices incapable of seeking, writing always takes place starting at the current position. The value of a file pointer associated with such a device is undefined. If the 0 _APPEND flag of the file status flags is set, the file pointer will be set to the end of the file prior to each write. Write will fail and the file pointer will remain unchanged if one or more of the following are true: Fildes is not a valid file descriptor open for writing. [EBADF] An attempt is made to write to a pipe that is not open for reading by any process. [EPIPE and SIGPIPE signal] An attempt was made to write a file that exceeds the process's file size limit or the maximum file size. See ulimit (2). [EFBIG] Buf points outside the process's allocated address space. [EFAULT] If a write requests that more bytes be written than there is room for (e.g., the ulimit (see ulimit (2» or the physical end of a medium), only as many bytes as there is room for will be written. For example, suppose there is space for 20 bytes more in a file before reaching a limit. A write of 512 bytes will return 20. The next write of a non-zero number of bytes will give a failure return (except as noted below). If the file being written is a pipe (or FIFO), no partial writes will be permitted. Thus, the write will fail if a write of nbyte bytes would exceed a limit. If the file being written is a pipe (or FIFO) and the 0 _NDELA Y flag of the file flag word is set, then write to a full pipe (or FIFO) will return a count of o. Otherwise (O_NDELAY clear), writes to a full pipe (or FIFO) will block until space becomes available. RETURN VALUE Upon successful completion the number of bytes actually written is returned. Otherwise, -1 is returned and errno is set to 'indicate the error. SEE ALSO creat(2), dup(2), Iseek(2) , open (2) , pipe(2), ulimit(2). - 1- INTRO(3) INTRO(3) NAME intro - introduction to subroutines and libraries SYNOPSIS #include < stdio.h > #include < math.h > DESCRIPTION This section describes functions found in various libraries, other than those functions that directly invoke UNIX system primitives, which are described in Section 2 of this volume. Certain major collections are identified by a letter after the section number: (3C) These functions, together with those of Section 2 and those marked (3S), constitute the Standard C Library Ubc, which is automatically loaded by the C compiler, cc(1). The link editor Id(I) searches this library under the -Ie option. Declarations for some of these functions may be obtained from #include files indicated on the appropriate pages. (3F) These functions constitute the FORTRAN intrinsic function library, UbF77. These functions are automatically available to the FORTRAN programmer and require no special invocation of the compiler. (3M) These functions constitute the Math Library, Ubm. They are automatically loaded as needed by the FORTRAN compiler 177(1). They are not automatically loaded by the C compiler, cc(1); however, the link editor searches this library under the -1m option. Declarations for these functions may be obtained from the #include file . (3S) These functions constitute the "standard 110 package" (see stdio (3S» . These functions are in the library Ubc, already mentioned. Declarations for these functions may be obtained from the #include file < stdio.h > . (3 X) Various specialized libraries. The files in which these libraries are found are given on the appropriate pages. DEFINITIONS A character is any bit pattern able to fit into a byte on the machine. The null character is a character with value 0, represented in the C language as '\0'. A character array is a sequence of characters. A null-terminated character array is a sequence of characters, the last of which is the null character. A string is a designation for a null-terminated character array. The null string is a character array containing only the null character. A NULL pointer is the value that is obtained by casting 0 into a pointer. The C language guarantees that this value will not match that of any legitimate pointer, so many functions that return pointers return it to indicate an error. NULL is defined as 0 in ; the user can include his own definition if he is not using . Many groups of FORTRAN intrinsic functions have generic function names that do not require explicit or implicit type declaration. The type of the function will be determined by the type of its argument(s). For example, the generic function max will return an integer value if given integer arguments (maxO), a real value if given real arguments (amaxI), or a double-precision value if given double-precision arguments (dmaxI). FILES Ilib/libc.a lusr Ilib/libF77.a llibllibm.a SEE ALSO ar(I), cc(1), f77(1) , Id(I), nm(I), intro(2), stdio(3S). - 1- INTRO(3) INTRO(3) DIAGNOSTICS Functions in the Math Library OM) may return the conventional values 0 or HUGE (the largest single-precision floating-point number) when the function is undefined for the given arguments or when the value is not representable. In these cases, the external variable errno (see intro (2» is set to the value EDOM or ERANGE. As many of the FORTRAN intrinsic functions use the routines found in the Math Library, the same conventions apply. - 2- A64L(3C) A64L (3C) NAME a641, l64a - convert between long integer and base-64 ASCII string SYNOPSIS long a641 (s) char .s; char .164a 0) long I; DESCRIPTION These functions are used to maintain numbers stored in base-64 ASC II characters. This is a notation by which long integers can be represented by up to six characters; each character represents a "digit" in a radix-64 notation. The characters used to represent "digits" are. for 0, / for I, 0 through 9 for 2-11, A through Z for 12-37, and a through z for 38-63. A641 takes a pointer to a null-terminated base-64 representation and returns a corresponding long value. If the string pointed to by s contains more than six characters, a641 will use the first six. L64a takes a long argument and returns a pointer to the corresponding base-64 representation. If the argument is 0, 164a returns a pointer to a null string. BUGS The value returned by 164a is a pointer into a static buffer, the contents of which are overwritten by each call. - 1- ABORT(3C) ABORT(3C) NAME abort - generate an lOT fault SYNOPSIS int abort ( ) DESCRIPTION Abort causes an lOT signal to be sent to the process. This usually results in termination with a core dump. It is possible for abort to return control if SIGIOT is caught or ignored, in which case the value returned is that of the kill(2) system call. SEE ALSO adb(l), exit(2), kill(2), signal(2). DIAGNOSTICS If SIGIOT is neither caught nor ignored, and the current directory is writable, a core dump is produced and the message "abort - core dumped" is written by the shell. - 1- i ABORT(3F) ABORT(3F) NAME abort - terminate Fortran program SYNOPSIS call abort ( ) DESCRIPTION Abort terminates the program which calls it, closing all open files truncated to the current position of the file pointer. DIAGNOSTICS When invoked, abort prints "Fortran abort routine called" on the standard error output. SEE ALSO abort(3C). - I - ABS(3C) ABS(3C) NAME abs - return integer absolute value SYNOPSIS int abs G) int i; DESCRIPTION Abs returns the absolute value of its integer operand. BUGS In two's-complement representation, the absolute value of the negative integer with largest magnitude is undefined. Some implementations trap this error, but others simply ignore it. SEE ALSO ftoorqM). - 1- ABS (3F) ABS OF) NAME abs, iabs, dabs, cabs, zabs - Fortran absolute value SYNOPSIS integer it, i2 real rt, r2 double precision dpt, dp2 complex cxt, cx2 double complex dxt, dx2 r2 abs(rt) i2 i2 iabsGt) absGt) dp2 dp2 dabs(dpt) abs(dpt) cx2 cx2 cabs(cxt) abs(cxt) dx2 dx2 zabs(dxt) abs(dxt) DESCRIPTION Abs is the family of absolute value functions. labs returns the integer absolute value of its integer argument. Dabs returns the double-precision absolute value of its double-precision argument. Cabs returns the complex absolute value of its complex argument. Zabs returns the double-complex absolute value of its double-complex argument. The generic form abs returns the type of its argument. SEE ALSO floor(3M} . I - 1- ACOS(3F) ACOS(3F) NAME acos, dacos - Fortran arccosine intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 = acos(rt) dp2 = dacos(dpt) dp2 = acos(dpt) DESCRIPTION Acos returns the real arccosine of its real argument. Dacos returns the double-precision arccosine of its double-precision argument. The generic form acos may be used with impunity as its argument will determine the type of the returned val ue. SEE ALSO trig(3M). I - 1- AIMAG(3F) AIMAG (3F) NAME aimag, dimag - Fortran imaginary part of complex argument SYNOPSIS real r complex cxr double precision dp double complex cxd r = aimag(cxr> dp = dimag(cxd) DESCRIPTION Aimag returns the imaginary part of its single-precision complex argument. Dimag returns the double-precision imaginary part of its double-complex argu- ment. I - 1- AINT(3F) AINT(3F) NAME aint, dint - Fortran integer part intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 dp2 dp2 = aintCrt> = dint(dpt> = aint(dpt> DESCRIPTION Aint returns the truncated value of its real argument in a real. Dint returns the truncated value of its double-precision argument as a double-precision value. Aint may be used as a generic function name, returning either a real or double-precision value depending on the type of its argument. I - 1- ASIN(3F) ASIN (3F) NAME asin, dasin - Fortran arcsine intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 = asin(rl) dp2 dp2 = = dasin(dpl) asin(dpl) DESCRIPTION Asin returns the real arcsine of its real argument. Dasin returns the doubleprecision arcsine of its double-precision argument. The generic form asin may be used with impunity as it derives its type from that of its argument. SEE ALSO trig(3M). I - 1- ASSERT(3X) ASSERT(3X) NAME assert - verify program assertion SYNOPSIS #include < assert.h > assert (expression) int expression; DESCRIPTION This macro is useful for putting diagnostics into programs. When it is executed, if expression is false (zero), assert prints "Assertion failed: expression, file xyz, line nnn" on the standard error output and aborts. In the error message, xyz is the name of the source file and nnn the source line number of the assert statement. Compiling with the preprocessor option -DNDEBUG (see cpp (1», or with the preprocessor control statement "#define NDEBUG" ahead of the "#include " statement, will stop assertions from being compiled into the program. SEE ALSO cpp(l), abort(3C). I - 1- ATAN(3F) ATAN(3F) NAME atan, datan - Fortran arctangent intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 = atan(rt) dp2 = datan(dpt) dp2 = atan(dpt) DESCRIPTION Atan returns the real arctangent of its real argument. Datan returns the double-precision arctangent of its double-precision argument. The generic form atan may be used with a double-precision argument returning a doubleprecision value. SEE ALSO trig(3M). I - 1- ATAN2(3F) ATAN2(3F) NAME atan2, datan2 - Fortran arctangent intrinsic function SYNOPSIS real rl, r2, r3 double precision dpl, dp2, dp3 r3 = atan2(rl, r2) dp3 dp3 = = datan2(dpl, dp2) atan2(dpl, dp2) DESCRIPTION Atan2 returns the arctangent of argJ /arg2 as a real value. Datan2 returns the double-precision arctangent of its double-precision arguments. The generic form atan2 may be used with impunity with double-precision arguments. SEE ALSO trig(3M). I - 1- ATOF(3C) ATOF(3C) NAME atof - convert ASCII string to floating-point number SYNOPSIS double atof (nptr) char *nptr; DESCRIPTION AID! converts a character string pointed to by nplr to a double-precision floating-point number. The first unrecognized character ends the conversion. AID! recognizes an optional string of white-space characters, then an optional sign, then a string of digits optionally containing a decimal point, then an optional e or E followed by an optionally signed integer. If the string begins with an unrecognized character, aID! returns the value zero. DIAGNOSTICS When the correct value would overflow, aID! returns HUGE, and sets errno to ERANGE. Zero is returned on underflow. SEE ALSO scanf(3S). - 1- BESSEL(3M) BESSEL (3M) NAME jO, j 1, jn, yO, y 1, yn - Bessel functions SYNOPSIS #include < math.h > double jO (x) double x; double j 1 (x) double x; double jn (n, x) int n; double x; double yO (x) double x; double y 1 (x) double x; double yn (n, x) int n; double x; DESCRIPTION JO and j 1 return Bessel functions of x of the first kind of orders 0 and 1 respectively. In returns the Bessel function of x of the first kind of order n. YO and y 1 return the Bessel functions of x of the second kind of orders 0 and 1 respectively. Yn returns the Bessel function of x of the second kind of order n. The value of x must be positive. DIAGNOSTICS Non-positive arguments cause yO, yJ and yn to return the value HUGE and to set ermo to EDOM. They also cause a message indicating DOMAIN error to be printed on the standard error output; the process will continue. These error-handling matherr(3M). procedures may SEE ALSO matherr(3M) . - 1- be changed with the function BOOL(3F) BOOL(3F) NAME and, or, xor, not, lshift, rshift - Fortran bitwise boolean functions SYNOPSIS integer i, j, k real a, b, c double precision dpl, dp2, dp3 k = andO, j) c = or(a, b) j = xorO, a) j = notO) k = IsbiftO, j) k = rsbiftO, j) DESCRIPTION The generic intrinsic boolean functions and, or and xor return the value of the binary operations on their arguments. Not is a unary operator returning the one's complement of its argument. Lshift and rshift return the value of the first argument shifted left or right, respectively, the number of times specified by the second (integer) argument. The boolean functions are generic, that is, they are defined for all data types as arguments and return values. Where required, the compiler will generate appropriate type conversions. NOTE Although defined for all data types, use of boolean functions on any but integer data is bizarre and will probably result in unexpected consequences. BUGS The implementation of the shift functions may cause large shift values to deliver weird results. - 1- BSEARCH (3C) BSEARCH(3C) NAME bsearch - binary search SYNOPSIS char .bsearch «char .) key, (char .) base, nel, sizeof (.key), compar) unsigned nel; int (.compar) ( ); DESCRIPTION Bsearch is a binary search routine generalized from Knuth (6.2.1) Algorithm B. It returns a pointer into a table indicating where a datum may be found. The table must be previously sorted in increasing order according to a provided comparison function. Key points to the datum to be sought in the table. Base points to the element at the base of the table. Nel is the number of elements in the table. Compar is the name of the comparison function, which is called with two arguments that point to the elements being compared. The function must return an integer less than, equal to, or greater than zero according as the first argument is to be considered less than, equal to, or greater than the second. DIAGNOSTICS A NULL pointer is returned if the key cannot be found in the table. NOTES The pointers to the key and the element at the base of the table should be of type pointer-to-element, and cast to type pointer-to-character. The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared. Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. SEE ALSO Isearch(3C), hsearch(3C), qsort(3C), tsearch(3C). - 1- CLOCK(3C) CLOCK(3C) NAME clock - report CPU time used SYNOPSIS long clock ( ) DESCRIPTION Clock returns the amount of CPU time On microseconds) used since the first call to clock. The time reported is the sum of the user and system times of the calling process and its terminated child processes for which it has executed wait (2) or system (3S) . The resolution of the clock is 10 milliseconds on Western Electric 3B processors, 16.667 milliseconds on Digital Equipment Corporation processors. SEE ALSO times (2), wait (2), system (3S). BUGS The value returned by clock is defined in microseconds for compatibility with systems that have CPU clocks with much higher resolution. Because of this, the value returned will wrap around after accumulating only 2147 seconds of CPU time (about 36 minutes). - 1- CONJG(3F) CONJG(3F) NAME conjg, dconjg - Fortran complex conjugate intrinsic function SYNOPSIS complex cxt, cx2 double complex dxt, dx2 cx2 = conjg(cxt) dx2 = dconjg(dxt) DESCRIPTION Conjg returns the complex conjugate of its complex argument. Dconjg returns the double-complex conjugate of its double-complex argument. - 1- CONV(JC) CONV(3C) NAME toupper, tolower, _toupper, _tolower, toascii - translate characters SYNOPSIS < ctype.h > iot toupper (d #ioclude iot c·, iot tolower (d iot c·, iot _toupper (d iot c; iot tolower (d iot c; iot toascii (d iot c·, DESCRIPTION Toupper and to lower have as domain the range of getc (3S): the integers from -1 through 255. If the argument of toupper represents a lower-case letter, the result is the corresponding upper-case letter. If the argument of tolower represents an upper-case letter, the result is the corresponding lower-case letter. All other arguments in the domain are returned unchanged. _toupper and _tolower are macros that accomplish the same thing as toupper and tolower but have restricted domains and are faster. _toupper requires a lower-case letter as its argument; its result is the corresponding upper-case letter. _tolower requires an upper-case letter as its argument; its result is the corresponding lower-case letter. Arguments outside the domain cause undefined results. Toascii yields its argument with all bits turned off that are not part of a standard ASCII character; it is intended for compatibility with other systems. SEE ALSO ctype (3C), getc (3S) . - 1- cos (3F) COS(3F) NAME cos, dcos, ccos - Fortran cosine intrinsic function SYNOPSIS real rt, r2 double precision dpt, dp2 complex cxt, cx2 r2 = cos(r1) dp2 dp2 dcos (dp 1) cos (dp 1) cx2 cx2 ccos(cx1) cos (cx1) DESCRIPTION Cos returns the real cosine of its real argument. Dcos returns the doubleprecision cosine of its double-precision argument. Ccos returns the complex cosine of its complex argument. The generic form cos may be used with impunity as its returned type is determined by that of its argument. SEE ALSO trig(3M). - 1- COSH(3F) COSH(3F) NAME cosh, dcosh - Fortran hyperbolic cosine intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 = cosb(r 1) dp2 = dcosb(dp 1) dp2 = cosb(dpt) DESCRIPTION Cosh returns the real hyperbolic cosine of its real argument. Dcosh returns the double-precision hyperbolic cosine of its double-precision argument. The generic form cosh may be used to return the hyperbolic cosine in the type of its argument. SEE ALSO sinh(3M). - 1- CRYPT(3C) CRYPT(3C) NAME crypt, setkey, encrypt - generate DES encryption SYNOPSIS char -crypt (key, salt) char -key, -salt; void setkey (key) char -key; void encrypt (block, edflag) char -block; int edflag; . DESCRIPTION Crypt is the password encryption function. It is based on the NBS Data Encryption Standard (DES), with variations intended (among other things) to frustrate use of hardware implementations of the DES for key search. Key is a user's typed password. Salt is a two-character string chosen from the set [a-zA-ZO-9./1; this string is used to perturb the DES algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeatedly a constant string. The returned value points to the encrypted password. The first two characters are the salt itself. The set key and encrypt entries provide (rather primitive) access to the actual DES algorithm. The argument of setkey is a character array of length 64 containing only the characters with numerical value 0 and 1. If this string is divided into groups of 8, the low-order bit in each group is ignored; this gives a 56-bit key which is set into the machine. This is the key that will be used with the above mentioned algorithm to encrypt or decrypt the string block with the function encrypt. The argument to the encrypt entry is a character array of length 64 containing only the characters with numerical value 0 and 1. The argument array is modified in place to a similar array representing the bits of the argument after having been subjected to the DES algorithm using the key set by set key . If edflag is zero, the argument is encrypted; if non-zero, it is decrypted. SEE ALSO 10gin(1), passwd(t), getpass(3C), passwd(4). BUGS The return value points to static data that are overwritten by each call. - 1- CTERMID OS) CTERMID (3S) NAME ctermid - generate file name for terminal SYNOPSIS #include < stdio.h > char .ctermid (s) char ·s; DESCRIPTION Ctermid generates the path name of the controlling terminal for the current process, and stores it in a string. If s is a NULL pointer, the string is stored in an internal static area, the contents of which are overwritten at the next call to ctermid, and the address of which is returned. Otherwise, s is assumed to point to a character array of at least L_ctermid elements; the path name is placed in this array and the value of s is returned. The constant L_ctermid is defined in the header file. NOTES The difference between ctermid and ttyname (3C) is that ttyname must be handed a file descriptor and returns the actual name of the terminal associated with that file descriptor, while ctermid returns a string (/dev/tty) that will refer to the terminal if used as a file name. Thus ttyname is useful only if the process already has at least one file open to a terminal. SEE ALSO ttyname(3C). - 1- CTIMEOC) CTIMEOC) NAME ctime, localtime, gmtime, asctime, tzset - convert date and time to string SYNOPSIS #include < time.h > char .ctime (clock) long ·clock; struct tm .Iocaltime (clock) long .clock; struct tm .gmtime (clock) long • clock; char .asctime header file. The structure declaration is: struct tm { int tm sec; /. seconds (0 - 59) ./ int tm-min; /. minutes (0 - 59) ./ int tm-hour; /. hours (0 - 23) ./ int tm=mday; /. day of month (t - 31) ./ int tm_mon; /. month of year (0 - 11) ./ int tmj'ear; /. year - 1900 ./ int tm_wday; /. day of week (Sunday = 0) ./ int tmj'day; /. day of year (0 - 365) ./ int tmJsdst; }; Tm_isdst is non-zero if Daylight Savings Time is in effect. The external long variable timezone contains the difference, in seconds, between GMT and local standard time Gn EST, timezone is 5.60.60); the external variable daylight is non-zero if and only if the standard U.S.A. Daylight Savings Time conversion should be applied. The program knows about the peculiarities of this conversion in 1974 and 1975; if necessary, a table for these years can be extended. If an environment variable named TZ is present, asctime uses the contents of the variable to override the default time zone. The value of TZ must be a - 1- CTIME(3C) CTIMEOC) three-letter time zone name, followed by a number representing the difference between local time and Greenwich Mean Time in hours, followed by an optional three-letter name for a daylight time zone. For example, the setting for New Jersey would be EST5EDT. The effects of setting TZ are thus to change the values of the external variables timezone and daylight; in addition, the time zone names contained in the external variable char .tzname[2] == { "EST", "EDT" }; are set from the environment variable TZ. The function tzset sets these external variables from TZ; tzset is called by asctime and may also be called explicitly by the user. Note that in most installations, TZ is set by default when the user logs on, to a value in the local/etc/profile file (see profile (4)). SEE ALSO time(2), getenv(3C), profile (4) , environ (5). BUGS The return values point to static data whose content is overwritten by each call. - 2- CTYPE(3C) CTYPE(3C) NAME isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii - classify characters SYNOPSIS #include < ctype.b > int isalpba (c) int c; DESCRIPTION These macros classify character-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. Isascii is defined on all integer values; the rest are defined only where isascii is true and on the single non-ASCII value EOF (-1 - see stdio (3S». isalpha is upper c is a letter. c is an upper-case letter. is lower c is a lower-case letter. isdigit c is a digit [0-9]. isxdigit c is a hexadecimal digit [0-9], [A-F] or [a-f1. isalnum c is an alphanumeric (letter or digit). isspace c is a space, tab, carriage return, new-line, vertical tab, or form-feed. ispunct c is a punctuation alphanumeric) . isprint c is a printing character, code 040 (space) through 0176 (tilde) . isgraph c is a printing character, like isprint except false for space. iscntrl c is a delete character (0177) or an ordinary control character Cless than 040). isascii c is an ASCII character, code less than 0200. character (neither control nor DIAGNOSTICS If the argument to any of these macros is not in the domain of the function, the result is undefined. SEE ALSO ascii(5) . - 1- CUSERID OS) CUSERID (3S) NAME cuserid - get character login name of the user SYNOPSIS #include < stdio.b > cbar .cuserid (s) char .s; DESCRIPTION Cuserid generates a character-string representation of the login name of the owner of the current process. If s is a NULL pointer, this representation is generated in an internal static area, the address of which is returned. Otherwise, s is assumed to point to an array of at least L_cuserid characters; the representation is left in this array. The constant L_cuserid is defined in the header file. DIAGNOSTICS If the login name cannot be found, cuserid returns a NULL pointer; if NULL pointer, a null character <\0) will be placed at s [OJ. SEE ALSO getlogin (3C), getpwent (3C). - 1- s is not a DIAL(3C) DIAL(3C) NAME dial - establish an out-going terminal line connection SYNOPSIS #include < dial.h > int dial {can> CALL • call; void undial (fd) int fd; DESCRIPTION Dial returns a file-descriptor for a terminal line open for read/write. The argument to dial is a CALL structure (defined in the header file. When finished with the terminal line, the calling program must invoke undial to release the semaphore that has been set during the allocation of the terminal device. The CALL typedef in the typedef struct { struct termio int int char char int < dial.h > header file is: *attr; baud; speed; .line; *telno; modem; /* /* /* /* /* /* pointer to termio attribute struct */ transmission data rate */ 212A modem: low=300, high=1200 */ device name for out-going line */ pointer to tel-no digits string */ specify modem control for direct lines */ } CALL; The CALL element speed is intended only for use with an outgoing dialed call, in which case its value should be either 300 or 1200 to identify the 113A modem, or the high or low speed setting on the 212A modem. The CALL element baud is for the desired transmission baud rate. For example, one might set baud to 110 and speed to 300 (or 1200). If the desired terminal line is a direct line, a string pointer to its device-name should be placed in the line element in the CALL structure. Legal values for such terminal device names are kept in the L-devices file. In this case, the value of the baud element need not be specified as it will be determined from the L-devices file. The telno element is for a pointer to a character string representing the telephone number to be dialed. Such numbers may consist only of symbols described on the acu (7). The termination symbol will be supplied by the dial function, and should not be included in the telno string passed to dial in the CALL structure. The CALL element modem is used to specify modem control for direct lines. This element should be non-zero if modem control is required. The CALL element attr is a pointer to a termio structure, as defined in the termio.h header file. A NULL value for this pointer element may be passed to the dial function, but if such a structure is included, the elements specified in it will be set for the outgoing terminal line before the connection is established. This is often important for certain attributes such as parity and baud-rate. FILES /usr /lib/uucp/L-devices /usr/spool/uucp/LCK .. tty-device SEE ALSO u ucp ( 1C), alarm (2), read (2), wri te(2) . acu(7), termio(7) in the UNIX System Administrator's Manual. - 1- DIAL(3C) DJAL(3C) DIAGNOSTICS On failure, a negative value indicating the reason for the failure will be returned. Mnemonics for these negative indices as listed here are defined in the header file. INTRPT D_HUNG NO_ANS ILL BD A_PROB L_PROB NO_Ldv DV NT A DV NT K NO_BD_A NO_BD_K -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 /* /* /* /* /* /* /* /* /* /* /* interrupt occured */ dialer hung (no return from write) *j no answer within 10 seconds */ illegal baud-rate */ acu problem (open 0 failure) */ line problem (openO failure) */ can't open LDEVS file */ requested device not available *j requested device not known */ no device available at requested baud */ no device known at requested baud *j WARNINGS Including the header file automatically includes the header file. The above routine uses < stdio.h > , which causes it to increase the size of programs, not otherwise using standard 110, more than might be expected. BUGS An alarm (2) system call for 3600 seconds is made (and caught) within the dial module for the purpose of "touching" the LCK.. file and constitutes the device allocation semaphore for the terminal device. Otherwise, uucp(IC) may simply delete the LCK.. entry on its 90-minute clean-up rounds. The alarm may go off while the user program is in a read(2) or write(2) system call, causing an apparent error return. If the user program expects to be around for an hour or more, error returns from reads should be checked for (errno = = EINTR), and the read possibly reissued. - 2 - DRAND48 (3C) DRAND480C) NAME drand48, erand48, Irand48, nrand48, mrand48, jrand48, srand48, seed48, lcong48 - generate uniformly distributed pseudo-random numbers SYNOPSIS double drand48 ( ) double erand48 (xsubi) unsigned short xsubil31; long Irand48 ( ) long nrand48 (xsubi) unsigned short xsubi[31; long mrand48 ( ) long jrand48 (xsubi) unsigned short xsubil31; void srand48 (seedvaO long seedval; unsigned short .seed48 (seed16v) unsigned short seed16v[31; void Icong48 (param) unsigned short param[7]; DESCRIPTION This family of functions generates pseudo-random numbers using the wellknown linear congruential algorithm and 48-bit integer arithmetic. Functions drand48 and erand48 return non-negative double-precision fioatingpoint values uniformly distributed over the interval [0.0, 1.0). Functions lrand48 and nrand48 return non-negative long integers uniformly distributed over the interval [0, 2 31 ). Functions mrand48 and jrand48 return signed long integers uniformly distributed over the interval [-2 31, 231). Functions srand48, seed48 and lcong48 are initialization entry points, one of which should be invoked before either drand48, lrand48 or mrand48 is called. (Although it is not recommended practice, constant default initializer values will be supplied automatically if drand48, lrand48 or mrand48 is called without a prior call to an initialization entry point.) Functions erand48, nrand48 and jrand48 do not require an initialization entry point to be called first. All the routines work by generating a sequence of 48-bit integer values, Xi, according to the linear congruential formula n~O. 48 The parameter m = 2 ; hence 48-bit integer arithmetic is performed. Unless lcong48 has been invoked, the multiplier value a and the addend value care given by a = C = B 16 = 13 8, 5DEECE66D 16 = 273673163155 8 The value returned by any of the functions drand48, erand48, lrand48, nrand48, mrand48 or jrand48 is computed by first generating the next 48-bit Xi in the sequence. Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of Xi and transformed into the returned value. - 1- DRAND48 (3C) DRAND48 (3C) The functions drand48, lrand48 and mrand48 store the last 48-bit Xi generated in an internal buffer; that is why they must be initialized prior to being invoked. The functions erand48, nrand48 and jrand48 require the calling program to provide storage for the successive Xi values in the array specified as an argument when the functions are invoked. That is why these routines do not have to be initialized; the calling program merely has to place the desired initial value of Xi into the array and pass it as an argument. By using different arguments, functions erand48, nrand48 and jrand48 allow separate modules of a large program to generate several independent streams of pseudo-random numbers, i.e., the sequence of numbers in each stream will not depend upon how many times the routines have been called to generate numbers for the other streams. The initializer function srand48 sets the high-order 32 bits of Xi to the 32 bits contained in its argument. The low-order 16 bits of Xi are set to the arbitrary value 330E 16 . The initializer function seed48 sets the value of X j to the 48-bit value specified in the argument array. In addition, the previous value of X j is copied into a 48-bit internal buffer, used only by seed48, and a pointer to this buffer is the value returned by seed48. This returned pointer, which can just be ignored if not needed, is useful if a program is to be restarted from a given point at some future time - use the pointer to get at and store the last X j value, and then use this value to reinitialize via seed48 when the program is restarted. The initialization function lcong48 allows the user to specify the initial Xi, the multiplier value a, and the addend value c. Argument array elements paramfO-2] specify Xi' paramf3-5] specify the multiplier a, and paramf6] specifies the 16-bit addend c. After lcong48 has been called, a subsequent call to either srand48 or seed48 will restore the "standard" multiplier and addend values, a and c, specified on the previous page. NOTES The versions of these routines for the VAX-II and PDP-II are coded in assembly language for maximum speed. It requires approximately 80 Ilsec on a VAX-I1I780 and 130 Ilsec on a PDP-IInO to generate one pseudo-random number. On other computers, the routines are coded in portable C. The source code for the portable version can even be used on computers which do not have floating-point arithmetic. In such a situation, functions drand48 and erand48 do not exist; instead, they are replaced by the two new functions below. long irand48 (m) unsigned short m; long krand48 (xsubi, m) unsigned short xsubil31, m; Functions irand48 and krand48 return non-negative long integers uniformly distributed over the interval [0, m -I]. SEE ALSO rand(3C). - 2- ECVT(3C) ECVT(3C) NAME ecvt, fcvt, gcvt - convert floating-point number to string SYNOPSIS char .ecvt (value, ndigit, decpt, sign) double value; int ndigit, .decpt, .sign; char .fcvt (value, ndigit, decpt, sign) double value; int ndigit, .decpt, ·sign; char .gcvt (value, ndigit, buf) double value; char .buf; DESCRIPTION Ecvt converts value to a null-terminated string of ndigit digits and returns a pointer thereto. The low-order digit is rounded. The position of the decimal point relative to the beginning of the string is stored indirectly through decpt (negative means to the left of the returned digits). The decimal point is not included in the returned string. If the sign of the result is negative, the word pointed to by sign is non-zero, otherwise it is zero. Fcvt is identical to ecvt, except that the correct digit has been rounded for Fortran F-format output of the number of digits specified by ndigit. Gcvt converts the value to a null-terminated string in the array pointed to by buf and returns buf. It attempts to produce ndigit significant digits in Fortran F-format if possible, otherwise E-format, ready for printing. A minus sign, if there is one, or a decimal point will be included as part of the returned string. Trailing zeros are suppressed. SEE ALSO printf(3S) . BUGS The return values point to static data whose content is overwritten by each call. - 1- END(3C) END(3C) NAME end, etext, edata - last locations in program SYNOPSIS extern end; extern etext; extern edata; DESCRIPTION These names refer neither to routines nor to locations with interesting contents. The address of etext is the first address above the program text, edata above the initialized data region, and end above the uninitialized data region. When execution begins, the program break (the first location beyond the data) coincides with end, but the program break may be reset by the routines of brk (2), mallod3C), standard input/output (stdio OS», the profile (- p) option of edt), and so on. Thus, the current value of the program break should be determined by sbrk (0) (see brk (2» . SEE ALSO brk(2), mallocOC). - 1- ERF(3M) ERF(3M) NAME erf, erfc - error function and complementary error function SYNOPSIS #include < math.h > double erf (x) double x; double erfc (x) double x; DESCRIPTION Erf returns the error function of x, defined as -~ "7r x f e-t'dt. 0 Erfc, which returns 1.0 - erf{x} , is provided because of the extreme loss of relative accuracy if erf{x} is called for large x and the result subtracted from 1.0 (e.g. for x = 5, 12 places are lost). SEE ALSO exp(3M) . - 1- EXP(3F) EXP(3F) NAME exp, dexp, cexp - Fortran exponential intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 complex cxl, cx2 r2 = exp(rl) dp2 dp2 dexp(dpl) exp(dpI) cx2 cx2 clog(cxI) exp(cxI) DESCRIPTION Exp returns the real exponential function eX of its real argument. Dexp returns the double-precision exponential function of its double-precision argument. Cexp returns the complex exponential function of its complex argument. The generic function exp becomes a call to dexp or cexp as required, depending on the type of its argument. SEE ALSO exp(3M). - 1- EXP(3M) EXP(3M) NAME exp, log, 10gIO, pow, sqrt - exponential, logarithm, power, square root functions SYNOPSIS #include < math.h > double exp (x) double x; double log (x) double x; double loglO (x) double x; double pow (x, y) double x, y; double sqrt (x) double x; DESCRIPTION Exp returns eX. Log returns the natural logarithm of x. The value of x must be positive. LogJO returns the logarithm base ten of x. The value of x must be positive. Pow returns xY. The values of x and y may not both be zero. If x is nonpositive, y must be an integer. Sqrt returns the square root of x. The value of x may not be negative. DIAGNOSTICS Exp returns HUGE when the correct value would overflow, and sets errno to ERANGE. Log and logJO return 0 and set errno to EDOM when x is non-positive. An error message is printed on the standard error output. Pow returns 0 and sets errno to EDOM when x is non-positive and y is not an integer, or when x and yare both zero. In these cases a message indicating DOMAIN error is printed on the standard error output. When the correct value for pow would overflow, pow returns HUGE and sets errno to ERANGE. Sqrt returns 0 and sets errno to EDOM when x is negative. A message indicating DOMAIN error is printed on the standard error output. These error-handling mat herr (3 M) . procedures may SEE ALSO hypot(3M), matherr(3M), sinh(3M). - 1- be changed with the function FCLOSE(3S) FCLOSE(3S) NAME fclose, fflush - close or flush a stream SYNOPSIS #include < stdio.h > iot fclose (stream) FILE *stream; iot mush (stream) FILE *stream; DESCRIPTION Fc/ose causes any buffered data for the named stream to be written out, and the stream to be closed. Fc/ose is performed automatically for all open files upon calling exit (2). Fflush causes any buffered data for the named stream to be written to that file. The stream remains open. DIAGNOSTICS These functions return 0 for success, and EOF if any error (such as trying to write to a file that has not been opened for writing) was detected. SEE ALSO c1ose(2), exit (2), fopen (3S), setbuf(3S). I - 1- FERROR(3S) FERROR(3S) NAME ferror, feof, clearerr, fileno - stream status inquiries SYNOPSIS #indude < stdio.h > int feof (stream) FILE *stream; int ferror (stream) FILE *stream; void dearerr (stream) FILE *stream; int fileno (stream) FILE *stream; DESCRIPTION Feo! returns non-zero when EOF has previously been detected reading the named input stream, otherwise zero. Ferror returns non-zero when an I/O error has previously occurred reading from or writing to the named stream, otherwise zero. Clearerr resets the error indicator and EOF indicator to zero on the named stream. Fileno returns the integer file descriptor associated with the named stream; see open (2). NOTE All these functions are implemented as macros; they cannot be declared or redeclared. SEE ALSO open (2), fopen OS). I - 1- FLOOR(3M) FLOOR(3M) NAME floor, ceil, fmod, fabs - floor, ceiling, remainder, absolute value functions SYNOPSIS #include double floor (x) double x; double ceil (x) double x; double fmod (x, y) double x, y; double fabs (x) double x; DESCRIPTION Floor returns the largest integer (as a double-precision number) not greater than x. Ceil returns the smallest integer not less than x. Fmod returns x if y is zero, otherwise the number f with the same sign as x, such that x = iy + f for some integer i, and lfI < Iy I. Fabs returns Ix I. SEE ALSO abs(3C). - 1- FOPEN(3S) FOPEN(3S) NAME fopen, freopen, fdopen - open a stream , SYNOPSIS #include < stdio.h > FILE *fopen (file-name, type) char *file-name, *type; FILE *freopen (file-name, type, stream) char *file-name, *type; FILE *stream; FILE *fdopen (fildes, type) int fildes; char *type; DESCRIPTION Fopen opens the file named by file-name and associates a stream with it. Fopen returns a pointer to the FILE structure associated with the stream. File-name points to a character string that contains the name of the file to be opened. Type is a character string having one of the following values: "r" "w" open for reading truncate or create for writing "a" append; open for writing at end of file, or create for writing "r+" open for update (reading and writing) "w+" truncate or create for update "a+" append; open or create for update at end-of-file Freopen substitutes the named file in place of the open stream. The original stream is closed, regardless of whether the open ultimately succeeds. Freopen returns a pointer to the FILE structure associated with stream. Freopen is typically used to attach the preopened streams associated with stdin, stdout and stderr to other files. I Fdopen associates a stream with a file descriptor obtained from open, dup, creat, or pipe (2), which will open files but not return pointers to a FILE structure stream which are necessary input for many of the section 3S library routines. The type of stream must agree with the mode of the open file. When a file is opened for update, both input and output may be done on the resulting stream. However, output may not be directly followed by input without an intervening fseek or rewind, and input may not be directly followed by output without an intervening fseek, rewind, or an input operation which encounters end-of-file. When a file is opened for append (i.e., when type is "a" or "a+"), it is impossible to overwrite information already in the file. Fseek may be used to reposition the file pointer to any position in the file, but when output is written to the file the current file pointer is disregarded. All output is written at the end of the file and causes the file pointer to be repositioned at the end of the output. If two separate processes open the same file for append, each process may write freely to the file without fear of destroying output being written by the other. The output from the two processes will be intermixed in the file in the order in which it is written. SEE ALSO open (2), fclose OS) . - 1- FOPEN(3S) FOPENOS) DIAGNOSTICS Fopen and Jreopen return a NULL pointer on failure. I - 2- FREAD(3S) FREAD(JS) NAME fread, fwrite - binary input/output SYNOPSIS #include < stdio.h > int fread (ptr, size, nitems, stream) char ·ptr; int size, nitems; FILE .stream; int fwrite (ptr, size, nitems, stream) char .ptr; int size, nitems; FILE .stream; DESCRIPTION Fread copies, into an array beginning at ptr, nitems items of data from the named input stream, where an item of data is a sequence of bytes (not necessarily terminated by a null byte) of length size. Fread stops appending bytes if an end-of-file or error condition is encountered while reading stream, or if nitems items have been read. Fread leaves the file pointer in stream, if defined, pointing to the byte following the last byte read if there is one. Fread does not change the contents of stream. Fwrite appends at most nitems items of data from the the array pointed to by ptr to the named output stream. Fwrite stops appending when it has appended nitems items of data or if an error condition is encountered on stream. Fwrite does not change the contents of the array pointed to by ptr. The variable size is typically sizeof(.ptr) where the pseudo-function sizeof specifies the length of an item pointed to by ptr. If ptr points to a data type other than char it should be cast into a pointer to char. SEE ALSO read(2), write(2), fopen(3S), puts (3S), scanf(3S). I getc(3S), gets(3S), printf(3S), putc(3S), DIAGNOSTICS Fread and fwrite return the number of items read or written. If nitems is non-positive, no characters are read or written and 0 is returned by both fread and fwrite. - 1- FREXP(3C) FREXP(3C) NAME frexp, ldexp, modf - manipulate parts of floating-point numbers SYNOPSIS double frexp (value, eptr) double value; int .eptr; double ldexp (value, exp) double value; int exp; double modf (value, iptr) double value, ·iptr; DESCRIPTION Every non-zero number can be written uniquely as x. 2n, where the "mantissa" (fraction) x is in the range 0.5 ~ Ixl < 1.0, and the "exponent" n is an integer. Frexp returns the mantissa of a double value, and stores the exponent indirectly in the location pointed to by eptr. Ldexp returns the quantity value. 2exp . Mod! returns the signed fractional part of value and stores the integral part indirectly in the location pointed to by iptr. DIAGNOSTICS If ldexp would cause overflow, HUGE is returned and ermo is set to ERANGE. I - 1- F,SEEK(3S) FSEEK(3S) NAME fseek, rewind, ftell - reposition a file pointer in a stream SYNOPSIS #include < stdio.h > int fseek (stream, offset, ptrname) FILE .stream; long offset; int ptrname; void rewind (stream) FILE .stream; long ftell (stream) FILE .stream; DESCRIPTION Fseek sets the posItIon of the next input or output operation on the stream. The new position is at the signed distance offset bytes from the beginning, from the current position, or from the end of the file, according as ptrname has the value 0, 1, or 2. Rewind(stream) is equivalent to fseek(stream, OL, 0), except that no value is returned. Fseek and rewind undo any effects of ungetc(3S). After fseek or rewind, the next operation on a file opened for update may be either input or output. Ftell returns the offset of the current byte relative to the beginning of the file associated with the named stream. SEE ALSO lseek (2), fopen (3S). DIAGNOSTICS I Fseek returns non-zero for improper seeks, otherwise zero. An improper seek can be, for example, an fseek done on a file that has not been opened via Jopen; in particular, fseek may not be used on a terminal, or on a file opened via popen(3S). WARNING Although on the UNIX System an offset returned by ftell is measured in bytes, and it is permissible to seek to positions relative to that offset, portability to non-UNIX Systems requires that an offset be used by fseek directly. Arithmetic may not meaningfully be performed on such a offset, which is not necessarily measured in bytes. - 1- FTW(3C) FTw(3C) NAME ftw - walk a file tree SYNOPSIS #include < ftw.h > int ftw (path, fn, depth) char *path; int (*fn) ( ); int depth; DESCRIPTION Ftw recursively descends the directory hierarchy rooted in path. For each object in the hierarchy, ftw calls In, passing it a pointer to a null-terminated character string containing the name of the object, a pointer to a stat structure {see stat containg information about the object, and an integer. Possible values of the integer, defined in the header file, are FTW _F for a file, FTW _D for a directory, FTW _DNR for a directory that cannot· be read, and FTW _NS for an object for which stat could not successfully be executed. If the integer is FTW _DNR, descendants of that directory will not be processed. If the integer is FTW _NS, the stat structure will contain garbage. An example of an object that would cause FTW _NS to be passed to In would be a file in a directory with read but without execute (search) permission. (2» Ftw visits a directory before visiting any of its descendants. The tree traversal continues until the tree is exhausted, an invocation of fn returns a nonzero value, or some error is detected within ftw (such as an 110 error). If the tree is exhausted, ftw returns zero. If fn returns a nonzero value, ftw stops its tree traversal and returns whatever value was returned by In. If ftw detects an error, it returns -1, and sets the error type in errno. Ftw uses one file descriptor for each level in the tree. The depth argument limits the number of file descriptors so used. If depth is zero or negative, the effect is the same as if it were 1. Depth must not be greater than the number of file descriptors currently available for use. Ftw will run more quickly if depth is at least as large as the number of levels in the tree. SEE ALSO stat (2), malloC(3C). BUGS Because ftw is recursive, it is possible for it to terminate with a memory fault when applied to very deep file structures. It could be made to run faster and use less storage on deep structures at the cost of considerable complexity. Ftw uses malloc(3C) to allocate dynamic storage during its operation. If ftw is forcibly terminated, such as by /ongjmp being executed by fn or an interrupt routine, ftw will not have a chance to free that storage, so it will remain permanently allocated. A safe way to handle interrupts is to store the fact that an interrupt has occurred, and arrange to have fn return a nonzero value at its next invocation. - 1- I FTYPE(3F) FTYPE(3F) NAME int, ifix, idint, real, float, sngl, dble, cmplx, dcmplx, ichar, char - explicit Fortran type conversion SYNOPSIS integer i, j real r, s double precision dp, dq complex cx double complex dcx character* 1 ch int(r) int(dp) int(cx) int(dcx) ifix(r) idint(dp) r = real(i) real (dp) r reaI(cx) r r = real (dcx) r = ftoat(j) r = sngl(dp) I dp dp dp dp dbleO) dble(r) dble(cx) dble(dcx) cx cx cx cx cx cx cx cmplx(i) cmplxO, j) cmplx(r) cmplx(r, s) cmplx(dp) cmplx (dp, dq) cmplx(dcx) dcx dcx dcx dcx dcx dcx dcx dcmplx(i) dcmplx 0, j) dcmplx(r) dcmplx(r, s) dcmplx(dp) dcmplx (dp, dq) dcmplx(cx) i = ichadch) ch = char (i) DESCRIPTION These functions perform conversion from one data type to another. int converts to integer form its real, double precision, complex, or double complex argument. If the argument is real or double precision, int returns the integer whose magnitude is the largest integer that does not exceed the magnitude of the argument and whose sign is the same as the sign of the argument (i.e. truncation). For complex types, the above rule is applied to the real part. ifix and idiot convert only real and double precision arguments respectively. real converts to real form an integer, double precision, complex, or double complex argument. If the argument is double precision or double complex, as - 1- FTYPE(3F) FTYPE(3F) much preclSlon is kept as is possible. If the argument is one of the complex types, the real part is returned. float and sngl convert only integer and double precision arguments respectively. dble converts any integer, real, complex, or double complex argument to double precision form. If the argument is of a complex type, the real part is returned. cmplx converts its integer, real, double precision, or double complex argument (s) to complex form. dcmplx converts to double complex form its integer, real, double precision, or complex argument (s) . Either one or two arguments may only one argument, it is taken as ginary part of zero is supplied. If as the real part and the second as be supplied to cmplx and dcmplx . If there is the real part of the complex type and a imatwo arguments are supplied, the first is taken the imaginary part. ichar converts from a character to an integer depending on the character's position in the collating sequence. char returns the character in the ith position in the processor collating sequence where i is the supplied argument. For a processor capable of representing n characters, ichar(char(i» = i for 0 <= i < n, and char(ichar(ch» = ch for any representable character ch. I - 2- GAMMA(3M) GAMMA(3M) NAME gamma - log gamma function SYNOPSIS #include extern iot signgam; double gamma (x) double x; DESCRIPTION Gamma returns In LOGHUGE) errore); y = signgam * exp(y); where LOGHUGE is the least value that causes exp (3M) to return a range error. DIAGNOSTICS For non-negative integer arguments HUGE is returned, and ermo is set to EDOM. A message indicating DOMAIN error is printed on the standard error output. If the correct value would overflow, gamma returns HUGE and sets ermo to ERANGE. These error-handling matherr (3M). procedures may SEE ALSO exp(3M), matherr(3M). I - 1- be changed with the function GETARG(3F) GETARG(3F) NAME getarg - return Fortran command-line argument SYNOPSIS character· N c integer i getarg (i, c) DESCRIPTION Getarg returns the i-th command-line argument of the current process. Thus, if a program were invoked via foo arg 1 arg2 arg3 getarg(2, c) would return the string "arg2" in the character variable c. SEE ALSO getopt (3C). I - 1- GETC(3S) GETC(3S) NAME getc, getchar, fgetc, getw - get character or word from stream SYNOPSIS #include < stdio.h > int getc (stream) FILE -stream; int getchar () int fgetc (stream) FILE -stream; int getw (stream) FILE -stream; DESCRIPTION Getc returns the next character (i.e. byte) from the named input stream. It also moves the file pointer, if defined, ahead one character in stream. Getc is a macro and so cannot be used if a function is necessary; for example one cannot have a function pointer point to it. Getchar returns the next character from the standard input stream, stdin. As in the case of getc, getchar is a macro. Fgetc performs the same function as getc, but is a genuine function. Fgetc runs more slowly than getc, but takes less space per invocation. Getw returns the next word (i.e. integer) from the named input stream. The size of a word varies from machine to machine. It returns the constant EOF upon end-of-file or error, but as that is a valid integer value, feof and ferror (3S) should be used to check the success of getw. Getw increments the associated file pointer, if defined, to point to the next word. Getw assumes no special alignment in the file. SEE ALSO fclose(3S), ferror(3S), fopen(3S), fread(3S), gets(3S), putc(3S), scanf(3S). DIAGNOSTICS These functions return the integer constant EOF at end-of-file or upon an error. I BUGS Because it is implemented as a macro, getc treats incorrectly a stream argument with side effects. In particular, getc(-f++) doesn't work sensibly. Fgetc should be used instead. Because of possible differences in word length and byte ordering, files written using putw are machine-dependent, and may not be read using getw on a different processor. - 1- GETCWD(3C) GETCWD(3C) NAME getcwd - get path-name of current working directory SYNOPSIS char .getcwd (buf, size) char ·buf; int size; DESCRIPTION Getcwd returns a pointer to the current directory path-name. The value of size must be at least two greater than the length of the path-name to be returned. If buf is a NULL pointer, getcwd will obtain size bytes of space using maUoc OC). In this case, the pointer returned by getcwd may be used as the argument in a subsequent call to free. The function is implemented by using popen OS) to pipe the output of the pwd (I) command into the specified string space. EXAMPLE char *cwd, *getcwd 0; if «cwd = getcwd«char *)NULL, 64» == NULL) perror("pwd"); exit (1); printf("%s\n", cwd); SEE ALSO pwd(l), mallocOC), popenOS). DIAGNOSTICS Returns NULL with ermo set if size is not large enough, or if an error ocurrs in a lower-level function. - 1- GETENV(3C) GETENv(3C) NAME getenv - return value for environment name SYNOPSIS char .getenv (name) char .name; DESCRIPTION Getenv searches the environment list (see environ (5» for a string of the form name = value, and returns a pointer to the value in the current environment if such a string is present, otherwise a NULL pointer. SEE ALSO environ (5) . - 1- GETENV(3F) GETENV(3F) NAME getenv - return Fortran environment variable SYNOPSIS character. N c getenv(-TMPDIR-, c) DESCRIPTION Getenv returns the character-string value of the environment variable represented by its first argument into the character variable of its second argument. If no such environment variable exists, all blanks will be returned. SEE ALSO getenv(3C), environ(S). - 1- GETGRENT(3C) GETGRENT(3C) NAME getgrent, getgrgid, getgrnam, setgrent, endgrent - get group file entry SYNOPSIS #include < grp.h > struct group *getgrent ( ) struct group *getgrgid (gid) int gid; struct group *getgrnam (name) char *name; void setgrent ( ) void endgrent ( ) DESCRIPTION Getgrent, getgrgid and getgrnam each return pointers to an object with the following structure containing the broken-out fields of a line in the fetcfgroup file. Each line contains a "group" structure, defined in the header file. struct group { char ·gr_name; .gryasswd; char int gr--.8id; **gr_mem; char }; f. f. f· /. the name of the group ./ the encrypted group password ./ the numerical group ID ./ vector of pointers to member names ./ Getgrent when first called returns a pointer to the first group structure in the file; thereafter, it returns a pointer to the next group structure in the file; so, successive calls may be used to search the entire file. Getgrgid searches from the beginning of the file until a numerical group id matching gid is found and returns a pointer to the particular structure in which it was found. Getgrnam searches from the beginning of the file until a group name matching name is found and returns a pointer to the particular structure in which it was found. If an end-of-file or an error is encountered on reading, these functions return a NULL pointer. I A call to setgrent has the effect of rewinding the group file to allow repeated searches. Endgrent may be called to close the group file when processing is complete. FILES /etc/group SEE ALSO getlogin(3C), getpwent(3C), group(4). DIAGNOSTICS A NULL pointer is returned on EOF or error. WARNING The above routines use , which causes them to increase the size of programs, not otherwise using standard 110, more than might be expected. BUGS All information is contained in a static area, so it must be copied if it is to be saved. - 1- GETLOGIN (3C) G ETLOG IN (3C) NAME getlogin - get login name SYNOPSIS char .getlogin ( ); DESCRIPTION Getlogin returns a pointer to the login name as found in /etc/utmp. It may be used in conjunction with getpwnam to locate the correct password file entry when the same user ID is shared by several login names. If getlogin is called within a process that is not attached to a terminal, it returns a NULL pointer. The correct procedure for determining the login name is to call cuserid, or to call get login and if it fails to call getpwuid. FILES /etc/utmp SEE ALSO cuserid(3S), getgrent(3C), getpwent(3C), utmp(4). DIAGNOSTICS Returns the NULL pointer if name not found. BUGS The return values point to static data whose content is overwritten by each call. - 1- GETOPT(3C) GETOPT(3C) NAME getopt - get option letter from argument vector SYNOPSIS int getopt (argc, argv, optstring) int argc; char .. argv; char .optstring; extern char .optarg; extern int optind; DESCRIPTION Getopt returns the next option letter in argv that matches a letter in optstring. Optstring is a string of recognized option letters; if a letter is followed by a colon, the option is expected to have an argument that mayor may not be separated from it by white space. Optarg is set to point to the start of the option argument on return from getopt. Getopt places in optind the argv index of the next argument to be processed. Because optind is external, it is normally initialized to zero automatically before the first call to get opt. When all options have been processed {i.e., up to the first non-option argument}, getopt returns EOF. The special option - - may be used to delimit the end of the options; EOF will be returned, and - - will be skipped. DIAGNOSTICS Getopt prints an error message on stderr and returns a question mark (?) when it encounters an option letter not included in optstring. WARNING The above routine uses < stdio.h > , which causes it to increase the size of programs, not otherwise using standard I/O, more than might be expected. EXAMPLE I The following code fragment shows how one might process the arguments for a command that can take the mutually exclusive options a and b, and the options f and 0, both of which require arguments: main (argc, argv) int argc; char uargv; { int c; extern int optind; extern char *optarg; while «c = get opt (argc, argv, "abf:o:"» switch (c) { case 'a': if (bflg) errflg++; else aflg++; break; case 'b': if (aflg) errflg++; else bproc( ); - 1- != EOF) GETOPT(3C) GETOPT(3C) break; case 'f': ifile = optarg; break; case '0': ofile = optarg; bufsiza = 512; break; case '?': errflg++; } if (errflg) fprintf (stderr, "usage: . . . "); exit (2); for ; optind < argc; optind++) { if (access (argv[optindl, 4» SEE ALSO getopt(1). - 2- GETPASS (3C) GETPASS (3C; NAME get pass - read a password SYNOPSIS char .getpass (prompt> char ·prompt; DESCRIPTION Getpass reads up to a newline or EOF from the file /dev/tty, after prompting on the standard error output with the null-terminated string prompt and disabling echoing. A pointer is returned to a null-terminated string of at most 8 characters. If /dev/tty cannot be opened, a NULL pointer is returned. An interrupt will terminate input and send an interrupt signal to the calling program before' returning. FILES /dev/tty SEE ALSO crypt(3C). WARNING The above routine uses , which causes it to increase the size of programs, not otherwise using standard 110, more than might be expected. BUGS The return value points to static data whose content is overwritten by each call. , - 1- GETPWOC) PETPWOC) NAME getpw - get name from UID SYNOPSIS int getpw (uid, but) int uid; char *buf; DESCRIPTION Getpw searches the password file for a user id number that equals uid, copies the line of the password file in which uid was found into the array pointed to by buJ, and returns o. Getpw returns non-zero if uid cannot be found. This routine is included only for compatibility with prior systems and should not be used; see getpwent (3C) for routines to use instead. FILES /etc/passwd SEE ALSO getpwent(3C), passwd(4). DIAGNOSTICS Getpw returns non-zero on error. WARNING The above routine uses < stdio.h > , which causes it to increase the size of programs, not otherwise using standard 110, more than might be expected. - 1- G ETPWENT (3C) GETPWENT(3Ch NAME getpwent, getpwuid, getpwnam, setpwent, endpwent - get password file entry SYNOPSIS #include < pwd.h > struct passwd *getpwent ( ) struct passwd *getpwuid (uid) int uid; struct passwd *getpwnam (name) char *name; void setpwent ( ) void endpwent ( ) DESCRIPTION Getpwent, getpwuid and getpwnam each returns a pointer to an object with the following structure containing the broken-out fields of a line in the /etc/passwd file. Each line in the file contains a "passwd" structure, declared in the header file: struct passwd { char ·pw_name; char ·pw yasswd; int pw_uid; int pw~id; char ·pw_age; char ·pw_comment; char ·pw~ecos; .pw_dir; char .pw_shell; char }; struct comment char char char char { ·c_dept; *c_name; ·c_acct; ·c_bin; This structure is declared in so it is not necessary to redeclare it. The pw_comment field is unused; the others have meanings described m passwd(4). Getpwent when first called returns a pointer to the first passwd structure in the file; thereafter, it returns a pointer to the next passwd structure in the file; so successive calls can be used to search the entire file. Getpwuid searches from the beginning of the file until a numerical user id matching uid is found and returns a pointer to the particular structure in which it was found. Getpwnam searches from the beginning of the file until a login name matching name is found, and returns a pointer to the particular structure in which it was found. If an end-of-file or an error is encountered on reading, these functions return a NULL pointer. A call to setpwent has the effect of rewinding the password file to allow repeated searches. Endpwent may be called to close the password file when processing is complete. FILES /etc/passwd - 1- GETPWENT (3C) GETPWENT(3C) SEE ALSO getlogin DC), getgrent DC), passwd (4). DIAGNOSTICS A NULL pointer is returned on EOF or error. WARNING The above routines use , which causes them to increase the size of programs, not otherwise using standard 110, more than might be expected. BUGS All information is contained in a static area, so it must be copied if it is to be saved. - 2 - GETS OS) GETS OS) NAME gets, fgets - get a string from a stream SYNOPSIS #include < stdio.h > char *gets (s) char *s; char *fgets (s, n, stream) char *s; int n; FILE *stream; DESCRIPTION Gets reads characters from the standard input stream, stdin, into the array pointed to by s, until a new-line character is read or an end-of-file condition is encountered. The new-line character is discarded and the string is terminated with a null character. Fgets reads characters from the stream into the array pointed to by s, until n-l characters are read, or a new-line character is read and transferred to s, or an end-of-file condition is encountered. The string is then terminated with a null character. SEE ALSO ferror(3S), fopen(3S), fread(3S), getc(3S), scanf(3S). DIAGNOSTICS If end-of-file is encountered and no characters have been read, no characters are transferred to s and a NULL pointer is returned. If a read error occurs, such as trying to use these functions on a file that has not been opened for reading, a NULL pointer is returned. Otherwise s is returned. - 1- GETUT(3C) GETUT(3C) NAME getutent, getutid, getutline, pututline, setutent, endutent, utmpname - access utmp file entry SYNOPSIS #include < utmp.h > struct utmp *getutent ( ) struct utmp *getutid (id) struct utmp *id; struct utmp *getutline Hine) struct utmp *line; void pututline (utmp) struct utmp *utmp; void setutent ( ) void endutent ( ) void utmpname (file) char *file; DESCRIPTION Getutent, getutid and getutline each return a pointer to a structure of the following type: struct utmp { char char char short short struct short short } ut_exit; time t ut user[8]; ut-id[4]; ut-line[12]; u(pid; ut_type; exit_status { e_termina tion; e_exit; ut_time; /* /* /* /* /* User login name */ /etc/inittab id (usually line #) */ device name (console, Inxx) */ process id */ type of entry */ /* /* /* * /* Process termination status */ Process exit status */ The exit status of a process marked as DEAD _PROCESS. */ time entry was made */ }; Getutent reads in the next entry from a utmp-like file. If the file is not already open, it opens it. If it reaches the end of the file, it fails. Getutid searches forward from the current point in the utmp file until it finds an entry with a ut_type matching id->ut_type if the type specified is RUN_LVL, BOOT_TIME, OLD_TIME or NEW_TIME. If the type specified in id is INIT_PROCESS, LOGIN_PROCESS, USER_PROCESS or DEAD_PROCESS, then getutid will return a pointer to the first entry whose type is one of these four and whose ut id field matches id - > ut id. If the end of file is reached without a match, it-fails. Getutline searches forward from the current point in the utmp file until it finds an entry of the type LOGIN_PROCESS or USER_PROCESS which also has a ut _line string matching the line - > ut }ine string. If the end of file is reached without a match, it fails. Pututline writes out the supplied utmp structure into the utmp file. It uses getutid to search forward for the proper place if it finds that it is not already at the proper place. It is expected that normally the user of pututline will have searched for the proper entry using one of the getut routines. If so, pututline will not search. If pututline does not find a matching slot for the new entry, it will add a new entry to the end of the file. - 1- GETUT(3C) GETUT(3C) Setutent resets the input stream to the beginning of the file. This should be done before each search for a new entry if it is desired that the entire file be examined. Endutent closes the currently open file. Utmpname allows the user to change the name of the file examined, from /etc/utmp to any other file. It is most often expected that this other file will be /etc/wtmp. If the file doesn't exist, this will not be apparent until the first attempt to reference the file is made. Utmpname does not open the file. It just closes the old file if it is currently open and saves the new file name. FILES /etc/utmp /etc/wtmp SEE ALSO ttyslot(3C), utmp(4). DIAGNOSTICS A NULL pointer is returned upon failure to read, whether for permissions or having reached the end of file, or upon failure to write. COMMENTS The most current entry is saved in a static structure. Multiple accesses require that it be copied before further accesses are made. Each call to either getutid or getutline sees the routine examine the static structure before performing more I/O. If the contents of the static structure match what it is searching for, it looks no further. For this reason to use getutline to search for multiple occurences, it would be necessary to zero out the static after each success, or getutline would just return the same pointer over and over again. There is one exception to the rule about removing the structure before further reads are done. The implicit read done by pututline if it finds that it isn't already at the correct place in the file will not hurt the contents of the static structure returned by the getutent, getutid or getutline routines, if the user has just modified those contents and passed the pointer back to pututline. These routines use buffered standard I/O for input, but pututline uses an unbuffered non-standard write to avoid race conditions between processes trying to modify the utmp and wtmp files. - 2- HSEARCH (3C) HSEARCH (3C) NAME hsearch, hcreate, hdestroy - manage hash search tables SYNOPSIS #include < search.h > ENTRY .hsearch (item, action) ENTRY item; ACTION action; int hcreate (neI) unsigned nel; void hdestroy ( ) DESCRIPTION Hsearch is a hash-table search routine generalized from Knuth (6.4) Algorithm D. It returns a pointer into a hash table indicating the location at which an entry can be found. Item is a structure of type ENTRY (defined in the header file) containing two pointers: item.key points to the comparison key, and item.data points to any other data to be associated with that key. (Pointers to types other than character should be cast to pointer-tocharacter.) Action is a member of an enumeration type ACTION indicating the disposition of the entry if it cannot be found in the table. ENTER indicates that the item should be inserted in the table at an appropriate point. FIND indicates that no entry should be made. Unsuccessful resolution is indicated by the return of a NULL pointer. Hcreate allocates sufficient space for the table, and must be called before hsearch is used. nel is an estimate of the maximum number of entries that the table will contain. This number may be adjusted upward by the algorithm in order to obtain certain mathematically favorable circumstances. Hdestroy destroys the search table, and may be followed by another call to hcreate. NOTES Hsearch uses open addressing with a multiplicative hash function. However, its source code has many other options available which the user may select by compiling the hsearch source with the following symbols defined to the preprocessor: DIV Use the remainder modulo table size as the hash function instead of the multiplicative algorithm. useR Use a User Supplied Comparison Routine for ascertaining table membership. The routine should be named hcompar and should behave in a mannner similar to strcmp (see string (3C». CHAINED Use a linked list to resolve collisions. If this option is selected, the following other options become available. START Place new entries at the beginning of the linked list (default is at the end). SORTUP Keep the linked list sorted by key in ascending order. SORTDOWN Keep the linked list sorted by key in descending order. Additionally, there are preprocessor flags for obtaining debugging printout ( - DDEBUC) and for including a test driver in the calling routine ( - DDRIVER). The source code should be consulted for further details. - 1- HSEARCH (3C) HSEARCH OC) SEE ALSO bsearch (3C), lsearch (3C), string(3C), tsearch (3C). DIAGNOSTICS Hsearch returns a NULL pointer if either the action is FIND and the item could not be found or the action is ENTER and the table is full. Hcreate returns zero if it cannot allocate sufficient space for the table. BUGS Only one hash search table may be active at any given time. I - 2- HYPOT(3M) HYPOT(3M) NAME hypot - Euclidean distance function SYNOPSIS #include < math.h > double hypot (x, y) double x, y; DESCRIPTION Hypot returns sqrt(x • x 1- Y • y), taking precautions against unwarranted overflows. DIAGNOSTICS When the correct value would overflow, hypot returns HUGE and sets errno to ERANGE. These error-handling matherr (3M). procedures SEE ALSO matherr(3M), sqrt(3F). - 1- may be changed with the function INDEX(3F) INDEX(3F) NAME index - return location of Fortran substring SYNOPSIS character-NI chI character-N2 ch2 integer i i = index(chl, ch2) DESCRIPTION Index returns the location of substring ch2 in string chI. The value returned is the position at which substring ch2 starts, or 0 is it is not present in string chI. - 1- L3TOL(3C) L3TOL(3C) NAME 13tol, Ito13 - convert between 3-byte integers and long integers SYNOPSIS void 13tol Op, cp, n) long *Ip; char *cp; int n; void Itol3 (cp, Ip, n) char *cp; long *Ip; int n; DESCRIPTION L3tol converts a list of n three-byte integers packed into a character string pointed to by cp into a list of long integers pointed to by Ip. Lto13 performs the reverse conversion from long integers Up) to three-byte integers (cp). These functions are useful for file-system maintenance where the block numbers are three bytes long. SEE ALSO fs(4). BUGS Because of possible differences in byte ordering, the numerical values of the long integers are machine-dependent. I - 1- (not on PDP-l 1) LDAHREAD OX) LDAHREAD OX) NAME ldahread - read the archive header of a member of an archive file SYNOPSIS #include #include #include #include < stdio.h > < ar.h > < filehdr.h > < Idfcn.h > int Idahread Odptr, arhead) LDFILE .Idptr; ARCHDR *arhead; DESCRIPTION If TYPE([dptr) is the archive file magic number, ldahread reads the archive header of the common object file currently associated with ldptr into the area of memory beginning at arhead. Ldahread returns SUCCESS or FAILURE. Ldahread will fail if TVPE(/dptr) does not represent an archive file, or if it cannot read the archive header. The program must be loaded with the object file access routine library libld.a. SEE ALSO Idclose(3X), Idopen(3X), Idfcn(4). I - 1- LDCLOSEOX) (not on PDP-I 1) LDCLOSE (3X) NAME ldclose, ldaclose - close a common object file SYNOPSIS #include #include #include < stdio.h > < filehdr.h > < Idfcn.h > int Idclose Odptr) LDFILE *Idptr; int Ida close Odptr) LDFILE *Idptr; DESCRIPTION Ldopen (3X) and Idclose are designed to provide uniform access to both simple object files and object files that are members of archive files. Thus an archive of common object files can be processed as if it were a series of simple common object files. If TYPE(/dptr) does not represent an archive file, Idclose will close the file and free the memory allocated to the LDFILE structure associated with Idptr. If TYPE(/dptr) is the magic number of an archive file, and if there are any more files in the archive, Idclose will reinitialize OFFSET(/dptr) to the file address of the next archive member and return FAILURE. The LDFILE structure is prepared for a subsequent Idopen (3X). In all other cases, /dclose returns sucCESS. Ldaclose closes the file and frees the memory allocated to the LDFILE structure associated with Idptr regardless of the value of TYPE Gdptr). Ldaclose always returns SUCCESS. The function is often used in conjunction with Idaopen. The program must be loaded with the object file access routine library )ibld.a. SEE ALSO fclose(3S), Idopen(3X), Idfcn(4). I - 1- LDFHREADOX) (not on PDP-ll) LDFHREAD OX) NAME ldfhread - read the file header of a common object file SYNOPSIS #include #include #include < stdio.h > < filehdr.h > < Idfcn.h > int Idfhread (Jdptr, filehead) LDFILE .Idptr; FILHDR .filehead; DESCRIPTION Ldfhread reads the file header of the common object file currently associated with ldptr into the area of memory beginning at filehead. Ldfhread returns SUCCESS or FAILURE. Ldfhread will fail if it cannot read the file header. In most cases the use of ldfhread can be avoided by using the macro HEADER (fdptr) defined in Idfcn.h (seeldfcn (4». The information in any field, fieldname, of the file header may be accessed using HEADER(ldptr).jieldname. The program must be loaded with the object file access routine library libld.a. SEE ALSO Idclose(3X), ldopen OX), ldfcn (4). I - 1- LDLREAD OX) (not on PDP-II) LDLREAD(3X) NAME ldlread, ldlinit, ldlitem - manipulate line number entries of a common object file function SYNOPSIS #include #include #include #include < stdio.h > < linenum.h > < Idfcn.h > int IdlreadOdptr, fcnindx, linenum, linent> LDFILE *Idptr; long fcnindx; unsigned short linenum; LlNENO linent; int IdlinitOdptr, fcnindx) LDFILE *Idptr; long fcnindx; int IdlitemOdptr, linenum, linent> LDFILE *ldptr; unsigned short linenum; LlNENO linent; DESCRIPTION Ldlread searches the line number entries of the common object file currently associated with ldptr. Ldlread begins its search with the line number entry for the beginning of a function and confines its search to the line numbers associated with a single function. The function is identified by fcnindx, the index of its entry in the object file symbol table. Ldlread reads the entry with the smallest line number equal to or greater than linenum into linent. Ldlinit and ldlitem together perform exactly the same function as ldlread. After an initial call to ldlread or ldlinit, ldlitem may be used to retrieve a series of line number entries associated with a single function. Ldlinit simply locates the line number entries for the function identified by fcnindx. Ldlitem finds and reads the entry with the smallest line number equal to or greater than linenum into linent. Ldlread, ldlinit, and ldlitem each return either SUCCESS or FAILURE. Ldlread will fail if there are no line number entries in the object file, if fcnindx does not index a function entry in the symbol table, or if it finds no line number equal to or greater than linenum. Ldlinit will fail if there are no line number entries in the object file or if fcnindx does not index a function entry in the symbol table. Ldlitem will fail if it finds no line number equal to or greater than linenum. The programs must be loaded with the object file access routine library libld.a. SEE ALSO Idc1ose(3X), Idopen(3X), Idtbindex(3X), Idfcn(4). - 1- I LDLSEEK OX) (not on PDP-II) LDLSEEKOX) NAME ldlseek,ldnlseek - seek to line number entries of a section of a common object file SYNOPSIS #include < stdio.h > #include #include < Idfcn.h > int Idlseek #include < filehdr.h > #include < Idfcn.h > int Idohseek (Jdptr) LDFILE *Idptr; DESCRIPTION Ldohseek seeks to the optional file header of the common object file currently associated with ldptr. Ldohseek returns SUCCESS or FAILURE. Ldohseek will fail if the object file has no optional header or if it cannot seek to the optional header. The program must be loaded with the object file access routine library Iibld.a. SEE ALSO Idc1oseOX), ldopen OX), ldfhread OX), ldfcn (4). - 1- LDOPEN(3X) LDOPEN(3X) (not on PDP-l 1) NAME ldopen, ldaopen - open a common object file for reading SYNOPSIS #include < stdio.h > #include < filehdr.h > #include LDFILE *ldopen (filename, Idptr) char *filename; LDFILE *Idptr; LDFILE *Idaopen (filename, oldptr) char *filename; LDFILE *oldptr; DESCRIPTION Ldopen and ldclose OX) are designed to provide uniform access to both simple object files and object files that are members of archive files. Thus an archive of common object files can be processed as if it were a series of simple common object files. If ldptr has the value NUll, then ldopen will open filename and allocate and initialize the LDFILE structure, and return a pointer to the structure to the calling program. If ldptr is valid and if TYPE (/dptr ) is the archive magic number, ldopen will reinitialize the LDFILE structure for the next archive member of filename. Ldopen and ldclose are designed to work in concert. Ldclose will return FAILURE only when TYPE(/dptr) is the archive magic number and there is another file in the archive to be processed. Only then should ldopen be called with the current value of ldptr. In all other cases, in particular whenever a new filename is opened, ldopen should be called with a NULL ldptr argument. The following is a prototype for the use of ldopen and ldclose. I 1* for each filename to be processed */ Idptr = NULL; do if ( (Idptr = ldopen(filename, ldptr» != NULL) /* check magic number */ /* process the file */ } } while (Idc1ose(Idptr) == FAILURE ); If the value of oldptr is not NULL, ldaopen will open filename anew and allocate and initialize a new LDFILE structure, copying the TYPE, OFFSET, and HEADER fields from oldptr. Ldaopen returns a pointer to the new LDFILE structure. This new pointer is independent of the old pointer, oldptr. The two pointers may be used concurrently to read separate parts of the object file. For example, one pointer may be used to step sequentially through the relocation information, while the other is used to read indexed symbol table entries. Both ldopen and ldaopen open filename for reading. Both functions return NULL if filename cannot be opened, or if memory for the LDFILE structure cannot be allocated. A successful open does not insure that the given file is a common object file or an archived object file. The program must be loaded with the object file access routine library Iibld.a. - 1- LDRSEEK Ox) (not on PDP-ll) LDRSEEK OX) NAME ldrseek, ldnrseek - seek to relocation entries of a section of a common object file SYNOPSIS #include < stdio.h > #include < filehdr.h > #include int Idrseek Odptr, sectindx) LDFILE .Idptr; unsigned short sectindx; int Idnrseek Odptr, sectname) LDFILE .Idptr; char .sectname; DESCRIPTION Ldrseek seeks to the relocation entries of the section specified by sectindx of the common object file currently associated with ldptr. Ldnrseek seeks to the relocation entries of the section specified by sect name . Ldrseek and ldnrseek return SUCCESS or FAILURE. Ldrseek will fail if sectindx is greater than the number of sections in the object file; ldnrseek will fail if there is no section name corresponding with sectname. Either function will fail if the specified section has no relocation entries or if it cannot seek to the specified relocation entries. Note that the first section has an index of one. The program must be loaded with the object file access routine library Iibld.a. SEE ALSO IdcloseOX), IdopenOX), Idshread(3X), Idfcn(4). - 1- LDSHREAD (3X) (not on PDP-II) LDSHREAD(3X) NAME ldshread, ldnshread - read an indexed/named section header of a common object file SYNOPSIS #include < stdio.h > #include < filehdr.h > #include < scnhdr.h > #include < Idfcn.h > int Idshread Odptr, sectindx, secthead) LDFILE *Idptr; unsigned short sectindx; SCNHDR *secthead; int Idnshread Odptr, sectname, sect head) LDFILE *Idptr; char sectname; SCNHDR *secthead; DESCRIPTION Ldshread reads the section header specified by sectindx of the common object file currently associated with Idptr into the area of memory beginning at secthead. Ldnshread reads the section header specified by sect name into the area of memory beginning at sect head . Ldshread and Idnshread return SUCCESS or FAILURE. Ldshread will fail if sectindx is greater than the number of sections in the object file; Idnshread will fail if there is no section name corresponding with sectname. Either function will fail if it cannot read the specified section header. Note that the first section header has an index of one. The program must be loaded with the object file access routine library libld.a. SEE ALSO Idclose(3X), Idopen(3X), Idfcn(4). I - 1- LDSSEEK OX) (not on PDP-H) LDSSEEK OX) NAME ldsseek, ldnsseek - seek to an indexed/named section of a common object file SYNOPSIS #include < stdio.h > #include #include int Idsseek (Jdptr, sectindx> LDFILE *Idptr; unsigned short sectindx; int Idnsseek Odptr, sectname) LDFILE *Idptr; char *sectname; DESCRIPTION Ldsseek seeks to the section specified by sectindx of the common object file currently associated with Idptr. Ldnsseek seeks to the section specified by sectname. Ldsseek and Idnsseek return SUCCESS or FAILURE. Ldsseek will fail if sectindx is greater than the number of sections in the object file; Idnsseek will fail if there is no section name corresponding with sectname. Either function will fail if there is no section data for the specified section or if it cannot seek to the specified section. Note that the first section has an index of one. The program must be loaded with the object file access routine library )ibld.a. SEE ALSO Idclose(3X), Idopen(3X), Idshread(3X), Idfcn(4). I - 1- (not on PDP-ll) LDTBINDEX Ox) LDTBINDEX OX) NAME ldtbindex - compute the index of a symbol table entry of a common object file SYNOPSIS #include #include #include #include < stdio.h > < filehdr.h > < syms.h> < Idfcn.h > long Idtbindex Odptr> LDFILE .Idptr; DESCRIPTION Ldtbindex returns the (tong) index of the symbol table entry at the current position of the common object file associated with ldptr. The index returned by ldtbindex may be used in subsequent calls to Idtbread(3X). However, since ldtbindex returns the index of the symbol table entry that begins at the current position of the object file, if ldtbindex is called immediately after a particular symbol table entry has been read, it will return the the index of the next entry. Ldtbindex will fail if there are no symbols in the object file, or if the object file is not positioned at the beginning of a symbol table entry. Note that the first symbol in the symbol table has an index of zero. The program must be loaded with the object file access routine library Iibld.a. SEE ALSO Idclose(3X), Idopen(3X), Idtbread(3X), Idtbseek(3X), Idfcn(4). - 1- LDTBREAD (3X) (not on PDP-ll) LDTBREAD (3X) NAME Idtbread - read an indexed symbol table entry of a common object file SYNOPSIS #include #include #include #include < stdio.h > < filehdr.h > < syms.h > < Idfcn.h > int Idtbread Odptr, symindex, symbol) LDFILE .Idptr; long symindex; SYMENT .symbol; DESCRIPTION Ldtbread reads the symbol table entry specified by symindex of the common object file currently associated with Idptr into the area of memory beginning at symbol. Ldtbread returns SUCCESS or FAILURE. Ldtbread will fail if symindex is greater than the number of symbols in the object file, or if it cannot read the specified symbol table entry. Note that the first symbol in the symbol table has an index of zero. The program must be loaded with the object file access routine library Iibld.a. SEE ALSO Idc1ose(3X), Idopen(3X), Idtbseek(3X), Idfcn(4). - 1- LDTBSEEK (3X) (not on PDP-ll) LDTBSEEK (3X) NAME ldtbseek - seek to the symbol table of a common object file SYNOPSIS #include #include #include < stdio.h > < filehdr.h > < Idfcn.h > int Idtbseek (Jdptr) LDFILE .Idptr; DESCRIPTION Ldtbseek seeks to the symbol table of the object file currently associated with ldptr. Ldtbseek return SUCCESS or FAILURE. Ldtbseek will fail if the symbol table has been stripped from the object file, or if it cannot seek to the symbol table. The program must be loaded with the object file access routine library libld.a. SEE ALSO Idclose(3X), Idopen(3X), Idtbread(3X), Idfcn(4). I - 1- LEN (3F) LEN(3F) NAME len - return length of Fortran string SYNOPSIS character. N ch integer i i = len(ch) DESCRIPTION Len returns the length of string ch. - 1- LOG(3F) LOG(3F) NAME log, alog, dlog, clog - Fortran natural logarithm intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 complex cxl, cx2 r2 = alog(rl) r2 = log(rt) dp2 dp2 dlog(dpt) log(dpt) cx2 cx2 clog (cxt) log(cxt) DESCRIPTION Alog returns the real natural logarithm of its real argument. Dlog returns the double-precision natural logarithm of its double-precision argument. Clog returns the complex logarithm of its complex argument. The generic function log becomes a call to alog, dlog, or clog depending on the type of its argument. SEE ALSO exp(3M). - 1- LOGlO(3F) LOGIOOF) NAME logIO, alogIO, dlogIO - Fortran common logarithm intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 = aloglO(rt) r2 = loglO(rt) dp2 = dloglO(dpt) dp2 = loglO(dpt) DESCRIPTION AlogIO returns the real common logarithm of its real argument. Dlog returns the double-precision common logarithm of its double-precision argument. The generic function log becomes a call to alog or dlog depending on the type of its argument. SEE ALSO exp(3M). - I - LOGNAME OX) LOGNAMEOX) NAME logname - return login name of user SYNOPSIS char .Iogname ( ) DESCRIPTION Logname returns a pointer to the null-terminated login name; it extracts the $LOGNAME variable from the user's environment. This routine is kept in lliblIibPW.a. FILES / etc/ profile SEE ALSO env(1), login(1), profile(4), environ(S). BUGS The return values point to static data whose content is overwritten by each call. This method of determining a login name is subject to forgery. - 1- LSEARCH (3C) LSEARCH(3C) NAME lsearch - linear search and update SYNOPSIS char .Isearch «char .)key, (char .)base, nelp, sizeof(.key), com par) unsigned .nelp; int (.compar) ( ); DESCRIPTION Lsearch is a linear search routine generalized from Knuth (6.1) Algorithm S. It returns a pointer into a table indicating where a datum may be found. If the datum does not occur, it is added at the end of the table. Key points to the datum to be sought in the table. Base points to the first element in the table. Nelp points to an integer containing the current number of elements in the table. The integer is incremented if the datum is added to the table. Compar is the name of the comparison function which the user must supply (strcmp, for example). It is called with two arguments that point to the elements being compared. The function must return zero if the elements are equal and nonzero otherwise. NOTES The pointers to the key and the element at the base of the table should be of type pointer-to-element, and cast to type pointer-to-character. The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared. Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. SEE ALSO bsearch (3C), hsearch (3C), tsearch (3C). BUGS Undefined results can occur if there is not enough room in the table to add a new item. - 1- MALLOC(3C) MALLOC(3C) NAME malloc, free, realloc, calloc - main memory allocator SYNOPSIS char .malloc (size) unsigned size; void free (ptr) char ·ptr; char .realloc (ptr, size) char .ptr; unsigned size; char .calloc (nelem, elsize) unsigned nelem, elsize; DESCRIPTION Mal/oc and free provide a simple general-purpose memory allocation package. Mal/oc returns a pointer to a block of at least size bytes suitably aligned for any use. The argument to free is a pointer to a block previously allocated by mal/oc; after free is performed this space is made available for further allocation, but its contents are left undisturbed. Undefined results will occur if the space assigned by mal/oc is overrun or if some random number is handed to free. Mal/oc allocates the first big enough contiguous reach of free space found in a circular search from the last block allocated or freed, coalescing adjacent free blocks as it searches. It calls sbrk (see brk (2» to get more memory from the system when there is no suitable space already free. Real/oc changes the size of the block pointed to by ptr to size bytes and returns a pointer to the (possibly moved) block. The contents will be unchanged up to the lesser of the new and old sizes. If no free block of size bytes is available in the storage arena, then realloc will ask mal/ocr to enlarge the arena by size bytes and will then move the data to the new space. Real/oc also works if ptr points to a block freed since the last call of mal/oc, real/oc, or cal/oc; thus sequences of free, mal/oc and realloc can exploit the search strategy of malloc to do storage compaction. I Calloc allocates space for an array of nelem elements of size elsize. The space is initialized to zeros. Each of the allocation routines returns a pointer to space suitably aligned (after possible pointer coercion) for storage of any type of object. DIAGNOSTICS Mal/oc, realloc and calloc return a NULL pointer if there is no available memory or if the arena has been detectably corrupted by storing outside the bounds of a block. When this happens the block pointed to by ptr may be destroyed. NOTE Search time increases when many objects have been allocated; that is, if a program allocates but never frees, then each successive allocation takes longer. - 1- MATHERR(3M) MATHERR(3M) NAME matherr - error-handling function SYNOPSIS #include < math.h > int matherr (x) struct exception .x; DESCRIPTION Matherr is invoked by functions in the Math Library when errors are detected. Users may define their own procedures for handling errors by including a function named matherr in their programs. Matherr must be of the form described above. A pointer to the exception structure x will be passed to the usersupplied matherr function when an error occurs. This structure, which is defined in the < math.h > header file, is as follows: struct exception { int type; char *name; double argl, arg2, retval; }; The element type is an integer describing the type of error that has occurred, from the following list of constants (defined in the header file): DOMAIN SING OVERFLOW UNDERFLOW TLOSS PLOSS domain error singularity overflow underflow total loss of significance partial loss of significance The element name points to a string containing the name of the function that had the error. The variables argJ and arg2 are the arguments to the function that had the error. Retval is a double that is returned by the function having the error. If it supplies a return value, the user's matherr must return nonzero. If the default error value is to be returned, the user's matherr must return O. If matherr is not supplied by the user, the default error-handling procedures, described with the math functions involved, will be invoked upon error. These procedures are also summarized in the table below. In every case, errno is set to non-zero and the program continues. EXAMPLE matherr(x) register struct exception *x; { switch (x->type) case DOMAIN: case SING: /* print message and abort */ fprintf(stderr, "domain error in %s\n", x->name); abort( ); case OVERFLOW: if (!strcmp("exp", x- > name» { /* if exp, print message, return the argument */ fprintf(stderr, "exp of %f\n", x->argl); x->retval = x->argl; } else if (!strcmp("sinh", x- > name» { /* if sinh, set errno, return 0 */ errno = ERANGE; - 1- MATHERR(3M) , MATH ERR (3M) x->retval = 0; } else 1* otherwise, return HUGE *1 x->retval = HUGE; break; case UNDERFLOW: return (0); /* execute default procedure */ case TLOSS: case PLOSS: /* print message and return 0 */ fprintf(stderr, "loss of significance in %s\n", x->name); x->retval = 0; break; } return (1); BESSEL: yO, yl,yn (neg. no.) EXP: POW: (neg.) ** (nonintJ,O**O LOG: 10g(O): log (neg.) : SQRT: GAMMA: HYPOT: SINH, COSH: SIN, COS: TAN: ACOS, ASIN: * M H -H ° DEFAULT ERROR HANDLING PROCEDURES Types of Errors DOMAIN SING OVERFLOW UNDERFLOW TLOSS PLOSS H 0 * M,-H - - - M,O - - M,-H M,-H M,O - - M,H - - M,O - - 0 0 - - - - - - M,O 0 M, * H H - - H - - - - H H ABBREVIATIONS As much as possible of the value is returned. Message is printed. HUGE is returned. -HUGE is returned. 0 is returned. - 2- * - ~AX(3F) MAX(3F) NAME max, maxO, amaxO, maxI, amaxI, dmaxI - Fortran maximum-value functions )YNOPSIS integer i, j, k, I real a, b, c, d double precision dpl, dp2, dp3 I = max(i, j, k) c = max(a, b) dp = max (a, b, c) k = maxO(i, j) a = amaxO (i, j, k) i = maxt(a, b) d = amaxt(a, b, c) dp3 = dmaxt(dpl, dp2) DESCRIPTION The maximum-value functions return the largest of their arguments {of which there may be any number}. Max is the generic form which can be used for all data types and takes its return type from that of its arguments {which must all be of the same type}. M axO returns the integer form of the maximum value of its integer arguments; amaxO, the real form of its integer arguments; maxi, the integer form of its real arguments; amaxi, the real form of its real arguments; and dmaxi, the double-precision form of its double-precision arguments. SEE ALSO min{3F} . - 1- MCLOCK(3F) MCLOCK(3F) NAME mclock - return Fortran time accounting SYNOPSIS integer i i = mclock( ) DESCRIPTION Mclock returns time accounting information about the current process and its child processes. The value returned is the sum of the current process's user time and the user and system times of all child processes. SEE ALSO times (2), clock (3C), system (3 F) . - 1- MEMORY(3C) MEMORy(3C) NAME memccpy, memchr, memcmp, memcpy: memset - memory operations SYNOPSIS #include < memory.h > char .memccpy (sl, s2, c, n) char .sl, ·s2; int c, n; char .memchr (s, c, n) char .s; int c, n; int memcmp (sl, s2, n) char .sl, .s2; int n; char .memcpy (sl, s2, n) char .sl, .s2; int n; char .memset (s, c, n) char .s; int c, n; DESCRIPTION These functions operate efficiently on memory areas (arrays of characters bounded by a count, not terminated by a null character). They do not check for the overflow of any receiving memory area. Memccpy copies characters from memory area s2 into s1, stopping after the first occurrence of character c has been copied, or after n characters have been copied, whichever comes first. It returns a pointer to the character after the copy of c in s 1, or a NULL pointer if c was not found in the first n characters of s2. Memchr returns a pointer to the first occurrence of character c in the first n characters of memory area s, or a NULL pointer if c does not occur. Memcmp compares its arguments, looking at the first n characters only, and returns an integer less than, equal to, or greater than 0, according as s1 is lexicographically less than, equal to, or greater than s2. Memcpy copies n characters from memory area s2 to s1. It returns s1. Memset sets the first n characters in memory area s to the value of character c. It returns s . NOTE For user convenience, all these functions are declared in the optional header file. BUGS Memcmp uses native character comparison, which is signed on PDP-lIs, unsigned on other machines. Character movement is performed differently in different implementations. Thus overlapping moves may yield surprises. - I - MIN(3F) MIN(3F) NAME min, minO, aminO, minI, aminI, dmini - Fortran minimum-value functions SYNOPSIS integer i, j, k, I real a, b, c, d double precision dpI, dp2, dp3 I = minG, j, k) c = min (a, b) dp = min (a, b, c) k = minOG, j) a = aminO G, j, k) i = minI (a, b) d = aminl (a, b, c) dp3 = dminHdpI, dp2) DESCRIPTION The minimum-value functions return the mInimum of their arguments {of which there may be any number}. Min is the generic form which can be used for all data types and takes its return type from that of its arguments (which must all be of the same type). MinO returns the integer form of the minimum value of its integer arguments; aminO, the real form of its integer arguments; minI, the integer form of its real arguments; aminI, the real form of its real arguments; and dminI, the double-precision form of its double-precision arguments. SEE ALSO max(3F). I - I - MKTEMP(3C) MKTEMP(3C) NAME mktemp - make a unique file name SYNOPSIS char .mktemp int (*)owpc)( ), (*highpc)( ); short *buffer; int bufsize, nfunc; DESCRIPTION An executable program created by cc -p automatically includes calls for monitor with default parameters; monitor needn't be called explicitly except to gain fine control over profiling. Monitor is an interface to projiI(2). Lowpc and highpe are the addresses of two functions; buffer is the address of a (user supplied) array of buJsize short integers. Monitor arranges to record a histogram of periodically sampled values of the program counter, and of counts of calls of certain functions, in the buffer. The lowest address sampled is that of lowpc and the highest is just below highpc. Lowpc may not equal for this use of monitor. At most nJunc call counts can be kept; only calls of functions compiled with the profiling option -p of ec(1) are recorded. (The C Library and Math Library supplied when cc -p is used also have call counts recorded.} For the results to be significant, especially where there are small, heavily used routines, it is suggested that the buffer be no more than a few times smaller than the range of locations sampled. ° To profile the entire program, it is sufficient to use extern etext; monitor (Gnt (.) 0) 2, etext, buf, bufsize, nfunc}; Etext lies just above all the program text; see end(3C). To stop execution monitoring and write the results on the file mon.out, use monitor (Gnt (.) O)NULL, 0, 0, 0, 0); ProJ( 1) can then be used to examine the results. FILES mon.out SEE ALSO cd 1), prof( 1), profiI(2), end (3C). - 1- NLIST(3C) NLIST(3C) NAME nlist - get entries from name list SYNOPSIS #include < a.out.h > int nlist (file-name, nJ) char .file-name; struct nlist .nIl 1; DESCRIPTION NUst examines the name list in the executable file whose name is pointed to by file-name, and selectively extracts a list of values and puts them in the array of nlist structures pointed to by nl. The name list nl consists of an array of structures containing names of variables, types and values. The list is terminated with a null name; that is, a null string is in the name position of the structure. Each variable name is looked up in the name list of the file. If the name is found, the type and value of the name are inserted in the next two fields. If the name is not found, both entries are set to O. See a.out (4) for a discussion of the symbol table structure. This subroutine is useful for examining the system name list kept in the file lunix. In this way programs can obtain system addresses that are up to date. SEE ALSO a.out(4). DIAGNOSTICS All type entries are set to 0 if the file cannot be read or if it doesn't contain a valid name list. NUst returns -1 upon error; otherwise it returns O. I - 1- PERROR(3C) PERROROC) NAME perror, errno, sys_errlist, sys_nerr - system error messages SYNOPSIS void perror (s) char .s; extern iot errno; extern char .sys_errlist[ J; extern iot sys _nerr; DESCRIPTION Perror produces a message on the standard error output, describing the last error encountered during a call to a system or library function. The argument string s is printed first, then a colon and a blank, then the message and a newline. To be of most use, the argument string should include the name of the program that incurred the error. The error number is taken from the external variable errno, which is set when errors occur but not cleared when nonerroneous calls are made. To simplify variant formatting of messages, the array of message strings sys_errlist is provided; errno can be used as an index in this table to get the message string without the new-line. Sys_nerr is the largest message number provided for in the table; it should be checked because new error codes may be added to the system before they are added to the table. SEE ALSO intro(2). I - 1- PLOT(3X) PLOT(3X) NAME plot - graphics interface subroutines SYNOPSIS openpl () erase 0 label (s) char *S; line (xl, yl, x2, y2) int xl, yl, x2, y2; circle (x, y, r) int x, y, r; arc (x, y, xO, yO, xl, yt) int x, y, xO, yO, xl, yl; move (x, y) int x, y; cont (x, y) int x, y; point (x, y) int x, y; linemod (s) char *s; space (xO, yO, xl, yt) int xO, yO, xl, yl; closepl 0 DESCRIPTION These subroutines generate graphic output in a relatively device-independent manner. Space must be used before any of these functions to declare the amount of space necessary. See plot (4). Openpl must be used before any of the others to open the device for writing. Closepl flushes the output. Circle draws a circle of radius r with center at the point (X, y). Arc draws an arc of a circle with center at the point (X, y) between the points (xO, yO) and (xl, y 1). String arguments to label and linemod are terminated by nulls and do not contain new-lines. See plot (4) for a description of the effect of the remaining functions. The library files listed below provide several flavors of these routines. FILES lusrllibllibplot.a lusrllibllib300.a lusrllibllib300s.a lusr llibllib450.a I usr IIi blli b40 14.a produces output for tplot (I G) filters for DASI 300 for DASI 300s for DASI 450 for Tektronix 4014 WARNINGS In order to compile a program containing these functions in file.c it is necessary to use "cc file.c -lplot". In order to execute it, it is necessary to use "a.out I tplot". - 1- PLOT(3X) PLOT OX) The above routines use < stdio.h > , which causes them to increase the size of programs, not otherwise using standard 110, more than might be expected. SEE ALSO graph(1G), stat(1G), tplot(1G), plot(4). I - 2- POPEN (3S) POPEN(3S) NAME popen, pclose - initiate pipe to/from a process SYNOPSIS #include < stdio.h > FILE -popen (command, type) char -command, -type; int pclose (stream) FILE -stream; DESCRIPTION The arguments to popen are pointers to null-terminated strings contammg, respectively, a shell command line and an I/O mode, either r for reading or w for writing. Popen creates a pipe between the calling program and the command to be executed. The value returned is a stream pointer such that one can write to the standard input of the command, if the I/O mode is w, by writing to the file stream; and one can read from the standard output of the command, if the I/O mode is r, by reading from the file stream. A stream opened by popen should be closed by pclose, which waits for the associated process to terminate and returns the exit status of the command. Because open files are shared, a type r command may be used as an input filter and a type w as an output filter. SEE ALSO pipe(2), wait(2), fclose(3S), fopen(3S), system(3S). DIAGNOSTICS Popen returns a NULL pointer if files or processes cannot be created, or if the shell cannot be accessed. Pc/ose returns -1 if stream is not associated with a "popened" command. BUGS If the original and "popen ed" processes concurrently read or write a common file, neither should use buffered I/O, because the buffering gets all mixed up. Problems with an output filter may be forestalled by careful buffer flushing, e.g. with fJlush; see Iclose OS). I - 1- PRINTF(3S) PRINTF(3S) NAME printf, fprintf, sprintf - print formatted output SYNOPSIS #include < stdio.h > int printf (format [ , arg ] ... char -format; ) int fprintf (stream, format [ , arg ] ... FILE -stream; char -format; ) int sprintf (s, format [ , arg ] ... char -s, format; DESCRIPTION Printf places output on the standard output stream stdout. Fprintf places output on the named output stream. Sprintf places "output", followed by the null character (\0) in consecutive bytes starting at *s; it is the user's responsibility to ensure that enough storage is available. Each function returns the number of characters transmitted (not including the \0 in the case of sprintfJ, or a negative value if an output error was encountered. Each of these functions converts, formats, and prints its args under control of the format. The format is a character string that contains two types of objects: plain characters, which are simply copied to the output stream, and conversion specifications, each of which results in fetching of zero or more args. The results are undefined if there are insufficient args for the format. If the format is exhausted while args remain, the excess args are simply ignored. Each conversion specification is introduced by the character %. After the %, the following appear in sequence: Zero or more flags, which modify the meaning of the conversion specification. An optional decimal digit string specifying a minimum field width. If the converted value has fewer characters than the field width, it will be padded on the left (or right, if the left-adjustment flag (see below) has been given) to the field width; A precision that gives the minimum number of digits to appear for the 0, u, x, or X conversions, the number of digits to appear after the decimal point for the e and f conversions, the maximum number of significant digits for the g conversion, or the maximum number of characters to be printed from a string in s conversion. The precision takes the form of a period (.) followed by a decimal digit string: a null digit string is treated as zero. d, An optional I specifying that a following d, character applies to a long integer argo 0, U, x, or X conversion A character that indicates the type of conversion to be applied. A field width or precision may be indicated by an asterisk (-) instead of a digit string. In this case, an integer arg supplies the field width or precision. The arg that is actually converted is not fetched until the conversion letter is seen, so the args specifying field width or precision must appear before the arg (if any) to be converted. The flag characters and their meanings are: The result of the conversion will be left-justified within the field. + The result of a signed conversion will always begin with a sign (+ or -). - 1- PRINTF(3S) PRINTF(3S) blank # If the first character of a signed conversion is not a sign, a blank will be prefixed to the result. This implies that if the blank and + flags both appear, the blank flag will be ignored. This flag specifies that the value is to be converted to an "alternate form." For c, d, s, and u conversions, the flag has no effect. For 0 conversion, it increases the precision to force the first digit of the result to be a zero. For x (X) conversion, a non-zero result will have Ox (OX) prefixed to it. For e, E, f, g, and G conversions, the result will always contain a decimal point, even if no digits follow the point (normally, a decimal point appears in the result of these conversions only if a digit follows it). For g and G conversions, trailing zeroes will not be removed from the result (which they normallyare). The conversion characters and their meanings are: d,o,u,x,X f e,E I g,G c s % The integer arg is converted to signed decimal, unsigned octal, decimal, or hexadecimal notation (x and X), respectively; the letters abcdef are used for x conversion and the letters ABCDEF for X conversion. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it will be expanded with leading zeroes. The default precision is 1. The result of converting a zero value with a precision of zero is a null string. The float or double arg is converted to decimal notation in the style ,,[ - ]ddd.ddd", where the number of digits after the decimal point is equal to the precision specification. If the precision is missing, 6 digits are output; if the precision is explicitly 0, no decimal point appears. The float or double arg is converted in the style ,,[ - Jd.ddde±dd", where there is one digit before the decimal point and the number of digit:; after it i:; equal tv the plceisi0ii; wh~ii th~ fllt:;(;isiul1 i:s llli:s:sing, 6 digits are produced; if the precision is zero, no decimal point appears. The E format code will produce a number with E instead of e introducing the exponent. The exponent always contains at least two digits. The float or double arg is printed in style f or e (or in style E in the case of a G format code), with the precision specifying the number of significant digits. The style used depends on the value converted: style e will be used only if the exponent resulting from the conversion is less than -4 or greater than the precision. Trailing zeroes are removed from the result; a decimal point appears only if it is followed by a digit. The character arg is printed. The arg is taken to be a string (character pointer) and characters from the string are printed until a null character (\0) is encountered or the number of characters indicated by the precision specification is reached. If the precision is missing, it is taken to be infinite, so all characters up to the first null character are printed. If the string pointer arg has the value zero, the result is undefined. A null arg will yield undefined results. Print a %; no argument is converted. In no case does a non-existent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is simply expanded to contain the conversion result. Characters generated by printf and fprintf are printed as if pute OS) had been called. - 2- PRINTF(3S) PRINTF(3S) EXAMPLES To print a date and time in the form "Sunday, July 3, 10:02", where weekday and month are pointers to null-terminated strings: printf("%s, %s %d, %.2d:%.2d", weekday, month, day, hour, min); To print 7r to 5 decimal places: printf("pi = %.5r', 4*atan(I.O»; SEE ALSO ecvt(3C), putc(3S), scanf(3S), stdio(3S). - 3- PUTC(3S) PUTC(3S) NAME putc, putchar, fputc, putw - put character or word on a stream SYNOPSIS #ioclude < stdio.h > iot putc (c, stream) char c; FILE -stream; iot putchar (c) char c; iot fputc (c, stream) char c; FILE -stream; iot putw (w, stream) iot w; FILE -stream; DESCRIPTION Pute writes the character e onto the output stream' (at the position where the file pointer, if defined, is pointing). Putehar(c) is defined as putc(e, stdout>. Pute and putehar are macros. . Fpute behaves like pute, but is a function rather than a macro. Fpute runs more slowly than pute, but takes less space per invocation. Putw writes the word (i.e. integer) w to the output stream (at the position at which the file pointer, if defined, is pointing). The size of a word is the size of an integer and varies from machine to machine. Putw neither assumes nor causes special alignment in the file. Output streams. with the exceotion of the standard error stream stderr. are bv defa-ult buffered if the output- refers to a file and line-buffered if the' outpu"t refers to a terminal. The standard error output stream stderr is by default unbuffered, but use of jreopen (see jopen OS» will cause it to become buffered or line-buffered. When an output stream is unbuffered information is queued for writing on the destination file or terminal as soon as written; when it is buffered many characters are saved up and written as a block; when it is linebuffered each line of output is queued for writing on the destination terminal as soon as the line is completed (that is, as soon as a new-line character is written or terminal input is requested). SetbujOS) may be used to change the stream's buffering strategy. SEE ALSO fcloseOS), ferrorOS) , fopen OS), fread OS), printfOS), puts OS), setbuf(3S). DIAGNOSTICS On success, these functions each return the value they have written. On failure, they return the constant EOF. This will occur if the file stream is not open for writing, or if the output file cannot be grown. Because EOF is a valid integer, jerrorOS) should be used to detect putw errors. BUGS Because it is implemented as a macro, pute treats incorrectly a stream argument with side effects. In particular, putc(c, -f+ +); doesn't work sensibly. Fpute should be used instead. Because of possible differences in word length and byte ordering, files written using putw are machine-dependent, and may not be read using getw on a different processor. For this reason the use of putw should be avoided. - 1- PUTPWENT (3C) PUTPWENT (3C) NAME putpwent - write password file entry SYNOPSIS #include < pwd.h > int putpwent (p, f) struct passwd .p; FILE .f; DESCRIPTION Putpwent is the inverse of getpwent (3C). Given a pointer to a passwd structure created by getpwent (or getpwuid or getpwnam), putpwuid writes a line on the stream f which matches the format of /etc/passwd. DIAGNOSTICS Putpwent returns non-zero if an error was detected during its operation, otherwise zero. WARNING The above routine uses < stdio.h > , which causes it to increase the size of programs, not otherwise using standard 110, more than might be expected. PUTS (3S) PUTS (3S) NAME puts, fputs - put a string on a stream SYNOPSIS #incliide < stdio.h > int puts (s) char .s; int fputs (s, stream) char .s; FILE .stream; DESCRIPTION Puts writes the null-terminated string pointed to by s, followed by a new-line character, to the standard output stream stdout. Fputs writes the null-terminated string pointed to by s to the named output stream. Neither function writes the terminating null character. DIAGNOSTICS Both routines return EOF on error. This will happen if the routines try to write on a file that has not been opened for writing. SEE ALSO ferror(3S), fopen (3S), fread (3S), printf(3S), putc(3S). NOTES Puts appends a new-line character while !puts does not. I - 1- QSORTOC) QSORTOC) NAME qsort - quicker sort SYNOPSIS void qsort ({char *) base, nel, sizeof (*base), com par) unsigned int nel; int (*compar) ( ); DESCRIPTION Qsort is an implementation of the quicker-sort algorithm. It sorts a table of data in place. Base points to the element at the base of the table. Net is the number of elements in the table. Compar is the name of the comparison function, which is called with two arguments that point to the elements being compared. The function must return an integer less than, equal to, or greater than zero according as the. first argument is to be considered less than, equal to, or greater than the second. NOTES The pointer to the base of the table should be of type pointer-to-element, and cast to type pointer-to-character. The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared. Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. SEE ALSO sor1(1), bsearch OC), lsearch OC), stringOC). I - 1- RANDOC) RANDOC) NAME rand, srand - simple random-number generator SYNOPSIS int rand ( ) void srand (seed) unsigned seed; DESCRIPTION Rand uses a multiplicative congruential random-number generator with period 2 32 that returns successive pseudo-random numbers in the range from 0 to 2 15 _1. Srand can be called at any time to reset the random-number generator to a random starting point. The generator is initially seeded with a value of 1. NOTE The spectral properties of rand leave a great deal to be desired. Drand48 (3 C) provides a much better, though more elaborate, random-number generator. SEE ALSO drand48 (3C). I - 1- RAND(3F) RAND(3F) NAME srand, rand - Fortran uniform random-number generator SYNOPSIS integer i, j call srand (n j = rand( ) DESCRIPTION Srand takes its integer argument as the seed of a random-number generator, the values of which are returned through successive invocations of rand. SEE ALSO randOC). I - 1- REGCMP(3X) REGCMP(3X) NAME regcmp, regex - compile and execute regular expression SYNOPSIS char -regcmp(stringl l, string2, 00.1, 0) char -stringl, -string2, .. 0; char -regex (re, subjectl, retO, .. oJ) char -re, -subject, -retO, 000; extern char -locI; DESCRIPTION Regcmp compiles a regular expression and returns a pointer to the compiled form. Malloc(3C) is used to create space for the vector. It is the user's responsibility to free unneeded space so allocated. A NULL return from regcmp indicates an incorrect argument. Regcmp (1) has been written to generally preclude the need for this routine at execution time. Regex executes a compiled pattern against the subject string. Additional arguments are passed to receive values back. Regex returns NULL on failure or a pointer to the next unmatched character on success. A global character pointer locI points to where the match began. Regcmp and regex were mostly borrowed from the editor, ed(l); however, the syntax and semantics have been changed slightly. The following are the valid symbols and their associated meanings. [] * 0" These symbols retain their current meaning. Matches the end of the string, \0 matches the new-line. $ Within brackets the minus means through. For example, [a -z] is equivalent to [abcd .. oxyz1. The - can appear as itself only if used as the last or first character. For example, the character class expression [) -] matches the characters] and -. + I A regular expression followed by + means one or more times. For example, [0 -9] + is equivalent to [0 -9][0 -9]-. {m} {m,} {m,u} Integer values enclosed in {} indicate the number of times the preceding regular expression is to be applied. m is the minimum number and u is a number, less than 256, which is the maximum. If only m is present (e.g., {m}), it indicates the exact number of times the regular expression is to be applied. {m,} is analogous to {m,infinity}. The plus ( +) and star (-) operations are equivalent to {1,} and to,} respectively. ( .. 0 )$n The value of the enclosed regular expression is to be returned. The value will be stored in the (n + IJth argument following the subject argument. At present, at most ten enclosed regular expressions are allowed. Regex makes its assignments unconditionally. ( "0 ) Parentheses are used for grouping. An operator, e.g. -, +, {}, can work on a single character or a regular expression enclosed in parenthesis. For example, (a*(cb+)*)$O. By necessity, all the above defined symbols are special. They must, therefore, be escaped to be used as themselves. EXAMPLES Example 1: char *cursor, *newcursor, *ptr; - 1- REGCMP(3X) REGCMP(3X) newcursor = regex«ptr = regcmp("A\n", 0)), cursor); free(ptr); This example will match a leading new-line in the subject string pointed at by cursor. Example 2: char retO[9]; char *newcursor, *name; name = regcmp("([A-Za-zHA-za-zO-9J{0,7})$0", 0); newcursor = regex(name, "123Testing321", retO); This example will match through the string "Testing3" and will return the address of the character after the last matched character (cursor+ 1 I). The string "Testing3" will be copied to the character array retO. Example 3: #inc1ude "filej" char *string, *newcursor; newcursor = regex (name, string); This example applies a precompiled regular expression in file.i (see regcmp (I)) against string. This routine is kept in /lib/libPW.a. SEE ALSO ed(l), regcmp(l), malloc(3C). BUGS The user program may run out of memory if regcmp is called iteratively without freeing the vectors no longer required. The following user-supplied replacement for maUoc (3C) reuses the same vector saving time and space: /* user's program */ malloc(n) { static int rebuf[256]; return rebuf; -2- I ROUND(3F) ROUND(3F) NAME ani nt, dnint, nint, idnint - Fortran nearest integer functions SYNOPSIS integer i real rl, r2 double precision dpl, dp2 r2 = anint (r 1) i = nint(r1) dp2 = anint(dp1) dp2 = dnint(dp1) i = nint(dp1) i = idnint(dp1) DESCRIPTION Anint returns the nearest whole real number to its real argument (i.e., int(a+O.S) if a ~ 0, int(a-O.S) otherwise). Dnint does the same for its double-precision argment. Nint returns the nearest integer to its real argument. Idnint is the double-precision version. Anint is the generic form of anint and dnint , performing the same operation and returning the data type of its argument. Nint is also the generic form of idnint. I - 1- SCANF(3S) SCANF(3S) NAME scanf, fscanf, sscanf - convert formatted input SYNOPSIS #include int scanf (format [ , pointer ] ... char .format; int fscanf (stream, format [ , pointer ] ... FILE .stream; char .format; int sscanf (s, format [ , pointer ] ... char .s, .format; DESCRIPTION Scanf reads from the standard input stream stdin. Fscanf reads from the named input stream. Sscanf reads from the character string s. Each function reads characters, interprets them according to a format, and stores the results in its arguments. Each expects, as arguments, a control string format described below, and a set of pointer arguments indicating where the converted input should be stored. The control string usually contains conversion specifications, which are used to direct interpretation of input sequences. The control string may contain: 1. White-space characters (blanks, tabs, new-lines, or form-feeds) which, except in two cases described below, cause input to be read up to the next non-white-space character. 2. An ordinary character (not %), which must match the next character of the input stream. 3. Conversion specifications, consisting of the character %, an optional assignment suppressing character ., an optional numerical maximum field width, an optional I or h indicating the size of the receiving variable, and a conversion code. A conversion specification directs the conversion of the next input field; the result is placed in the variable pointed to by the corresponding argument, unless assignment suppression was indicated by •. The suppression of assignment provides a way of describing an input field which is to be skipped. An input field is defined as a string of non-space characters; it extends to the next inappropriate character or until the field width, if specified, is exhausted. The conversion code indicates the interpretation of the input field; the corresponding pointer argument must usually be of a restricted type. For a suppressed field, no pointer argument should be given. The following conversion codes are legal: % d u o x e,f,g a single % is expected in the input at this point; no assignment is done. a decimal integer is expected; the corresponding argument should be an integer pointer. an unsigned decimal integer is expected; the corresponding argument should be an unsigned integer pointer. an octal integer is expected; the corresponding argument should be an integer pointer. a hexadecimal integer is expected; the corresponding argument should be an integer pointer. a floating point number is expected; the next field is converted accordingly and stored through the corresponding argument, which should be a pointer to a float. The input format for floating point numbers is an optionally signed string of digits, possibly containing a decimal point, - 1- I SCANFOS) SCANFOS) s c followed by an optional exponent field consisting of an E or an e, followed by an optionally signed integer. a character string is expected; the corresponding argument should be a character pointer pointing to an array of characters large enough to accept the string and a terminating \0, which will be added automatically. The input field is terminated by a white-space character. a character is expected; the corresponding argument should be a character pointer. The normal skip over white space is suppressed in this case; to read the next non-space character, use % Is. If a field width is given, the corresponding argument should refer to a character array; the indicated number of characters is read. indicates string data and the normal skip over leading white space is suppressed. The left bracket is followed by a set of characters, which we will call the scanset, and a right bracket; the input field is the maximal sequence of input characters consisting entirely of characters in the scanset. The circumflex, ("), when it appears as the first character in the scanset, serves as a complement operator and redefines the scanset as the set of all characters not contained in the remainder of the scanset string. There are some conventions used in the construction of the scanset. A range of characters may be represented by the construct first-last, thus [0123456789] may be expressed [0-91. Using this convention, first must be lexically less than or equal to last, or else the dash will stand for itself. The dash will also stand for itself whenever it is the first or the last character in the scanset. To include the right square bracket as an element of the scanset, it must appear as the first character (possibly preceded by a circumflex) of the scanset, and in this case it will not be syntactically interpreted as the closing bracket. The corresponding argument must point to a character array large enough to hold the data field and the terminating \0, which will be added automatically. The conversion characters d, u, 0, and x may be preceded by I or h to indicate that a pointer to long or to short rather than to int is in the argument list. Similarly, the conversion characters e , f , and g may be preceded by I to indicate that a pointer to double rather than to float is in the argument list. I Scan! conversion terminates at EOF, at the end of the control string, or when an input character conflicts with the control string. In the latter case, the offending character is left unread in the input stream. Scanf returns the number of successfully matched and assigned input items; this number can be zero in the event of an early conflict between an input character and the control string. If the input ends before the first conflict or conversion, EOF is returned. EXAMPLES The call: int i; float x; char name[50]; scanf ("%d%f%s", &i, &x, name); with the input line: 25 54.32E-l thompson will assign to i the value 25, to x the value 5.432, and name will contain thompson\O. Or: int i; float x; char name[50]; scanf ("%2d%f%*d %[0-9]", &i, &x, name); - 2- SCANF(3S) SCANFOS) with input: 56789 0123 56a72 will assign 56 to i, 789.0 to x, skip 0123, and place the string 56\0 in name. The next call to get char (see getc (3S» will return a. SEE ALSO atof(3C), getc (3S), printf(3S), strtol (3C). NOTE Trailing white space (including a new-line) is left unread unless matched in the control string. DIAGNOSTICS These functions return EOF on end of input and a short count for missing or illegal data items. BUGS The success of literal matches and suppressed assignments is not directly determinable. -3- SETBUF(3S) SETBUF(3S) NAME setbuf - assign buffering to a stream SYNOPSIS #include < stdio.h > void setbuf (stream, bur) FILE .stream; char .buf; DESCRIPTION Setbuf is used after a stream has been opened but before it is read or written. It causes the character array pointed to by buf to be used instead of an automatically allocated buffer. If buf is a NULL character pointer input/output will be completely unbuffered. A constant BUFSIZ, defined in the header file, tells how big an array is needed: char buf(BUFSIZ]; A buffer is normally obtained from maUoe (3C) at the time of the first gete or pute (3S) on the file, except that the standard error stream stderr is normally not buffered. Output streams directed to terminals are always line-buffered unless they are unbuffered. SEE ALSO fopen(3S), getc(3S), malloc(3C), putc(3S). NOTE A common source of error is allocating buffer space as an "automatic" variable in a code block, and then failing to close the stream in the same block. - 1- SETJMP(3C) SETJMP(3C) NAME setjmp, longjmp - non-local goto SYNOPSIS #include < setjrnp.h > int setjmp (env) jmp_buf env; void longjmp (env, val) jmp_buf env; int val; DESCRIPTION These functions are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. Setjmp saves its stack environment in env (whose type, jmp _buJ, is defined in the header file), for later use by longjmp. It returns the value o. Longjmp restores the environment saved by the last call of setjmp with the corresponding env argument. After longjmp is completed program execution continues as if the corresponding call of setjmp (which must not itself have returned in the interim) had just returned the value val. Longjmp cannot cause setjmp to return the value O. If longjmp is invoked with a second argument of 0, setjmp will return 1. All accessible data have values as of the time longjmp was called. SEE ALSO signal(2). WARNING If longjmp is called when env was never primed by a call to setjmp, or when the last such call is in a function which has since returned, absolute chaos is guaranteed. - 1- SIGN(3F) SIGN (3F) NAME sign, isign, dsign - Fortran transfer-of-sign intrinsic function SYNOPSIS integer i, j, k real rl, r2, r3 double precision dpl, dp2, dp3 k = isign (i, j) k = sign (i, j) r3 = sign (r 1, r2) dp3 dp3 = = dsign(dpl, dp2) sign(dpl, dp2) DESCRIPTION [sign returns the magnitude of its first argument with the sign of its second argument. Sign and dsign are its real and double-precision counterparts, respectively. The generic version is sign and will devolve to the appropriate type depending on its arguments. - 1- SIGNAL(3F) SIGNAL(3F) NAME signal - specify Fortran action on receipt of a system signal SYNOPSIS integer i external integer intfnc call signalO, intfnd DESCRIPTION Signal allows a process to specify a function to be invoked upon receipt of a specific signal. The first argument specifies which fault or exception, the second argument the function to be invoked. SEE ALSO kill (2), signal (2) . - 1- SIN(3F) SIN(3F) NAME sin, dsin, csin - Fortran sine intrinsic function SYNOPSIS real rt, r2 double precision dpt, dp2 complex cxt, cx2 r2 = sin(rl) dp2 dp2 dsin(dpl) sin (dp I) cx2 cx2 csin(cxl) sin(cxl) DESCRIPTION Sin returns the real sine of its real argument. Dsin returns the doubleprecision sine of its double-precision argument. Csin returns the complex sine of its complex arguemnt. The generic sin function becomes dsin or csin as required by argument type. SEE ALSO trig(3M) . - 1- ,INH OF) SINH OF) ~AME sinh, dsinh - Fortran hyperbolic sine intrinsic function ~YNOPSIS real rl, r2 double precision dpl, dp2 r2 = sinb(rl) dp2 = dsinb(dpl) dp2 = sinb(dpl) >ESCRIPTION Sinh returns the real hyperbolic sine of its real argument. Dsinh returns the double-precision hyperbolic sine of its double-precision argument. The generic form sinh may be used to return a double-precision value given a doubleprecision argument. ~EE ALSO sinh(3M). - 1- SINH(3M) SINH (3M) NAME sinh, cosh, tanh - hyperbolic functions SYNOPSIS #include < math.h > double sinh (x) double x; double cosh (x) double x; double tanh (x) double x; DESCRIPTION Sinh, cosh and tanh return respectively the hyberbolic sine, cosine and tangent of their argument. DIAGNOSTICS Sinh and cosh return HUGE when the correct value would overflow, and set errno to ERANGE. These error-handling procedures may be changed with the function matherr (3M). SEE ALSO matherr(3M) . - 1- SLEEP(3C) SLEEP (3C) NAME sleep - suspend execution for interval SYNOPSIS unsigned sleep (seconds) unsigned seconds; DESCRIPTION The current process is suspended from execution for the number of seconds specified by the argument. The actual suspension time may be less than that requested for two reasons: (1) Because scheduled wakeups occur at fixed 1second intervals, (on the second, according to an internal clock) and (2) because any caught signal will terminate the sleep following execution of that signal's catching routine. Also, the suspension time may be longer than requested by an arbitrary amount due to th.e scheduling of other activity in the system. The value returned by sleep will be the "unslept" amount (the requested time minus the time actually slept) in case the caller had an alarm set to go off earlier than the end of the requested sleep time, or premature arousal due to another caught signal. The routine is implemented by setting an alarm signal and pausing until it (or some other signal) occurs. The previous state of the alarm signal is saved and restored. The calling program may have set up an alarm signal before calling sleep; if the sleep time exceeds the time till such alarm signal, the process sleeps only until the alarm signal would have occurred, and the caller's alarm catch routine is executed just before the sleep routine returns, but if the sleep time is less than the time till such alarm, the prior alarm time is reset to go off at the same time it would have without the intervening sleep. SEE ALSO alarm (2), pause (2), signa1(2). I - 1- SPUTL(3X) (not on PDP-II) SPUTL(3X) NAME sputl, sgetl - access long numeric data in a machine independent fashion. SYNOPSIS sputl ( value, buffer ) long value; char -buffer; long sgetl ( buffer ) char -buffer; DESCRIPTION Sputl(3X) will take the 4 bytes of the long value and place them in memory starting at the address pointed to by buffer. The ordering of the bytes is the same across all machines. Sgetl will retrieve the 4 bytes in memory starting at the address pointed to by buffer and return the long value in the byte ordering of the host machine. The usage of sputl(3X) and sgetl in combination provides a machine independent way of storing long numeric data in an ASCII file. The numeric data stored in the portable archive file format (see ar(4» is written and read into/from buffers with sputl(3X) and sgetl respectively. A program which uses these functions must be loaded with the object file access routine library libld.a. SEE ALSO ar(4). I - 1- SQRT(3F) SQRT(3F) NAME sqrt, dsqrt, csqrt - Fortran square root intrinsic function SYNOPSIS real rl, r2 double precision dp 1, dp2 complex cxl, cx2 r2 = sqrt(rt) dp2 dp2 dsqrt(dpt) sqrt(dpt) cx2 cx2 csqrt(cxl) sqrt(cxt) DESCRIPTION Sqrt returns the real square root of its real argument. Dsqrt returns the double-precision square root of its double-precision arguement. Csqrt returns the complex square root of its complex argument. Sqrt, the generic form, will become dsqrt or csqrt as required by its argument type. SEE ALSO exp(3M). I - 1- SSIGNAL (3C) SSIGNAL(3C) NAME ssignal, gsignal - software signals SYNOPSIS #include < signal.h > int (-ssignal (sig, action» ( int sig, (-action) ( ); int gsignal (sig) int sig; DESCRIPTION Ssignal and gsignal implement a software facility similar to signal (2). This facility is used by the Standard C Library to enable users to indicate the disposition of error conditions, and is also made available to users for their own purposes. Software signals made available to users are associated with integers in the inclusive range 1 through 15. A call to ssignal associates a procedure, action, with the software signal sig; the software signal, sig, is raised by a call to gsignal. Raising a software signal causes the action established for that signal to be taken. The first argument to ssignal is a number identifying the type of signal for which an action is to be established. The second argument defines the action; it is either the name of a (user defined) action function or one of the manifest constants SIG_DFL (default) or SIG_IGN (ignore). Ssignal returns the action previously established for that signal type; if no action has been established or the signal number is illegal, ssignal returns SIG_DFL. Gsignal raises the signal identified by its argument, sig: If an action function has been established for sig, then that action is reset fn ~_ cr~ nVT -..... ......... _&.IJl..A..J nnrl +1".0. n,-..+;" ..... .f'l1l ..... ,... ... ;,,_ ...... .1..1.'-6 ".1..1."" ""' . . . . "'.1."' ...... ~C1 .I.,-&.I.I."''''.I.'--'.I..I..I.~ .o._+.o. .... .o.~ nr;f'h "",.1..1"""",,,,,,"," 1'1'.1\".1..1 ~_ .......... ...- ...... _+ U . l 6 U J..l.l"".l.l\. n:_ ""5- ~,..:_ '-1""5- nai returns the value returned to it by the action function. If the action for sig is SIG_IGN, gsignai returns the value 1 and takes no other action. I If the action for sig is SIG_DFL, gsignai returns the value 0 and takes no other action. If sig has an illegal value or no action was ever specified for sig, gsignai returns the value 0 and takes no other action. NOTES There are some additional signals with numbers outside the range 1 through 15 which are used by the Standard C Library to indicate error conditions. Thus, some signal numbers outside the range 1 through 15 are legal, although their use may interfere with the operation of the Standard C Library. - 1- STDIO(3S) STDIO (3S) NAME stdio - standard buffered input/output package SYNOPSIS #include < stdio.h > FILE .stdin, ·stdout, .stderr; DESCRIPTION The functions described in the entries of sub-class 3S of this manual constitute an efficient, user-level I/O buffering scheme. The in-line macros gete (3S) and putcC3S) handle characters quickly. The macros getehar, putehar, and the higher-level routines jgete, jgets, jprintj, jputc, jputs, jread, jseanJ, jwrite, gets, getw, printj, puts, putw, and seanj all use gete and pute; they can be freely intermixed. A file with associated buffering is called -a stream and is declared to be a pointer to a defined type FILE. Fopen (3S) creates certain descriptive data for a stream and returns a pointer to designate the stream in all further transactions. Normally, there are three open streams with constant pointers declared in the header file and associated with the standard open files: stdin stdout stderr standard input file standard output file standard error file. A constant NULL (0) designates a nonexistent pointer. An integer constant EOF (- 1) is returned upon end-of-file or error by most integer functions that deal with streams (see the individual descriptions for details). Any program that uses this package must include the header file of pertinent macro definitions, as follows: #include The functions and constants mentioned in the entries of sub-class 3S of this manual are declared in that header file and need no further declaration. The constants and the following "functions" are implemented as macros (redeclaration of these names is perilous): gete, getehar, pute, putehar, jeoj, jerror, clearerr, and fileno. SEE ALSO open (2) , close(2), Iseek(2), pipe(2), read(2), write(2), ctermid(3S), cuserid(3S), fclose(3S), ferror(3S), fopen(3S), fread(3S), fseek(3S), getc(3S), gets(3S), popen(3S), printf(3S), putc(3S), puts(3S), scanf(3S), setbuf(3S), system (3S), tmpfile (3S), tmpnam (3S), ungetc (3S). DIAGNOSTICS Invalid stream pointers will usually cause grave disorder, possibly including program termination. Individual function descriptions describe the possible error conditions. - 1- I STDIPC(3C) STDIPC(3C) NAME stdipc - standard interprocess communication package SYNOPSiS #include #include < sys/types.h > < sys/ipc.h > key _t ftok(path, id) char .path; char id; DESCRIPTION All interprocess communication facilities require the user to supply a key to be used by the msgget (2), semget (2) and shmget (2) system calls to obtain interprocess communication identifiers. One suggested method for forming a key is to use the flOk subroutine described below. Another way to compose keys is to include the project ID in the most significant byte and to use the remaining portion as a sequence number. There are many other ways to form keys, but it is necessary for each system to define standards for forming them. If some standard is not adhered to, it will be possible for unrelated processes to unintentionally interfere with each other's operation. Therefore, it is strongly suggested that the most significant byte of a key in some sense refer to a project so that keys do not conflict across a given system. Ftok returns a key based on path and id that is usable in subsequent msgget, semget and shmget system calls. Path must be the path name of an existing file that is accessible to the process. Id is a character which uniquely identifies a project. Note that ftok will return the same key for linked files when called with the same id and that it will return different keys when called with the same file name but different ids. SEE ALSO intro(2), !!!sgget(2), ~em.get (2), ~hrr.g~t (2). DIAGNOSTICS Ftok returns (key _0 -1 if path does not exist or if it is not accessible to the process. WARNING I If the file whose path is passed to ftok is removed when keys still refer to the file, future calls to ftok with the same path and id will return an error. If the same file is recreated, then ftok is likely to return a different key than it did the original time it was called. - 1- STRING(3C) STRING(3C) NAME strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, strchr, strrchr, strpbrk, strspn, strcspn, strtok - string operations SYNOPSIS #include < string.h > char .strcat (sl, s2) char .sl, .s2; char .strncat (sl, s2, n) char .sl, .s2; int n; int strcmp (sl, s2) char .sl, .s2; int strncmp (sl, s2, n) char .sl, .s2; int n; char .strcpy (sl, s2) char .sl, .s2; char .strncpy (sl, s2, n) char .sl, ·s2; int n; int strlen (s) char .s; char .strchr (s, c) char .s, c; char ·strrchr (s, c) char .s, c; char .strpbrk (sl, s2) char .sl, .s2; int strspn (sl, s2) char .sl, .s2; int strcspn (s 1, s2) char .sl, .s2; char .strtok (sl, s2) char .sl, .s2; DESCRIPTION The arguments sl, s2 and s point to strings (arrays of characters terminated by a null character). The functions strcat, strncat, strcpy and strncpy all alter s 1. These functions do not check for overflow of the array pointed to by s 1 . Strcat appends a copy of string s2 to the end of string sl. Strncat appends at most n characters. Each returns a pointer to the null-terminated result. Strcmp compares its arguments and returns an integer less than, equal to, or greater than 0, according as sl is lexicographically less than, equal to, or greater than s2. Strncmp makes the same comparison but looks at at most n characters. Strcpy copies string s2 to sl, stopping after the null character has been copied. Strncpy copies exactly n characters, truncating s2 or adding null characters to sl if necessary. The result will not be null-terminated if the length of s2 is n or more. Each function returns s 1 . - 1- I STRING(3C) STRING(3C) Str/en returns the number of characters in s, not including the terminating null character. Strchr (strrchr) returns a pointer to the first Clast) occurrence of character c in string s, or a NULL pointer if c does not occur in the string. The null character terminating a string is considered to be part of the string. Strpbrk returns a pointer to the first occurrence in string s 1 of any character from string s2, or a NULL pointer if no character from s2 exists in sl. Strspn (strcspn) returns the length of the initial segment of string sl which consists entirely of characters from (not from) string s2. Strtok considers the string sl to consist of a sequence of zero or more text tokens separated by spans of one or more characters from the separator string s2. The first call (with pointer sl specified) returns a pointer to the first character of the first token, and will have written a null character into sl immediately following the returned token. The function keeps track of its position in the string between separate calls, so that on subsequent calls (which must be made with the first argument a NULL pointer) will work through the string sl immediately following that token. In this way subsequent calls will work through the string sl until no tokens remain. The separator string s2 may be different from call to call. When no token remains in sl, a NULL pointer is returned. NOTE For user convenience, all these functions are declared in the optional < string. h > header file. BUGS Strcmp and strncmp use native character comparison, which is signed on POP11 s, unsigned on other machines. Character movement is performed differently in different implementations. "T"1- ________ 1 _ _ _ ! ___________ . ______ .ll1U~ UV~II<1l-'l-'ll1o 1I1UVV~ 111<1y ~_l..l Y IvlU ____ .- __ _ ~Ul"Jll~v~. I - 2- STRTOLOC> STRTOLOC> NAME strtol, atol, atoi - convert string to integer SYNOPSIS long strtol (str, ptr, base) char .str; char "ptr; int base; long atol (str) char .str; int atoi (str) char .str; DESCRIPTION Strtol returns as a long integer the value represented by the character string str. The string is scanned up to the first character inconsistent with the base. Leading "white-space" characters are ignored. If the value of ptr is not (char •• )NULL, a pointer to the character terminating the scan is returned in .ptr. If no integer can be formed, .ptr is set to str, and zero is returned. If base is positive (and not greater than 36), it is used as the base for conversion. After an optional leading sign, leading zeros are ignored, and "Ox" or "OX" is ignored if base is 16. If base is zero, the string itself determines the base thus: After an optional leading sign, a leading zero indicates octal conversion, and a leading "Ox" or "OX" hexadecimal conversion. Otherwise, decimal conversion is used. Truncation from long to int can, of course, take place upon assignment, or by an explicit cast. Atof(str) is equivalent to strtof(str, (char **)NULL, 10). Atodstr) is equivalent to unt) strtof(str, (char **)NULL, 10). SEE ALSO atof(3C), scanf(3S). BUGS Overflow conditions are ignored. - 1- SWAB(3C) SWAB(3C) NAME swab - swap bytes SYNOPSIS void swab (from, to, nbytes) char .from, ·to; int nbytes; DESCRIPTION Swab copies nbytes bytes pointed to by from to the array pointed to by to, exchanging adjacent even and odd bytes. It is useful for carrying binary data between PDP-lIs and other machines. Nbytes should be even and nonnegative. If nbytes is odd and positive swab uses nbytes-l instead. If nbytes is negative swab does nothing. - I - I SYSTEM (3F) SYSTEM(3F) "NAME system - issue a shell command from Fortran SYNOPSIS character· N c call system(c) DESCRIPTION System causes its character argument to be given to sh (1) as input, as if the string had been typed at a terminal. The current process waits until the shell has completed. SEE ALSO sh (1), exec(2), system OS). - 1- SYSTEM(3S) SYSTEM(3S) NAME system - issue a shell command SYNOPSIS #include < stdio.h > int system (string) char .string; DESCRIPTION System causes the string to be given to sh (1) as input, as if the string had been typed as a command at a terminal. The current process waits until the shell has completed, then returns the exit status of the shell. FILES Ibin/sh SEE ALSO sh (1), exec(2). DIAGNOSTICS System forks to create a child process that in turn exec's Ibinlsh in order to execute string. If the fork or exec fails, system returns -1 and sets errno. I - 1- TAN(3F) TAN(3F) NAME tan, dtan - Fortran tangent intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 = tan(rt) dp2 = dtan(dpl) dp2 = tan(dpt) DESCRIPTION Tan returns the real tangent of its real argument. Dtan returns the doubleprecision tangent of its double-precision argument. The generic tan function becomes dtan as required with a double-precision argument. SEE ALSO trig(3M). - 1- TANH(3F) TANH(3F) NAME tanh, dtanh - Fortran hyperbolic tangent intrinsic function SYNOPSIS real rl, r2 double precision dpl, dp2 r2 = tanb(rt) dp2 dp2 = = dtanb(dpt) tanb(dpl) DESCRIPTION Tanh returns the real hyperbolic tangent of its real argument. Dtanh returns the double-precision hyperbolic tangent of its double precision argument. The generic form tanh may be used to return a double-precision value given a double-precision argument. SEE ALSO sinh(3M). - 1- TMPFILE (3S) TMPFILE (3S) NAME tmpfile - create a temporary file SYNOPSIS #include FILE .tmpfile () DESCRIPTION Tmpfile creates a temporary file and returns a corresponding FILE pointer. The file will automatically be deleted when the process using it terminates. The file is opened for update. SEE ALSO creat(2), unlink(2), fopen OS), mktempOC), tmpnam OS). - 1- TMPNAMOS) TMPNAMOS) NAME tmpnam, tempnam - create a name for a temporary file SYNOPSIS #include < stdio.h > char *tmpnam (s) char *s; char *tempnam (dir, pfx) char *dir, .pfx; DESCRIPTION These functions generate file names that can safely be used for a temporary file. Tmpnam always generates a file name using the path-name defined as P _tmpdir in the header file. If s is NULL, tmpnam leaves its result in an internal static area and returns a pointer to that area. The next call to tmpnam will destroy the contents of the area. If s is not NULL, it is assumed to be the address of an array of at least L_tmpnam bytes, where L_tmpnam is a constant defined in ; tmpnam places its result in that array and returns s. Tempnam allows the user to control the choice of a directory. The argument dir points to the path-name of the directory in which the file is to be created. If dir is NULL or points to a string which is not a path-name for an appropriate directory, the path-name defined as P _tmpdir in the header file is used. If that path-name is not accessible, Itmp will be used as a last resort. This entire sequence can be up-staged by providing an environment variable TMPDIR in the user's environment, whose value is a path-name for the desired tern porary -file directory. Many applications prefer their temporary files to have certain favorite initial jeuer sequences in their names. Use the pfx argument for this. This argument may be NULL or point to a string of up to five characters to be used as the first few characters of the temporary-file name. I Tempnam uses maUoe (3C) to get space for the constructed file name, and returns a pointer to this area. Thus, any pointer value returned from tempnam may serve as an argument to free (see maUoe (3C)). If tempnam cannot return the expected result for any reason, i.e. maUac failed, or none of the above mentioned attempts to find an appropriate directory was successful, a NULL pointer will be returned. NOTES These functions generate a different file name each time they are called. Files created using these functions and either fapen or creat are temporary only in the sense that they reside in a directory intended for temporary use, and their names are unique. It is the user's responsibility to use unlink (2) to remove the file when its use is ended. SEE ALSO creat(2), unlink(2), fopen(3S), malloc(3C), mktemp(3C), tmpfile(3S). BUGS If called more than 17,576 times in a single process, these functions will start recycling previously used names. Between the time a file name is created and the file is opened, it is possible for some other process to create a file with the same name. This can never happen if that other process is using these functions or mktemp, and the file names are chosen so as to render duplication by other means unlikely. - 1- TRIG(3M) TRIG(3M) NAME sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions SYNOPSIS #include < math.h > double sin (x) double x; double cos (x) double x; double tan (x) double x', double asin (x) double x', double acos (x) double x', double atan (x) double x; double atan2 (y, x) double x, y; DESCRIPTION Sin, cos and tan return respectively the sine, cosine and tangent of their argument, which is in radians. Asin returns the arcsine of x, in the range -1('12 to 1('12. Acos returns the arccosine of x, in the range 0 to 1('. Atan returns the arctangent of x, in the range -1('12 to 1('12. Atan2 returns the arctangent of ylx, in the range -1(' to 1(', using the signs of both arguments to determine the quadrant of the return value. DIAGNOSTICS Sin, cos and tan lose accuracy when their argument is far from zero. For arguments sufficiently large, these functions return 0 when there would otherwise be a complete loss of significance. In this case a message indicating TLOSS error is printed on the standard error output. For less extreme arguments, a PLOSS error is generated but no message is printed. In both cases, ermo is set to ERANGE. Tan returns HUGE for an argument which is near an odd multiple of 1('12 when the correct value would overflow, and sets ermo to ERANGE. Arguments of magnitude greater than 1.0 cause asin and acos to return 0 and to set ermo to EDOM. In addition, a message indicating DOMAIN error is printed on the standard error output. These error-handling procedures may be changed with the function mat herr (3 M) . SEE ALSO rna therr (3 M) . - 1- TSEARCH(3C) TSEARCH (3C) NAME tsearch, tdelete, twalk - manage binary search trees SYNOPSIS #include < search.h > char .tsearch ({char .) key, (char .. ) rootp, compar) int (.compar)( ); char .tdelete ({char .) key, (char .. ) rootp, compar) int (.compar) ( ); void twalk «char .) root, action) void (·action) ( ); DESCRIPTION Tsearch is a binary tree search routine generalized from Knuth (6.2.2) Algorithm T. It returns a pointer into a tree indicating where a datum may be found. If the datum does not occur, it is added at an appropriate point in the tree. Key points to the datum to be sought in the tree. Rootp points to a variable that points to the root of the tree. A NULL pointer value for the variable denotes an empty tree; in this case, the variable will be set to point to the datum at the root of the new tree. Compar is the name of the comparison function. It is called with two arguments that point to the elements being compared. The function must return an integer less than, equal to, or greater than zero according as the first argument is to be considered less than, equal to, or greater than the second. Tdelete deletes a node from a binary search tree. It is generalized from Knuth (6.2.2) algorithm D. The arguments are the same as for tsearch. The variable pointed to by rootp will be changed if the deleted node was the root of the tree. Tdelete returns a pointer to the parent of the deleted node, or a NULL pointer if the node is not found. I Twalk traverses a binary search tree. Root is the root of the tree to be traversed. (Any node in a tree may be used as the root for a walk below that node.) Action is the name of a routine to be invoked at each node. This routine is, in turn, called with three arguments. The first argument is the address of the node being visited. The second argument is a value from an enumeration data type typedef enum {preorder, postorder, endorder, leaf} VISIT; (defined in the < search.h > header file), depending on whether this is the first, second or third time that the node has been visited (during a depth-first, left-to-right traversal of the tree), or whether the node is a leaf. The third argument is the level of the node in the tree, with the root being level zero. NOTES The pointers to the key and the root of the tree should be of type pointer-toelement, and cast to type pointer-to-character. The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared. Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. Warning: the root argument to twalk is one level of indirection less than the rootp arguments to tsearch and tdelete. DIAGNOSTICS A NULL pointer is returned by tsearch if there is not enough space available to create a new node. A NULL pointer is returned by tsearch and tdelete if rootp is NULL on entry. SEE ALSO bsearch OC), hsearch OC), lsearch OC). - 1- TSEARCH (3C) TSEARCH (3C) BUGS Awful things can happen if the calling function alters the pointer to the root. I - 2 - TTYNAME (3C) TTYNAME (3C) NAME ttyname, isatty - find name of a terminal SYNOPSIS char .ttyname (fildes) int fildes; int isatty (fildes) int fildes; DESCRIPTION Ttynarne returns a pointer to a string containing the null-terminated path name of the terminal device associated with file descriptor fi/des. !satty returns 1 if fi/des is associated with a terminal device, 0 otherwise. FILES !dev!· DIAGNOSTICS Ttynarne returns a NULL pointer if fi/des does not describe a terminal device in directory Idev. BUGS The return value points to static data whose content is overwritten by each call. I - 1- TTYSLOT (3C) TTYSLOT(3C) NAME ttyslot - find the slot in the utmp file of the current user SYNOPSIS int ttyslot ( ) DESCRIPTION Ttyslot returns the index of the current user's entry in the letc/utmp file. This is accomplished by actually scanning the file letc/inittab for the name of the terminal associated with the standard input, the standard output, or the error output (0, 1 or 2). FILES /etclinittab /etc/utmp SEE ALSO getut(3C), ttyname(3C). DIAGNOSTICS ° A value of is returned if an error was encountered while searching for the terminal name or if none of the above file descriptors is associated with a terminal device. I - 1- UNGETCOS) UNGETCOS) NAME ungetc - push character back into input stream SYNOPSIS #include < stdio.h > int ungetc (c, stream) char c; FILE -stream; DESCRIPTION Ungetc inserts the character c into the buffer associated with an input stream. That character, c, will be returned by the next getc call on that stream. Ungetc returns c, and leaves the file stream unchanged. One character of push back is guaranteed provided something has been read from the stream and the stream is actually buffered. If c equals EOF, ungetc does nothing to the buffer and returns EOF. Fseek (3S) erases all memory of inserted characters. SEE ALSO fseek(3S), getc(3S), setbuf(3S). DIAGNOSTICS In order that ungetc perform correctly, a read statement must have been performed prior to the call of the ungetc function. Ungetc returns EOF if it can't insert the character. In the case that stream is stdin, ungetc will allow exactly one character to be pushed back onto the buffer without a previous read statement. I - 1- X25ALNK (3C) X25ALNK (3C) NAME x25alnk, x25ilnk - attach or install a BX.25 link SYNOPSIS #include < x25lib.h > int x25alnk (Hnkid, devname, lineno, mod name, int Iinkid, lineno; char .devname, .modname; unsigned flags; int x25ilnk (Hnkid, pktsize, flags) int Iinkid, pktsize; unsigned flags; DESCRIPTION X25alnk is used to attach a BX.25 logical link specified by linkid to a level 2 device whose name is devname by making the necessary connections between data structures. Linkid is the identifier for the link data structure to be used in the operating system. This identifier can be thought of as the connector between x25ipvc calls and the x25alnk call for the physical link on which the channels are multiplexed. An example of a link identifier is 1. Devname is the name of the physical device running the interpreter and script for this link, e.g., Idev/kmcO. Lineno is the physical line number (range 0-7) for a logical link on a physical unit, e.g., 4. Modname is the name of the synchronous modem control device. If the LNKMOD flag is specified, the standard modem control functions performed for the line are to raise data terminal ready and request to send. An example of modname is Idev/kdmO. Flags specifies the options for the attach call, e.g., LNKBACK requests devname as a backup device. The permissible flags bit settings for attach are: LNKMOD modname specified. LNKBACK attach a backup rather a primary device. X25ilnk is used to initialize a link; more precisely, to start the level 2 protocol in the associated device and to start the level 3 protocol in the UNIX System driver for the link specified by linkid. Pktsize is the packet size to be used for level 3 data packets. Pktsize must be a number that is a power of 2 between 16 and 1024 inclusive. The default packet size is 128. The LNKPKT flag must be raised to set a non-default size. Flags specifies the options for the initialization call, e.g., LNKISB requests the B address. The permissible flags bit settings for initialization are: LNKPKT LNKISB LNKBACK LNKFAST packet size specified tell interpreter line is an X.25 B address; default is A. initialize the backup device. the device speed is greater than 9.6 KB. SEE ALSO ioct1(2), open (2), stat(2), perror(3C), x25clnk(3C), x25hlnk(3C). x25pvc(IM), nc(7) , vpm(7), x25(7) in the UNIX System Administrator's Manual. Operations Systems Network Protocol Specification: BX.25 Issue 2, Bell La bora tories. - 1- X25ALNK(3C) DIAGNOSTICS ELNKPKT ELNKNCO ELNKNCi ELNKDS ELNKDNC ELNKMCO ELNKMCI ELNKLNO X25ALNK (3C) packet size specified is illegal. network control device open failed; check errno. network control device ioctl failed; check ermo. stat of physical device failed; check errno. file associated with device name not a character special device. modem control device open failed; check errno. modem control device ioctl failed; check errno. device line number illegal. I - 2- X25CLNK (3C) X25CLNK OC) NAME x25clnk - change over a BX.25 link SYNOPSIS #include < x25lib.h > int x25c1nk Oinkid} int linkid; DESCRIPTION X25clnk is used to change over from the primary to the backup level 2 device associated with link linkid. Linkid is the identifier for the link data structure which is used in the operating system. This identifier was set up by the x25alnk subroutine call. SEE ALSO ioctl(2), open(2), stat(2), perror(3C), x25alnk(3C), x25hlnk(3C). x25pvc(lM), nc(7), vpm(7), x25(7) in the UNIX System Administrator's Manual. Operations Systems Network Protocol Specification: BX.25 Issue 2, Bell Laboratories. DIAGNOSTICS ELNKNCO ELNKNCI ELNKDS ELNKDNC network control device open failed; check errno. network control device ioctl failed; check errno. stat of physical device failed; check errno. file associated with device name not a character special device. - 1- X25HLNK (3C) X25HLNK (3C) NAME x25hlnk, x25dlnk - halt or detach a BX.25 link SYNOPSiS #include int x25hlnk Oinkid, flags) int Iinkid; unsigned flags; int x25dlnk Oinkid, flags) int linkid; unsigned flags; DESCRIPTION X25hlnk is used to halt a link; more precisely, to stop the level 2 protocol in the associated device and to stop the level 3 protocol in the UNIX System driver for the link specified by linkid. If a backup device has been attached and started, the level 2 protocol on the backup will also be stopped. X25dlnk is used to detach a BX.25 logical link specified by linkid. removes the logical connections which were made by x25alnk. This Linkid is the identifier for the link data structure which is used in the operating system. This identifier was set up by the x25alnk subroutine call. Flags specifies the options for the halt or detach call. The permissible flags bit settings for halt is: LNKBACK halt only the level 2 protocol on the backup device. The level 3 protocol must not be running on this backup device. The permissible flags bit settings for detach is: LNKBACK detach a backup rather than a primary device. I SEE ALSO ioctI(2), open(2), stat(2), perrorOC), x25alnk(3C), x25c1nkOC). x25pvc(1M), nc(7) , vpm(7), x25(7) in the UNIX System Administrator's Manual. Operations Systems Network Protocol Specification: BX.25 Issue 2,Bell Laboratories. DIAGNOSTICS ELNKNCO ELNKNCI ELN KDS ELNKDNC network control device open failed; check ermo. network control device ioctl failed; check ermo. stat of physical device failed; check ermo. file associated with device name not a character special device. - 1- X25IPVC (3C) X25IPVC (3C) NAME x25ipvc, x25rpvc - install or remove a PVC on a link SYNOPSIS #include < x25lib.h > int x25ipvc (slotname, chno, Iinkid, flags) char .slotname; int chno, Iinkid; unsigned flags; int x25rpvc (slotname) char ·slotname; DESCRIPTION X25ipvc may be used to install a BX.25 Permanent Virtual Circuit (PVC) on a specified BX.25 interface (link). If slotname is currently connected (but removable) this connection is removed and the new connection is made to the logical channel chno on the link specified by linkid. Slotname is a path name that specifies a BX.25 minor device (slot), e.g., Idev/x25s12. Chno is the BX.25 level 3 logical channel number associated with the PVC, e.g., 3. chno must be in the range 1 to 4095 and must not be currently in use for any other BX.25 minor device associated with that link. Linkid is the identifier for the link data structure to be used in the operating system. This identifier can be thought of as the connector between x25ipvc calls and the x25alnk call for the physical link on which the channels are multiplexed. An example of a link identifier is 1. Flags contains settings for specifying PVC install options; permissible PVC flags bit settings are: PVCSESS Session connect/disconnect packets used. PVCREST RESET in-order/out-of-order responded to. PVCNONE No establishment protocol used. X25rpvc is used to remove the association between BX.25 minor device slotname and the link and channel to which it is currently connected. The command will fail if the slot is open, if packets are waiting to be transmitted, or if there are unacknowledged packets outstanding. SEE ALSO ioct1(2), open(2), stat(2) , perror(3C). nc(7), vpm(7), x25(7) in the UNIX System Admninistrator's Manual. Operations Systems Network Protocol Specification: BX.25 Issue 2, Bell Laboratories. DIAGNOSTICS EPVCNP no (or mUltiple) setup protocol specified (one of PVCSESS, PVCREST, or PVCNONE must be in flags argument). EPVCNCO network control device open failed; check errno. EPVCNCI network control device ioctl failed; check errno. EPVCSS stat of slot (PVC) name failed; check errno. EPVCSNC file associated with slotname not a character special device. - 1- INTRO(4) INTRO(4) NAME intro - introduction to file formats DESCRIPTION This section outlines the formats of various files. The C struct declarations for the file formats are given where applicable. Usually, these structures can be found in the directories lusr/include or lusr/include/sys. References of the type name (1 M) refer to entries found in Section 1 of the UNIX System Administrator's Manual. - 1- A.OUT(4) (not on PDP-I 1) A.OUT(4) \ NAME a.out - common assembler and link editor output DESCRIPTION The file name a.out is the output file from the assembler as(I) and the link editor ld (I) . Both programs will make a.out executable if there were no errors in ' assembling or linking and no unresolved external references. A common object file consists of a file header, a UNIX System header, a table of section headers, relocation information, (optional) line numbers, and a sym- . bol table. The order is given below. File header. UNIX System header. Section 1 header. Section n header. Section 1 data. Section n data. Section 1 relocation. Section n relocation. Section 1 line numbers. Section n line numbers. Symbol table. The last three sections (relocation, line numbers and symbol table) may be missing if the program was linked with the -s option of ld(I) or if the symbol table and relocation bits were removed by strip (1). Also note that if there wt;rt; nu unresuived exiernal references after iinking, the relocation information will be absent. The sizes of each segment (contained in the header, discussed below) are in bytes and are even. I When an a.out file is loaded into memory for execution, three logical segments are set up: the text segment, the data segment (initialized data followed by uninitialized, the latter actually being initialized to all O's), and a stack. The text segment begins at location 0 in the core image; the header is not loaded. If the magic number (the first field in the UNIX System header) is 407 (octal), it indicates that the text segment is not to be write-protected or shared, so the data segment will be contiguous with the text segment. If the magic number is 410 (octal), the data segment begins at the next segment boundary following the text segment, and the text segment is not writable by the program; if other processes are executing the same a.out file, they will share a single text segment. On the 3B20S, the stack begins at the end of the text and data sections and grows towards higher addresses. On the VAX, the stack begins at the end of memory and grows towards lower addresses. The stack is automatically extended as required. The data segment is extended only as requested by the brk (2) system call. The value of a word in the text or data portions that is not a reference to an undefined external symbol is exactly the value that will appear in memory when the file is executed. If a word in the text involves a reference to an undefined external symbol, the storage class of the symbol-table entry for that word will be marked as an "external symbol", and the section number will be set to o. - 1- (not on PDP-II) A.OUT(4) A.OUT(4) When the file is processed by the link editor and the external symbol becomes defined, the value of the symbol will be added to the word in the file. File Header The format of the filehdr header is struct filehdr { unsigned unsigned long long long unsigned unsigned }; short Cmagic; short Cnscns; Ctimdat; Csymptr; Cnsyms; short Copthdr; short fJlags; /* /* /* /* /* /* /* magic number */ number of sections */ time and date stamp */ file ptr to symtab */ # symtab entries */ sizeof(opt hdr) */ flags */ /* /* /* /* /* /* /* /* magic number */ version stamp */ text size in bytes, padded */ initialized data (data) */ uninitialized data (bss) */ entry point */ base of text used for this file */ base of data used for this file */ UNIX Header The format of the UNIX System header is typedef struct aouthdr { short magic; short vstamp; long tsize; long dsize; long bsize; long entry; long text_start; long data_start; } AOUTHDR; Section Header The format of the section header is struct scnhdr { char s_name[SYMNMLEN];I* section name */ long syaddr; /* physical address */ long s vaddr; / * virtual address */ long s=size; /* section size */ long s_scnptr; /* file ptr to raw data */ long sJelptr; /* file ptr to relocation */ long sJnnoptr; /* file ptr to line numbers */ unsigned short s_nreloc; /* # reloc entries */ unsigned short s_nlnno; /* # line number entries */ long s_flags; /* flags */ }; Relocation Object files have one relocation entry for each relocatable reference in the text or data. If relocation information is present, it will be in the following format: struct reloc { long long short }; r vaddr; /* (virtual) address of reference */ r=symndx; /* index into symbol table */ r_type; /* relocation type */ The start of the relocation information is relptr from the Section Header. If there is no relocation information, reiptr is o. -2- A.OUT(4) (not on PDP-l 1) A.OUT(4) Symbol Table The format of the symbol table header is #define SYMNMLEN #define FILNMLEN #define SYMESZ 8 14 18 struct syment { char unsigned long n _value; short unsigned short n_type; char char }; /* the size of a SYMENT */ n_namelSYMNMLEN]; /* name of sym" /* value of symbol */ n_scnum;/* section number */ /* type and derived type */ n_sc1ass;/* storage class */ n_numaux:/* number of aux entries */ Some symbols require more information than a single entry; they are followed by auxiliary entries that are the same size as a symbol entry. The format follows: - 3 - A.OUT(4) (not on PDP-ll) A.OUT(4) union auxent { struct { long x tagndx; union { struct { unsigned short xJnno; unsigned short x_size; } x lnsz; long xJsize; } x misc; union { struct { long xJnnoptr; long x_endndx; } x fcn; struct { unsigned short x_dimen[DIMNUM]; } x_ary; } xJcnary; unsigned short x_tvndx; } x_sym; struct { char } xJile; xJname[FILNMLEN]; struct { long x_scnlen; unsigned short x_nreloc; unsigned short x_nlinno; } x_scn; struct { x_tvfill; long unsigned short x tvlen; unsigned short x=tvran[2]; } x_tv; }; Indexes of symbol table entries begin at zero. The start of the symbol table is symptr (from the file header) bytes from the beginning of the file. If the symbol table is stripped, symptr is O. SEE ALSO as(I), cc(I), Id(I), filehdr(4) , Idfcn(4) , linenum(4), reloc(4), scnhdr(4) , syms(4) . -4- A.OUT(4) (PDP-ll only) A.OUT(4) NAME a.out - PDP-II assembler and link editor output DESCRIPTION A.out is the output file of the assembler as (1) and the link editor Id (1). Both programs will make a.out executable if there were no errors in assembling or linking and no unresolved external references. This file has four sections: a header, the program text and data segments, relocation information, and a symbol table Gn that order). The last two sections may be missing if the program was linked with the -s option of Id (1) or if the symbol table and relocation bits were removed by strip (1). Also note that if there were no unresolved external references after linking, the relocation information will be removed. The sizes of each segment (contained in the header, discussed below) are in bytes and are even. The size of the header is not included in any of the other sizes. When an a.out file is loaded into memory for execution, three logical segments are set up: the text segment, the data segment (initialized data followed by uninitialized, the latter actually being initialized to all O's), and a stack. The text segment begins at location 0 in the core image; the header is not loaded. If the magic number (the first field in the header) is 407 (octal), it indicates that the text segment is not to be write-protected or shared, so the data segment will be contiguous with the text segment. If the magic number is 410 (octal), the data segment begins at the first 0 mod 8K byte boundary following the text segment, and the text segment is not writable by the program; if other processes are executing the same a.out file, they will share a single text segment. If the magic number is 411 (octal) the text segment is again pure (write-protected and shared) and, moreover, the instruction and data spaces are separated; the text and data segment both begin at location o. See the PDP11/10 Processor Handbook for restrictions that apply to this situation. The stack will occupy the highest possible locations in the core image: from 177776 (octal) on the PDP-II and growing downwards. The stack is automatically extended as required. The data segment is only extended as requested by the brk (2) system call. The start of the text segment in the a.out file is hsize; the start of the data segment is hsize+S t (the size of the text), where hsize is 20 (octal) on the PDP11. The value of a word in the text or data portions that is not a reference to an undefined external symbol is exactly the value that will appear in memory when the file is executed. If a word in the text or data portion involves a reference to an undefined external symbol, as indicated by the relocation information (discussed below) for that word, then the value of the word as stored in the file is an offset from the associated external symbol. When the file is processed by the link editor and the external symbol becomes defined, the value of the symbol will be added to the word in the file. - 1- (PDP-II only) A.OUT(4) A.OUT(4) Header-POP-II The format of the a.out header for the PDP-II is as follows: struct exec short unsigned unsigned unsigned unsigned unsigned char char char char a_magic; a_text; a_data; a_bss; a_syms; a_entry; magic number *j size of text segment *j size of data segment *j size of bss segment *j size of symbol table *j entry point of program *j a_unused; a_hitext; j* hi bits for large text spaces *j ajlag; j* set if relocation info stripped *j a_stamp; j* version stamp *j j* j* j* j* j* j* Relocation-POP-II If relocation information is present, it amounts to two bytes per relocatable datum. There is no relocation information if the "suppress relocation" flag (a Jlag) in the header is on. The format of the relocation data is: struct r info int r_symbolnum:II, r_.segment:3, rycrel:I; }; The r ycrel field indicates, if on, that the reference is relative to the program counter (pc) register (e.g., clr x); if off, that the reference is to the actual symbol (e.g., clr *$x). The r _segment field indicates the segment referred to by the text or data word associated with the relocation word: 00 02 04 06 10 indicates indicates indicates indicates indicates the the the the the reference reference reference reference reference is is is is is absolute; to the text segment; to initialized data; to bss (uninitialized data); to an undefined external symbol. The field r_symbolnum contains a symbol number in the case of external references, and is unused otherwise. The first symbol is numbered 0, the second I, etc. The start of the relocation information on the PDP-II is: hsize+a- text +a- data Symbol Table-POP-II The symbol table on the PDP-ll consists of entries of the form: { struct nlist n_name[8]; char int n_type; unsigned n_value; }; The n_name field contains the ASCII name of the symbol, null-padded. The nJype field indicates the type of the symbol; the following values are possible: - 2- A.OUT(4) (PDP-ll only) 00 01 02 03 04 37 40 41 42 43 44 A.OUT(4) \ undefined symbol absolute symbol text segment symbol data segment symbol bss segment symbol file name symbol (produced by Id(I) undefined external symbol absolute external symbol text segment external symbol data segment external symbol bss segment external symbol The start of the symbol table on the PDP-II is: hsize+2 (a _text +a _data) if relocation information is present, and hsize+a text +a data if it is not. If a symbol's type on the PDP-II is undefined external and the value field is non-zero, the symbol is interpreted by the link editor ld (1) as the name of a common region whose size is indicated by the value of the symbol. SEE ALSO as(1), Id(I), nm(1), strip(I). - 3- ACCT(4) ACCT(4) NAME form~t acct - per-process accounting file SYNOPSIS #include DESCRIPTION Files produced as a result of calling acct (2) have records in the form defined by , whose contents are: typedef ushort comp_t; /. "floating point" ./ /. 13-bit fraction, 3-bit exponent ./ struct { acct /. Accounting flag ./ /. Exit status ./ char char ushort ushort dev_t time t comp_t comp_t comp_t comp_t comp_t comp_t char ac_flag; ac_stat; ac_uid; ac_tty; ac_btime; ac_utime; ac_stime; ac_etime; ac_mem; acjo; aCJw; ac_comm[8]; /. /. /. /. /. /. /. /. struct struct acct inode acctbuf; ·acctp; /. inode of accounting file ./ ac~id; Beginning time ./ acctng user time in clock ticks ./ acctng system time in clock ticks ./ acctng elapsed time in clock ticks ./ memory usage in clicks ./ chars trnsfrd by read/write ./ number of block reads/writes ./ command name ./ }; extern extern #define AFORK 01 #define ASU 02 #define ACCTF 0300 /. has executed fork, but no exec ./ /. used super-user privileges ./ /. record type: 00 = acct ./ In acJiag, the AFORK flag is turned on by each fork (2) and turned off by an exec (2). The ac_comm field is inherited from the parent process and is reset by any exec. Each time the system charges the process with a clock tick, it also adds to ac _mem the current process size, computed as follows: (data size) + (text size) / (number of in-core processes using text) The value of ac_mem/(ac_stime +ac_utime) can be viewed as an approximation to the mean process size, as modified by text-sharing. - 1- ACCT(4) ACCT(4) The structure tacct.h, which resides with the source files of the accounting commands, represents the total accounting format used by the various accounting commands: /* * total accounting (for acct period), also for day */ struct tacct { ta uid; uid t ta -name[8]; char float ta=cpu[2]; ta kcore[2]; float float ta=con[2]; ta_du; float long tayc; unsigned short ta sc; unsigned short ta=dc; unsigned short tajee; }; /* /* /* /* /* /* /* /* /* /* userid ./ login name */ cum. cpu time, p/np (mins) */ cum kcore-minutes, p/np */ cum. connect time, p/np, mins */ cum. disk usage */ count of processes */ count of login sessions */ count of disk samples */ fee for special services */ SEE ALSO acct (1 M), acctcom (1), acct (2) . BUGS The ac_mem value for a short-lived command gives little information about the actual size of the command, because ac_mem may be incremented while a different command (e.g., the shell) is being executed by the process. -2- I I AR(4) (not on PDP-It) AR(4) NAME ar - common archive file format DESCRIPTION The archive command ar is used to combine several files into one. Archives are used mainly as libraries to be searched by the link editor ld (I). Each archive begins with an archive file header which is made up of the following components: #define ARMAG #define SARMAG struct ar hdr char char char char " " 4 { I * archive header *I ar_magic[SARMAG]; 1* magic number *1 ar name[16]; 1* archive name *1 ar- date[4]; 1* date of last archive modification *1 ar=syms[4]; 1* number of ar_sym entries *1 }; Each archive which contains common object files (see a.out (4» includes an archive symbol table. This symbol table is used by the link editor ld(I) to determine which archive members must be loaded during the link edit process. The archive file header described above is followed by a number of symbol table entries. The number of symbol table entries is indicated in the ar_syms variable. Each symbol table entry has the following format: struct ar_sym { char sym_name[S]; char symytr[4]; 1* archive symbol table entry *1 1* symbol name, recognized by Id *j 1* archive position of symbol *1 The archive symbol table is automatically created and/or updated by the ar(1) command. Following the archive header and symbol table are the archive file members. Each file member is preceded by a file member header which is of the following format: struct arf hdr { arf name[ 16]; char arf-date[4]; char arf-uid[4]; char ar(gid[4]; char arf mode[4]; char ar(size[4]; j* j* 1* 1* 1* 1* j* cha~ archive file member header *1 file member name *1 file member date *1 file member user identification *1 file member group identification *j file member mode *1 file member size .1 }; All information in the archive header, symbol table and file member headers is stored in a machine independent fashion. All character data is automatically portable. The numeric information contained in the headers is also stored in a machine independent fashion. All numeric data is stored as four bytes and is accessed by the special archive 110 functions described in sputlOX) functions of the libld.a library. Common format archives can be moved from system to system as long as the portable archive command ar(I) is used. Conversion tools such as arcv (I) and convert (1) exist to aid in the transportation of non- - 1- AR(4) (not on PDP-! 1) AR(4) common format archives to this format. Each archive file member begins on a word boundary; a null byte is inserted between files if necessary. Nevertheless the size given reflects the actual size of the file exclusive of padding. Notice there is no provision for empty areas in an archive file. SEE ALSO ar(I), arcv(I), convert(l), ld(l), sputl(3X). BUGS The common archive structure is not compatible between the PDP-11 and the IBM-370, due to the different file formats. See arcv(l) and convert(I) to convert between machines. Strip (0 will remove all archive symbol entries from the header. The archive symbol entries must be restored via the s option of the ar(O command before the archive can be used with the link editor ld (I). - 2- AR(4) (PDP-II only) AR(4) NAME ar - archive file format DESCRIPTION The archive command ar is used to combine several files into one. Archives are used mainly as libraries to be searched by the link editor ld (1). A file produced by ar has a magic number at the start, followed by the constituent files, each preceded by a file header. The magic number is 0177545 (octal) Cit was chosen to be unlikely to occur anywhere else). The header of each file is 26 bytes long: #define ARMAG 0177545 struct ar hdr { char ar_name[I4]; long ar_date; char ar uid; char ar:Eid; int ar _mode; long ar _size; }; Each file begins on a word boundary; a null byte is inserted between files if necessary. Nevertheless the size given reflects the actual size of the file exclusive of padding. Notice there is no provision for empty areas in an archive file. SEE ALSO ar(1),ld(1). I - 1- CHECKLIST (4) CHECKLIST (4) NAME checklist - list of file systems processed by fsck DESCRIPTION Checklist resides in directory fete and contains a list of at most 15 special file names. Each special file name is contained on a separate line and corresponds to a file system. Each file system will then be automatically processed by the !sck(IM) command. SEE ALSO fsck(IM) . I - 1- CORE(4) CORE(4) NAME core - format of core image file DESCRIPTION The UNIX System writes out a core image of a terminated process when any of various errors occur. See signal (2) for the list of reasons; the most common are memory violations, illegal instructions, bus errors, and user-generated quit signals. The core image is called core and is written in the process's working directory (provided it can be; normal access controls apply). A process with an effective user ID different from the real user ID will not produce a core image. The first section of the core image is a copy of the system's per-user data for the process, including the registers as they were at the time of the fault. The size of this section depends on the parameter usize, which is defined in lusr linclude/sys/param.h. The remainder represents the actual contents of the user's core area when the core image was written. If the text segment is readonly and shared, or separated from data space, it is not dumped. The format of the information in the first section is described by the user structure of the system, defined in lusr/include/sys/user.h. The important stuff not detailed therein is the locations of the registers, which are outlined in lusr linclude/sys/reg.h. SEE ALSO crash (I M), sdb (1), setuid (2), signa1(2). - 1- CPIO(4) CPIO(4) NAME cpio - format of cpio archive DESCRIPTION The header structure, when the -c option of cpio(I) is not used, is: struct { short ushort h_magic, h_dev; h ino, h-mode, h=uid, h~id; short char h nlink, h-rdev, h=mtimel21, h namesize, h-filesizel21; h=namelh_namesize rounded to word]; } Hdr; When the -c option is used, the header information is described by: sscanf( Chdr, "%60%60%60%60%60%60%60%60% 1110%60% Illo%s", &Hdr.h magic, &Hdr.h dev, &Hdr.h ino, &Hdr.h mode, &Hdr.h=uid, &Hdr.h~id, &Hdr.h_nlink, & Hdr.h_rdev, & Longtime, & Hdr.h _namesize, & Longfile,Hdr .h _name); Longtime and Longfile are equivalent to Hdr.h_mtime and Hdr.hJilesize, respectively. The contents of each file are recorded in an element of the array of varying length structures, archive, together with other items describing the file. Every instance of h_magic contains the constant 070707 (octal). The items h_dev through h_mtime have meanings explained in stat(2). The length of the null-terminated path name h_name, including the null byte, is given by h namesize. The last record of the archive always contains the name TRAILER!!!. Special files, directories, and the trailer are recorded with hJilesize equal to zero. SEE ALSO cpio(I), find(I), stat(2). I - 1- DIR (4) DIR (4) NAME dir - format of directories SYNOPSIS #include DESCRIPTION A directory behaves exactly like an ordinary file, save that no user may write into a directory. The fact that a file is a directory is indicated by a bit in the flag word of its i-node entry (see Is (4». The structure of a directory entry as given in the include file is: #ifndef DIRSIZ #define DIRSIZ 14 #endif struct direct { ino t d ino; char d=name[DIRSIZ); }; By convention, the first two entries in each directory are for . and ... The first is an entry for the directory itself. The second is for the parent directory. The meaning of .. is modified for the root directory of the master file system; there is no parent, so .. has the same meaning as .. SEE ALSO fs(4). - 1- ERR FILE (4) ERRFILE(4) NAME errfile - error-log file format DESCRIPTION When hardware errors are detected by the system, an error record is generated and passed to the error-logging daemon for recording in the error log for later analysis. The default error log is lusr/adm/errfile. The format of an error record depends on the type of error that was encountered. Every record, however, has a header with the following format: struct errhdr { short short time t }; e_type; eJen; e_time; 1* record type *1 1* bytes in record {inc hdr} *1 1* time of day *1 The permissible record types are as follows: #define #define #define #define #define #define #define #define #define #define E_GOTS E_GORT E_STOP E_TCHG E_CCHG E_BLK E_STRAY E_PRTY E_PIO E_IOP 010 011 012 013 014 020 030 031 041 042 1* start for the UNIX System 3.0*1 1* start for the UNIX/RT System*1 1* stop *1 1* time change *1 configuration change *1 block device error *1 stray interrupt *1 memory parity *1 3B-20 programmed I/O *1 3B-20 I/O processor *1 1* 1* 1* 1* 1* 1* Some records in the error file are of an administrative nature. These include the startup record that is entered into the file when logging is activated, the stop record that is written if the daemon is terminated "gracefully", and the time-change record that is used to account for changes in the system's time-ofday. These records have the following formats: I struct estart { short struct utsname #ifndef u3b short long short #endif #ifdef u3b int #endif }; e_cpu; e name; e_mmr3; e_syssize; e_bconf; 1* CPU type *1 1* system names *1 e_mmcnt; 1* kbytes per array *1 1* contents mem mgmt reg 3 *1 1* 11170 system memory size *1 1* block dev configuration *1 #define eend errhdr 1* record header *1 struct etimchg { time t 1* new time *1 }; - 1- ERRFILE(4) ERRFILE(4) Stray interrupts cause a record with the following format to be logged: struct estray { #ifdef u3b uint #else physadr short #endif }; /* stray loc or device addr */ e saddr; e=sbacty; /* stray loc or device addr */ /* active block devices */ Memory subsystem error on 3B-20 and 11/70 processors cause the following record to be generated: struct eparity { #ifdef u3b int #else short #endif }; e---.parreg[3]; /* 3B memory registers */ e---.parreg[4]; /* memory subsys registers */ Memory subsystem errors on VAX-ll/780 processors cause the following record to be generated: struct ememory { e_sbier; int int e_memcad; }; Error records for block devices have the following format: struct eblock { #ifdef u3b e_num; ushort struct iostat { long io_ops; long io_misc; ushort io_unlog; e stats; short e=bflags; daddr t e bnum; uint e=bytes; union ptbl { int page[64]; union ptbl *pnext; e---.ptbl; struct ptbl e---'ptbl; uint e_voff; uint e_statl; e_stat2; uint #endif - 2- /* device number */ /* number read/writes */ /* number "other" operations */ /* number unlogged errors */ /* read/write, error, etc */ /* logical block number */ /* number bytes to transfer */ /* page table entries */ /* /* /* /* page table for transfer */ offset into page table */ status word 1 */ status word 2 */ ERRFILE(4) ERRFILE(4) #ifndef u3b dev t e dev; physadr e=regloc; e_bacty; short struct iostat { io_ops; long long io_misc; io_unlog; ushort e_stats; e_bflags; short e_cyloff; short e bnum; daddr t ushort e=bytes; e_memadd; paddr_t ushort eJtry; short #endif #ifdef vax struct mbaJegs { long mba_csr; long mba_cr; long mba_sr; long mba_var; long mba_vcr; } e_mba; #endif }; /* "true" major + minor dev no */ /* controller address */ /* other block I/O activity */ /* number read/writes */ /* number "other" operations */ /* number unlogged errors */ /* /* /* /* /* /* /* read/write, error, etc */ logical dev start cyl */ logical block number */ number bytes to transfer */ buffer memory address */ number retries */ number device registers */ The following values are used in the e_bflags word: #define #define #define #define #define #define E _WRITE E_READ E_NOIO E_PHYS /* write operation */ / * read operation */ /* no I/O pending */ /* physical I/O */ /* Unibus map in use */ /* I/O failed */ 0 1 02 E _MAP 04 010 E_ERROR 020 The following error records are for the 3B-20 only: I struct epio { char char uint uint e_chan; e_dev; e_chstat; e_cmd; /* /* /* /* /* struct eiop { char uint uint e unit; e-wordO; e=wordl; /* I/O processor Gop) error */ /* unit number */ / * iop report word * / / * iop report word */ - 3- programmed I/O (pio) error */ which channel */ which devon channel */ channel status */ pio command */ ERRFILE(4) ERRFILE(4) The "true" major device numbers that identify the failing device are as follows: Digital Equipment #define RKO 0 #define RPO 1 2 #define RFO #define TMO 3 4 #define TeO #define HPO 5 #define HTO 6 7 #define HSO 8 #define RLO #define HPI 9 #define HP2 10 #define HP3 11 Western Electric #define OFeO 0 #define IOPO 1 #define MTO 2 SEE ALSO errdemon (1 M) . -4- FILEHDR(4) FILEHDR(4) (not on PDP-ll) NAME filehdr - file header for common object files SYNOPSIS #include < filehdr.h > DESCRIPTION Every common object file begins with a 20-byte header. The following C struct declaration is used: stfUct filehdr { unsigned unsigned long long long unsigned unsigned }; short f_magic ; short f nscns ; f-timdat; (symptr; Cnsyms; short Copthdr; short fJlags; /. /. /. /. /. /. /. magic number ./ number of sections */ time & date stamp */ file ptr to symtab */ # symtab entries */ sizeof(opt hdr) */ flags *j F_symptr is the byte offset into the file at which the symbol table can be found. Its value can be used as the offset in fseek (3S) to position an 110 stream to the symbol table. The UNIX System optional header is always 36 bytes. The valid magic numbers are given below: #define N3BMAGIC #define NTVMAGIC 0550 0551 /* 3B20S */ /* 3B20S */ /* VAX writable text segments */ #define VAXWRMAGIC 0570 /* VAX readonly sharable text segments */ #define VAXROMAGIC 0575 The value in f_timdat is obtained from the time (2) system call. Flag bits currently defined are: #define #define #define #define #define #define #define #define #define #define #define I F_RELFLG F EXEC F_LNNO F_LSYMS F_MINMAL F_UPDATE F SWABD F AR16WR F_AR32WR F AR32W F_PATCH SEE ALSO time(2), fseek(3S), a.out(4). 00001 00002 00004 00010 00020 00040 00100 00200 00400 01000 02000 /. /* /. /. /* /* /. /. /* /* /. relocation entries stripped */ file is executable */ line numbers stripped ./ local symbols stripped */ minimal object file */ update file, ogen produced */ file is "pre-swabbed" */ 16 bit DEC host */ 32 bit DEC host */ non-DEC host */ "patch" list in opt hdr */ FS(4) FS(4) NAME file system - format of system volume SYNOPSIS #include < sys/filsys.h > #include < sys/types.h > #include DESCRIPTION Every file system storage volume has a common format for certain vital information. Every such volume is divided into a certain number of 512 byte long sectors. Sector 0 is unused and is available to contain a bootstrap program or other information. Sector 1 is the super-block. The format of a super-block is: /. • Structur.e of the super-block ./ struct filsys { ushort sjsize; /. size in blocks of i-list ./ /. size in blocks of entire volume ./ daddr t sJsize; s nfree; /. number of addresses in s free ./ short s)ree[NICFREE); /. free block list ./ daddr_t s ninode; short /. number of i-nodes in s inode ./ s:inode[NICINOD); /. free i-node list ./ ino t s_flock; char /. lock during free list manipulation ./ sjlock; /. lock during i-list manipulation ./ char char /. super block modified flag ./ sJmod; char /. mounted read-only flag ./ sJonly; s time; /. last super block update ./ time t s-dinfo[4); /. device information ./ short /. total free blocks./ daddr t s:tfree; ino t s tinode; /. total free inodes ./ s-fname(6); char /. file system name ./ s)pack[6); /. file system pack name ./ char s_fill[ 13); long /. ADJUST to make sizeof filsys be 512 ./ s_magic; long /. magic number to indicate new file system ./ s_type; /. type of new file system ./ long }; #define FsMAGIC Oxfd187e20 #define Fs 1b #define Fs2b /. 512 byte block ./ /. 1024 byte block ./ 1 2 S_type indicates the file system type. Currently, two types of file systems are supported: the original 512-byte oriented and the new improved 1024-byte oriented. S _magic is used to distinguish the original 512-byte oriented file systems from the newer file systems. If this field is not equal to the magic number, FsMAGIC, the type is assumed to be Fslb, otherwise the s_type field is used. In the following description, a block is then determined by the type. For the original 512-byte oriented file system, a block is 512 bytes. For the 1024-byte oriented file system, a block is 1024 bytes or two sectors. The operating system takes care of all conversions from logical block numbers to physical sector numbers. S _isize is the address of the first data block after the i-list; the i-list starts just after the super-block, namely in block 2; thus the i-list is s _isize-2 blocks long. - 1- FS(4) FS(4) S Jsize is the first block not potentially available for allocation to a file. These numbers are used by the system to check for bad block numbers; if an "impossible" block number is allocated from the free list or is freed, a diagnostic is written on the on-line console. Moreover, the free array is cleared, so as to prevent further allocation from a presumably corrupted free list. The free list for each volume is maintained as follows. The s Jree array contains, in s Jree[ 1], ... , sJree[s _nfree-l], up to 49 numbers of free blocks. S Jree[O] is the block number of the head of a chain of blocks constituting the free list. The first long in each free-chain block is the number (up to 50) of free-block numbers listed in the next 50 longs of this chain member. The first of these 50 blocks is the link to the next member of the chain. To allocate a block: decrement s_nfree, and the new block is s Jree[s _nfree 1 If the new block number is 0, there are no blocks left, so give an error. If s_nfree became 0, read in the block named by the new block number, replace s_nfree by its first word, and copy the block numbers in the next 50 longs into the s Jree array. To free a block, check if s_nfree is 50; if so, copy s_nfree and the sJree array into it, write it out, and set s_nfree to O. In any event set sJree[s_nfree1 to the freed block's number and increment s_nfree. S _tfree is the total free blocks available in the file system. S_ninode is the number of free i-numbers in the s_inode array. To allocate an i-node: if s_ninode is greater than 0, decrement it and return s_inode[s_ninodel If it was 0, read the i-list and place the numbers of all free inodes (up to 100) into the s_inode array, then try again. To free an i-node, provided s_ninode is less than 100, place its number into s_inode[s_ninode1 and increment s_ninode. If s_ninode is already 100, do not bother to enter the freed i-node into any table. This list of i-nodes is only to speed up the allocation process; the information as to whether the inode is really free or not is maintained in the inode itself. S _tinode is the total free in odes available in the file system. S Jiock and s_ilock are flags maintained in the core copy of the file system while it is mounted and their values on disk are immaterial. The value of s Jmod on disk is likewise immaterial; it is used as a flag to indicate that the super-block has changed and should be copied to the disk during the next periodic update of file system information. S Jonly is a read-only flag to indicate write-protection. S _time is the last time the super-block of the file system was changed, and is the number of seconds that have elapsed since 00:00 Jan. 1, 1970 (GMT). During a reboot, the s_time of the super-block for the root file system is used to set the system's idea of the time. S Jname is the name of the file system and s Jpack is the name of the pack. I-numbers begin at 1, and the storage for i-nodes begins in block 2. Also, inodes are 64 bytes long. I-node 1 is reserved for future use. I-node 2 is reserved for the root directory of the file system, but no other i-number has a built-in meaning. Each i-node represents one file. For the format of an inode and its flags, see inode (4). FILES lusr lincludel sys/filsys.h lusr/include/sys/stat.h SEE ALSO fsck(IM), fsdb(IM), mkfs(IM), inode(4). - 2- FSPEC(4) FSPEC(4) NAME fspec - format specification in text files DESCRIPTION It is sometimes convenient to maintain text files on the UNIX System with non-standard tabs, (i.e., tabs which are not set at every eighth column). Such files must generally be converted to a standard format, frequently by replacing all tabs with the appropriate number of spaces, before they can be processed by UNIX System commands. A format specification occurring in the first line of a text file specifies how tabs are to be expanded in the remainder of the file. A format specification consists of a sequence of parameters separated by blanks and surrounded by the brackets <: and :>. Each parameter consists of a keyletter, possibly followed immediately by a value. The following parameters are recognized: ttabs The t parameter specifies the tab settings for the file. The value of tabs must be one of the following: 1. a list of column numbers separated by commas, indicating tabs set at the specified columns; 2. a - followed immediately by an integer n, indicating tabs at intervals of n columns; 3. a - followed by the name of a "canned" tab specification. Standard tabs are specified by t -8, or equivalently, tl,9,17,25,etc. The canned tabs which are recognized are defined by the tabs (1) command. ssize The s parameter specifies a maximum line size. The value of size must be an integer. Size checking is performed after tabs have been expanded, but before the margin is prepended. mmargin The m parameter specifies a number of spaces to be prepended to each line. The value of margin must be an integer. d The d parameter takes no value. Its presence indicates that the line containing the format specification is to be deleted from the converted file. e The e parameter takes no value. Its presence indicates that the current format is to prevail only until another format specification is encountered in the file. Default values, which are assumed for parameters not supplied, are t -8 and mO. If the s parameter is not specified, no size checking is performed. If the first line of a file does not contain a format specification, the above defaults are assumed for the entire file. The following is an example of a line containing a format specification: * <:t5,10,15 s72:> * If a format specification can be disguised as a comment, it is not necessary to code the d parameter. Several UNIX System commands correctly interpret the format specification for a file. Among them is gath (see send(1C» which may be used to convert files to a standard format acceptable to other UNIX System commands. SEE ALSO ed(I), newform(1), send(1C), tabs(1). - 1- GETTYDEFS(4) GETTYDEFS (4) NAME gettydefs - speed and terminal settings used by getty DESCRIPTION The /etc/gettydefs file contains information used by getty (1 M) (see the UNIX System Administrator's Manual) to set up the speed and terminal settings for a line. It supplies information on what the login prompt should look like. It also supplies the speed to try next if the user indicates the current speed is not correct by typing a < break> character. Each entry in /etc/gettydefs has the following format: label# initial-flags # final-flags # login-prompt #next-Iabel Each entry is followed by a blank line. Lines that begin with # are ignored and may be used to comment the file. The various fields can contain quoted characters of the form \b, \n, \c, etc., as well as \nnn, where nnn is the octal value of the desired character. The various fields are: label This is the string against which getty tries to match its second argument. It is often the speed, such as 1200, at which the terminal is supposed to run, but it needn't be (see below). initial-flags These flags are the initial ioctl(2) settings to which the terminal is to be set if a terminal type is not specified to getty. Getty understands the symbolic names specified in /usr/include/sys/termio.h (see termio(7) in the UNIX System Administrator's Manual). Normally only the speed flag is required in the initial-flags. Getty automatically sets the terminal to raw input mode and takes care of most of the other flags. The initial-flag settings remain in effect until getty executes login (I). final-flags These flags take the same values as the initial-flags and are set just prior to getty executes login. The speed flag is again required. The composite flag SANE takes care of most of the other flags that need to be set so that the processor and terminal are communicating in a rational fashion. The other two commonly specified final-flags are TAB3, so that tabs are sent to the terminal as spaces, and HUPCL, so that the line is hung up on the final close. login-prompt This entire field is printed as the login-prompt. Unlike the above fields where white space is ignored (a space, tab or newline), they are included in the login-prompt field. next-label I This indicates the next label of the entry in the table that getty should use if the user types a or the input cannot be read. Usually, a series of speeds are linked together in this fashion, into a closed set. For instance, 2400 linked to 1200, which in turn is linked to 300, which finally is linked to 2400. If getty is called without a second argument, then the first entry of /etc/gettydefs is used, thus making the first entry of /etc/gettydefs the default entry. It is also used if getty can't find the specified label. If /etc/gettydefs itself is missing, there is one entry built into the command which will bring up a terminal at 300 baud. It is strongly recommended that after making or modifying /etc/gettydefs, it be run through getty with the check option to be sure there are no errors. FILES / etc/ gettydefs - 1- l GETTYDEFS(4) GETTYDEFS (4) SEE ALSO getty(1M), termio(7) in the UNIX System Administrator's Manual. login ( 1), ioctl (2) . - 2- GPS (4) GPS (4) NAME gps - graphical primitive string, format of graphical files DESCRIPTION GPS is a format used to store graphical data. Several routines have been developed to edit and display GPS files on various devices. Also, higher level graphics programs such as plot Gn stat (lG)) and vtoc Gn toc(IG)) produce GPS format output files. A GPS is composed of five types of graphical data or primitives. GPS PRIMITIVES lines The lines primitive has a variable number of points from which zero or more connected line segments are produced. The first point given produces a move to that location. (A move is a relocation of the graphic cursor without drawing.) Successive points produce line segments from the previous point. Parameters are available to set color, weight, and style (see below). arc The arc primitive has a variable number of points to which a curve is fit. The first point produces a move to that point. If only two points are included a line connecting the points will result, if three points a circular arc through the points is drawn, and if more than three, lines connect the points. (In the future, a spline will be fit to the points if they number greater than three.) Parameters are available to set color, weight, and style. text The text primitive draws characters. It requires a single point which locates the center of the first character to be drawn. Parameters are color, jont, textsize, and textangle. hardware The hardware primitive draws hardware characters or gives control commands to a hardware device. A single point locates the beginning location of the hardware string. comment A comment is an integer string that is included in a GPS file but causes nothing to be displayed. All GPS files begin with a comment of zero length. GPS PARAMETERS color Color is an integer value set for arc, lines, and text primitives. weight Weight is an integer value set for arc and lines primitives to indicate line thickness. The value 0 is narrow weight, 1 is bold, and 2 is medium weight. style Style is an integer value set for lines and arc primitives to give one of the five different line styles that can be drawn on Tektronix 4010 series storage tubes. They are: o solid 1 dotted 2 dot dashed 3 dashed 4 long dashed font An integer value set for text primitives to designate the text font to be used in drawing a character string. (Currently jont is expressed as a four-bit weight value followed by a four-bit style value.) textsize Textsize is an integer value used in text primitives to express the size of the characters to be drawn. Textsize represents the height of characters in absolute universe-units and is stored at one-fifth this value in the size-orientation (so) word (see below). - 1- GPS (4) GPS(4) textangle Textangle is a signed integer value used in text primitives to express rotation of the character string around the beginning point. Textangle is expressed in degrees from the positive x-axis and can be a positive or negative value. It is stored in the size-orientation (so) word as a value 256/360 of it's absolute value. ORGANIZATION GPS primitives are organized internally as follows: lines arc text hardware comment cw cw cw cw cw points sw points sw point sw so [string] point [string] [string] cw Cw is the control word and begins all primitives. It consists of four bits that contain a primitive-type code and twelve bits that contain the word-count for that primitive. point(s) Point(s) is one or more pairs of integer coordinates. Text and hardware primitives only require a single point. Point(s) are values within a Cartesian plane or universe having 64K (-32K to +32K) points on each axis. sw Sw is the style-word and is used in lines, arc, and text primitives. The first eight bits contain color information. In arc and lines the last eight bits are divided as four bits weight and four bits style. In the text primitive the last eight bits of sw contain the font. so So is the size-orientation word used in text primitives. The first eight bits contain text size and the remaining eight bits contain text rotation. string String is a null-terminated character string. If the string does not end on a word boundary an additional null is added to the GPS file to insure word-boundary alignment. SEE ALSO graphics (1 G). I - 2- GROUP(4) GROUP(4) NAME group - group file DESCRIPTION Group contains for each group the following information: group name encrypted password numerical group ID comma-separated list of all user allowed in the group This is an ASCII file. The fields are separated by colons; each group is separated from the next by a new-line. If the password field is null, no password is demanded. This file resides in directory fete. Because of the encrypted passwords, it can and does have general read permission and can be used, for example, to map numerical group ID's to names. FILES /etc/group SEE ALSO newgrp(l), passwd(I), crypt(3C), passwd(4). I - 1- INITTAB(4) INITTAB(4) NAME inittab - script for the init process DESCRIPTION The inittab file supplies the script to init's role as a general process dispatcher. The process that constitutes the majority of init's process dispatching activities is the line process fete/getty that initiates individual terminal lines. Other processes typically dispatched by init are daemons and the shell. The inittab file is composed of entries that are position dependent and have the following format: id:rstate:action:process Each entry is delimited by a newline, however, a backslash (\) preceding a newline indicates a continuation of the entry. Up to 512 characters per entry are permitted. Comments may be inserted in the process field using the sh (1) convention for comments. Comments for lines that spawn gettys are displayed by the who(1) command. It is expected that they will contain some information about the line such as the location. There are no limits (other than maximum entry size) imposed on the number of entries within the inittab file. The entry fields are: id This is one to four characters used to uniquely identify an entry. rstate This defines the run-level in which this entry is to be processed. Run-levels effectively correspond to a configuration of processes in the system. That is, each process spawned by init is assigned a run-level or run-levels in which it is allowed to exist. The run-levels are represented by a number ranging from 0 through 6. As an example, if the system is in run-levell, only those entries having a 1 in the rstate field will be processed. When init is requested to change runlevels, all processes which do not have an entry in the rstate field for the target run-level will be sent the warning signal (SIGTERM) and allowed a 20 second grace period before being forcibly terminated by a kill signal (SIGKILL). The rstate field can define multiple runlevels for a process by selecting more than one run-level in any combination from 0 -6. If no run-level is specified, then action will be taken on this process for all run-levels 0 -6. There are three other values, a, band c, which can appear in the rstate field, even though they are not true run-levels. Entries which have these characters in prothe rstate field are processed only when the telinit (see in it (1 cess requests them to be run (regardless of the current run-level of the system). They differ from run-levels in that the system is only in these states for as long as it takes to execute all the entries associated with the states. A process started by an a, b or c command is not killed when in it changes levels. They are only killed if their line in letc/inittab is marked off in the action field, their line is deleted entirely from letc/inittab, or init goes into the SINGLE USER state. M» action Key words in this field tell init how to treat the process specified in the process field. The actions recognized by init are as follows: respawn If the process does not exist then start the process, do not wait for its termination (continue scanning the inittab file), and when it dies restart the process. If the process currently exists then do nothing and continue scanning the inittab file. wait Upon init's entering the run-level that matches the entry's rstate, start the process and wait for its termination. All subsequent reads of the inittab file while init is - 1- INITTAB(4) INITTAB(4) in the same run-level will cause init to ignore this entry. a once Upon init's entering run-level that matches the entry's rstate, start the process, do not wait for its termination and when it dies, do not restart the process. If upon entering a new run-level, where the process is still running from a previous run-level change, the program will not be restarted. boot The entry is to be processed only at init's boot-time read of the inittab file. [nit is to start the process, not wait for its termination, and when it dies, not restart the process. In order for this instruction to be meaningful, the rstate should be the default or it must match init's run-level at boot time. This action is useful for an initialization function following a hardware- reboot of the system. bootwait The entry is to be processed only at init's boot-time read of the inittab file. [nit is to start the process, wait for its termination and, when it dies, not restart the process. powerfail Execute the process associated with this entry only when init receives a power fail signal (SIGPWR see signal (2». powerwait Execute the process associated with this entry only when init receives a power fail signal (SIGPWR) and wait until it terminates before continuing any processing of inittab. off If the process associated with this entry is currently running, send the warning signal (SIGTERM) and wait 20 seconds before forcibly terminating the process via the kill signal (SIGKILL). If the process is nonexistent, ignore the entry. ondemand This instruction is really a synonym for the respawn action. It is functionally identical to respawn but is given a different keyword in order to divorce its association with run-levels. This is used only with the a, b or c values described in the rstate field. initdefault An entry with this action is only scanned when init initially invoked. [nit uses this entry, if it exists, to determine which run-level to enter initially. It does this by taking the highest run-level specified in the rstate field and using that as its initial state. If the rstate field is empty, this is interpreted as 0123456 and so init will enter run-level 6. Also, the initdefault entry can use s to specify that init start in the SINGLE USER state. Additionally, if init doesn't find an initdefault entry in letc/inittab, then it will request an initial run-level from the user at reboot time. sysinit Entries of this type are executed before init tries to access the console. It is expected that this entry will be only used to initialize devices on which init might try to ask the run-level question. These entries are executed and waited for before continuing. process This is a sh command to be executed. The entire process field is prefixed with exec and passed to a forked sh as sh -c exec command'. For this reason, any legal sh syntax can appear in the the process field. Comments can be inserted with the; #comment syntax. i - 2- INITTAB(4) INITTAB(4) FILES letc/inittab SEE ALSO getty(lM), init(tM) in the UNIX System Administrator's Manual. sh (t ), who (t)' exec(2), open (2), signal(2). -3- INODE(4) INODE(4) NAME inode - format of an inode SYNOPSIS #include #include < sys/ino.h > DESCRIPTION An i-node for a plain file or directory in a file system has the following structure defined by . j* Inode structure as it appears on a disk block. *j struct dinode { j* mode and type of file *j ushort di_mode; j* number of links to file *j short di nlink; j* owner's user id *j ushort dCuid; j* owner's group id *j ushort dCgid; j* number of bytes in file *j di size; off t dCaddrl401; j* disk block addresses *j char j* time last accessed *j time t dCatime; j* time last modified */ time t di_mtime; time_t di_ctime; j* time created */ }; j* * the 40 address bytes: 39 used; 13 addresses of 3 bytes each. *j For the meaning of the defined types ofJ_t and time _t see types (5). FILES /usr jinclude/ sysjino.h SEE ALSO stat(2), fs(4), types(5). I - 1- ISSUE(4) ISSUE(4) NAME issue - issue identification file DESCRIPTION The file /etc/issue contains the issue or project identification to be printed as a login prompt. This is an ASCII file which is read by program getty and then written to any terminal spawned or respawned from the lines file. FILES /etc/issue SEE ALSO login(1). - 1- LDFCN(4) (not on PDP-It) LDFCN(4) NAME ldfcn - common object file access routines SYNOPSIS #include #include #include < stdio.h > < filehdr.h > < Idfcn.h > DESCRIPTION The common object file access routines are a collection of functions for reading an object file that is in VAX or 3B20S (common) object file form. Although the calling program must know the detailed structure of the parts of the object file that it processes, the routines effectively insulate the calling program from knowledge of the overall structure of the object file. The interface between the calling program and the object file access routines is based on the defined type LDFILE, defined as struct Idfile, declared in the header file Idfen.h. The primary purpose of this structure is to provide uniform access to both simple object files and to object files that are members of an archive file. The function ldopen OX) allocates and initializes the LDFILE structure and returns a pointer to the structure to the calling program. The fields of the LDFILE structure may be accessed individually through macros defined in Idfcn.h and contain the following information: LDFILE *ldptr; TYPEOdptr) The file magic number, used to distinguish between archive members and simple object files. OPTROdptr) The file pointer returned by Jopen and used by the standard input/output functions. OFFSETOdptr) The file address of the beginning of the object file; the offset is non-zero if the object file is a member of an archive file. HEADEROdptr) The file header structure of the object file. The object file access functions themselves may be divided into four categories: (1) functions that open or close an object file ldopen (3X) and ldaopen open a common object file ldclose (3X) and ldaclose close a common object file I (2) functions that read header or symbol table information ldahread OX) read the archive header of a member of an archive file ldfhread OX) read the file header of a common object file ldshread OX) and ldnshread read a section header of a common object file ldtbread (3X) read a symbol table entry of a common object file 0) functions that position an object file at (seek to) the start of the section, relocation, or line number information for a particular section. ldohseek OX) seek to the optional file header of a common object file ldsseek OX) and ldnsseek - 1- (not on PDP-ll) :LDFCN(4) LDFCN(4) seek to a section of a common object file ldrseek (3X) and ldnrseek seek to the relocation information for a section of a common object file ldlseek (3X) and ldnlseek seek to the line number information for a section of a common object file ldtbseek (3X) seek to the symbol table of a common object file (4) the function ldtbindex (3X) which returns the index of a particular common object file symbol table entry These functions are described jn detail in their respective manual pages. All the functions except ldopen, ldaopen and ldtbindex return either SUCCESS or FAILURE, both constants defined in IdfeD.b. Ldopen and ldaopen both return pointers to a LDFILE structure. MACROS Additional access to an object file is provided through a set of macros defined in IdfeD.b. These macros parallel the standard input/output file reading and manipulating functions, translating a reference of the LDFILE structure into a reference to its file descriptor field. The following macros are provided: LDFILE .ldptr; GETCOdptr) FGETCOdptr) GETWOdptr) UNGETC(c, ldptr) FGETS(s, n, ldptr) FREAD«char .) ptr, sizeof (.ptr), nitems, ldptr) FSEEKOdptr, offset, ptrname) FTELLOdptr) REWINDOdptr) FEOFOdptr) FERROROdptr) FILENOOdptr) SETBUFOdptr, bur) See the manual entries for the corresponding standard input/output library functions for details on the use of these macros. The program must be loaded with the object file access routine library libld.a. CAVEAT The macro FSEEK defined in the header file Idfcn.b translates into a call to the standard input/output function jseek(3S). FSEEK should not be used to seek from the end of an archive file since the end of an archive file may not be the same as the end of one of its object file members! SEE ALSO fseek(3S), Idahread(3X), Idclose(3X), Idfhread(3X), Idlread(3X), Idlseek(3X), Idohseek(3X), ldopen (3X), Idrseek(3X), Idlseek(3X), ldshread (3X), Idtbindex(3X), Idtbread(3X), Idtbseek(3X). Common Object File Format, by I. S. Law. - 2 - LINENUM(4) (not on PDP-l I) LINENUM (4) :._ NAME linenum - line number entries in a common object file SYNOPSIS #include < linenum.h> DESCRIPTION Compilers based on pee generate an entry in the object file for each C source line on which a breakpoint is possible (when invoked with the -g option; see ee(I». Users can then reference line numbers when using the appropriate software test system (see sdb(t). The structure of these line number entries appears below. struct lineno { union { long long l_symndx; lyaddr; l_addr; unsigned short IJnno ; }; Numbering start~ with one for each function. The initial line number entry for a function has I_In no equal to zero, and the symbol table index of the function's entry is in l_symndx. Otherwise, Clnno is non-zero, and lyaddr is the physical address of the code for the referenced line. Thus the overall structure is the following: function symtab index physical address physical address 0 line line function symtab index physical address physical address 0 line line SEE ALSO cdt), sdb(t), a.out(4). - 1- (DEC only) MASTER (4) MASTER (4) NAME master - master device information table DESCRIPTION This file is used by the conjig(IM) program to obtain device information that enables it to generate the configuration files. The file consists of 3 parts, each separated by a line with a dollar sign ($) in column 1. Part 1 contains device information; part 2 contains names of devices that have aliases; part 3 contains tunable parameter information. Any line with an asterisk (.) in column 1 is treated as a comment. Part 1 contains lines consisting of at least 10 fields and at most 13 fields, with the fields delimited by tabs and/or blanks: Field 1: Field 2: Field 3: device name (8 chars. maximum). interrupt vector size (decimal, in bytes). device mask (octaD-each "on" bit indicates that the handler exists: 000100 initialization handler 000040 power-failure handler 000020 open handler 000010 close handler 000004 read handler 000002 write handler 000001 ioctl handler. device type indicator (octal): Field 4: 000400 VAX-ll/780 massbus adapter 000200 allow only one of these devices 000100 suppress count field in the conf.c file 000040 suppress interrupt vector 000020 required device 000010 block device 000004 character device 000002 floating vector 000001 fixed vector. handler prefix (4 chars. maximum). Field 5: device address size (decimaD. Field 6: major device number for block-type device. Field 7: major device number for character-type device. Field 8: maximum number of devices per controller (decimal). Field 9: maximum bus request level (4 through 7). Field 10: Fields 11-13: optional configuration table structure declarations (8 chars. maximum). Part 2 contains lines with 2 fields each: Field 1: Field 2: alias name of device (8 chars. maximum). reference name of device (8 chars. maximum; specified in part 1). Part 3 contains lines with 2 or 3 fields each: Field 1: Field 2: Field 3: parameter name (as it appears in description file; 20 chars. maximum) parameter name (as it appears in the conf.c file; 20 chars. maximum) default parameter value (20 chars. maximum; parameter specification is required if this field is omitted) - 1- MASTER(4) (DEC only) MASTER (4) Devices that are not interrupt-driven have an interrupt vector size of zero. The 040 bit in Field 4 causes config{1 M) to record the interrupt vector although the low.s (univec.c on the VAX-II/780) file will show no interrupt vector assignment at those locations (interrupts here will be treated as strays). SEE ALSO config (I M) . - 2- MASTER (4) (3B20S only) MASTER (4) NAME master - master device information table DESCRIPTION This file is used by the config{I M} program to obtain device information that enables it to generate the configuration file. Master contains lines of various forms for controlling the configuration of hardware devices, software drivers, parameters and aliases. Hardware devices and software drivers are defined as follows: device name (8 chars maximum). element type (del', mbd, pc or sw) functions for this device: o open handler c close handler r read handler w write handler i ioctl handler d diagnostic handler s startup routine f fork e exec x exit 4: element characteristics: o specify only once s supress count field r required device b block device c character device 5: handler prefix 6: major device number if block-type device 7: major device number if character-type device 8: number of sub-devices per device 9: diagnostic port number if diagnosable device 10: configuration table structure Field 1: Field 2: Field 3: Field Field Field Field Field Field Field Parameters are defined as follows: Field Field Field Field 1: 2: 3: 4: parameter name element type (param) element characteristics, as defined above parameter name to appear in conf.c file UNIX System devices and UNIX System devices with arguments are defined as follows: Field Field Field Field 1: 2: 3: 4: device name element type (udel' or udel'a) element characteristics, as defined above device name to appear in conf.c file Aliases for names are defined as follows: Field 1: Field 2: Field 3: alias name element type (alias) reference name of device - 1- MASTER (4) (3B20S only) MASTER (4) Lines to be ignored by the config program, but are necessary to the diagnostic system, are defined as follows: Field 1: Field 2: name to be ignored element type (ignore) SEE ALSO config (1 M) sysdef( 1M) . - 2- iMNTTAB(4) MNTTAB(4) ,NAME mnttab - mounted file system table SYNOPSIS #include < mnttab.h > DESCRIPTION Mnttab resides in directory letc and contains a table of devices, mounted by the mount (1 M) command, in the following structure as defined by < mnttab.h > : struct mnttab { char char short time_t mt dev[IO]; mt=filsys[ 10]; mtJoJlg; mt_time; }; Each entry is 26 bytes in length; the first 10 bytes are the null-padded name of the place where the special file is mounted; the next 10 bytes represent the null-padded root name of the mounted special file; the remaining 6 bytes contain the mounted special file's read/write permissions and the date on which it was mounted. The maximum number of entries in mnttab is based on the system parameter NMOUNT located in /usr/src/uts/cf/conf.c, which defines the number of allowable mounted special files. SEE ALSO mount (1 M), setmnt (1 M). - 1- PASSWD(4) PASSWD(4) l NAME passwd - password file DESCRIPTION Passwd contains for each user the following information: login name encrypted password numerical user ID numerical group ID GCOS job number, box number, optional GCOS user ID initial working directory program to use as Shell This is an ASCII file. Each field within each user's entry is separated from the next by a colon. The GCOS field is used only when communicating with that system, and in other installations can contain any desired information. Each user is separated from the next by a new-line. If the password field is null, no password is demanded; if the Shell field is null, the Shell itself is used. This file resides in directory fete. Because of the encrypted passwords, it can and does have general read permission and can be used, for example, to map numerical user ID's to names. The encrypted password consists of 13 characters chosen from a 64 character alphabet (., f, 0-9, A-Z, a-z), except when the password is null in which case the encrypted password is also null. Password aging is effected for a particular user if his encrypted password in the password file is followed by a comma and a non-null string of characters from the above alphabet. (Such a string must be introduced in the first instance by the super-user.) The first character of the age, M say, denotes the maximum number of weeks for which a password is valid. A user who attempts to login after his password has expired will be forced to supply a new one. The next character, m say, denotes the minimum period in weeks which must expire before the password may be changed. The remaining characters define the week (counted from the beginning of 1970) when the password was last changed. (A null string is equivalent to zero.) M and m have numerical values in the range 0-63 that correspond to the 64 character alphabet shown above (i.e. f = 1 week; z = 63 weeks). If m = M = 0 (derived from the string . or .. ) the user will be forced to change his password the next time he logs in (and the "age" will disappear from his entry in the password file). If m > M (signified, e.g., by the string ./) only the super-user will be able to change the password. FILES letc/passwd SEE ALSO 10gin(1), passwd(l), a641(3C), crypt(3C), getpwent(3C), group(4). - 1- PLOT (4) PLOT (4) NAME plot - graphics interface DESCRIPTION Files of this format are produced by routines described in plot OX) and are interpreted for various devices by commands described in tplot (I G) . A graphics file is a stream of plotting instructions. Each instruction consists of an ASCII letter usually followed by bytes of binary information. The instructions are executed in order. A point is designated by four bytes representing the x and y values; each value is a signed integer. The last designated point in an I, m, D, or p instruction becomes the "current point" for the next instruction. Each of the following descriptions begins with the name of the corresponding routine in plot OX). m move: The next four bytes give a new current point. D p cont: Draw a line from the current point to the point given by the next four bytes. See tplot (I G). point: Plot the point given by the next four bytes. line: Draw a line from the point given by the next four bytes to the point given by the following four bytes. label: Place the following ASCII string so that its first character falls on the current point. The string is terminated by a new-line. e erase: Start another frame of output. f linemod: Take the following string, up to a new-line, as the style for drawing further lines. The styles are "dotted", "solid", "longdashed", "shortdashed", and "dotdashed". Effective only for the -T4014 and -Tver options of tplot (1 G) (Tektronix 4014 terminal and Versatec plotter). s space: The next four bytes give the lower left corner of the plotting area; the following four give the upper right corner. The plot will be magnified or reduced to fit the device as closely as possible. Space settings that exactly fill the plotting area with unity scaling appear below for devices supported by the filters of tplot (I G). The upper limit is just outside the plotting area. In every case the plotting area is taken to be square; points outside may be displayable on devices whose face is not square. DASI 300 DASI 300s DASI 450 Tektronix 4014 Versatec plotter space(O, space(O, space(O, space(O, space(O, 0, 0, 0, 0, 0, 4096, 4096, 4096, 3120, 2048, 4096); 4096); 4096); 3120); 2048); SEE ALSO graph(1G), tplot(IG), plot(3X), gps(4), term(5). I PNCH(4) PNCH(4) NAME pnch - file format for card images DESCRIPTION The PNCH format is a convenient representation for files consisting of card images in an arbitrary code. A PNCH file is a simple concatenation of card records. A card record consists of a single control byte followed by a variable number of data bytes. The control byte specifies the number (which must lie in the range 0-80) of data bytes that follow. The data bytes are 8-bit codes that constitute the card image. If there are fewer than 80 data bytes, it is understood that the remainder of the card image consists of trailing blanks. SEE ALSO send(1C). I - 1- PROFILE (4) PROFILE (4) NAME profile - setting up an environment at login time DESCRIPTION If your login directory contains a file named .profile, that file will be executed (via the shell's exee .profile) before your session begins; .profiles are handy for setting exported environment variables and terminal modes. If the file /ete/profile exists, it will be executed for every user before the .profile. The following example is typical (except for the comments): # Make some environment variables global export MAIL PATH TERM # Set file creation mask umask 22 # Tell me when new mail comes in MAIL=/usr/mail/myname # Add my'/bin directory to the shell search sequence PATH=$PATH:$HOME/bin # Set terminal type echo "terminal: \c" read TERM case $TERM in 300) stty cr2 nlO tabs; tabs;; 300s) stty cr2 nlO tabs; tabs;; 450) stty cr2 nlO tabs; tabs;; hp) stty crO nlO tabs; tabs;; stty crt nIl -tabs; TERM=745;; 745 1735) 43) stty crt nlO -tabs;; stty crO nlO -tabs ff1; TERM=4014; echo "\33;";; 40141 tek) .) echo "$TERM unknown";; esac FILES $HOME/.profile /etc/profile SEE ALSO env(t), login(t), maiI(t), sh(t), stty(t), su(t), environ(5), term(5). - 1- RELOC(4) RELOC(4) (not on PDP-l 1) NAME reloc - relocation information for a common object file SYNOPSIS < reloc.h > #include DESCRIPTION Object files have one relocation entry for each relocatable reference in the text or data. If relocation information is present, it will be in the following format. struct { reloc long long short r_vaddr ; /* (virtual) address of reference */ r_symndx; /* index into symbol table */ r_type ; /* relocation type */ }; /* * All generics * reloc. already performed to symbol in the same section */ o #define R ABS /* * 3B generic * 24-bit direct reference 24-bit "relative" reference * 16-bit optimized "indirect" TV * 24-bit "indirect" TV reference * 32-bit "indirect" TV reference * reference */ #define #define #define #define #define R DIR24 R REL24 R-OPT16 R IND24 R IND32 04 05 014 015 016 /* * DEC * Processors VAX 11/780 and VAX 111750 */ I #define #define #define #define #define #define R RELBYTE R=RELWORD R RELLONG R - PCRBYTE R=PCRWORD R _PCRLONG 017 020 021 022 023 024 As the link editor reads each input section and performs relocation, the relocation entries are read. They direct how references found within the input section are treated. The reference is absolute, and no relocation is necessary. The entry will be ignored. R DIR24 A direct, 24-bit reference to a symbol's virtual address. - 1- RELOC(4) (not on PDP-II) RELOC(4) R REL24 A "PC-relative", 24-bit reference to a symbol's virtual address. Relative references occur .in instructions such as jumps and calls. The actual address used is obtained by adding a constant to the value of the program counter at the time the instruction is executed. R OPT16 An optimized, indirect, 16-bit reference through a transfer vector. The instruction contains the offset into the transfer vector table to the transfer vector where the actual address of the referenced word is stored. R IND24 An indirect, 24-bit reference through a transfer vector. The instruction contains the virtual address of the transfer vector, where the actual address of the referenced word is stored. R IND32 An indirect, 32-bit reference through a transfer vector. The instruction contains the virtual address of the transfer vector, where the actual address of the referenced word is stored. R RELBYTE A direct 8 bit reference to a symbol's virtual address. R RELWORD A direct 16 bit reference to a symbol's virtual address. R_RELLONG A direct 32 bit reference to a symbol's virtual address. R PCRBYTE A "PC-relative", 8 bit reference to a symbol's virtual address. R PCRWORD A "PC-relative", 16 bit reference to a symbol's virtual address. R PCRLONG A "PC-relative", 32 bit reference to a symbol's virtual address. On the V AX processors relocation of a symbol index of -1 indicates that the relative difference between the current segment's start address and the program's load address is added to the relocatable address. Other relocation types will be defined as they are needed. Relocation entries are generated automatically by the assembler and automatically utilized by the link editor. A link editor option exists for removing the relocation entries from an object file. SEE ALSO Id(I), strip(I), a.out(4), syms(4). - 2- SCCSFILE (4) SCCSFILE(4) NAME sccsfile - format of SCCS file DESCRIPTION An SCCS file is an ASCII file. It consists of six logical parts: the checksum, the delta table (contains information about each delta), user names (contains login names and/or numerical group IDs of users who may add deltas), flags (contains definitions of internal keywords), comments (contains arbitrary descriptive information about the file), and the body (contains the actual text lines intermixed with control lines). Throughout an sees file there are lines which begin with the ASCII SOH (start of heading) character (octal 001). This character is hereafter referred to as the control character and will be represented graphically as @. Any line described below which is not depicted as beginning with the control character is prevented from beginning with the control character. Entries of the form DDDDD represent a five digit string (a number between 00000 and 99999). Each logical part of an sces file is described in detail below. Checksum The checksum is the first line of an @hDDDDD sees file. The form of the line is: The value of the checksum is the sum of all characters, except those of the first line. The @h provides a magic number of (octal) 064001. Delta table The delta table consists of a variable number of entries of the form: @s DDDDD/DDDDD/DDDDD @d yr/mo/da hr:mi:se DDDDD DDDDD @gDDDDD .. . @m @c ... I- @e The first line (@s) contains the number of lines inserted/deleted/unchanged respectively. The second line (@d) contains the type of the delta (currently, normal: D, and removed: R), the sees ID of the delta, the date and time of creation of the delta, the login name corresponding to the real user ID at the time the delta was created, and the serial numbers of the delta and its predecessor, respectively. The @i, @x, and @g lines contain the serial numbers of deltas included, excluded, and ignored, respectively. These lines are optional. The @m lines (optional) each contain one MR number associated with the delta; the @c lines contain comments associated with the delta. - 1- SCCSFILE (4) SCCSFILE (4) The @e line ends the delta table entry. User names The list of login names and/or numerical group IDs of users who may add deltas to the file, separated by new-lines. The lines containing these login names and/or numerical group IDs are surrounded by the bracketing lines @u and @U. An empty list allows anyone to make a delta. Flags Keywords used internally (see admin (1) for more information on their use) . Each flag line takes the form: @f The following flags @f t @f v @fi @fb @fm @ff @fc @fd @fn @fj @f I @f q @fz are defined: < type of program> < default-sid> < user defined> < reserved for use in interfaces> The t flag defines the replacement for the % Y% identification keyword. The v flag controls prompting for MR numbers in addition to comments; if the optional text is present it defines an MR number validity checking program. The i flag controls the warning/error aspect of the "No id keywords" message. When the i flag is not present, this message is only a warning; when the i flag is present, this message will cause a "fatal" error (the file will not be gotten, or the delta will not be made). When the b flag is present the - b key letter may be used on the get command to cause a branch in the delta tree. The m flag defines the first choice for the replacement text of the % M % identification keyword. The f flag defines the "floor" release; the release below which no deltas may be added. The c flag defines the "ceiling" release; the release above which no deltas may be added. The d flag defines the default SID to be used when none is specified on a get command. The n flag causes delta to insert a "null" delta (a delta that applies no changes) in those releases that are skipped when a delta is made in a new release (e.g., when delta 5.1 is made after delta 2.7, releases 3 and 4 are skipped). The absence of the n flag causes skipped releases to be completely empty. The j flag causes get to allow concurrent edits of the same base SID. The I flag defines a list of releases that are locked against editing (get{l) with the -e key letter) . The q flag defines the replacement for the % Q % identification keyword. z flag is used in certain specialized interface programs. Comments Arbitrary text surrounded by the bracketing lines @t and @T. The comments section typically will contain a description of the file's - 2- SeeSFILE(4) sees FILE (4) purpose. Body The body consists of text lines and control lines. Text lines don't begin with the control character, control lines do. There are three kinds of control lines: insert, delete, and end, represented by: @IDDDDD @DDDDDD @EDDDDD respectively. The digit string is the serial number corresponding to the delta for the control line. SEE ALSO admin (1), delta (1), get(1), prs(1). Source Code Control System User's Guide in the UNIX System User's Guide. I -3- SCNHDR(4) (not on PDP-ll) SCNHDR(4) NAME scnhdr - section header for a common object file SYNOPSIS #include DESCRIPTION Every common object file has a table of section headers to specify the layout of the data within the file. Each section within an object file has its own header. The C structure appears below. . struct scnhdr { char s_name[SYMNMLEN); /* section name */ long syaddr; /. physical address */ s_vaddr; /. virtual address */ long long s_size; /. section size */ long s_scnptr; /. file ptr to raw data */ long sJelptr; /* file ptr to relocation */ long sJnnoptr; /. file ptr to line numbers */ unsigned short s_nreloc; /. # reloc entries ./ /. # line number entries */ unsigned short s_nlnno; long sJlags; /. flags */ }; File pointers are byte offsets into the file; they can be used as the offset in a call to fseek OS). If a section is initialized, the file contains the actual bytes. An uninitialized section is somewhat different. It has a size, symbols defined in it, and symbols that refer to it. But it can have no relocation entries, line numbers, or data. Consequently, an uninitialized section has no raw data in the object file, and the values for s_scnptr, sJelptr, s_lnnoptr, s_nreloc, and s nlnno are zero. SEE ALSO Id(I), fseekOS), a.out(4). - 1- SYMS(4) (not on PDP-} 1) SYMS(4) NAME syms - common object file symbol table format SYNOPSIS < syms.h > #include DESCRIPTION Common object files contain information to support symbolic software testing (see sdb (1). Line number entries, linenum (4), and extensive symbolic information permit testing at the C source level. Every object file's symbol table is organized as shown below. File name 1. Function 1. Local symbols for function 1. Function 2 Local symbols for function 2. Static externs for file 1. File name 2. Function 1. Local symbols for function 1. Function 2. Local symbols for function 2. Static ex terns for file 2. Defined global symbols. Undefined global symbols. The entry for a symbol is a fixed-length structure. The members of the structure hold the name (null padded), its value, and other information. The C structure is given below. #define SYMNMLEN #define FILNMLEN struct { II- 8 14 syment char long short unsigned short n_type; char char n name[SYMNMLEN] ; n=value ;/* value of symbol *1 n scnum ;1* section number *1 I; type and derived type *1 n_sclass ;1* storage class *1 n_numaux ;1* number of aux entries }; Meaningful values and explanations for them are given in both syms.h and Common Object File Format. Anyone who needs to interpret the entries should seek more information in these sources. Some symbols require more information than a single entry; they are followed by auxiliary entries that are the same size as a symbol entry. The format follows. - 1- SYMS(4) (not on PDP-ll) SYMS(4) union auxent { struet { long union { struet { unsigned short xJnno; unsigned short x_size; } xJnsz; long x fsize; } x_mise; union { struet { long xJnnoptr; x_endndx; long xJen; struet { unsigned short x_dimen[DIMNUM1; x_ary; xJenary; unsigned short x_tvndx; x_sym; } struet { ehar xJnamelFILNMLEN1; xJile; struet { long x_senlen; unsigned short x_nreloe; unsigned short x_nlinno; x_sen; struet { unsigned short x tvlen; unsigned short x=tvran[21; x_tv; }; Indexes of symbol table entries begin at zero. SEE ALSO sdb(I), a.out(4), linenum(4). Common Object File Format by I. S. Law. - 2- (3B20S only) SYSTEM (4) SYSTEM (4) NAME system - format of 3B20S system description file DESCRIPTION This file contains information about the hardware configuration and systemdependent parameters for the user's system. A more complete description of the system file is found in Setting up the UNIX System in the UNIX System Administrator's Guide. This information is used by the c01ifigClM) program in configuring systems. The file is divided into two sections, separated by a line with a dollar sign ($) in column 1. The first section describes the hardware configuration and the second contains system-dependent information. Any lines with a number sign (#) in column 1 are treated as comments and are ignored. Blank lines are also ignored. All fields may be separated by one or more space and tab characters. The following codes are used throughout the following description: Name chan count dev devname driver equip hv inter low minor mt mv num parm pc pumpcode slot unit value Meaning channel number of disk blocks in swap or dump area device on a channel name of device name of a software device driver equipage hardware version interrupt source bit lowest disk block in swap or dump area minor device number maintenance type maintenance version the number of instances of a software device driver name of a UNIX System parameter name of device driver for a PC path name of pump code file slot number of a sub-device on its device logical unit number of a device value of a UNIX System parameter Hardware Configuration This section describes the configuration of the Control Unit (CU) and its components, the Disk File Controllers (DFCs) and their Moving Head Disks (MHDs), and the Input Output Processors (lOPs) and their Peripheral Controllers (PCs). Any line that describes an lOP, DFC, MHO or PC may optionally have an exclamation. point (!) preceding the first field. This indicates that a device should not automatically be brought into service by the system (see don Cl M». Note that an exclamation point which precedes an lOP implies that neither the lOP nor its PCs will be brought into service. The same applies to a OFC and its MHOs. The CU and its components are specified as follows: cu unit cc masc sat ch ch csu dma chan unit unit unit unit unit unit unit ch dev mt mt mt mt mt mt mt unit mt mv mv mv mv mv mv mv mt - 1- mv hv hv hv hv hv hv hv mv hv equip equip equip equip equip equip equip hv 0 0 0 0 0 0 0 equip inter (3B20S only) SYSTEM (4) SYSTEM (4) Each OFC and its MHOs are specified as follows: dfc unit mhd chan unit dey slot mt mt mv mv hv hv equip equip hv hv equip equip Each lOP and its PCs are specified as follows: iop unit pc chan unit dey slot mt mt mv mv [pumpcode] System-Dependent Information This section specifies UNIX System devices, UNIX System parameters and software drivers. The root and pipe devices are specified by: root pipe devname devname minor minor The swap and dump devices are specified by: swap dump devname devname minor minor low low count count Tunable parameters are specified by: parm value Software drivers are specified in one of two forms: driver driver num SEE ALSO config (I M), don (I M), master( 4) . Setting up the UNIX System in the UNIX System Administrator's Guide. - 2- UTMP(4) UTMP(4) NAME utmp, wtmp - utmp and wtmp entry formats SYNOPSIS #include #include < utmp.h > DESCRIPTION These files, which hold user and accounting information for such commands as who (1), write (I), and login (1), have the following structure as defined by : #define #define #define UTMP FILE WTMP FILE ut name struct utmp { char char char short short struct short short } ut_exit; "/etc/utmp" "/etc/wtmp" ut user ut user[S]; ut-id[4]; ut)ine[ 12]; utyid; ut_type; exit_status { e_termination; e_exit; time t /* User login name */ /* /etclinittab id (usually line #) */ / * device name (console, lnxx) */ /* process id */ /* type of entry */ /* Process termination status */ /* Process exit status */ /* The exit status of a process * marked as DEAD_PROCESS. */ /* time entry was made */ }; /* Definitions for ut_type #define EMPTY #define RUN LVL #define BOOT TIME #define OLD TIME #define NEW TIME #define INIT PROCESS #define LOG IN PROCESS #define USER PROCESS #define DEAD _PROCESS #define ACCOUNTING #define UTMAXTYPE */ 0 1 2 3 4 5 6 7 /* Process spawned by "init" */ /* A "getty" process waiting for login ..7 / * A user process */ 8 9 ACCOUNTING /* Largest legal value of ut_type */ /* Special strings or formats used in the "utJine" field when */ /* accounting for something other than a process. */ /* No string for the utJine field can be more than 11 chars + */ /* a NULL in length. */ #define RUNLVL_MSG "run-level %c" #define BOOT_MSG "system boot" #define OTIME_MSG "old time" #define NTIME_MSG "new time" FILES /usr linc1ude/utmp.h /etc/utmp ./ptl'/whnn ---... ----r SEE ALSO login(1), who(1), write(l), getut(3C). - 1- INTRO (5) INTRO(5) NAME intro - introduction to miscellany DESCRIPTION This section describes miscellaneous facilities such as macro packages, character set tables, etc. - 1- ASCII (S) ASCII (S) NAME ascii - map of ASCII character set SYNOPSIS cat /usr/pub/ascii DESCRIPTION Ascii is a map of the ASCII character set, giving both octal and hexadecimal equivalents of each character, to be printed as needed. It contains: 000 nul 001 soh 010 bs 011 ht 020 die 021 del 030 can 031 em 040 sp 041 OSO ( 0 5 1 060 0 061 1 070 8 0719 100 @ 101 A 110H 1111 120 P 121 Q 130 X 131 Y 140' 141 a 150 h 151 160 P 161 q 170 x 171 y 00 08 10 18 20 28 30 38 40 48 50 58 60 68 70 nul bs die can sp ( 0 8 @ H P X ' h P 78 x 01 09 11 19 21 29 31 39 41 49 51 59 61 69 71 79 soh ht del em 1 9 A I Q Y a q y 002 stx 012 nl 022 de2 032 sub 042" 052 * 062 2 072 102 B 112J 122 R 132 Z 142 b 152 162 r 172 z 02 Oa 12 la 22 2a 32 3a 42 4a 52 5a 62 6a 72 7a stx nl de2 sub " * 2 B J R Z b r z 003 etx 013 vt 023 de3 033 esc 043 # OS3 + 063 3 073; 103 C 113K 123 S 133 [ 143 e 153 k 163 s 173 03 Ob 13 1b 23 2b 33 3b 43 4b 53 Sb 63 6b 73 7b I I I I # I + I 3 I ; I C I K I S I [ I e I k I s I { I e tx vt de3 esc FILES / usr / pub/ ascii - 1- 004 eot 014 np 024 de4 034 fs 044 $ 054 064 4 074 < 104 D 114L 124 T 134 \ 144 d 154 I 164 174 04 Oe 14 1e 24 2e 34 3e 44 4e 54 Se 64 6c 74 7e eot np dc4 fs $ 4 < D L T \ d I 005 enq 01S er 02S nak 035 gs 045 % 055 065 5 075 105 E 115M 125 U 135] 145 e 155 m 165 u 175 05 enq Od er 15 nak Id gs 25 % 2d 35 5 3d = 45 E 4d M 55 U Sd ] 65 e 6d m 75 u 7d } 006 aek 016 so 026 syn 036 rs 046 & 056. 066 6 076> 106 F 116N 126 V 136 146 156 n 166 v 176 ft 06 Oe 16 Ie 26 2e 36 3e 46 4e 56 5e 66 6e 76 7e aek so syn rs & . 6 > F N V ft n v - 007 bel 017 si 027 etb 037 us 047' 057 / 067 7 077 107 G 1170 127 W 137 147 g 157 0 167 w 177 del 07 bel Of si 17 etb 1 f us 27 ' 2f / 37 7 3f ? 47 G 4f 0 57 W Sf 67 g 6f 0 77w 7f del ENVIRON(S) ENVIRON(S) NAME environ - user environment DESCRIPTION An array of strings called the "environment" is made available by exec(2) when a process begins. By convention, these strings have the form "name=value". The following names are used by various commands: The sequence of directory prefixes that sh(I), time (1), nice(1), nohup(I), etc., apply in searching for a file known by an incomplete path name. The prefixes are separated by colons (:). Login(1) sets PATH == :Ibin: lusr Ibin. HOME Name of the user's login directory, set by login (t) from the password file passwd(4). TERM The kind of terminal for which output is to be prepared. This information is used by commands, such as mm(1) or tplot(1G), which may exploit special capabilities of that terminal. TZ Time zone information. The format is xxxnzzz where xxx is standard local time zone abbreviation, n is the difference in hours from GMT, and zzz is the abbreviation for the daylight-saving local time zone, if any; for example, EST5EDT. PATH Further names may be placed in the environment by the export command and "name=value" arguments in sh (1), or by exec(2). It is unwise to conflict with certain shell variables that are frequently exported by .profile files: MAIL, PSt, PS2,IFS. SEE ALSO env (1), login (1), sh (1), exec(2), getenv (3C), profile( 4), term (5). - 1- EQNCHAR(5) EQNCHAR(5) NAME eqnchar - special character definitions for eqn and neqn SYNOPSIS I eqn /usr/pub/eqnchar [ files ] neqn /usr/pub/eqnchar [ files ] troff [ options ] I nroff [ options ] DESCRIPTION Eqnchar contains trojJ(1) and nroff character definitions for constructing characters that are not available on the Wang Laboratories, Inc. CI A/T phototypesetter. These definitions are primarily intended for use with eqn (1) and neqn; eqnchar contains definitions for the following characters: dplus EB @ dtimes wig -wig > wig ~ <=> 1< I> \ \ / Ti J. .... ~ {: :} ang rang 3dot thl quarter 3quarter degree L ==> ~ FILES lusr/pub/eqnchar SEE ALSO eqn (1), nroff(1), troff(I). - 1- L It4 % square circle blot bullet prop empty member nom em cup cap inc! subset supset !subset !supset scrL 0 0 • • ex: 0 E rt u n b C ::) ~ :2 ~ FCNTL(S) FCNTL(S) NAME fcntl - file control options SYNOPSIS #include < fcntl.h > DESCRIPTION The fcntl (2) function provides for control over open files. This include file describes requests and arguments to fcntl and open (2). /* Flag values accessible to open (2) and fcntl (2) */ /* (The first three can only be set by open) */ #define O_RDONLY 0 #define 0_WRONL Y 1 2 #define _RDWR #define O_NDELAY 04 /* Non-blocking I/O */ #define O_APPEND 010 /* append (writes guaranteed at the end) */ ° /* Flag values accessible only to open(2) */ #define O_CREAT 00400 /* open with file create (uses third open arg)*/ #define O_TRUNC 01000 /* open with truncation */ #define O_EXCL 02000 /* exclusive open */ /* fcntI(2) requests */ #define F_DUPFD 0 #define F_G ETFD 1 #define F_SETFD 2 #define F_GETFL 3 #define F_SETFL 4 /* Duplicate fildes */ / * Get tildes flags */ /* Set fildes flags */ /* Get file flags */ /* Set file flags */ SEE ALSO fcntl (2), open (2). - 1- GREEK(5) GREEK(5) NAME greek - graphics for the extended TTY-37 type-box SYNOPSIS cat /usr/pub/greek [ I greek -Tterminal ] DESCRIPTION Greek gives the mapping from ASCII to the "shift-out" graphics in effect between SO and SI on TELETYPE@ Model 37 terminals equipped with a 128character type-box. These are the default greek characters produced by nroff. The filters of greek (1) attempt to print them on various other terminals. The file contains: alpha GAMMA epsilon THETA LAMBDA xi rho tau psi OMEGA partial a r e A ~ p T If; .n a A G S T E X K I V Z ] beta delta zeta theta mu pi sigma phi PSI nabla integral {3 0 r () J..L 7r (j cJ> W \l B D Q 0 M J y U H [ gamma DELTA eta lambda nu PI SIGMA PHI omega not J FILES I usr I pu bl greek SEE ALSO 300(1), 4014(1), 450(1), greek(1), hp(}), tc(1), nrotf(}). - 1- 'Y \ ~ W N L 11 A v IT ~ w @ P R F C MAN(S) MAN(S) NAME man - macros for formatting entries in this manual SYNOPSIS nroff -man files troff -man [ -rsl ] files DESCRIPTION These trojf(1) macros are used to layout the format of the entries of this manual. A skeleton entry may be found in the file lusr/manV lu_man/manO/skeleton. These macros are used by the man (I) command. The default page size is 8.5"x 11", with a 6.5"x 10" text area; the -rsl option reduces these dimensions to 6"x9" and 4.75"x8.375", respectively; this option (which is not effective in nrojf) also reduces the default type size from la-point to 9-point, and the vertical line spacing from 12-point to la-point. The -rV2 option may be used to set certain parameters to values appropriate for certain Versatec printers: it sets the line length to 82 characters, the page length to 84 lines, and it inhibits underlining; this option should not be confused with the -Tvp option of the man (1) command, which is available at some UNIX System sites. Any text argument below may be one to six "words". Double quotes ("") may be used to include blanks in a "word". If text is empty, the special treatment is applied to the next line that contains text to be printed. For example, .I may be used to italicize a whole line, or .SM followed by .B to make small bold text. By default, hyphenation is turned off for nrojf, but remains on for trojf. Type font and size are reset to default values before each paragraph and after processing font- and size-setting macros, e.g., .1, .RB, .SM. Tab stops are neither used nor set by any macro except .DT and .TH. Default units for indents in are ens. When in is omitted, the previous indent is used. This remembered indent is set to its default value (7.2 ens in tro!!, 5 ens in nrojf-this corresponds to 0.5" in the default page size) by .TH, .P, and .RS, and restored by .RE. .TH t sen .SH text .SS text . B text •1 text .SM text .RI a b Set the title and entry heading; t is the title, s is the section number, c is extra commentary, e.g., "local", n is new manual name. Invokes .DT (see below) . Place subhead text, e.g., SYNOPSIS, here . Place sub-subhead text, e.g., Options, here . Make text bold. Make text italic . Make text 1 point smaller than default point size . Concatenate roman a with italic b, and alternate these two fonts for up to six arguments. Similar macros alternate between any two of roman, italic, and bold: .IR .P .HP in .TP in .IP t in .RS in .RB .BR .18 .BI Begin a paragraph with normal font, point size, and indent. .PP is a synonym for .P. Begin paragraph with hanging indent. Begin indented paragraph with hanging tag. The next line that contains text to be printed is taken as the tag. If the tag does not fit, it is printed on a separate line. Same as .TP in with tag t; often used to get an indented paragraph without a tag. Increase relative indent (initially zero). Indent all output an extra in units from the current left margin. - 1- MAN(5) MAN(5) Return to the kth relative indent level (initially, k=l; k=O is equivalent to k=1); if k is omitted, return to the most recent lower indent level. Produces proprietary markings; where m may be P for PRIVATE, N for NOTICE, BP for BELL LABORATORIES PROPRIETARY, or BR for BELL LABORATORIES RESTRICTED. Restore default tab settings (every 7.2 ens in trojJ, 5 ens in nroJf) . Set the interparagraph distance to v vertical spaces. If v is omitted, set the interparagraph distance to the default value (OAv in trojJ, 1v in nroJf). .RE k .PMm . DT .PD v The following strings are defined: \.R \.S in trojJ, (Reg.) in nrojJ. Change to default type size. Trademark indicator. ® \.(Tm The following number registers are given default values by .TH: Left margin indent relative to subheads (default is 7.2 ens in trojJ, 5 ens in nroJf). Line length including IN. Current interparagraph distance. IN LL PD CAVEATS In addition to the macros, strings, and number registers mentioned above, there are defined a number of internal macros, strings, and number registers. Except for names predefined by trojJ and number registers d, m, and y, all such internal names are of the form XA, where X is one of ), I, and}, and A stands for any alphanumeric character. If a manual entry needs to be preprocessed by cw (1), eqn (1) (or neqn), and/or tbl( 1), it must begin with a special line (described in man (1), causing the man command to invoke the appropriate preprocessor(s). The programs that prepare the Table of Contents and the Permuted Index for this Manual assume the NAME section of each entry consists of a single line of input that has the following format: namer, name, name .. .J \- explanatory text The macro package increases the inter-word spaces (to eliminate ambiguity) in the SYNOPSIS section of each entry. The macro package itself uses only the roman font (so that one can replace, for example, the bold font by the constant-width font-see cw (1». Of course, if the input text of an entry contains requests for other fonts (e.g., .I, .RB, \fI), the corresponding fonts must be mounted. FILES I usr Ili bl tmacl tmac.an lusrllib/macros/cmp.[ntUdt1.an lusrllib/macros/ucmp.[nt1.an lusr/man/[ua]_man/manO/skeleton SEE ALSO man (1), nroff( 1), troff( 1) . BUGS If the argument to .TH contains any blanks and is not enclosed by double f"ll1At,:lt.C' '1-,,,,,,,",,u (II") , /, .. 1 , 0... 0 "'1..1""1.'-' ",;11 hoOt. h; ... rl_rl.,." ........... ;,.."n_l;t,.o fl-.;n ..... C" .. T.l.l..l v,", u.lJ.u-uJ.vl-'l-'J.J.1.6-.I..1.n..v - 2- ".1.J..I..lJ.6~ 1"\7"\ V.l1. +1,.0 "'.1.1"" "'11t-",,"I1+ VU\....,UL. MM(5) ) MM(5) NAME mm - the MM macro package for formatting documents SYNOPSIS mm [ options ] [ files ] nroff - mm [ options ] [ files ] nroff -em [ options ] [ files ] mmt [ options ] [ files ] troff - mm [ options ] [ files ] troff -em [ options ] [ files ] DESCRIPTION This package provides a formatting capability for a very wide variety of documents. It is the standard package used by the BTL typing pools and documentation centers. The manner in which a document is typed in and edited is essentially independent of whether the document is to be eventually formatted at a terminal or is to be phototypeset. See the references below for further details. The -mm option causes nroff and troff(I) to use the non-compacted version of the macro package, while the -em option results in the use of the compacted version, thus speeding up the process of loading the macro package. FILES lusr Ilib/tmac/tmac.m lusr/lib/macros/mm[nt] lusr/lib/macros/cmp.[ntUdd.m lusr/lib/macros/ucmp.[nt].m pointer to the non-compacted version of the package non-compacted version of the package compacted version of the package initializers for the compacted version of the package SEE ALSO mm(I), mmt(I), nroff(I), troff(I). MM-Memorandum Macros by D. W. Smith and 1. R. Mashey. Typing Documents with MM by D. W. Smith and E. M. Piskorik. - 1- MOSD(5) MOSD(5) NAME mosd - the OSDD adapter macro package for formatting documents SYNOPSIS osdd [ options ] [ files ] mm -mosd [ options ] [ files ] nroff - mm - mosd [ options ] [ files ] nroff -em -mosd [ options ] [ files ] mmt -mosd [ options ] [ files ] troff -mm -mosd [ options ] [ files ] troff -em -mosd [ options] [ files] DESCRIPTION The OSDD adapter macro package is a tool used in conjunction with the MM macro package to prepare Operations Systems Deliverable Documentation. Many of the OSDD Standards are different than the default format provided by MM. The OSDD adapter package sets the appropriate MM options for automatic production of the OSDD Standards. The OSDD adapter package also generates the correct OSDD page headers and footers, heading styles, Table of Contents format, etc. OSDD document (input) files are prepared with the MM macros. Additional information which must be given at the beginning of the document file is specified by the following string definitions: .ds HI document-number .ds H2 section-number .ds H3 issue-number .ds H4 date .ds H5 rating The document-number should be of the standard 10 character format. The words "Section" and "Issue" should not be included in the string definitions; they will be supplied automatically when the document is printed. For example: .ds HI OPA-IP135-01 .ds H2 4 .ds H3 2 automatically produces OPA-IP135-01 Section 4 Issue 2 as the document page header. Quotation marks are not used in string definitions. If certain information is not to be included in a page header, then the string is defined as null; e.g., .ds H2 means that there is no section-number. The OSDD Standards require that the Table of Contents be numbered beginning with Page 1. By default, the first page of text will be numbered Page 2. If the Table of Contents has more than one page, for example n, then either -rPn + 1 must be included as a command line option or .or P 0 must be included in the document file. For example, if the Table of Contents is four pages then use -rP5 on the command line or .or P 4 in the document file. - 1- MOSD(S) MOSD(S) The OSDD Standards require that certain information such as the document rating appear on the Document Index or on the Table of Contents page if there is no index. By default, it is assumed that an index has been prepared separately. If there is no index, the following must be included in the document file: .nr Di 0 This will ensure that the necessary information is included on the Table of Contents page. The OSDD Standards require that all numbered figures be placed at the end of the document. The .Fg macro is used to produce full page figures. This macro produces a blank page with the appropriate header, footer, and figure caption. Insertion of the actual figure on the page is a manual operation. The macro usage is .Fg page-count "figure caption" where page-count is the number of pages required for a multi-page figure (default 1 page). Figure captions are produced by the .Fg macro using the .BS/.BE macros. Thus the .BS/.BE macros are also not available for users. The .Fg macro cannot be used within the document unless the final .Fg in a series of figures is followed by a .SK macro to force out the last figure page. The Table of Contents for OSDD documents (see Figure 4 in Section 4.1 of the OSDD Standards) is produced with: .Tc System Type System Name Document Type .Td The .Tc/.Td macros are used instead of the .TC macro from MM. By default, the adapter package causes the NOTICE disclosure statement to be printed. The .PM macro may be used to suppress the NOTICE or to replace it with the PRIVATE disclosure statement as follows: .PM .PM P .PMN none printed PRIVATE printed NOTICE printed (default) The .P macro is used for paragraphs. The Np register is set automatically to indicate the paragraph numbering style. It is very important that the .P macro be used correctly. All paragraphs (including those immediately following a .H macro) must use a .P macro. Unless there is a .P macro, there will not be a number generated for the paragraph. Similarly, the .P macro should not be used for text which is not a paragraph. The .SP macro may be appropriate for these cases, e.g., for "paragraphs" within a list item. The page header format is produced automatically in accordance with the OSDD Standards. The OSDD Adapter macro package uses the .TP macro for this purpose. Therefore the .TP macro normally available in MM is not available for users. FILES /usr/lib/tmac/tmac.osd SEE ALSO mm(1), mmt(1), nroff(O, troff(1), mm(5). MM-Memorandum Macros by D. W. Smith and J. R. Mashey. Operations Systems Deliverable Documentation Standards, June 1980. -2- MPTX(S) MPTX(S) NAME mptx - the macro package for formatting a permuted index SYNOPSIS nroff - mptx [ options ] [ files ] troff - mptx [ options ] [ files ] DESCRIPTION This package provides a definition for the .xx macro used for formatting a permuted index as produced by ptx(I). This package does not provide any other formatting capabilities such as headers and footers. If these or other capabilities are required, the mptx macro package may be used in conjuction with the MM macro package. In this case, the -mptx option must be invoked after the -mm call. For example: nroff -cm -mptx file or mm -mptx file FILES lusrllib/tmacltmac.ptx lusrllib/macros/ptx pointer to the non-compacted version of the package non-compacted version of the package SEE ALSO mm (1), nroff( 1), ptx (I), troff( 1), mm (5). - 1- MV(5) MV(5) NAME mv - a troff macro package for typesetting vi~w graphs and slides SYNOPSIS mvt [ -a ] [ options ] [ files ] troff [ -a ] [ -rXl ] -mv [ options ] [ files ] DESCRIPTION This package makes it easy to typeset view graphs and projection slides in a variety of sizes. A few macros (briefly described below) accomplish most of the formatting tasks needed in making transparencies. All of the facilities of troff(l), cw(1), eqn(I), and tbt(1) are available for more difficult tasks. The output can be previewed on most terminals, and, in particular, on the Tektronix 4014, as well as on the Versatec printer. For these two devices, specify the -rXl option (this option is automatically specified by the mvt command-q.v.-when that command is invoked with the -T4014 or -Tvp options). To preview output on other terminals, specify the -a option. The available macros are: .vs [n] [i] [d] Foil-start macro; foil size is to be 7" x7"; n is the foil number, i is the foil identification, d is the date; the foilstart macro resets all parameters (indent, point size, etc.) to initial default values, except for the values of i and d arguments inherited from a previous foil-start macro; it also invokes the .A macro (see below). The naming convention for this and the following eight macros is that the first character of the name (V or S) distinguishes between view graphs and slides, respectively, while the second character indicates whether the foil is square (S), small wide (w), small high (h), big wide (W), or big high (H). Slides are "skinnier" than the corresponding view graphs: the ratio of the longer dimension to the shorter one is larger for slides than for view graphs. As a result, slide foils can be used for view graphs, but not vice versa; on the other hand, view graphs can accommodate a bit more text. .Vw •Vh •VW . VH [n] [n] [n] [n] •Sw [n] •Sh [n] •SW [n] .SH [n] •A [x] [I] [i] [I] [i] [I] [i] [i] [I] [d] [d] [d] [d] [d] [d] [d] [d] .B [m [s] ] .c [m [s] ] Same as .VS, except that foil size is 7" wide x 5" high . Same as .VS, except that foil size is 5"x7" . Same as .VS, except that foil size is 7"xS.4" . Same as .VS, except that foil size is 7"x9" . Same as .VS, except that foil size is 7"x5" . Same as .VS, except that foil size is 5" x7" . Same as .VS, except that foil size is 7"x5.4" . Same as .VS, except that foil size is 7"x9" . Place text that follows at the first indentation level (left margin); the presence of x suppresses the V2 line spacing from the preceding text. Place text that follows at the second indentation level; text' is preceded by a mark; m is the mark (default is a large bullet); s is the increment or decrement to the point size of the mark with respect to the prevailing point size (default is 0); if s is 100, it causes the point size of the mark to be the same as that of the default mark. Same as .B, but for the third indentation level; default mark is a dash. - 1- MV(5) MV(5) .D [m [s] ] Same as .B, but for the fourth indentation level; default mark is a small bullet . .T string String is printed as an over-size, centered title . •1 [in] [a [x]] Change the current text indent (does not affect titles); in is the indent (in inches unless dimensioned, default is 0); if in is signed, it is an increment or decrement; the presence of a invokes the .A macro (see below) and passes x (if any) to it. .S [p] [l] Set the point size and line length; p is the point size (default is "previous"); if p is 100, the point size reverts to the initial default for the current foil-start macro; if p is signed, it is an increment or decrement (default is 18 for .VS, .VH, and .SH, and 14 for the other foil-start macros); I is the line length (in inches unless dimensioned; default is 4.2" for .Vb, 3.8" for .Sb, 5" for .SH, and 6" for the other foil-start macros) . •DF n f [n f .. .1 Define font positions; may not appear within a foil's input text (i.e., it may only appear after all the input text for a foil, but before the next foil-start macro); n is the position of font f; up to four "n 1" pairs may be specified; the first font named becomes the prevailing font; the initial setting is (H is a synonym for G): .DF 1 H 2 I 3 B 4 S .DV [a] [b] [c] [d] Alter the vertical spacing between indentation levels; a is the spacing for .A, b is for .B, c is for .C, and d is for .D; all non-null arguments must be dimensioned; null arguments leave the corresponding spacing unaffected; initial setting is: .DV .5v .5v .5v Ov .U strl [str2] Underline strl and concatenate str2 (if any) to it. The last four macros in the above list do not cause a break; the .1 macro causes a break only if it is invoked with more than one argument; all the other macros cause a break. The macro package also recognizes the following upper-case synonyms for the corresponding lower-case troff requests: .AD .BR .CE .FI .HY .NA .NF .NH .NX .SO .SP .TA .TI The Tm string produces the trademark symbol. The input tilde (-) character is translated into a blank on output. See the user's manual cited below for further details. FILES lusr/lib/tmacltmac.v lusr Ilibl macros/vmca SEE ALSO cw(1), eqn(1), mmt(1), tbI(I), troff(1). A Macro Package for View Graphs and Slides by T. A. Dolotta and D. W. Smith. BUGS The .VW and .SW foils are meant to be 9" wide by 7" high, but because the typesetter paper is generally only 8" wide, they are printed 7" wide by 5.4" high and have to be enlarged by a factor of 9/7 before use as view graphs; this makes them less than totally useful. - 2- REGEXP(S) REGEXP(S) NAME regexp - regular expression compile and match routines SYNOPSIS #define #define #define #define #define #define INIT < declara tions > GETCO PEEKCO UNGETC(c) RETURN(pointer) ERROR(vaI) #include < regexp.h > char .compileCinstring, expbuf, endbuf, eof) char .instring, .expbuf, .endbuf; int step(string, expbuf) char .string, .expbuf; DESCRIPTION This page describes general purpose regular expression matching routines in the form of ed (1) , defined in lusr linclude/regexp.h. Programs such as ed (1) , sed(I), grep(I), bs(I), expr(I), etc., which perform regular expression matching use this source file. In this way, only this file need be changed to maintain regular expression compatibility. The interface to this file is unpleasantly complex. Programs that include this file must have the following five macros declared before the "#include < regexp.h > "statement. These macros are used by the compile routine. GETCO Return the value of the next character in the regular expression pattern. Successive calls to GETCO should return successive characters of the regular expression. PEEKCO Return the next character in the regular expression. Successive calls to PEEKCO should return the same character (which should also be the next character returned by GETC () ) . UNGETC(c) Cause the argument c to be returned by the next call to GETCO (and PEEKCO). No more that one character of push back is ever needed and this character is guaranteed to be the last character read by GETCO. The value of the macro UNGETC(c) is always ignored. RETURN (pointer) This macro is used on normal exit of the compile routine. The value of the argument pointer is a pointer to the character after the last character of the compiled regular expression. This is useful to programs which have memory allocation to manage. ERROR (vaJ) This is the abnormal return from the compile routine. The argument val is an error number (see table below for meanings). This call should never return. - 1- REGEXP(5) REGEXP(5) ERROR 11 16 25 36 41 42 43 44 45 46 49 50 MEANING Range endpoint too large. Bad number. "\digit" out of range. Illegal or missing delimiter. No remembered search string. \ ( \) imbalance. Too many \ (. More than 2 numbers given in \ { \l. } expected after \. First number exceeds second in \ { \l. [ ] imbalance. Regular expression overflow. The syntax of the compile routine is as follows: compileGnstring, expbuf, endbuf, eof) The first parameter instring is never used explicitly by the compile routine but is useful for programs that pass down different pointers to input characters. It is sometimes used in the INIT declaration (see below). Programs which call functions to input characters or have characters in an external array can pass down a value of «char .) 0) for this parameter. The next parameter expbuJ is a character pointer. It points to the place where the compiled regular expression will be placed. The parameter endbuJ is one more than the highest address where the compiled regular expression may be placed. If the compiled expression cannot fit in (endbuj-expbuj) bytes, a call to ERROR(50) is made. The parameter eoj is the character which marks the end of the regular expression. For example, in ed(I), this character is usually a I. Each program that includes this file must have a #define statement for IN IT. This definition will be placed right after the declaration for the function compile and the opening curly brace ((). It is used for dependent declarations and initializations. Most often it is used to set a register variable to point the beginning of the regular expression so that this register variable can be used in the declarations for GETCO, PEEKCO and UNGETCO. Otherwise it can be used to declare external variables that might be used by GETCO, PEEKCO and UNGETCO. See the example below of the declarations taken from grep(I). There are other functions in this file which perform actual regular expression matching, one of which is the function step. The call to step is as follows: step(string, expbuf) The first parameter to step is a pointer to a string of characters to be checked for a match. This string should be null terminated. The second parameter expbuJ is the compiled regular expression which was obtained by a call of the function compile. The function step returns one, if the given string matches the regular expression, and zero if the expressions do not match. If there is a match, two external character pointers are set as a side effect to the call to step. The variable set in step is locI. This is a pointer to the first character that matched the regular expression. The variable loc2, which is set by the function advance, points the character after the last character that matches the regular expression. Thus if the regular expression matches the entire line, locI will point to the first character of string and loc2 will point to the null at the end of string. - 2 - REGEXP(5) REGEXP(5) Step uses the external variable eirc! which is set by compile if the regular expression begins with If this is set then step will only try to match the regular expression to the beginning of the string. If more than one regular expression is to be compiled before the first is executed the value of eirc! should be saved for each compiled expression and eirc! should be set to that saved value before each call to step. A. The function advance is called from step with the same arguments as step. The purpose of step is to step through the string argument and call advance until advance returns a one indicating a match or until the end of string is reached. If one wants to constrain string to the beginning of the line in all cases, step need not be called, simply call advance. When advance encounters a • or \{ \J sequence in the regular expression it will advance its pointer to the string to be matched as far as possible and will recursively call itself trying to match the rest of the string to the rest of the regular expression. As long as there is no match, advance will back up along the string until it finds a match or reaches the point in the string that initially matched the • or \( \J. It is sometimes desirable to stop this backing up before the initial point in the string is reached. If the external character pointer loes is equal to the point in the string at sometime during the backing up process, advance will break out of the loop that backs up and will return zero. This is used be ed (1) and sed (1) for substitutions done globally (not just the first occurrence, but the whole line) so, for example, expressions like s/y.//g do not loop forever. The routines ecmp and getrange are trivial and are called by the routines previously mentioned. EXAMPLES The following is an example of how the regular expression macros and calls look from grep (1) : #define #define #define #define #define #define INIT GETC() PEEKCO UNGETC(c) RETURN(c) ERROR (c) register char *sp = instring; (*sp++) (*sp) (--sp) return; regerr() #inc1ude compile(*argv, expbuf, &expbuf(ESIZE1, \0'); if(stepOinebuf, expbuO) succeed(); FILES lusr/inc1ude/regexp.h SEE ALSO ed(I), grep(1), sed(1). BUGS The handling of eirc! is kludgy. The routine ecmp is equivalent to the Standard 110 routine strncmp and should be replaced by that routine. The actual code is probably easier to understand than this manual page. STAT(S) STAT(S) NAME stat - data returned by stat system call SYNOPSIS #include #include DESCRIPTION The system calls stat and Jstat return data whose structure is defined by this include file. The encoding of the field st _mode is defined in this file also. /* * Structure of the result of stat */ struct { stat dev_t ino_t ushort short ushort ushort dey t off t time t time t time t st_dev; stjno; st_mode; st nlink; st=uid; st~id; stJdev; st_size; st_atime; st_mtime; st_ctime; }; #define #define #define #define #define #define #define #define #define #define #define #define S_IFMT S_IFDIR S IFCHR S_IFBLK S IFREG S_IFIFO S_ISUID S_ISGID S ISVTX S_IREAD S_IWRITE S_IEXEC 0170000 0040000 0020000 0060000 0100000 0010000 04000 02000 01000 00400 00200 00100 /* /* /* /* /* /* /* /* /* /* /* /* type of file */ directory */ character special */ block special */ regular */ fifo */ set user id on execution */ set group id on execution */ save swapped text even after use */ read permission, owner */ write permission, owner */ execute/search permission, owner */ FILES /usr/inc1ude/sys/types.h /usrlinc1ude/sys/stat.h SEE ALSO stat(2), types(S). - 1- TERM(5) TERM (5) NAME term - conventional names for terminals DESCRIPTION These names are used by certain commands (e.g., nroff, mm (1) , man (1 ) , tabs (1» and are maintained as part of the shell environment (see sh (1), profile (4), and environ (5» in the variable $TERM: 1520 1620 1620-12 2621 2631 2631-c 2631-e 2640 2645 300 300-12 300s 382 300s-12 3045 33 37 40-2 40-4 4540 3270 4000a 40 14 43 450 450-12 735 745 dumb sync hp lp tn1200 tn300 Datamedia 1520 Diablo 1620 and others using the HyType II printer same, in 12-pitch mode Hewlett-Packard HP2621 series Hewlett-Packard 2631 line printer Hewlett-Packard 2631 line printer - compressed mode Hewlett-Packard 2631 line printer - expanded mode Hewlett-Packard HP2640 series Hewlett-Packard HP264n series (other than the 2640 series) DASIIDTC/GSI 300 and others using the HyType I printer same, in 12-pitch mode DASIIDTC/GSI 300s DTC 382 same, in 12-pitch mode Datamedia 3045 TELETYPE@ Terminal Model 33 KSR TELETYPE Terminal Model 37 KSR TELETYPE Terminal Model 40/2 TELETYPE Terminal Model 40/4 TELETYPE Terminal Model 4540 IBM Model 3270 Trendata 4000a Tektronix 4014 TELETYPE Model 43 KSR DASI 450 (same as Diablo 1620) same, in 12-pitch mode Texas Instruments TI735 and TI725 Texas Instruments TI745 generic name for terminals that lack reverse line-feed and other special escape sequences generic name for synchronous TELETYPE 4540-compatible terminals Hewlett-Packard (same as 2645) generic name for a line printer General Electric TermiNet 1200 General Electric TermiNet 300 Up to 8 characters, chosen from [-a-zO-9], make up a basic terminal name. Terminal sub-models and operational modes are distinguished by suffixes beginning with a -. Names should generally be based on original vendors, rather than local distributors. A terminal acquired from one vendor should not have more than one distinct basic name. Commands whose behavior depends on the type of terminal should accept arguments of the form -Tterm where term is one of the names given above; if no such argument is present, such commands should obtain the terminal type from the environment variable $TERM, which, in turn, should contain term. SEE ALSO mm(1), nroif(O, tplot(1G), sh(1), stty(O, tabs(1), profile(4), environ(5). - 1- TERM(S) TERM(S) BUGS This is a small candle trying to illuminate a large, dark problem. Programs that ought to adhere to this nomenclature do so somewhat fitfully. I.. 2 - TYPES(5) TYPES (5) NAME types - primitive system data types SYNOPSIS #include < sys/types.h > DESCRIPTION The data types defined in the include file are used in UNIX System code; some data of these types are accessible to user code: typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef struct { int rll]; } • long daddr t; caddr=t; char • unsigned int uint; unsigned short ushort; ushort ino_t; cnt_t; short long time_t; label_d 10]; int short dev_t; long off_t; long paddr_t; long key_t; physadr; The form daddrJ is used for disk addresses except in an i-node on disk, see Times are encoded in seconds since 00:00:00 GMT, January 1, 1970. The major and minor parts of a device code specify kind and unit number of a device and are installation-dependent. Offsets are measured in bytes from the beginning of a file. The label_t variables are used to save the processor state while another process is running. /s(4). SEE ALSO fs(4). - 1- INTRO (6) INTRO(6) NAME intro - introduction to games DESCRIPTION This section describes the recreational and educational programs found in the directory lusr/games. The availability of these programs may vary from system to system. - 1- ARITHMETIC (6) ARITHMETIC (6) NAME arithmetic - provide drill in number facts SYNOPSIS lusr/games/arithmetic [ + -xl] [ range DESCRIPTION Arithmetic types out simple arithmetic problems, and waits for an answer to be typed in. If the answer is correct, it types back "Right!", and a new problem. If the answer is wrong, it replies "What?", and waits for another answer. Every twenty problems, it publishes statistics on correctness and the time required to answer. To quit the program, type an interrupt (delete). The first optional argument determines the kind. of problem to be generated; +, -, x, and I respectively cause addition, subtraction, multiplication, and division problems to be generated. One or more characters can be given; if more than one is given, the different types of problems will be mixed in random order; default is + -. Range is a decimal number; all addends, subtrahends, differences, multiplicands, divisors, and quotients will be less than or equal to the value of range. Default range is 10. At the start, all numbers less than or equal to range are equally likely to appear. If the respondent makes a mistake, the numbers in the problem which was missed become more likely to reappear. As a matter of educational philosophy, the program will not give correct answers, since the learner should, in principle, be able to calculate them. Thus the program is intended to provide drill for someone just past the first learning stage, not to teach number facts de novo. For almost all users, the relevant statistic should be time per problem, not percent correct. I - 1- BACK(6) BACK(6) NAME back - the game of backgammon SYNOPSIS /usr/garnes/back DESCRIPTION Back is a program which provides a partner for the game of backgammon. It is designed to play at three different levels of skill, one of which you must select. In addition to selecting the opponent's level, you may also indicate that you would like to roll your own dice during your turns (for the superstitious players). You will also be given the opportunity to move first. The practice of each player rolling one die for the first move is not incorporated. The points are numbered 1-24, with 1 being white's extreme inner table, 24 being brown's inner table, 0 being the bar for removed white pieces and 25 the bar for brown. For details on how moves are expressed, type y when back asks "Instructions?" at the beginning of the game. When back first asks "Move?", type ? to see a list of move options other than entering your numerical move. When the game is finished, back will ask you if you want the log. If you respond with y, back will attempt to append to or create a file back. log in the current directory. FILES lusr I games/lib/backrules Itmp/b* back. log rules file log temp file log file BUGS The only level really worth playing is "expert", and it only plays the forward game. Back will complain loudly if you attempt to make too many moves in a turn, but will become very silent if you make too few. Doubling is not implemented. - 1- BJ(6) BJ(6) NAME bj - the game of black jack SYNOPSIS /usr / games/bj DESCRIPTION Bj is a serious attempt at simulating the dealer in the game of black jack (or twenty-one) as might be found in Reno. The following rules apply: The bet is $2 every hand. A player "natural" (black jack) pays $3. A dealer natural loses $2. Both dealer and player naturals is a "push" (no money exchange). If the dealer has an ace up, the player is allowed to make an "insurance" bet against the chance of a dealer natural. If this bet is not taken, play resumes as normal. If the bet is taken, it is a side bet where the player wins $2 if the dealer has a natural and loses $1 if the dealer does not. If the player is dealt two cards of the same value, he is allowed to "double". He is allowed to play two hands, each with one of these cards. (The bet is doubled also; $2 on each hand.} If a dealt hand has a total of ten or eleven, the player may "double down". He may double the bet ($2 to $4) and receive exactly one more card on that hand. Under normal play, the player may "hit" (draw a card) as long as his total is not over twenty-one. If the player "busts" (goes over twenty-one), the dealer wins the bet. When the player "stands" (decides not to hit), the dealer hits until he attains a total of seventeen or more. If the dealer busts, the player wins the bet. If both player and dealer stand, the one with the largest total wins. A tie is a push. The machine deals and keeps score. The following questions will be asked at appropriate times. Each question is answered by y followed by a new-line for "yes", or just new-line for "no". ? Insurance? Double down? (means, "do you want a hit?") Every time the deck is shuffled, the dea\er so states and the "action" (total bet) and "standing" (total won or lost) is printed. To exit, hit the interrupt key (DEL) and the action and standing will be printed. I - 1- CHESS(6) (PDP-ll only) CHESS(6) NAME chess - the game of chess SYNOPSIS lusr/gaDles/chess DESCRIPTION Chess is a computer program that plays class D chess. Moves may be given either in standard (descriptive) notation or in algebraic notation. The symbol + must be placed at the end of a line when the move on that line places the opponent's king in check. 0-0 and 0-0-0 specify castling, king side or queen side, respectively. The user is prompted for a move or command by a •. To play black, type first at the onset of the game. To print a copy of the board in play, type a carriage return only. Each move is echoed in the appropriate notation, followed by the program's reply. Near the middle and end games, the program can take considerable time in computing its moves. A ? or help may be typed to get a help message that briefly describes the possible commands. DIAGNOSTICS The most cryptic diagnostic is "eh?" which means that the input was syntactically incorrect. BUGS Pawns may be promoted only to queens. - 1- CRAPS (6) CRAPS (6) NAME craps - the game of craps SYNOPSIS /usr/games/craps DESCRIPTION Craps is a form of the game of craps that is played in Las Vegas. The program simulates the roller, while the user (the player) places bets. The player may choose, at any time, to bet with the roller or with the House. A bet of a negative amount is taken as a bet with the House, any other bet is a bet with the roller. The player starts off with a "bankroll" of $2,000. The program prompts with: bet? The bet can be all or part of the player's bankroll. Any bet over the total bankroll is rejected and the program prompts with bet? until a proper bet is made. Once the bet is accepted, the roller throws the dice. The following rules apply (the player wins or loses depending on whether the bet is placed with the roller or with the House; the odds are even). The first roll is the roll immediately following a bet: 1. On the first roll: 7 or 11 2, 3, or 12 any other number 2. On subsequent rolls: point 7 any other number wins for the roller; wins for the House; is the point, roll again (Rule 2 applies). roller wins; House wins; roll again. If a player loses the entire bankroll, the House will offer to lend the player an additional $2,000. The program will prompt: marker? A yes (or y) consummates the loan. Any other reply terminates the game. If a player owes the House money, the House reminds the player, before a bet is placed, how many markers are outstanding. If, at any time, the bankroll of a player who has outstanding markers exceeds $2,000, the House asks: Repay marker? A reply of yes (or y) indicates the player's willingness to repay the loan. If only 1 marker is outstanding, it is immediately repaid. However, if more than 1 marker are outstanding, the House asks: How many? markers the player would like to repay. If an invalid number is entered (or just a carriage return), an appropriate message is printed and the program will prompt with How many? until a valid number is entered. If a player accumulates 10 markers (a total of $20,000 borrowed from the House), the program informs the player of the situation and exits. I Should the bankroll of a player who has outstanding markers exceed $50,000, the total amount of money borrowed will be automatically repaid to the House. - 1- CRAPS (6) CRAPS (6) Any player who accumulates $100,000 or more breaks the bank. The program then prompts: New game? to give the House a chance to win back its money. Any reply other than yes is considered to be a no (except in the case of bet? or How many?). To exit, send an interrupt (break), DEL, or control-D. The program will indicate whether the player won, lost, or broke even. MISCELLANEOUS The random number generator for the die numbers uses the seconds from the time of day. Depending on system usage, these numbers, ·at times, may seem strange but occurrences of this type in a real dice situation are not uncommon. -2- HANGMAN (6) HANGMAN (6) NAME hangman - guess the word SYNOPSIS lusr/games/hangman [ arg DESCRIPTION Hangman chooses a word at least seven letters long from a dictionary. The user is to guess letters one at a time. The optional argument arg names an alternate dictionary. FILES lusr/lib/w2006 BUGS Hyphenated compounds are run together. I - 1- JOTTO(6) JOTTO(6) NAME jotto - secret word game SYNOPSIS /usr/games/jotto [ -p] DESCRIPTION lotto is a word guessing game. You try to guess the computer's secret word before it guesses yours. Clues are obtained by entering probe words. For example, if the computer's secret word is "brown" and you probe with "stare", it will reply "1" indicating that there is one letter in common between your probe and the secret word. Double letters count only once unless they appear in both words. For example, if the hidden word is "igloo" and you probe with "broke", the computer will reply "I". But if you probe with "gloom", the computer will respond "4". All secret words and probe words should be non-proper English five-letter words. If the computer guesses your word exactly, please respond with "y". It will then tell you what its secret word was. The -p flag instructs the computer to report its progress in guessing your word. BUGS The dictionary contains some unusual words and lacks some common ones. - 1- MAZE(6) (PDP-ll only) NAME maze - generate a maze SYNOPSIS /usr / games/maze DESCRIPTION Maze asks a few questions and then prints a maze. BUGS Some mazes (especi~lly small ones) have no solutions. - 1- MAZE(6) MOO(6) MOO(6) NAME moo - guessing game SYNOPSIS /usr/gaDles/Dloo DESCRIPTION Moo is a guessing game imported from England. The computer picks a number consisting of four distinct decimal digits. The player guesses four distinct digits being scored on each guess. A "cow" is a correct digit in an incorrect position. A "bull" is a correct digit in a correct position. The game continues until the player guesses the number (a score of four bulls). - 1- QUIZ(6) QUIZ(6) NAME quiz - test your knowledge SYNOPSIS /usr/games/quiz [ -i file ] [ -t ] [ categoryl category2 ] DESCRIPTION QUiz gives associative knowledge tests on various subjects. It asks items chosen from category 1 and expects answers from category 2, or vice versa. If no categories are specified, quiz gives instructions and lists the available categories. QUiz tells a correct answer whenever you type a bare new-line. At the end of input, upon interrupt, or when questions run out, quiz reports a score and terminates. The -t flag specifies "tutorial" mode, where missed questions are repeated later, and material is gradually introduced as you learn. The -i flag causes the named file to be substituted for the default index file. The lines of these files have the syntax: line category alternate primary option = category new-line I category: line = alternate I category I alternate = empty I alternate primary = character I [ category] I option = { category} The first category on each line of an index file names an information file. The remaining categories specify the order and contents of the data in each line of the information file. Information files have the same syntax. Backslash \ is used as with sh (0 to quote syntactically significant characters or to insert transparent new-lines into a line. When either a question or its answer is empty, quiz will refrain from asking it. FILES /usr / gamesllib/ quiz/index /usr / games/lib/ quiz/ * BUGS I The construct "a Iab" doesn't work in an information file. Use "a {b}". - 1- REVERSI(6) (PDP-ll only) REVERSI(6) NAME reversi - a game of dramatic reversals SYNOPSIS /usr/games/reversi [ [ -r ] file ] DESCRIPTION Reversi (also knpwn as "friends", "Chinese friends" and "Othello") is played on an 8 by 8 board using two-sided tokens. Each player takes his turn by placing a token with his side up in an empty square. During the first four turns, players may only place tokens in the four central squares of the board. Subsequently, with each turn, a player must capture one or more of his opponent's tokens. He does this by placing one of his tokens such that it and another of his tokens embrace a solid line of his opponent's horizontally, vertically or diagonally. Captured tokens are flipped over and thus can be re-captured. If a player cannot outflank his opponent he forfeits his turn. The play continues until the board is filled or until no more outflanking is possible. In this game, your tokens are asterisks (.) and the machine's are at-signs (@). You move by typing in the row and column at which you want to place your token as two digits (I -8), optionally separated by blanks or tabs. You can also type in: c to continue the game after hitting break (this is only necessary if you interrupt the machine while it is deliberating), to start reversi playing against itself for the next n moves (or gn until the break key is hit), n to stop printing the board after each move, o to start it up again, p to print the board regardless, q to quit (without dishonor), s to print the score, and, as always, to escape to the shell. Control-d gets you back. Reversi also recognizes several commands which are valid only at the start of the game, before any moves have been made. They are: f to let the machine go first. bn to ask for a handicap of from one to four corner squares. If you're really good, you can give the machine a handicap by typing a negative number. to set the amount of look-ahead used by the machine in In searching for moves. Zero means none at all. Four is the default. Greater than six means you may fall asleep waiting for the machine to move. t n to tell reversi that you will only need n seconds to consider each move. If you fail to respond in the allotted time, you forfeit your turn. If reversi is given a file name as an argument, it will checkpoint the game, move by move, by dumping the board onto file. The -r option will cause reversi to restart the game from file and continue logging. DIAGNOSTICS "Illegal!" for an illegal move, and "Huh?" for a move that even the machine cannot understand. . - 1- (PDP-ll only) SKY(6) SKY(6) NAME sky - obtain ephemerides SYNOPSIS /usr/games/sky [ -I ] DESCRIPTION Sky predicts the apparent locations of the Sun, the Moon, the planets out to Saturn, stars of magnitude at least 2.5, and certain other celestial objects. Sky reads the standard input to obtain a GMT time typed on one line with blanks separating year, month number, day, hour, and minute; if the year is missing the current year is used. If a blank line is typed the current time is used. The program prints the azimuth, elevation, and magnitude of objects which are above the horizon at the ephemeris location of Murray Hill at the indicated time. The -I flag causes it to ask for another location. Placing a "1" input after the minute entry causes the program to print out the Greenwich Sidereal Time at the indicated moment and to print for each body its topographic right ascension and declination as well as its azimuth and elevation. Also, instead of the magnitude, the semidiameter of the body, in seconds of arc, is reported. A "2" after the minute entry makes the coordinate system geocentric. The effects of atmospheric extinction on magnitudes are not included; the brightest magnitudes of variable stars are marked with *. For all bodies, the program takes into account precession and nutation of the equinox, annual (but not diurnal) aberration, diurnal parallax, and the proper motion of stars. In no case is refraction included. The program takes into account perturbations of the Earth due to the Moon, Venus, Mars, and Jupiter. The expected accuracies are: for the Sun and other stellar bodies a few tenths of seconds of arc; for the Moon (on which particular care is lavished) likewise a few tenths of seconds. For the Sun, Moon and stars the accuracy is sufficient to predict the circumstances of eclipses and occultations to within a few seconds of time. The planets may be off by several minutes of arc. There are lots of special options not described here, which do things like substituting named star catalogs, smoothing nutation and aberration to aid generation of mean places of stars, and making conventional adjustments to the Moon to improve eclipse predictions. For the most accurate use of the program it is necessary to know that it actually runs in Ephemeris time. SEE ALSO American Ephemeris and Nautical Almanac, for the appropriate years; also, the Explanatory Supplement to the American Ephemeris and Nautical Almanac. - 1- TTT(6) NAME .-ttt, cubic - tic-tac-toe SYNOPSIS /usr/games/ttt /usr/games/cubic DESCRIPTION Ttt is the X and 0 game popular in the first grade. This is a learning program that never makes the same mistake twice. Although it learns, it learns slowly. It must lose nearly 80 games to completely know the game. Cubic plays three-dimensional tic-tac-toe on a 4x4x4 board. Moves are specified as a sequence of three coordinate numbers in the range 1-4. FILES lusr I games/ttt.klearning file BUGS Cubic does not yet work on V AX. - 1- WUMP(6) WUMP(6) NAME wump - the game of hunt-the-wumpus SYNOPSIS lusr Igames/wump DESCRIPTION Wump plays the game of "Hunt the Wumpus." A Wumpus is a creature that lives in a cave with several rooms connected by tunnels. You wander among the rooms, trying to shoot the Wumpus with an arrow, meanwhile avoiding being eaten by the Wumpus and falling into Bottomless Pits. There are also Super Bats which are likely to pick you up and drop you in some random room. The program asks various questions which you answer one per line; it will give a more detailed description if you want. This program is based on one described in People's Computer Company, 2, 2 (November 1973). BUGS It will never replace Adventure. - 1-
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37 Create Date : 2013:11:20 19:36:56-08:00 Modify Date : 2013:11:20 22:53:36-07:00 Metadata Date : 2013:11:20 22:53:36-07:00 Producer : Adobe Acrobat 9.55 Paper Capture Plug-in Format : application/pdf Document ID : uuid:92d8c4a1-bee5-d54c-95bd-4f55cb0d5bda Instance ID : uuid:c811e021-b4d4-6a46-ab8f-9c42f84711a5 Page Layout : SinglePage Page Mode : UseOutlines Page Count : 744EXIF Metadata provided by EXIF.tools