UNIX Programmers Manual Third Edition Feb73

UNIX_Programmers_Manual_Third_Edition_Feb73 UNIX_Programmers_Manual_Third_Edition_Feb73

UNIX_Programmers_Manual_Third_Edition_Feb73 UNIX_Programmers_Manual_Third_Edition_Feb73

User Manual: manual pdf -FilePursuit

Open the PDF directly: View PDF PDF.
Page Count: 276

DownloadUNIX Programmers Manual Third Edition Feb73
Open PDF In BrowserView PDF
UNIX PROGRAMMER'S MANUAL
Third Edition.

1<. Thompson
D. M. Ritchie

February, 1973

Copyright @ 1 972
Bell Telephone Laboratories, Inc.
No part of this document may be reproduced~
or distributed outside: the Laboratori.es, without
the written permission of Bell Telephone Laboratories.

PREFACE
to the Third Edition
In the 'months since the last appearance of this manual, many
Changes have occurred both in the system itself and in the way it
is used.
Perhaps most obviously, there have been additions, deletions, and
rrodifications to the system and its software. It is these,
changes, of course, that caused the appearance of this revised
manual.
Second, the number of people spending an appreciable amount of
time writing UNIX software has increased. Credit is due to
L. L. Cherry, M. D. McIlroy, L. E. MCMahon, R. MorriS,
J. F. Ossanna, and E. N. Pinson for their contributions.
Finally, the number of UNIX installations has grown to 16, with
more expected. None of these has exactly the same complement of
hardware or software. Therefore, at an¥ particular installation,
it is quite possible that this manual will give inappropriate
informa tion.
In- particular, any system which.!!.!!.! .! fl2E-ll/-'.Q processor ill!
~ software described herein, .!!2!: will the
software behave ~ .!!!!!! way,.' The second, or even the first,
edition of this manual is likely to be more appropriate.

!!2.!: include'.!!!

Besides additions, deletions, and modifications to the writeups
in each section, this manual differs from its predecessors in two
ways: all the commands used for system maintenance and not intended for normal users have beenrnoved to a new section VIII;
and there is a new "How to Get Started" chapter that gives some
elementary facts and many pOinters to other sections.

- ii -

INTRODUCTION TO THIS MANUAL
This manual gives descriptions of the 'publicly available features
of UNIX. It provides neither a general overview (see "The UNIX
Time-sharing system" for that) nor details of the implementation
of the system (which remain to be disclosed).
Within the area it surveys, this manual attempts to be as complete and timely as possible. A conscious decision was made to
describe each program in exactly the state it was in at the time
its manual section was prepared. In particular, the desire to
describe something as it should, be, not as it is, was resisted.
Inevitably, this means that many sections will soon be out of
date. (The rate 'of change of the system is so great that a
dismayingly large number of early sections had to be modified
while. the rest were being written.. The unbounded effort required
to stay up-tO-date is best indicated by the fact that several of
the programs described were written specifically to aid in
preparation of this manuall)
This manual is divided into eight sections:
Commands
System calls
III. Subroutines
Special files
IV.
File formats
V.
User-maintained programs
VI.
VII. Miscellaneous
VIII. Maintenance

I.
II.

Commands are programs intended to be invoked directly by the
user, in contradistinction to subroutines, which are intended to
be called by the user's programs. Commands generally reside in
directory /bin (for E.!naryprograms). This directory is searched
automatically by the command line interpreter. Some programs
classified as commands are located elsewhere; this fact is indicated in the appropriate sections.
System calls are entries into the UNIX supervisor. .n a,sembly
language, they are coded -with the use of the opcode sys, a
S¥nonym for the·trap instruction.
A small assortment of subroutines is available; they are
described in section III •. The binary form of most of them is
kept in the system library /lib/liba.a.
The special files section IV discusses the characteristics of
each system "file" which actually refers to an.I/O device.
Unlike previous editions, the names in this section refer to the
DEC device names for the hardware, ~nstead of the names of the
special files themselves.
iii -

The file formats section V documents the structure of particular
kinds of files; for example, the form of the output of the loader
and assembler is given. Excluded are files used by only one command, for example the assembler's intermediate files.
User-maintained programs
the UNIX system, and the
indicate their existence
description. The author

(section VI) are not considered part of
prinCipal reason for listing them is to
without necessarily giving a complete
should be consulted for information.

The miscellaneous section (VII) gathers odds and ends.
Section VIII discusses commands which are not intended for ~se by
the ordinary user, in some cases because they disclose information in which he is presumably not interested, and in others
because they perform privileged functions.
Each section conSists o'f a number ,of independent entries of a
page· or so each. The name of the entry is in the upper corners
of its pages, its preparation date in the upper middle. Entries
within each section are alphabetized. The page numbers of each
entry start at 1. (The earlier hope for frequent, partial updates of the manual is clearly in vain, but in any event it is
not feasible to maintain consecutive page numbering in a document
like this.)
All entries have a common format.
The n!m! section repeats the entry name and gives a very
short description o,f its, purpose.
The synopSiS summarizes the use of the program being
described. A few conventions are used, particularly in the
Commands section:
Underlined words are considered literals, and are typed
just as they appear.
Square brackets ([]) around an argument indicate that the
argument is optional. 'When an argument is given as
" name " , it always refers to a file name.
Ellipses " ••• " are used to show that the previous
argument-prototype may be repeated.
A final convention is used by the commands themselves.
An argument beginning with a minus s'ign "-" is often taken to mean 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 " -".
The description section discusses in detail the subject at
hand.
The files section gives the names of files which are built
- iv -

into the program.
A

~

!!!Qsection gives pOinters to related information.

A diagnostics section discusses the diagnostics that may be
produced. This section tends to be as terse as the diagnostics themselves.
The bugs section gives known bugs and sometimes deficiencies. Occasionally also the suggested fix is described.
Previous edition of this manual had an owner section, which has
been dropped from this edition because the "owners" of many
routines became fairly hard to pin down. The major contributors
to UNIX, (cast in order of appearance) together with their login
names and most notable contributions, are
ken
dmr
jfo
doug
rhm
1em
llc
csr
enp

K.
D.
J.
M.
R.

L.
L.
C'.

E.

Thompson
M. Ritchie
F. Ossanna
D. McIlroy
Morris
E. McMahon
L. Cherry,
s. Roberts
N. Pinson

. (UNIX" many commands)
(many commands, as, ld, C)
(roff, nroff)
(tmg, m6)
(dc, much of library)
(cref)
( form, fed, sal1oc)
(tss)
(proof)

At the beginning of this document is a table of contents, organIzed by section and alphabetically within each section. There is
also a permuted index derived from the table of contents. Within
each index entrY, the title of the writ,eup to which it refers is
followed by the appropriatesect1on number in parentheses. This
fact is important because there is considerable name duplication
among the sections·, arising principally from commands which exist
only to exercise a particular system call.
This manual was prepared using the UNIX text editor ed and the
formatting program ~.
The assistance of R. ,Morris is gratefully acknowledged.

HOW TO GET STARTED
This section provides the basic information you need to get.
started on UNIX: how to log in and log out, how to communicate·
through your terminal, and how to run a program.
Logging

in

You must call UNIX from an appropriate terminal. UNIX supports
ASCII terminals typified by the TTY 37, the GE Terminet 300, the
Memorex 1240, and various graphical terminals on the one hand,
and IBM 2741-type terminals on the other.
To use UNIX, you must have a valid UNIX user name, which may be
obtained, together with the telephone number, from the system
administrators.
The same telephone number serves terminals operating at all the
standa·rd speeds.· After a data connection is established, the
login procedure depends on what kind of terminal you are using.

I!X 37 terminal
UNIX will type out "login: "; you respond with your user
name. From the TTY 37 terminal, and any other which has the
"new-line" function (combined carriage.. return and linefeed),
term!nate e~ch line you type with the new line key (~
the return key).
lQ,Q-baud terminals
Such terminals include the GE Terminet 300, most display
terminals, Execuport,. TI, and certain Anderson-Jacobson te·rminals. These terminals generally have a speed switch which
should be set at "300" (or "30" for 30 characters per
second) and a half/full duplex switch which should be set at
full-duplex. (Note tha·t this switch will often have to be
changed since MH-TSS requires half-duplex). When a connection with UNIX is established, a few garbage characters are
~yped 1the login message at the wrong.speed)~
Depress the
break key; ·this is a speed-independent signal" to UNIX .. that
a 300~baud terminal is in use. UNIX will type login:
at
the correct speed; you type your user name, followed by the
".. return " '~ey. Henceforth, the " return,
. . " new line " , or
linefeed keys will give :ex8ctly the same re.sults. Each
line must be terminated with one of these keys; no one is
listening to you until the return is received.
Selectric terminals
From an IBM 2741 or the Anderson-Jacobson Selectric terminal, no message will apeear. ~fter the ,data connection is
!stablisbed, press the return key. UNIX should type
login:
as described above. If the greeting does not
- vi -

appear after a few seconds, unlock the keyboard by switching
the terminal to local and back to remote, and type "return".
If necessary, hang up and try again; something has gone
wrong.
For all these terminals, it is important that you type your name
in lower·case if possible; if you type upper case letters, UNIX
will assume that your terminal cannot generate lower-case letters
and will translate all subsequent upper-case letters to lower
case.
The evidence that you have successfully logged in is that a UNIX
program, the Shell, will type a "ev"
10
to you." ( The Shell is
described below under How to run a program •
For more information, consult getty(VII) which discusses the
login sequence in more detail, and dC(IV~, which discusses typewriter I/O.
Logging 2Y!
There are three ways to log out:
You can simply hang up the phone. Hanging up is safe if you
are at command leVll. that is, if the Shell has just typed
its prompt signal % • It is also safe if you are in interactive system programs, for example the editor. It is
unsafe if you are executing a non-interactive program, or
one of your own programs., which either does no·tread the
typewriter or ignores the end-of-file indications which will
,result from hanging up •. The reason is that UNIX, unlike
most systems, does not terminate a program simply because it
has been hung-up upon.
You can log out by tyeing an end-of-file indication (EOT
character, control "d ) to the Shell. The Shell will terminate and the "login: " message will appear again.
You can also log· in directly as another user by giving a·
login command (login (I».
~ ~

communicate through your terminal

When you type to UNIX, a gnome deep in the system is· gathering
.your characters and saving them in a secret place. The characters will not be given to a program until you type a return, as
described above in Logging !n.
UNIX·typewriter I/O is full-duplex (except for Selectric terminals). 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
~u type during output·, the output will ·have the input characters
interSpersed. However, whatever you type will be saved up and
interpreted in correct sequence.
There is a limit to the amount of read-ahead, but it is generous
vii"-

and not likely to be exceeded unless the system is in trouble •
.When the read-ahead limit is exceeded. ~he system stops echoing
input characters, am starts echoing , no matter what you
.
typed.·. The las.t character which was echoed correctly will be
received correctly by the program to which you were talking; subsequent characters have been thrown away.
.
On a typewri
ter i'nput line, the character " @" kills all the characters typed before it, so typing mistakes can be repaired on a
single line. Also, the character "," erases the last character
typed. Successive uses o'f "," erase characters back to, but not
beyond, the beginning of the line. " @ " and " II " can be transmitted to
prog.aW by preceding them with "\ft. (so, to erase "\",
}'Ou need two # s).
.

a

The ASCII ft delete " ( a.k.a.··" rubout ") character is not passed to
programs but instead generates an interrupt 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, 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
It not only c;:auses
erates a file with
Quit is useful for

generated by typinq the ASCII FS character.
a running program to terminate but also genthe core image of the terminated process.
debugging.

Besides adapting· to the speed of the terminal,' UNIX tries to ·be
intelligent about whether you have a terminal with the "new line"
function or whether it must be simulated with carriage-return and
line-feed. In the latter case all input carriage returns are
turned to new-line characters the standard line delimiter) and
both a carriage return 'and a line feed are echoed to the terminal. If you get into the wrong mode, the stty command (I) will
rescue you.

l

Tab characters are used freely in UNIX source programs. If your
terminal does ,not have the tab functlon, you can arrange to have
them turned into spaces during output, and echoed as 'spaces during'input. The system assumes that tabs are set every eight
columns. Again, the stty command (I) will set'or reset this
mode. Also,there is a file which, if printed on TTY 37 or TermiNet 300 terminals, will set the tab stops correctly
( tabs (VII) ) •
Section dc(IV) discusses typewriter I/O more fully.
kl(IV) discusses the console typewriter.
~

£2

~ ~'program;

1h!

Section

Shell

When you have successfully logged into UNIX, a program called the
Shell is listening to your terminal. The Shell reads typed-in
- viii -

lines, splits them up into a command name and arguments, and executes the command. A command is simply an executable program.
The Shell looKs first in your current directory (see next section) for a program with the .givenname, and if none is there,
then in a system directory. There is nothing special about
s¥stem-provided commands except that they are kept in a directory
Where the Shell can find them.
The command name is always the first word on an input. line; it
and its arguments are separated from one another by spaces.
When a program terminates,the Shell will ordinarily regain control and type a "%" at you to indicate that it is ready for
anothe r command.
The Shell has many other capabilities, which are described in
detail in section sh(l).
The current directory
UNIX has a file system arranged in a hierarchy of directories.
When the system administrator gave you a user name, he also
created a directory for you (ordinarily with the same name as
your user name). 'When you log in, any file name you type is by
default in this directory. Since you are the owner of this
directory, you have full permissions to read, 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 owners. As a matter of observed fact,· few UNIX users protect their files from destruction, let alone perusal, by other
users.
To change the current directory (but not the set of permissions
you were endowed with at login) use chdir(I).
~

names

To' reference files not in the current directory, you must use a
path name.
Full path names begin with "I" , the name of the root directory of
the whole file system. After the slash comes the name of each
directory containing the next sub-directory (followed by a "I" l
until finally the file name is reached. E.i.: lusr/lem/filex
. refers to file "filex"1n directory "lem";· lem" is itself a
sub-directory of "usr"; "usr" springs directly from the root
directory.
If your current directory has subdirectories, the path names of
files therein begin with the name of the subdirectory (no prefixed "I").
.
Without important exception, a path name may be used anywhere a
file name is required.
Important commands which modify the contents of files are Cp(I),
- ix -

rov( I ), and rm (I), which re specti ve ly copy, move (i.e. rename) and
remove files. To find out the status of files or directories,
use 1s(1) and stat(I). See mkdir(I) for making directories;
rmdir(I) for dest+oying them.
For a 'fuller discUssion of the file system, see MM-71-1273-4. It
may also be useful to glance through section II of this manual,
which discusses system calls, even if you don't intend to deal
with the system at the assembly-language level.
Writing

~

program

To enter the text of a source program into a UNIX file, use
ed (I ) • The three princ ipal languages in UNIX are assembly
language (see as(I»,Fortran (see fcCI», and C ,(see cC(I».
After the program text has been ,entered through the editor and
written on a file, you can give the file to the appropriate
language processor as an argument. The output of the language
ilrocessor will be left on a file in the current directory named
a.out" • (If the output is precious, use mv to· move it to a less
exposed name soon.) If you wrote in assembly language, you will
probably need to load the program with library subroutines; see
Id(I). The other two language processors 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.
The next command you will need is db(I). As a debugger, db is
better than average for assembly-language programs,marginally
useful for C programs (when completed,cdb{I) will be a boon),
and virtually useless for .Fortran.
Your programs can receive' arguments from the command line just as
&yst'em programs do. For assembly language programs, see
exec(II) ..
~

processing

Almost.all text is entered through the editor •. The commands most
often used to write text on a terminal are: cat( I), 'pr(I),
roff(I), or nroff(I).
The cat command simply dumps ASCII text on the terminal, with no
processing at all. The pr command paginates the text and supplies headings. The nroff command is an elaborate text formattinq program, and requires careful forethought in entering both
the text and the formatting commands into the input file. The
roff command is a somewhat less elaborate formatting program, and
require~ somewhat less forethought.
Surprises
Certain' commands provide inter-user communication. Even if you
do not plan to use them, it would be well to learn something
- x -

about them, because someone else may aim them at you.
To communic"ate with another user currently logged in, write(I) is
used. To leave a message. the presenc.e of which will be announced
to another user when he next logs in, mail(I) is used. The
write-ups in the manual also suggest how to respond to the two
commands if you are a target.
When you log in, a message-of-the-day may greet you before the
first "%".

- xi -

TABLE OF CONTENTS
I.

COMMANDS

•• • •••••••••••••••••••••••••• place label
ar •••••••••••••••••••••••••• archive (combine) files
as • • • • • • • • • • • • • • • • • • • • • • • • • • assembler
bas • • • • • • • • • • • • • • • • • • • • • • • • • BASIC dialect
cat • • • • • • • • • • • • • • • • • • • • • • • • • concatenate (or print) files
cc • • • • • • • • • • • • • • • • • • • • • • • • • • compileC program
cdb -• •••••••••••••••••••••••• C debugger
chdir • • • • • • • • • • • • • • • • • • • • • • • change working directory
chmod
change access mode of files
chown • •••••••••••••••••••••• change owner of files
Q'Ilp ••••••••••••••••••••••••• compare file contents
cp •••••••••••••••••••••••••• copy file
cref •••••••••••••••••••••••• cross· reference table
crypt ••••••••••••••••••••••• encrypt, decrypt a file
date •••••••••••••••••••••••• get date and time of day
db •••••••••••••••••••••••••• symbolic debugger
dc •••••••••••••••••••••••••• desk calculator
df •••••••••••••••••••••••••• find free disk space
dsw ••••••••••••••••••••••••• delete files interactively
du •••••••••••••••••••••••••• find disk usage
echo •••••••••••••••••••••••• print command arguments
ai • ••••••••••••••••••••••••• text editor
exit •••••••••••••••••••••••• -end .command sequencE!
factor •••••••••••••••••••••• factor a number
fc •••••••••••••••••••••••••• compile Fortran program
fed ••••••••••••••••••••••••• 'form letter editor
form •••••••••••••••••••••••• generate form letter
forml • •••••••••••••••••••••• generate form letters
~ot() •••••••••••••••••••••••• command transfer
h.y'phen •••••••••••••••.••••••• find hyphenated words
ti •••••••••••••••••••••••••• conditional commana
ld •••••••••••••••••••••••••• link editor (loader)
In • ••••••••••••••••••••••••• link to file
login ••••••••• ~ ••••••••••••• log on to system
ls •••••••••••••••••••••••••• list content~ of directory
n15 •••••••••••••••••••••••••• macroprocessor
mail •••••••••••••••••••••••• send mail to another user
man ••••••••••••••••••••••••• run off manual section
mesg ~ ••••••••••••••••••••••• permit or deny'messages
mkdir •••••••••••••••••••••••- create directory
mt •••••••••••••••••••••••••• save, restore files on magtape
rnv •••••••••••••••••••••••••• move or rename file
run •••••••••••••••••••••••••• print namelist
nroff ••••••••••••••••••••••• format text for printing
ad. •••••••••••••••••••••••••• octal dump of file
cpr ••••••••••••••••••••••••• print file off-line
0'.1 • • • • • • • • • • • • • • • • • • • • • • • • • • page overlay file print
passwd •••••••••••••••••••••• set login password
pr •••••••••••••••••••••••••• print file with headings
proof ••••••••••••••••••••••• compare-text files
reloc ••••••••••••••••••••••• relocate object files

·............ ......... .
-

- xii -

rew •••••••••••••••••••••••••
rm ••••••••••••••••••••••••••
rmdir •••••••••••••••••••••••
roff ••••••••••••••••••••••••
sh •••••••' ••••••••••••.•••••••
size ••••••••••••••••••••••••
ano •••••••••••••••••••••••••
sort ••••••••••••••••••••••••
speak •••••••••••••••••••••••
split •••••••••••••••••••••••
stat •••• ~ •••••••••••••••••••
strip •••••••••••••••••••••••
stty ••••••••••••••••••••••••
S\1m

•••••••••••••••••••••••••

tap •••••••••••••••••••••••••

time ••••••••••••••••••••••••
tmg •••••••••••••••••••••••••

tss •••••••••••••••••••••••••
tty •••••••••••••••••••••••••

type ••••••••••••••••••••••••
typo ••••••••••••••••••••••••
\.l'l

••••••••••••••••••••••••••

uniq ••••••••••••••••••••••••
vs ••••••••••••••••••••••••••
~

..........................

w'tlo. • ••••••••••••••••••••••••

write •••••••••••••••••••••••
II.

rewind DECtape
remove (delete) file
remove (delete) directory
format text for, printing
command interpreter
get executable program size
compile Snobol program
sort ASCII file
send words to voice synthesizer
brea~ a file ,into pieces
get file status
remove symbols, relocation bits
set typewriter modes
sum file
save, restore files on DECtape
get time information
compile tmgl program
communicate with MH-TSS (GCOS)
find name of terminal.
print file page-by-page
find typographic errors
find undefined symbols
find duplicate.lines in a file
generate voice synthesizer phonemes
get (English) word count
who is on the system
write to another user

SYSTEM CALLS

boot •••••••••••••••••••••••• ,reboot the system
break ••••••••••••••••••••••• set program b~eak
cemt •••••••••••••••••••••••• catch EMT traps
chdir ••••••••••••••••••••••• change working directory
chmod ••••••••••••••••••••••• change mode of file
chown ••••••••••••••••••••••• change owner of file
close ••••••••••••••••••••••• close open file
creat ••••••••••••••••••••••• create file
csw ••••••••••••••••••••••••• read the console switches
dup •••,••••••••••••••••••••• '.' duplicate an open f~le
exec •••••••••••••••••••••••• execute program file
exit •••••••••••••••••••••••• terminate execution
fork •••••••••••••••••••••••• create new process
fpe ••••••••••••••••••••••••• catch floating exception errors
fstat ••••••••••••••••••••••• status of open file
qetuid •••••••••••••••••••••• get user ID'
qtty ••••••••••••••• '••••••••• get typewriter mode,
ilqins •••••••••••••••••••••• catch illegal instruction trap
intr •••••••••••••••••••••••• catch or inhibit interrupts
kill •••••••••••••••••••••••• destroy process
link. •••••••••••••••••••••••• link to file
makdir •••••••••••••••••••••• create directory
mdate ••••••••••••••••••••••• set date modified of file
nount ••••••••••••••••••••••• mount file system
nice •••••••••••••••••••••••• set low-priority status
xiii -

open file
inter process ehannel
·... ................... . open
'inhibit quits

open • •••••••••••••••••••••••
pipe
quit • •••••••••••••••••••••••
read • • • • • • • • • • • • • • • • • • • • • • • •
rele ••••••••••••••••••••••••
seek • •••••••••••••••••••••••
setuid ••••••••••••••••••••••
.sleep •••••••••••••••••••••••
'

sta t

••••••••••••••••••••••••

•••••••••••••••••••••••
stty ••••••••••••••••••••••••
sync ••••••••••••••••••••••••
time ••••••••••••••••••••••••
times •••••••••••••••••••••••
\lnount ••••••••••••••••••••••
tJ:llink ••••••••••••••••••••••
wait ••••••••••••••••••••••••
write • • • • • • • • • • • • • • • • • • • • • • •
~ime

III.

re·ad file
release processor
move read'or write pointer
set· user ID
delay execution
qet file status
set system time
set mode of typewriter
assure synchronization
get time of year
qet execution times
dismount file system
remove (delete) file
wait for process
write file

SUBROUTINES

atan • •••••••••••••••••••••••
atof ••••••••••••••••••••••••
atoi ••••••••••••••••••••••••
oompar ••••••••••••••••••••••
crypt •••••••••••••••••••••••
ctime •••••••••••••••••••••••
ddsput ••••••••••••••••••••••
ecyt ••••••••••••••••.••••••••
expo •••••••••••••••••••••••••
ftoa ••••••••••••••••••••••••
ftoo .~ ••••••••.••••••••••••••
qerts •••••••••••••••••••••••
getc .•••••••••••••••••.•••••••

arctangent
convert ASCII'to floatinq
convert ASCII to integer
string compare for -sort
encrypt accordinq to a keyword
convert time to ASCII
display character on picturephone
edited output conversion
exponential function
convert floatinq to ASCII
convert floatinq to octal
communicate with GCOS
qet character
11ypot ••••••••••••••••••••••• - compute hypotenuse
~oa •••••••••••••••••••••••• conv~rt integer to ASCII
loq ••••••••••••••••••••••••• loqarithm base e
mesq •••••••••••••••••••••••• print strinq on typewriter
nlist ••••••••••••••••••••••• read name list
pow ••••••••••••.••••••••••••• take powers of numbers
ptime ••••••••••••••••••••••• print time
putc •••••••••••••••••••••••• write character or word
qsort •••••••••.•••••••••••••• quicker sort
rand •••••••••••••••••••••••• pseudo random number qenerator
salloc •••••••••••••••••••••• storage allocator
sin ••••••••••••••••••••••••• sine, cosine
SCIrt •••••••••••••••••••••••• square root
switch •••••••••••••••••••••• transfer depending on value
ttyn •••••••••••••••••••••••• find teletype name
IV.

SPECIAL FILES

dc •••••••••••••••••••••••••• remote typewriter
dn •••••••••••••••••••••••••• 801 ACU
- xiv -

ci~
~

•••••••••••••••••••••••••• 201 Dataphone

......................... .

console typewriter
rnem ••••••••••••••••••••••••• core memory
pc •••••••••••••••••••••••••• punched paper tape
rf •••••••••••••••••••••••••• RF disk
rk •••••••••••••••••••••••••• RI< disk
t:c •••••••••••••••••••••••••• DECta~
tin ••••••••••••••••••••••••••• 9-track magtape
vt: •••••••••••••••••••••••••• st:orage-tube display

v.

FILE FORMATS

wtm~

assembler and loader output
archive file
core image ,file
directory format
file system format
password file
DECtape and magt:ape format
•••••••••••••••••••••••• logged-in user information
•••••••••••••••••••••••• accountinq files

VI •

USER MAI.NTAINED PROGRAMS

a.out: •••••••••••••••••••••••
archive •••••••••••••••••••••
oore ' ••••••••••••••••••••••••
direct:ory •••••••••••••••••••
file system •••••••••••••••••
passwd ••••••••••••••••••••••
ta~ •••••••••••••••••••••••••
utm~

be: •••••••••••••••••••••••••• compile B program

bj •••••••••••••••••••••••••• blackjack
ptx ••••••••••••••••••••••••• permuted index
yacc •••••••••••••••••••••••• yet another compiler-compiler
VII.

MISCELLANEOUS

ascii •••••••••••••••••••••••
•••••••••••••••••••••••••
getty •••••••••••••••••••••••
glob •••••••••••••••••••••••.•
greek •••••••••••••••••••••••

d~d_

ini t ••••••••••••••••••••••• '.
rnsh •• ' •••••••••••••••••••••••
tabs ••••••••••••••• ~ ••••••••
vs~

•••••••••••••••••••••••••

map of ASCII
spawn dat:&phone daemon
adapt to typewriter
arqument expander"
extended TTY 37 typebox map
in~tializer process
mini Shell
set tab stops on typewriter
voice synthesizer phonemes

VIII. SYSTEM MAINTAINANCE
20boot •••••••••••••••••••••• reboot 11/20 system

acct •••••••••••••••••••••••• get connect-time accounting
bproc ••••••••••••••••••••••• boot procedure
Check ••••••••••••••••••••••• check cons iste'ncy of file system
dhk ••••••••••••••••••••••••• check all file systems
clr1 •••••••••••••••••••••••• clear file~s i-node
dcheck •••••••••••••••••••••• verify directory hierarchy
dli ••••••••••••••••••••••••• load DEC binary paper tapes
istat ••••••••••••••••••••••• file status by i-number
- xv -

kill ••••••••••••••••••••••••
nount •••••••••••••••••••••••
ps ••••••••••••••••••••••••••
salv ••••••••••••••••••••••••

terminate a process
mount removable file system
get process status
repair damaged file system
enJ • • • • • • • • • • • • • • • • • • • • • • • • • • become super-user
swtmp ••••••••••••••••••••••• truneate accounting files
tm •••••••••••••••••••••••••• qet system time information
umount •••••••••••••••••••••• dismount removable file system

- xvi -

INDEX
20boot(VIII): reboot
dp(IV) :
greek(VII): extended TTY
dn (IV) :
tm(IV):
chmod (I): change
crypt(III): encrypt
wtrnp (V) :
acct(VIII): get connect-time
dn(IV): 801
getty(VII):
chk(VIII): check
salloc(III): storage
dup(II): duplicate
yacc (VI): yet
mail(I): send mail to
write(I): write to
are I) :
archive (V) :
atan( III) :
glob(VII):
echo(I): print command
sort( I): sort
atof( III): convert
atoi(III): convert
ascii(VII): ~ap ~f
ctime(III): convert time to
convert floating to
itoa(III): convert integer to
a.out(v) :
as (I) :
sync(II):

bc (VI): compile
10g(III): logarithm
bas(I) :
dli(VIII): load DEC
remove symbols, relocation
bj (VI) :

11/20 system
201 Dataphone
20boot(VIII): reboot 11/20 system
37 typebox map
801 ACU
9-track magtape
: (I): place label
a.out(v): assembler and loader output
'access mode of files
according to a keyword
accounting files
accounting
acct(VIII ),: get connect-time accounting
ACU
adapt to typewriter
all file systems
allocator
an open file
another compiler-compiler
another user
another user
archive (combine) files
archive file
archive(v): archive file
arctangent
argument expander
arguments
ar(I): archive (combine) files
ASCII file
ASCII to floating
ASCII to integer
ascii(VII): map of ASCII
ASCII
ASCII
ASCII ••• ftoa(III):
ASCII
asCI): assembler
assembler and loader output
assembler
assure synchronization
atan(III): arctangent
atof(III): convert ASCII to floating
atoi(III): convert ASCII to integer
B program
base e
bas(I): BASIC dialect
, BASIC dialect
bC(VI): compile B program
binary paper tapes
bits ••• strip(I):
bj(VI): blackjack
blackjack

- xvii -

bproc(VIII):
split(I) :
break(II): set program
istat(VIII): file status
cdb( I) :
cc(I): compile
dc(I): desk
cemt(II):
fpe(II):
ilgins(II):
intr(II):

chmod(I):
chmod(II):
chown(I):
chown(II)':
chdir(I) :
chd1r(II):
pipe(II): open ihter process
ddsput(III): display
putc(III): write
getc (III): get
chk(VIII) :
check(VIII):
system •••

clri(VIII):
close(II):

are I): archive
echo (I): print
shCI) :
exit(I): end
goto(I):
if(I): conditional
gerts;( III) :
tss (I) :
cmp(I):
compar(III): string
proof(I):
bC(VI} :

boot procedure
boot(II): reboot the system
bproc(VIII): boot procedure
break a file·into pieces
break(II): set program break
break
by i-number
C debugger
e program
calculator
catch EMT traps
catch floating exception errors
catch illegal instruction trap
. catch or inhibit interrupts
cat(I): concatenate (or print) files
cc(I): compile e program
cdb(I): e debugger
cemt(II): catch' EMT traps
'change acce.ssmode of files
change mode of file
change owner of files
change owner of file
change working directory
change working directory
channel
character on Picturephone
character or word
character
. chdir(I): change working directory
chdlr (II): change working directory
check all file systems
check consistency of file system
check(VIII): check consistency of file
chk(VIII): check all file systems
chmod(I): change access mode of files
chmod(II): change mode of file
chown( I l: change owner of files
chown(II): change owner of file
clear f11e's i-node
close open f1le
close(II): close open file
clri(VIII): clear file's i-node
cmp(I'): compare file contents
(combine) files
command arguments
command ,interpreter
comman~'sequence .
command transfer
command
communicate wit~ GeOS
communicate with MH-TSS (GCOS)
compare file contents
compare for so·rt
compare text files
compar(III): string compare for sort
compile B program

- xviii -

cC(I):
fc(I):
sno(I) :
tmg(I):
yacc (VI): yet another
hypot (III) :
cat(I) :
if (I) :
acct(VIII): qet'
check(VIII): check
csw(II): read the
kl(IV):
la(I): list
cmp( I): compare file
ecvt(III): edited output
atof(III):
atoi( III) :
ftoa(III):
ftoo(III):
itoa( III):
ctime(III):
cp(I):
core(V):
mem(IV} :

compile C program
compile Fortran proqram
compile Snobol program
compile tmq1 program
compiler-compiler
compute hypotenuse
concatenate (or print) files
conditional command
connect-time accountinq
consistency of file system
console switches
console typewriter
contents of directory
contents
conversion
convert ASCII to floating
convert ASCII to integer
convert floating to ASCII
convert floating to octal
convert integer to ASCII
convert time to ASCII
copy file
core image file
core memory
core{V) : core image file
sine III): sine, cosine
wc(I): qet (Enqlish) word count
cp{I): copy file
makdir(II): create directory
mkdir( I}: create directory
create II) : create file
fork(II): create new process
creat(II): create file
cref(I): cross reference table
cref(I) : cross reference table
crypt(I): encrypt, decrypt a file
crypt(III): encrypt according to a keyworc
csw(II): read the console switches
ctime(III): convert time to ASCII
dpd(VII): spawn dataphone daemon
aalv(VIII): repair damaged file system
dpd(VII): spawn dataphone daemon
dp(IV): 201 Dataphone
date (I): get date and time' of day
mdate (II): set date. modified of file
date(I): qet date and time of day
.
date(I): qet date and time of day
db( I): symbolic debugger
dcheck(VIII): verify directory hierarchy
dC(I): desk' calculator'
dC(IV): remote typewriter
P icturephone ••• ddsput(III): display character on
.
cdb(I): C debugger
db( I): symbolic debugger
dli{VIII): load· DEC binary paper tapes
crypt{I): encrypt, decrypt a file

- xix -

tap(V):
rew( I): rewind
save, restore files on
tc( IV):
sleep(II):
dsw (I):
rmdir(I): remove
rm( I): remove
unlink(II): remove
mesg(I): permit or
switch(III): transfer
dc(I):
kill(II):

DECtape and magtape format
DECtape
DECtape ••• tap(I):
DECtape
delay execution
delete files interactively
(delete) directory
(delete) file
(delete) file
deny messages
depending on value
desk calculator
destroy process
df(I): find free disk space
bas (I): BASIC dialect
directory( V): directory format
dcheck(VIII): verify directory hierarchy
directory(V): directory format
chdir(I): change working directory
chdir(II): change working directory
Is(I): list contents of directory
makdir(II): create directory
mkdir(I): create directory
rmdir(I): remove (delete) directory
df(I): find free disk space
du(I): find disk usage
rf (IV): RF disk
rk( IV): RK disk
umount (II) : dismount file system
ddsput(III): display character on Picturephone
vt(IV): storage-tube display
dli(VIII): load DEC binary paper tapes
dn( IV): 801 ACU
dpd(VII) : spawn dataphone daemon
dp(IV): 201 Dataphone
dsw(I): delete files interactively
du(I): find disk usage
od ( I): octal dump of file
dup(II): duplicate an open file
dup (II): . duplicate an open file
uniq(I): find duplicate lines in a file
echo(I): print command arguments
ecvt(III): edited output conversion
ed(I): text editor
ecvt(III): edited output conversion
Id(I): link editor (loader)
ed(I): text editor
fed(I): form letter editor
cemt(II): catch EMT traps
crypt(III): encrypt according to a keyword
crypt(I): encrypt, decrypt a file
exit (I) : end command sequence
wc(I): get (English) word count
catch floating exception errors ••• fpe(II):
typo(I): find typographic errors
fpe(II): catch floating exception errors
- xx -

size(I): get
exec (II) :
times(II): get
exit(II): terminate
sl eep (II): delay
glob(VII): argument
exp(III):
greek(VII):
log(III): logarithm base
factor(I):

cmp(I): compare
split(I): break a
opr(I): print
type(I): print
ov(I): page overlay
istat (VIII) :
stat( I): get
stat(II): get
file system (V):
chk(VIII): check all
check consistency of
mount(II): mount
mount(VIII): mount removable
salv(VIII): repair damaged
umount(II): dismount
. pr ( I ): pr in t
clri(VIII): clear
dsw(I): delete
tap(I): save, restore
mt(I): save, restore
ar(I): archive (combine)
concatenate (or print)
change access mode of
chown(I): change owner of
proof(I): compare text
reloc(I): relocate object
wtmp(V): accounting
archive(V): archive
chmod(II): change mode of
chown(II): change owner of
close(II): close open
core(V): core image
cp(I): copy
creat(II): create
crypt(I): encrypt, decrypt a
dup(II): duplicate an open
exec(II): execute program
fstat(II): status of open

exec(lI): execute program file
executable program size
execute program file
execution times
execution
execution
exit(I): end command sequence
exit(II): terminate execution
expander
exp(lII): exponential function
exponential function
extended TTY 37 typebox map
e

factor a number
factor(I): factor a number
fc(I): compile Fortran program
fed(I): form letter editor
file contents
file into pieces
file off-line
file page-by-page
file print
file status by i-number
file status
file status
file system format
file systems
file system(V): file system format
file system ••• check(VIII):
file system
file system
file system
file system
file with headings
file's i-node
files interactively
files on DECtape
files on magtape
files
files ••• cat (I) :
files ••• chmod(I):
files
files
files
files
file
file
file
file
file
file
file
file
file
file
file

- xxi -

link(II): link to
In(I): link to
set date modified of
mv(I): move or rename
od(I): octal dump of
open(II): open
passwd(V): password
read( II): read
rm( I): remove (del ete)
sort(I}: sort ASCII
sum( I): sum
find duplicate lines in a
unlink(II}: remove (delete)
write(II): write
du (I) :
uniq (I):
df(I):
hyphen(I):
tty (I) :
ttyn(III):
typo(I}:
unCI}:
fpe(II): catch
ftoa(III): convert
ftoo(III): convert
atof(III): convert ASCII to
fed(I) :
forml(I): generate
form(I): generate
nroff(I):
roff(I):
directory(V): directory
file system(V): file system
tap(V): DECtape and magtape
fc(I): compile
df(I): find

exp(llI): exponential
communicate with MH-TSS
gerts(IlI): communicate with
forml(I):
forme I):
vs(I):
pseudo random number
getc(III):
acct(VIII):
date(I):
wc(I):
size(I):

file
file
file ••• mdate(II):
file
file
file
file
file
file
file
file
file ••• uniq (I):
file
file
find disk usage
find duplicate lines in a file
find free disk space
find hyphenated words
find name of terminal
find teletype name
find typographic errors
find undefined symbols
floating exception errors
floating to ASCII
floating to octal
floating
fork(II): create new process
form letter editor
form letters
form letter
format text for printing
format text for printing
format
format
format
forme I): generate form letter
forml(I): generate form letters
Fortran progran
fpe(II): catch floating exception errors
free disk space
fstat(II): status of open file
ftoa(III): convert floating to ASCII
ftoo( III): convert floating to octal
function
(GCOS) ••• tss(I):
GCOS
generate form letters
generate form letter
generate voice synthesizer phonemes
generator ••• rand(IlI):
gerts(III): communicate with GCOS .
get character
get connect-time accounting
get date and time of day
get (English) word count
get executable program size

- xxii -

times(II):
stat(I) :
stat(II):
ps(VIII):
time(I):
time(II):
gtty(II) :
getuid(II):

pr(I): print file with
verify directory
hyphen(I): find
hypot(III): compute
clri(VIII): clear file's
istat(VIII): file status by
getuid(II): get user
setuid(II): set user
ilgins(II): catch
core(V): core
uniq(I): find duplicate lines
ptx(VI): permuted
time(I): get time
utmp(V): logged-in user
intr(II): catch or
quit(II):
init(VII):
ilgins(II): catch illegal
itoa(III): convert
atoi(III): convert ASCII to
pipe( II): open
dsw(I): delete files
sh(I): command
intr(II): catch or inhibit
split(I): break a file

encrypt according to a

: (I): place
fed (I): form
forml(I): generate form

get execution times
get file status
get fil e status
get process status
get time information
get time of year
get typewriter mode
get user ID
getc(III): get character
getty( VII): adapt to typewriter
getuid(II): get user ID
glob(VII): argument expander
goto(I): command transfer
greek(VII): extended TTY 37 typebox map
gtty(II): get typewriter mode
headings
hierarchy ••• dcheck(VIII):
hyphenated words
hyphen(I): find hyphenated words
hypotenuse
hypot(III): compute hypotenuse
i-node
i-number
ID
ID
if(I): conditional command
ilgins(II): catch illegal instruction trap
illegal instruction trap
image file
in a file
index
information
information
inhibit interrupts
inhibit quits
initializer process
init(VII): initializer process
instruction trap
integer to ASCII
integer·
inter process channel
interactively
interpreter
interrupts
into pieces
intr(II): catch or inhibit interrupts
istat(VIII): file status by i-number
itoa(III): convert integer to ASCII
keyword ••• crypt(III):
kill(II): destroy process
kill(VIII): terminate a process
kl(IV): console typewriter
label
Id(I): link editor (loader)
letter editor
letters

- xxiii -

form{I): generate form
uniq(I): find duplicate
ld (I) :
link(II):
In(I) :
ls (I) :
n1ist(III): read name
dli(VIII):
a.out(v): assembler and
ld(I): link editor
login( I) :
10g(III):
utmp(V) :
passwd (I): set
nice(II): set
m6( I) :
tap(v): DECtape and
mt (I ) : save, restore files on
tm (IV): 9-track
mail( I): send

mane I): run off
ascii(VII):
extended TTY 37 type box
mem(IV): core
mesg(I): permit or deny
tss(I): communicate with
msh(VII):
chmod(I): change access
chmod(II): change
stty(II): set
stty(I}: set typewriter
gtty(II}: get typewriter
mdate (II): set date
mount(II):
mount(VIII) :
mv( I) :
seek( II) :

letter
lines in a file
link editor (loader)
link to file
link to file
link(II): link to file
list contents of directory
list
lnCI): link to file
load DEC binary paper tapes
loader output
(loader)
log on to system
logarithm base e
logged-in user information
-log(III): logarithm base e
login password
10gin(I): log on to system
low-~riority status
ls(I): list contents of directory
m6(I): macroprocessor
macroprocessor
magtape format
magtape
magtape
mail to another user
mail(I): send mail to another user
makdir(II): create directory
man(I): run off manual section
ma·nual section
map of ASCII
map ••• greek{VII):
mdate{II): set date modified of file.
mem(IV): core memory
memory
mesg(I): permit or deny messages
mesg(lll): print string on typewriter
messages
MH-TSS (GCOS)
mini Shell
mkdir( I)': create directory
mode of files
mode of file
mode of typewriter
modes
mode
modified of file
mount file system
mount removable file system
mountelI): mount file system
mount(VIlI): mount removable file system
move· or rename file
move read or write pointer
msh(VII): mini Shell
mt(I): save, restore files on magtape
mv(l): move or rename file

- xxiv -

nlist(III): read
tty(I): find
nm(I): print
ttyn(III): find teletype
fork(II): create

name list
name of terminal
namelist
name
new process
nice(II): set low-priority status
nlist(III): read name list
nm(I): print namelist
nroff(I): format text for printing
rand(III): pseudo random number generator
pow(III): take powers of numbers
factor(I): factor a number
reloc(I): relocate object files
od(I): octal dump of file
convert floating to octal ••• ftoo(III):
od(I): octal dump of file
man(I): run off manual section
opr(I): print file off-line
close(II): close open file
. dup(II): duplicate an open file
fstat(II): status of open file
open( II):' open file
pipe(II): open inter process channel
open(II): open file
opr(I): print file off-line
cat(I): concatenate (or print) files
ecvt(III): edited output conversion
assembler and loader output ••• a.out(V):
ov(I): page overlay file print
ov(I): page overlay file print
chown(I): change owner of files
chown(II): change owner of file
ov{ I) : page overlay file print
t¥pe(I): print file page-by-page
dli(VIII): load DEC binary paper tapes
pc ( IV ): punched paper tape
passwd(I): set login password
passwd(V): password file
passwd(V) : password file
passwd{I): set login password
pc( IV): punched paper tape
mesg( I): permit or deny messages
ptx(VI): permuted index
generate voice synthesizer phonemes ••• vs ( I) :
vsp(VII): voice synthesizer phonemes
display character on Picturephone ••• ddsput(IIl):
split(I): break a file into pieces
pipe(II): open inter process channel
: (I) :
place label
seek(II): move read or write pOinter
pow ( III): take powers of numbers
pow(lII): take powers of numbers
pr(I): print file with headings
echo(I): print command arguments
opr (I) : print file off-line
type(I): print file page-by-page
- xxv -

pr (I) :
nm (I) :
mesg(III):
ptime (III) :
cat(I): concatenate (or
nroff(I): format text for
roff(I): format text for
oV(I): page overlay file
bproc(VIII): boot
pipe(II): open inter
ps(VIII): get
rele(II): release
fork(II): create new
init(VII): initializer
kill(II): destroy
kill(VIII): terminate a
wait(II): wait for
break(II): set
exec(II): execute
size(I): get executable
bc(VI): compile B
cc(I): compile C
fc(I): compile Fortran
sno(I): compile Snobol
tmg(I): compile tmgl
rand( III) :

pc( IV) :
qsort(III):
quit(II): inhibit
rand(III): pseudo
read(II) :
nlist(III):
seek (II): move
csw(II) :
20boot(VIII):
boot(II):
cref (I): cross
rele( II):
reloc(I):
strip(I): remove symbols,
dc( IV):
mount(VIII): mount
rmdir(I):
rm( I) :
unlink( II) :

print file with h~adings
pr int n amel i st
print string on typewriter
print time
print) files
printing
printing
print
procedure
process channel
process status
processor
process
process
process
process
process
program break
program file
program size
program
program
program
program
program
proof(I): compare text files
pseudo random number generator
ps(VIII): get process status
ptime(III): print time
ptx(VI): permuted index
punched paper tape
putc(III): write character or word
qsort(III): quicker sort
quicker sort
quit(II): inhibit quits
quits
rand(III): pseudo random number generator
random number generator
read file
read name list
read or write pointer
read the console switches
read(II): read file
reboot 11/20 system
reboot the system
reference table
release processor
rele(II): release processor
relocate object files
relocati'on bits
reloc(I): relocate object files
remote typewriter
removable file system
r emov e (del et e) dir ectory
remove (delete) file
remove (delete) file

- xxvi -

strip ('I) :
mv ( I ): move or
salv(VIII):
tap(I): save,
mt(I): save,
rew (I) :
rf (IV) :
rk( IV):

sqrt(III): square
man(I):
tap (I) :
mt (I) :
man{I): run off manual
mail(I):
speak ( I):
exit(I): end command
mdate(II):
passwd(I) :
nice( II) :
stty(II) :
break( II) :
stime( II):
tabs (VII):
stty(I):
setuid(II):
msh(VII): mini
sin(III):
get executable program
sno(I): compile
sort(I):
string compare for
qsort(III): quicker
df(I): find free disk
dpd(VII):

sqrt(III):

remove symbols, relocation bits
rename file
repair damaged file system
restore files on DECtape
restore files on magtape
rew(I): rewind DECtape
rewind DECtape
RF disk
rf(IV): RF disk
RK disk
rk ( IV ): RK di sk
rmdir(I): remove (delete) directory
rm(I): remove (delete) file
roff{I): format text for printing
root
run off manual section
salloc(III): storage allocator
salv(VIII): repair damaged file system
save, restore files on DECtape
save, restore files on magtape
section
seek(II): move read or write pointer
send mail to another user
send words to voice synthesizer
sequence
set date modified of file
set login password
set low-priority status
set mode of typewriter
set program break
set system time
set tab stops on typewriter
set typewriter modes
set user ID
setuid(II): set user ID
. Shell
sh(I): command interpreter
sine, cosine
sin (III): _sin e, cosine
size(I): get executable program size
size ••• size( I):
sleep(II): delay execution
Snobol program
sno(I): compile Snobol program
sort ASCII file
sort(I): sort ASCII file
sort ••• compar(III):
sort
space
spawn dataphone daemon
speak(I): send words to voice synthesizer
split(I): break a file into pieces
sqrt(III): square root
square root
stat(I): get file status
stat(II): get file status

- xxvii -

istat(VIII): file
fstat(II):
nice(II): set low-priority
ps(VIII): get process
stat(I): get file
stat(II): get file
tabs(VII): set tab
salloc(III):
vt( IV):
compar(III) :
mesg(III): print

sum (I) :
csw(II): read the console
db (I) :
stripe I): remove
unCI): find undefined
sync(II): assure
vs(I): generate voice
vsp(VII): voice
speak(I): send words to voice
file system(V): file
stime(II): set
chk(VIIl): check all file
file
20boot(VIII): reboot 11/20
boot(lI): reboot the
check consistency of file
login(I): log on to
mount(Il): mount file
mount removable file
repair damaged file
umount(II): dismount file
who(I): who is on the
tabs(VII): set
cref(I): cross reference
·pow{ III):
load DEC binary paper
pc( IV): punched paper

ttyn(III): find
tty(I): find name of
kill(VIII):
exit(lI) :
ed( I) :
proof(I): compare
nroff(I): format

status by i-number
status of open file
status
status
status
status
stime(II): set system time
stops on typewriter
storage allocator
storage-tube display
string compare for sort
string on typewriter
strip(I): remove symbols, relocation bits
stty(l): set typewriter modes
stty(II): set mode of typewriter
sum file
sum(l): sum file
switches
switch(llI): transfer depending on value
symbolic debugger
symbols, relocation bits
symbols
synchronization
sync(II): assure synchronization
synthesizer phonemes
synthesizer phonemes
synthesizer
system format
system time
systems
system(V): file system format
system
system
system ••• check(Vlll):
system
system
system ••• mount(Vlll):
system ••• salv(Vlll):
system
system
tab stops on typewriter
table
tabs(VII): set tab ·stops on typewriter
take powers of numbers
tapes ••• dli(VIIl):
tape
tap(l): save, restore files on DECtape
tap(V): DECtape and magtape format
tc( IV): DECtape
teletype. name
terminal
terminate a process
terminate execution
text editor
text files
text for printing

:.-. xxviii -

roff(I): format
, time(I): get
date(I): get date and
time(II): get
ctime(III): convert

times(II): get execution
ptime(III): print
stime(II): set system
tmg(I): compile
swi tch( III) :
goto(I): command
cemt(II): catch EMT
catch illegal instruction
greek(VII): extended
greek(VII): extended TTY 37
stty( I) : set
gtty( II): get
dc ( IV): remote
getty(VII): adapt to
kl (IV): console
mesg(III): print string on
stty(II): set mode of
tabs(VII): set tab stops on
. typo ( I): find
unCI): find

dU(I): find disk
getuid( II): get
setuid(II): set
utmp(V): logged-in
mail(I): send mail to another
write(I): write to another
transfer depending on
dcheck(VIII):
vs (I): generate
vsp(VII):
speak(I): send words to

wait(II):

text for printing
time information
time of day
time of year
time to ASCII
time(I): get time information
time(II): qet time of year
times(II): get execution times
times
time
time
tm(IV): 9-track magtape
tmg(I): compile tmgl program
tmgl program
transfer depending on value
transfer
traps
trap ••• ilgins(II):
tss(I): communicate with MH-TSS (GCOS)
TTY 37 typebox map
tty(I): find name of terminal
ttyn(III): find teletype name
type box map
type(I): print file page-by-page
typewriter modes
typewriter mode
typewriter
typewriter
typewriter
typewriter
typewriter
typewriter
typographic errors
typo{I): find typographic errors
umount(II): dismount file system
undefined symbols
unCI}: find undefined symbols
uniq(I): find duplicate lines in a file
unlink{II): remove (delete) file
usage
user ID
user·ID
user information
user
user
utmp(V): logged-in user information
value ••• switch ( III ):
verify directory hierarchy
voice synthes1zerphonemes
voice synthesizer phonemes
voice synthesizer
va(I): generate voice synthesizer phoneme
vsp(VII): voice synthesizer phonemes
vt(IV): storage-tube display
wait for process
wait(II): wait for process

- xxix -

who ( I):
gerts(III): communicate
pr(l): print file
tss(l): communicate
wc(l): get (English)
speak(l): send
hyphen(I): find hyphenated
putc(lII): write character or
chdir(I): change
chdir(II): change
putc(IIl):
write( II):
seek(II): move read or
write(I):

time(II): get time of
yacc(Vl) :

wc(I): get (English) word count
who is on the system
who(l): who is on the system
with GCOS
with headings
with MH-TSS (GCOS)
word count
words to voice synthesizer
words
'
word
working directory
working directory
write character or word
write file
write pointer
write to another user
write(I): write to another user
write(ll): write f1le
wtmp(V): accounting files
yacc(Vl): yet another compiler-compiler
year
yet another compiler-compiler

- xxx -

3/15/72

: (I)

: (I)

place a label

NAME

••

SYNOPSIS

J. [ label]

DESCRIPTION

The purpose of ~ is to place a label for the goto
command. It has no effect when executed.

FILES
SEE ALSO

goto(I)

DIAGNOSTICS
BUGS

-

1 -

AR (I)

3/15/72

AR (I)

NAME

ar

SYNOPSIS

! ! key afile name 1 •••
~ maintains groups of files combined into a single archive file. Its main use is to create and
update library files as used by the loader. It
can be used, though, for any similar purpose.

DESCRIPTION

archive

key is one character from the set drtux, optionally concatenated with~. afile is the archive
file. The names are constituent files in the
archive file. The meanings of the key characters
are:
d means delete the named files from the archive
f1le.
r means replace the named files in the archive
f1le. If the archive file does not exist, r will
create it. If the named files are not in tne
archive file, they are appended.

! prints a table of contents of the archive file.
If no names are qiven, all files in the archive
are tabled. If names are qiven, only those files
are tabled.
is similar to ~ except that only those files
that have 'been modified are replaced. If no
names are qiven, all files in the arc1:tive that
have been modified will be replaced by the modified version.

~

x will extract the named files. If no names are
given, all files in the archive are extracted.
In neither case does ~ alter the archive file.
means verbose. Under the verbose option, ! !
gives a file-by-file description of the making of
a new archive file from the old archive and the
constituent files. The following abbreviations
are used:

~

oS copy
.! append
g delete
1: replace
~ extract
FILES

/tmp/vtm?

SEE ALSO

Id(I), archive(V)

DIAGNOSTICS

"
" "afile --"no~ in archive format " ~
"Bad
usage,
cannot open temp file, name -- cannot open t

temporary

-

-

1

3/15/72

AR (I)

AR (I)

" " name -- cannot create " ~
phase error,
" no archive file,
" " cannot create archive file " ,
" name -- not found " •
" name

BUGS

Option ~ should be implemented as a table with
more information.
There should be a way to specify the placement of
a new file in an archive. currently, it is
placed at the end.

" ar x " changes the modified-date of the current
directory to a random number.

-

2 -

1/15/73

AS (I)

AS (I)

NAME

as

assembler

SYNOPSIS

~

DESCRIPTION

as assembles the concatenation of name 1 , ..... If
the optional first argument
is used, all undefined symbols in the assembly are treated as global.

[ =] name 1

•••

=

The output of the assembly is left on the file
" a.out.
"
It is executable if no errors occurred
during the assembly.
FILES

/etc/as2
/tmp/atm1?
/tmp/atm2?
/tmp/atm3?
a.out

pass 2 of the assembler
temporary
temporary
temporary
object

SEE ALSO

ld(I), nm(I), uniI), db(I), a.out{v), "UNIX
Assembler Manual •

DIAGNOSTICS

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 filename in
which it occurred. Errors in pass 1 cause cancellation of pass 2. The possible errors are:
)

parentheses error
parentheses error
< String not terminated properly
("~") used"i!legally
* Indirection
Illegal
assignment
to •
•
A error in Address
B j!ranch instruction is odd or too remote
E error in Express~on
F error in local ( E" or "b") type symbol
G garbage (unknown)' character
End of file inside an If
I
M Hultiply defined symbor-as label
o Odd-- word quantity assembled at odd address
P fhase error-- " • " different in pass 1 and 2
R Relocation error
U yndefined symbol
X
syntaz error
]

-

BUGS

Symbol table overflow 1s not checked.

- 1 -

BAS (I)

1/15/73

NAME

bas -

SYNOPSIS

l2!J! [ file ]

DESCRIPTION

l2!J! is a dialect of basic [1].

BAS"(I)

basic

If a file argument is provided, the file is used for input
before the console is read.

E!.! accepts lines of the form:
statement
integer statement
Integer numbered statements (known. as internal
statements) are stored for later execution. They
are stored in sorted ascending order. Nonnumbered statements are immediately executed.
The result of an immediate expression statement
(that does not have '=' as its highest operator)
is printed.
Statements have the following syntax:
expression
The expression is executed for its side
effects (assignment or function call) or
for printing as described above.
done

~eturn

to system level.

expression expression expression
A line is drawn on the Tektronix 611
display (/dev/vtO) from the current display
position to the XY co-ordinates specified
by the first two expressions. (The scale
is zero to one in both X and Y directions)
If the third expreSSion is zero the line
is inVisible. The current display position
is set to the end point •.

~

display list
The list of expressions and strings is concatenated and displayed (i.e. printed) on
the 611 starting at the current display
position. The current display position is
not changed.
erase
The 611 screen is erased.
for name - expression expression statement
for name ; expression expression
•••

~

The !2!: statement repetitively executes a
- 1

-

1/15/73

BAS (I)

BAS (I)

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 1s
incremented by one on each loop, not to
exceed the value of the second expression.
goto expression
The expression is evaluated, truncated to
an integer and execution goes to the
corresponding integer numbered statment.
If executed from immediate mode, the internal statements are compiled first.

!! expression statement

The statement is executed if the expression
evaluates to non-zero.

~

[expression [expression]]
is used to print out the stored internal statements. If no arguments are given,
all internal statements are printed. If
one argument is given, only that internal
statement is listed. If two arguments are
given, all internal statements inclusively
between the arguments are printed.

~

print list
The list of expressions and strings are
concatenated and printed. (A string is
delimited by • characters.)
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 internal statements are compiled. The
symbol table is re-initialized. The random
number generator is re-set. control is
passed to the lowest numbered internal
statement.
Expressions have the following syntax:
name
A name is used "to specify a variable.
Names are composed of a letter ('a' - 'z')
followed by letters and digits. The first
four characters of a name are significant.
number
A number is used to represent a constant
value. A number is composed of digits, at
2 -

1/15/73

BAS (I)

BAS (I)

most one decimal point ('.') and possibly a
scale factor of the form ~ digits or ~
digits.

1

expression 1
parentheses are used to alter normal order
of evaluation.

expression operator expression
Common fUnctions of two arguments are abbreviated by the two arguments separated by
an operator denoting the function. A complete list of operators is given below.
expression 1 [expre ssion L.L expre ssion ••• ]] 1
Functions of an ar·bitrary number of arguments can be called by an expression followed by the arguments in parentheses
separated b¥ commas. The expression evaluates to the line number of the entry of the
function in the internally stored statements. This causes the internal statements
to be compiled. If the expression evaluates negative, a builtin fUnction is
called. The list of builtin fUnctions
appears below.
name 1 expression [~ expression ••• ] 1
Each expression is truncated to an integer
and used as a specifier for the name. The
result is syntactically.identical to a
name. a[1,2] is the same as a[1] [2]. The
truncated expressions are restricted to
values between 0 and 32767.
The following is the list of operators:

= = 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.

& I

~

(logical and) has result zero if either
of its arguments are zero. It has result
one if both its arguments are non-zero. 1
(logical or)'has result zero if both of its
arguments are zero. It has result one if
either of its arguments are non-zero.

< <=The> relational
>= == <>

operators « less than, <=
less than or equal, > greater than, >=
greater than or equal, == equal to, <> not
-

3 -

BAS (I)

1/15/73

BAS (I)

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.
+ -

* /

Add and subtract.
Multiply and divide.
Exponentiation.

The following is a list of builtin functions:
arg
Arg(i) is the value of the ith actual
parameter on the current level of function
call.
exp

Exp(x) is the exponential function of x.

log
Log(x) is the logarithm base e of x.
sin
Sin(x) is the sine of x (radians).
cos

Cos (x) is the cosine of x (radians).

atn
Atn(x) is the arctangent of x.
rnd

.
Rnd() is a uniformly distributed random
number between zero and one.

expr
Expr() is the only form of program input.
A line is read from the input and evaluated
as an expression. The resultant value is
returned.
1nt

Int(x) returns x truncated to an integer.
temporary

FILES

/tap/btm?

SEE ALSO

[1] DEC-11 -AJPB-D

DIAGNOSTICS

Syntax errors cause the incorrect line to be
typed with an underscore where the parse failed.
- 4 -

CAT (I)

CAT (I)

1/15/73

NAME

cat

SYNOPSIS

.£!! file 1 •••

DESCRIPTION

cat reads each file in sequence and writes it on
the standard output. Thus:

concatenate and print

.£ll~

is about the easiest way to print a file.

Also:

.£ll file1 file2 )file3
is about the easiest way to concatenate files.
If no input fil~ is qiven £!! reads from the
sta.ndard input file.
If the argument " - " 1s encountered, cat reads
from the standard input file.
FILES
SEE ALSO

pr( I ), cp (I)

DIAGNOSTICS

none; 1f a f1le cannot be found it is iqnored.

BUGS

cat x y)x
results.

and

-

cat x y)y

1 -

cause strange

CC (I)

CC (I)

3/15/72

NAME

cc -- C compiler

SYNOPSIS

.££ [ .:.£ ] sfile1~ ••• ofile 1 •••
.££ is the UNIX C.compiler. It accepts three
types of arquments:

DESCRIPTION

Arguments whose names end with " .c " are assumed
, to be C source proqrams; they are compiled, and
the object program is left on the file sfile .0
1
(i.e. the file whose name is that of the source
with " .0 " substituted for " .c ") •
Other arguments (except for "-c") are assumed to
be either loader flag arquments, or C-compatib1e
object programs, typically produced by an earlier
££ run, or perhaps libraries of C-compatib1e
routines. These programs, together with the
results of any compilations specified, are loaded
(in the order given) to produce an executable
program with name a.out.
The "-c" argument suppresses the loading phase,
as does any syntax error in any of the routines
being compiled.
input file
object file
loaded output
temporary
compiler
runtime startoff
builtin functions, etc.
system· library

FILES

file.c
file.o
a.out
/tmp/ctm?
/lib/c [01]
/lib/crtO.o
/lib/libc.a
/lib/liba.a

SEE ALSO

C reference manual (in preparation), cdb(I)

DIAGNOSTICS

Diagnostics are intended to be self-explanatory.

BUGS

- 1 -

CDB (I)

1/1 5/73

CDB (I)

NAME

cdb -- C deblgger

SYNOPSIS

£SE [

DESCRIPTION

£9E 1.s a deblgg ing program for use with C programs. It is by no means completed, and this
section is essentially only a placeholder for the
actual description.

core [ a .out ] ]

Cdb resembles db in many respects, except that
all integers are decimal.
Even the present cdb has one useful feature: the
command
$

will give a stack trace of the core image of a
terminated C program. The calls are listed in
the order made; the actual arguments to each
routine are given in octal.
FILES
SEE ALSO

cc(I), db(I), C Reference Manual

DIAGNOSTICS

"? "

BUGS

- 1 ...

CHDIR (I)

3/15/72

CHDIR (I)

NAME

chdir

SYNOPSIS

chdir directory

DESCRIPTION

directory becomes the new working directory.

change working directory

Because a new process is created to execute each
command, chdir would be ineffective if it were
written as a normal command. It is therefore
recognized and executed by the Shell.
FILES
SEE ALSO

sh(I)

DIAGNOSTICS

" Bad directory " if the directory cannot be
changed to.

BUGS

-

1 -

3/15/72

CHMOD (I)

CHMOD (I)

NAME

chmod

SYNOPSIS

chmod octal f1le 1 •••
The octal mode replaces the mode of each of the
files. The mode is constructed from the OR of,
the following modes:

DESCRIPTION

change mode

01 write for non-owner
02 read for non-owner
04 write for owner
10 read for owner
20 executable
40 set-UID

Only the owner of a file may chanqe its mode.
FILES
SEE ALSO

stat(I), la(I)

DIAGNOSTICS

"? "

BUGS

-

1 -

CHOWN (I)

3/15/72

CHOWN (I)

NAME

chown

SYNOPSIS

chown owner file 1 •••
owner becomes the new owner of the files. The
owner may be either a decimal UID or a login name
found in the password file.

DESCRIPTION

change owner

Only the owner of a file is allowed to change the
owner. It is illegal to change the owner of a
file with the set-user-ID mode.
FILES

/etc/passwd

SEE ALSO

stat(I)

DIAGNOSTICS

"Who?" if owner cannot be found, "file?" if file
cannot be found.

BUGS

-

1 -

CMP (I)

1/15/73

CMP (I)

NAME

cmp

SYNOPSIS

cmp file 1 file 2
The two files are compared for identical contents. Discrepancies are noted by giving the
offset and the differing words, all in octal.

DESCRIPTION

compare two files

FILES
SEE ALSO

proof(I)

DIAGNOSTICS

Messages are given for inability to open either
argument, premature EOF on either argument, and
incorrect usage.

BUGS

If the shorter of the two files is of' odd length,
cmp acts as if a null byte had been appended to
it.

-

1 -

CP (I)

1/24/73

CP (I)

NAME

cp -

SYNOPSIS

£e file 1 file 2
The first file is copied onto the second. The
mode and owner of the target file are preserved
if it already existed; the mode of the source
file is used otherwise.

DESCRIPTION

copy

If file 2 is a directory, then the target file is
a file 1n that directory with the file-name of
file 1 •
FILES
SEE ALSO

cat(I), pr(I), mV(I)

DIAGNOSTICS

Error returns are checked at every system call,
and appropriate diagnostics are produced.

BUGS

Copying a file onto itself destroys its contents.

-

1 -

CREF (I)

2/5/1973

CREF (I)

NAME

cref

SYNOPSIS

.£!!! [ ::..!Q! ] name1 •••

DESCRIPTION

CREF makes a cross reference listing of files in
assembler format (see AS(I». The files named as
arguments in the command line are searched for
symbols (defined as a succession of alphabetics,
numerics, ' .', or ' " beginning with an alpha" . , or , _ ' ) •
b etc,
i

make cross reference listing

The output report is in four columns:
(1 )

(2)

(3)

(4)

symbol

file

see
below

text as it appears in file

The third column contains the line number in the
file by default; the =! option will cause the
most recent name symbol to appear there instead.
CREF uses either an ignore file or an only file.
If the -i option is given, it will take the next
filename to be an ignore file; if the :9 option
is given, the next filename will be taken as an
only file. Ignore and only files should be lists
of symbols separated by new lines. If an ignore
file is given, all the symbols in the file will
be ignored in columns (1) and (3) of the output.
If an only file is given, only symbols appearing
in the file will appear in column (1), but column
(3) will still contain the most recent name encountered. Only one of the options .:.! or ::Q may
be used. The default setting is -i; all symbols
predefined in the assembler are ignored, except
system call names, which are collected.
FILES

Files t.O, t.1, t.2, t.3 are created (i.e.
DESTROYED) in the working directory of anyone
using S!!!. This nuisance will be repaired soon.
The output is left in file s.out in the working
directory.
/usr/lem/s.tab is the default ignore file.

SEE ALSO

as(I)

DIAGNOSTICS

"line too long" -- input line )131 characters

" symbol too long " -- symbol )20 characters
"too many symbols" -

)10 symbols in line

" cannot open t.? " -- bug; see LEM
" cannot fork; examine t.out " -- can , t start
-

1 -

~

CREF (I)

2/5/1973

CREF (I)

process; intermediate results are on files
t.O, ~,t.2,t,3. These may be sorted independently and the results concatenated by
the user,

" cannot sort " -- odd response

from~;

examine

intermediate results, as above.
"impossible situation" -- system bug

" cannot open " file -- one of the input names
cannot be opened for reading.

BUGS

The destruction of unsuspecting users' files
should soon be fixed. A limitation that may
eventually go away is the restriction to assembler lanquage format. There should be options for
FORTRAN, Enqlish, etc., lexical analysis,
File names longer than eight characters cause
misalignment in the output if tabs are set at
every eighth column.
It should write on the standard output, not
s.out,

- 2 -

CRYPT (1)

10/23/71

CRYPT (I)

NAME

crypt

SYNOPSIS

crypt [ password ]

DESCRIPTION

Crypt is an exact implementation of Boris_
Hagelin's cryptographic machine called the M-209
by the U. S. Army [ 1] •

encode/decode

crypt reads from the standard input file and
writes on the standard output. For a given password, the encryption process is idempotent; that
is,
crypt znorkle  (i. e., the character "new line") This
command advances the current location
counter "." and prints the resulting location in the mode' last specified by one of
the above requests.

-

This character decrements " • " and prints
the resulting location in the mode last
selected one of the above requests. It is
a converse to .
Exit.

Odd addresses to word-oriented commands are

rounded down. The incrementing and decrementing
of "." done by the  and - requests is by one
or two depending on whether the last command was
word or byte oriented.
The address portion of any of the above commands
may be followed by a comma and then by an expression. In this case that number of sequential
words or ~tss specified by the expreSSion is
printed.
• is advanced so that it pOints at
the last thing printed.
There are two commands to interpret the value of
expressions.

=

When preceded by an expression, the value
of the expression is typed in octal. When
po~ preceded by an expression, the value of
• is indicated. This command does not
"
change the value of " ••

:

An attempt is made to print the given expression asa symbolic address. If the
expression is relocatable·, that symbol is
found whose value is nearest that of the
expression, and the symbol is typed, followed by a sign and the appropriate offset.
If the value of the expression is absolute,
a symbol with exactly the indicated value
is sought and printed if found; ·if no
matching symbol is· discovered,the octal
value of the expression is given.

The following command may be used to patch the
file beinq debugqed.
!

Th~CO~and must be preceded by an expressi
'. ~ value of the expression is

sto~tt
..~at the loc!t~on addressed by the
cur,.. tlue of •• The opcodes do not
appear·' i .ttle symbol ~able, so the user
must III ssemble th~m 1::("" hand •

- 3 -

DB (I)

3/15/72

DB (I)

The following command is used after a fault has
caused a core image file to be produced.
$

causes the fault type and the contents of
the general registers and several other
registers to be printed both in octal and
symbolic format. The values are as they
were at the time of the fault.

£E should not be used to examine special files,
for example disks and tapes, since it reads one
byte at a time. Use od(l) instead.
For some purposes, it is important to know how
addresses .typed by the user correspond with locations in the file being debugged. Themapping
algorithm employed by db is non-trivial for two
reasons: First, in an a.out file, there is a
20(8) byte header which will not appear when the
file is loaded into core for execution. Therefore, apparent location 0 should correspond w~th
actual file offset 20. Second, some systems
cause a ." squashed " core image to be written. In
such a core image, addresses in the stack must be
mapped according to the degree of squashing which
has been employed. !2l2 obeys the following rules:
If exactly one argument is given, and if it appears to be an a,out file, the 20-byte header is
skipped during addressing, l.e., 20 is added to
all addresses typed. As a consequence, the
header can be examined beginning at location -20.
If exactly one argument is given and if the file
does not appear to be an a.out file, no mapping
is done,
If zero or two arguments are given, the mapping
appropriate to a core image file is employed.
This means that locations above the program break
and below the stack effectively do not exist (and
are not, in fact, recorded in the core file).
Locations above the user's stack pOinter are
mapped, in looking at the core file, to the place
where they are really stored. The pe·r-process
data kept by the system, which is stored in the
last 512(10) bytes of the core file, can be addressed at apparent locations 160000-160777.
If one wants to examine a file which has an associated name list, ~u~ is not a~core image file,
the last argument - can be used (actually the
only purpose of the last argument is to make the
number of arguments not equal to two). This
feature is used most frequently in examining the'
memory file /dev/mem.
- 4 -

DB (I)

3/15/72

DB (I)

FILES
SEE ALSO

asCI), core(v), a.out(v), od(I)

DIAGNOSTICS

"File not fOUnd""i: the first argument cannot be
read; otherwise ?

BUGS

-

5 -

DC (I)

1/15/73

DC (I)

NAME

dc -- desk calculator

SYNOPSIS

~

DESCRIPTION

dc is an arbitrary precision integer arithmetic
package. The overall structure of dc is a stacking (reverse polish) calculator. The following
constructions are recognized by the calculator:

[file]

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.

:J:.=~L%:
The top two values on the stack are added (±),
subtracted (-) t multiplied (~") t diyided (L) t
·remaindered (!) or exponentiated ( ). The two
entries are popped off the· stack; the result
is pushed on the stack in their place.

!.X

The top of the stack is popped and stored into
a register named x, where x may be any character.
The value in register x is pushed on the
stack. The register x is not altered. All
registers start with zero value.
The top value on the stack is pushed on the
stack. Thus the top value is duplicated •

.e

The top value on the stack is printed.
top value remains unchanged.

The

All values on the stack and in registers are
printed.
exits the program. If executing a string, the
nesting level 1s popped by two.
treats the top element of the stack as a character string and executes it as a string of dc
commands.

[ ••• J

puts the bracketed ascii string onto the top
of the stack.
- 1-

1/15/73

DC (I)
~x

DC (I)

.=x 2.x
The top two elements of the stack are popped
and compared. Register x is executed if they
obey the stated relation.

v

replaces the top element on the stack by its
square root.

1

interprets the rest of the line as a UNIX command.
All values on the stack are popped.
The top value on the stack is popped and used
as the number radix for further input.
the top value on the stack 'is popped and used
as the number radix for further output.
the stack level is pushed onto the stack.

1

a line of input is taken from the input source
(usually the console) and executed.

new-line
ignored except as the name of a register or to
end the response to a 1.
space'
ignored except as the name of a register or to
terminate a number.
If a file name is given, input is taken from that
file until end-of-file, then input is taken from
the console.

An example to calculate the monthly, weekly and
hourly rates for a $10,000/year salary.
10000
100*
dsa

(now in cents)
(non-destructive store)
(pennies per month)
(pennies per week)
(deei-pennies per week)
(pennies per hour)
(print all results)

12/
1a52/

d10*
375/
f

512
19230

-

2 -

DC (I)

'1/15/73

"a "

DC (I)

83333

1000000

An example which prints the first ten values of nI is
[la1+dsa*pla10)x]sx
Osa1
lxx
FILES
SEE ALSO

msh(VII), salloc(lII}

DIAGNOSTICS

(x) ? for unrecognized character x.
(x) ? for not enough elements on the stack to do
what was asked by command x.
"out of space" when the free list is exhausted
1too many digit!).
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.

BUGS

-

3 -

1/20/73

DF (I)

DF (I)

NAME

df -- disk free

SYNOPSIS

~

DESCRIPTION

9! prints out the number of free blocks available

FILES

/dev/rf?, /dev/rk?, /dev/rp?

SEE ALSO

check(VIII)

[ file system ]

on a file system. If the file system is unspecified, the free space on all of the normally
mounted file systems is printed.

DIAGNOSTICS
BUGS

-

1 -

3/15/72

DSW (I)

NAME

dsw

SYNOPSIS

~

DESCRIPTION

For each file in the
specified) ~ types
the file is deleted;
thing else, the file

DSW (I)

delete interactively
[ directory ].
given directo~ i"." if not
its name. If y is typed,
if "x", ~ exits; if anyis not removed.

FILES
SEE ALSO

rm(I)

DIAGNOSTICS

"?"

BUGS

The name " dsw " i8 a carryover from the ancient
past. Its etymology is amusinq but the name is
nonetheless ill-advised.

-

1 -

DU (I)

1/20/73

DU (I)

NAME

du

SYNOPSIS

~

DESCRIPTION

du gives the number of blocks contained in all
files and (recursively) directories within each
specified directory or file~. If ~ is
missing, ~ is used.

summarize disk usage
[=.!!] [=.!] [ name ••• ]

The optional arqument ::! causes only the grand
total to be given. The optional argument =!
causes an entry to be generated for each file.
Absence of either causes an entry to be generated
for each directory only.
A file which has two links to it is only counted
once.
FILES

•

SEE ALSO
DIAGNOSTICS
BUGS

Non-directories given as arguments (not under -a
option) are not listed.
Removable file systems do· not work correctly
since i-numbers may be repeated while the
corresponding files are distinct. Du should
maintain ·an i-number list per root directory
encountered.

-

1 -

ECHO (I)

3/15/72

NAME

echo --echo arguments

SYNOPSIS

~

DESCRIPTION

ECHO (I)

[ arg 1 ••• ]
echo writes all its arquments in order as a line
on-the standard output file. It is mainly useful
for producing diaqnostics in command files.

FILES
SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

ED (I)

1/15/73

ED (I)

NAME
ed

editor

SYNOPSIS

-ed

[ name]

DESCRIPTION
ed is the standard text editor.
If the optional arqument is given, ed simulates an e command on the named file; that is to say, the file is-read
into !2's buffer so that it can be edited.
operates on a copy of any file it is editing; changes
made in the copy have no effect on the file until a write
(~)- command is given.
The copy of the text being edited
resides in a temporary file called the buffer. There is
only one buffer.

~

Commands to ~ have a simple and regular structure: zero
or more addresses followed by a single character command,
possibly followed by parameters to-the command. These
addresses specify one or more lines in the buffer. Every
command which requires addresses has default addresses,
so that the addresses can 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 ~
is accepting text, it is said to be in input !!!!29.!'. 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.

!9 supports a limited form of regular expression nota-

tion. A regular expression is an expression which specifies a set of strinqs of characters. A member of this
set of strings is said to be matched by the regular expression. The regular expressions allowed by !9 are constructed as follows:
1. An ordinary character (not one of those discussed
below) is a regular expression and matches that
character.
2. A circumflex (-) at the beginning of a regular
expression matches the null character at the beginning of a line.
3. A currency symbol ($) at the end of a regular expression matches the null character at the end of a
line.
4. A period' (.) matches any character but a new-line
character.
-

1 -

ED (1)

1/15/73

ED (I)

5. A reqular expression' followed by an asterisk (*)
matches any number of adjacent occurrences (including zero) of the regular expression it follows.
6. A string of characters enclosed in square brackets
( []) matches any character in the string but no
others. If, however, the first character of the
string is a circumflex(-) the regular expression
matches any character but new-line and the characters in the string.
7. The
lar
the
lar

concatenation of regular expressions is a reguexpression which matches the concatenation of
strings matched by the components of the reguexpre ssion.

8. The null regular expression standing alone is
equivalent to the last regular expression encountered.
Regular expressions are used in addresses to specify
lines and in one command (~, see below) to specify a portion of a line which is to be replaced.
If it is desired to use one of the regular expression
metacharacters as aD- ~rdinary character, that character
may be preceded by \ . This also applies to the character bounding the regular expression (often "I") and to
"\" itself.
'
Addresses are constructed as follows. To understand
addressinq in .!S it is necessary to know that at any t'ime
there is a current lina. ' Generally speaking, the current
line is the last line affected by a command; however, the
exact effect on' the current line by each command is discussed under the description of the command.
1. The character " • " addresses the current line •
2. The character "-" addresses the line immediately
before the, current line.
3. The character "$" addresses the last line of the
buffer.
4. A decimal number B addresses the nth line of the
buffer.
6. A regula'r expression enclosed in slashes" /" addresses the first line found by searching toward
the end of the buffer and stopping· at the first
line containinq a string matching the regular expression. If necessary the search wraps around to
the beginning of the buffer.
5.A regular expression enclosed in queries " ? "
-

2 -

1/15/73

ED (I)

ED (I)

addresses the first line found by searchinq toward
the beginninq of the buffer and stoppinq at the
first line found containing a strinq matchinq the
regular expression. If necessary the search wraps
around to the end of the buffer.
.
7. An address followed
by ~ plus sign " +" or a minus
sign "_". followed by a decimal number specifies
that address plus (resp. minus) the indicated
number of lines. The plus sign may be omitted.

8. "'x" addresses the line associated (marked) with
the mark name character "x" which must be a printable character. Lines may be marked with the " k "
command described below.
Commands may require zero, one, or two addresses. Commands which require no addresses regard the presence of
an address as an error. Commands which accept one or two
addresses assume default addresses when insufficient are
given. If more addresses axe given than such a command
requixes, the last one or two (dependinq on what is accepted) are used.
Addresses are separated from each other typically by a
comma (,). They may also be separat!d.by a semicolon'
(;). In this case the current line • is set to the
previous address before the next address is interpreted.
This feature can be used to determine the startinq line
for forward and backward searches ( "/" , ."")
?
The second
address of any two-address sequence must correspond toa
line following the line correspondinq to the first address.In the followinq list of ~ commands, the default addresses are shown in parentheses. The parentheses are
not part of the address, but are used to show that the
given addresses are the default.
As mentioned,it is qenerally illegal for more than one
command to allPtar on ! line" However, any command may·.be
suffixed by p (for print). In that case, the curr~nt
line is printed after the command is complete.
( .)a


•
The !ppend command reads the given text and appends
it after the addressed line •. "." is le.ft on the
last line input, if there wert eny, otherwise at
the addressed line. Address 0 1s legal for this
command; text is placed at the beginning of the
buffer.
(.,.)c


-

3 -

ED (I)

1/15/73

•

ED (I)

The s.hanqe command deletes the addressed ,lines,
then accepts input text which replaces these lines.
"." is left at the last line input; if theze were
none, it is left at the first line not chanqed.

(.,.)d

The delete command deletes the, addressed' 'lines from
the'buffer. The line oriqinally after the last
line deleted becomes the current line; if the lines
deleted were originally at the end, the new last
line becomes the current line.
e filename
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. The number of characters read is typed.
"filename" is remembered for possible use as a
default file name in a subsequent ~ or ~ command.
f filename
The filename command erints th, currently remembered file name. If filename is qiven, the
currently remembered file name is changed to
"filename".
(1 ,$)q/regular expreSSion/command list

, In the global command, the first step is to mark
every line which matches the given regular expression. Then for every such line, ,the given command
list is executed with ..... initially set to that
line. A Single command or the first of multiple
commands appears on the same, line with the global
command. All lines of a multi-1ine list except the
last line must be ended with \ . ~,.it and .£"cs>mmands and associated input are permitted; the •
tertninatinq inpu't mode may be omitted if it would
be on the last line of the command list. The (global) commands, g and ~, are not permitted in the
command list.
(~)i



•

This command inserts the given text before the
addressed line. "." is left at the ,last line
input; if there were none,' at, the addressed line.
This command differs from the ~ command only in the
placement of the text.

(. )kx
The mar5 command associates or marks the Idgressed
line with the single character mark name x. The
ten most recent mark names are remembered. The
current mark names may be printed with the ~

- 4 -

1/15/73

ED (I)

ED (I)

command.
(.,.)mA

The move command will reposition t~e"addressed
lines after the line addressed by A. The line
oriqinally after the las.t. line moved becomes the
current line; if the lines moved were oriqinally at
the end, the new last line becomes the current
line.
n

The marknames command will print the current mark
·names.

.. .

(.,.)p

The'.,Erint command ·prints the addressed lines.
•
is left at the last line printed. The 2 command
may be placed on the same line after any command.
The guit command causes .!f! to exit.
write of a file is done.

No automatic

($)r filename
The ~ead command reads in the qiven file after the
addressed line. If no f11e name isqiven, the
remembered file name, if any, is used (see!. andf
commands) • The remembe red file name is not chanqed
unless "filename" is the very first file name mentioned. Address " 0 " is legal for ~ and causes the
file to be read at the beqinninqof the buffer. If
the read is succ~sl·ful, the number of characters
read is typed.·
• is left at the last line read
in from the file.
(.,.)s/regular expression/replacement/
or,
(.,.)s/regular expression/replacement/q
The SUbstitute command searches each addressed line
for an occurrence of the specified reqular expres.sion. On each line in which a match is found,all
matched strinqsare replaced by ,the replacement" ..
specified,· if the global replacement indicator q
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
characte·r o~h,r than space or new-line may be used
instead of / to delimit the regular expression
and the replacement. "." is left at the last line
substituted.
The ampersand "&" appearing in the replacement is
replaced by the regular expressioQ ~hat was
matched. The special meaninq of & in this context may be suppressed by precedinq it by "\".
- 5 -

1/15/73

ED (I)

ED (I)

(1,$)v/regular expression/command list
This command is the same as the global command
except that the command list is executed with "."
initially set to every line except those matching
the regular expression
(1 ,$)w filename
The write command writes the addressed lines onto
the given file. If the file does not exist, it is
created mode 17 (readable and writeable by everyone). The remembered file name is not changed
unless "filename" is the very first file name mentioned. If no file name is given, the remembered
!i!e name, if any, is used (see ~ and ! commands).
• is unchansed. If the command is successful,
the number of characters written is typed.
($)=

The line number of the addressed line is typed.
" • " is unchanged by this command.
!UNIX command
The remainder of the line after the "I" is sent to
UNIX to be interpreted as a command. " • " is unchanged.
(.+1 ) (newline>
An address alone on a line causes that line to be
erint!d. A blank line alone is equivalent to
.+1p ; it is useful for stepping through text.
If an interrupt Signal (ASCII DEL) is sent,
a "?" and return to its command level.

!9

will print

If invoked with the comma~ name '-', (s!e init) !2 will
sign on with the message Editing system and print "*"
as the command level prompt character.
Ed has size limitations on the maximum number of lines
that can be edited, and on the maximum number of characters in a line, in a global's command list, and in a
remembered file name. These limitations vary with the
physical core size of the PDP11 computer on which .!.9 is
being used. The range of limiting sizes for the above
mentioned items is; 1300 - 4000 lines per file, 256 - 512
characters per line, 63 - 256 characters per global command list, and 64 characters per file name.
FILES
/tmp/etm?
/etc/msh

temporary
to implement the " I " command.

SEE ALSO
DIAGNOSTICS

"?" for any error
-

6 -

EXIT(I)

3/15/72

NAME

exit

SYNOPSIS

~

DESCRIPTION

~

terminate command file

performs a ~ to the end of its standard
input file. Thus, if it is invoked inside a file
of commands, upon return from ~ the shell will
discover an end-of-file and terminate.

FILES
SEE ALSO

EXIT(I)

if(I), qoto(I), sheIl

DIAGNOSTICS
BUGS

-

1 -

FACTOR (I)

1/15/73

FACTOR (I)

discover prime factors of a number

NAME

factor

SYNOPSIS

factor

DESCRIPTION

When factor is invoked, it types out " Enter: " at
you.
If you type in a positive number less than
A
2 S6 (about 7.2E16), it will repeat the number
back at you and then its prime factors each one
erintedftthe proper number of times. Then it says
Enter: again. To exit, feed it an EOT or a
delete.
Maximum time to factor is proportional to sqrt(n)
and occurs when n is prime.
It takes 1 minute to
A
factor a prime near 10 13.

FILES
SEE ALSO
DIAGNOSTICS

" Ouch. ft for input out of range or for garbage
input.

BUGS

-

1 -

FC (I)

9/1/72

NAME

fc

SYNOPSIS

fc [

DESCRIPTION

FC (I)

fortran compiler

=s ]

sfile1~

••• ofile 1 •••
1£ is the UNIX Fortran compiler. It accepts
three types of arguments:
Arquments whose names end with ".f" ·are assumed
to be Fortran source program units; they are compiled, and the object program is left on the file
sfile 1 .o (i.e. the file whose name is that of
the sOurce
with ".0" substituted for ".f").

" are assumed to
Other arguments (except for " -c)
be either lOader flags, or object programs, typically produced by an earlier fc run, or perhaps
libraries of Fortran-compatible routines. These
programs, together with the results of any compilations specified, are loaded (in the order
given) to produce an executable program with name
a.out.
The "-c" argument suppresses the loading phase,
as does any syntax error in any of the routines
beinq compiled.
The followinq is a list of differences between
and ANSI standard Fortran (also see the BUGS
section) :

!2

1. Arbitrary combination of types is allowed in'
expressions. Not all combinations are expected to be supported at runtime. All of the
normal conversions involving integer, real,
double precision and complex are ·allowed.
2. The ·standard' implicit statement is recognized.
3. The types doublecomplex, loqical*1, integer*2
and real*8 (doubleprecision) are supported.
4.

as the first character of a line signals a
continuation card.

~

5. g as the first character of a line signals a
comment.
6. All keywords are recognized in lower case.
7. The notion of 'column 7' is not implemented.
8. G-format input ·is free form-- leadinq blanks
are ignored, the first blank after the start
of the number terminates the field.
-.1 -

Fe (I)

9/1/72

FC (I)

9. A comma in any nUmeric or logical input field
terminates the field.

10. There is no carriage control on output.

In I/O statements, only unit numbers 0-19 are
!upporte9. Uni t numbe r !!D corrf! sponds .. to f.ile
fortnn;
(e.g. unit 9 is file fort09). For
input, the file must exist; for output, it will
be created.
Unit 5 is. permanently associated with the'standard input file; unit 6 with the standard output
file.
input file
loaded output
temporary (deleted)
compilation phases
runtime startoff
interpreter library
builtin functions, etc.
system library

FILES

f1le.f
a.out
f. tmp[1 23]
/usr/fort/fc[1234]
/usr/lib/frO.o
/usr/lib/filib.a
/usr/lib/libf.a
/usr/lib/liba.a

SEE ALSO

ANSI standard

DIAGNOSTICS

Compile-time diagnostics are given by number. If
the source code is available, it is printed with
an underline at the current character pointer.
Errors possible are:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

statement too long
syntax error in type statement
redeclaration
missing ( in array declarator
syntax error in dimension statement
inappropriate or gratuitous array declarator
syntax error in subscript b~und
illegal character
common variable is a parameter or already
in common
common syntax error
subroutine/blockdata/function not first
statement
subroutine/function syntax error
block data syntax error
redeclaration in external
external syntax er~or
implicit syntax error
subscrip~ on non-.array
incorrect subscript count
subscript out of range
subscript syntax error
DATA syntax error
DATA semantics error
Illegal variable in DATA
-

2 -

FC (I)

9/1/72
23
24
25
26
27
28
29
30
31
32
33
35
37
38
39
40
41
42
43
50
51
52
53
54
55
56
99
101

FC (I)

equivalence inconsistency
equivalence syntax error
separate common blocks equivalenced
common block illegally extended b¥
equivalence
common inconsistency created by
equivalence
DATA table overflow
() imbalance in expre ssion
expression syntax error
illegal variable in equivalence
Storage initialized twice by DATA
non array/function used with
subscripts/arguments
goto syntax error
illegal return
continue, return, stop, call, end, or
pause syntax error
assign syntax error
if syntax error
I/O syntax error
do or I/O iteration error
do end missing
illegal statement in block data
multiply defined labels
undefined label
dimension mismatch
expression syntax error.
end of statement in hollerith constant
array too large
~ table overflow
unrecognized· statement

Runtime diagnostics:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

invalid log argument
bad arg c.ount to amod
bad ·arg count to atan2
excessive argument to cabs
exp too large in cexp
bad arg count to cmplx
bad arq count to dim
excessive argument to exp
bad arq count t~ idim
bad arq count to isign
bad arg count to mod
bad arq count to sign
illegal argument to sqrt
assigned/computed goto out of range
subscript out'of range
real**real overflow

100
101
102
103

illegal I/O unit numberinconsistent use of I/O unit
cannot create output file
cannot open input file
- 3 -

FC (1)

9/1/72
104
105
106
107
108
109
110
111
999

BUGS

FC (1)

EOF on input file
illegal character in format
format does not begin with (
no conversion in format but non-empty
list
excessive parenthesis depth in format
illegal format specification
illegal character in input ·field
end of format in hollerith specification
unimplemented input conversion

The followinq is a list of those features not yet
implemented:
ar1 thInetic statement functions
backspace, endfile, rewind runtime
binary I/O
no scale factors on input

- 4 -

FED (I)

1/15/73

FED (I)

NAME

fed -- edit associative memory for form letter
SYNOPSIS
DESCRIPTION

fed is used to edit a form letter associative
memory file,form.m, which consists of' named
strings. Commands consist of single letters followed .by a list of string names separated by a
single space and e·nding with a new line. The
conventions of the Shell with respect to '*' and
'?' hold for all commands but m where literal
string names are expected. The commands are:
e name 1 •••
.!!dit writes the string whose name is name 1
onto a temporary file and executes the system editor~.. On exit from the system editor the temporary file is copied back into
the associative memory. Each argument is
operated on separately. The sequence of
commands to add .the string from 'file' to
memory with name 'newname'- is as follows:
e newname
(printed by ed)
r file

o

200
w

200
q

(get out of ed)
(get out of fe)

q

To dump a string onto a file:
e name
200
(printed by ed)
w filename
200

(g·et out of ed)
(get out of fe)

q

q

d [ name 1 ••• ]
geletes a string and its name from the
memory. When called with no arguments ~
operates i·n a verbose 'mode typing each
string name and deleting only if a 'y' is
typed. A 'q' response returns to fed's command level. Arty other response does nothing.
-

1. -

FED (1)

1/15/73

FED (1)

m name 1 name 2 •••
(move) changes the name of name 1 to name
and removes previous string name if one 2
exists. Several pairs of argume6ts may be
given.
n

[ name

1

••• ]

(~ames) lists the string names in the
memory. If called with the optional arguments, it just lists those requested.

p name 1 •••

Erints the contents of the strings with
names given by the arguments.
q (guit) returns to the system.

c [.e) [ ! ]

£hecks the associative memory file for consistency and reports the number of free
headers and blocks. The optional arguments
do the following:
p causes any unaccounted for string to be
printed
f fixes broken memories by adding
unaccounted-for headers to free storage
and removing references to released
headers from associative memory.
FILES

/tmp!ftmp?
temporary
form.m associative memory

SEE ALSO

form(I), ed(l),sh(I)

DIAGNOSTICS

'?' unknown command
'Cannot open temp. file'-- cannot create a temporary file for ed command
'name not in memory.' if string 'name' is not in
the associative memory and is. used as an argument
for 9 or m.

BUGS
WARNING

It is legal but an unwise idea to have string
names with blanks, ":" or "?" in them.
- 2 -

FORM (I)

6/15/72

FORM (I)

NAME

form -- form letter generator
SYNOPSIS

!E.!m proto a rq 1

•••

DESCRIPTION

form generates a form letter from a prototype
retter, anassoeiative memory, arguments and in a
special case, the current date.
If -!2.!:!!1 is invoked' with the proto argument ~x',
the associative memory is' searched for an entry
wlthname 'x' and the contents filed under that
name are used as the prototype. If the search
fails, the message "[x]:" is typed on the console
and'whatever text is typed in from the console,
term-inated by two new lines, is used as the prototype.
If the prototype argument is missing, '{letter}'
is assumed.
BaSically, !2!!!! is a copy process from the prototype to the output file. If an element of the
form [n] (where,!! is a digit from 1 to 9) is
encountered, the ,!!th argument arg is inserted in
its place, ,and that argument 1s tHen rescanned.
If {oJ is encountered, the·current date is inserted. If the desired ·argument ha,s not been
given, a message of the form "[n]:" is typed.
The response typed in then is used for· that argument.
If an element of the form [name] or {name} is,
encountered, the name is looked up in the associative memory. If it is found, the contents of
the memory under this name replaces the original
element (a9ain rescanned). If the .name is not
']" is. typed.
found, a message of the form . [name:
The response typed in is used for that element.
The response is entered in the memory under the
name if the name is enclosed in []. The response
is· not entered in_the memorY but is remembered
for the duration of the letter if the name is
enclosed in {}.

..

In both of the above cases, the response is typed
in by entering arbitrary text terminated by two
new lines. only the first of the two new lines
is passed with the text.
If one of the special characters [{]}\ is preceded by a \, it loses its special character.
If a file named "forma" already exists 1n the
1 -

FORM (I)

6/15/72
.

n

FORM (I)
n

users directory, forwb isnused as the output
file and so forth to formz.
The file " form.m " is created if none exists.
Because form.m is operated on by the disc allocater, it should only be chanqed by usinq £!.g,
the form letter editor, or ~.
FILES
form.m
form?

associative memory
output file (read only)

SEE ALSO
fed(I), type(I), roff(I)
DIAGNOSTICS
"cannot open output file" "cannot open memory
file" when the appropriate files cannot be located or created.
BUGS
An unbalanced ] or } acts as an end, of file but
may add a few stranqe entries to the associative
memory.

-

2 -

FORML (I)

10/24/72

FORML (I)

SYNOPSIS

forml [ name] •••

DESCRIPTION

A streamlined program for typing form letters.
The names pick out pre stored . form letters
prepared according to the conventions of ~ and
~.
The program prompts to get each blank
filled i~. When al! the forms are. completed, it
prompts Set paper. It waits for a newline before printing each letter.
If more than one name is given, the name of each
letter is :announced before the prompts for it
begin. If no na·mes are given, the program asks
" which letter? " before each. Respond with the
name and a newline, or newline only when done.
.

On a 2741 type terminal, the program assumes the
letter is to bet~ped with a correspondence ball,
and also prompts Change ball." Replace the ball
at the end.
FILES

form.m (memory),
forma, formb, ••• temporaries

SEE ALSO

form(l), fed(l), roff(l)

DIAGNOSTICS

"Try again"--can't qet a process

BUGS

-

1 -

3/15/72

GOTO (I)

GOTO (I)

NAME

goto

command transfer

SYNOPSIS

goto label

DESCRIPTION

goto is only allowed when·the Shell is takin~
commands from a file. The file is searched {from
the beginninq} for' a line beginninq with":" followed by one or more spaces followed by the
'label. If such a' line is found, the Sloto command
returns. Since the read pointer in the command
file points to the line after the label, the
effect is to cause the Shell to transfer to the
'labelled line.

" : " is a do-nothing command that only serves to
place a label.
FILES
SEE ALSO

sh(I), :(I)

DIAGNOSTICS

" goto error " , 1f the input file is a typewriter;
" label not found " •

BUGS

-

1 -

HYPHEN (I)

1/15/73

HYPHEN (I)

NAME

hyphen

SYNOPSIS

hyphen f11e 1 •••
It finds all of the words in a document which are
hyphenated across lines and prints them back at
you in a convenient format.
.

DESCRIPTION

find hyphenated words

If no arguments are given, the standard input 1s
used. Thus hyphen may be used as a filter.
FILES
SEE ALSO
DIAGNOSTICS

yes

BUGS

yes, it gets confused, but with no ill effects
other than spurious extra output;

- 1 -

3/15/72

IF (I)

IF (I)

NAME

if

SYNOPSIS

if expr command [ arq1 ••• ]

DESCRIPTION

g evaluates the expression

conditional command

~, and if its
value is~, executes the given command with
the given arguments.

The following primitives are used to construct
the ~:
: I file

true if the file exists and is readable.

~

file
true if the file exists and is writable

s1 .: s2
true if the strings .!..1 and

~

are equal.

s1 .!..: s 2
true if the strings .!..1 and .!1 are not
equal.
These primaries may be combined with the following operators:

1

unary negation operator
binary

!nS

opezator

binary 2£ operator
lexprl
parentheses for grouping.
=! haa higher precedence than :2.' Notice that
all the operators and flags are separate arguments to !! and hence must be surrounded by
spaces.
FILES
SEE ALSO

sheIl

DIAGNOSTICS

"if error", if the expression has the wrong
syntax; " command not found. "

BUGS

-

1 -

LD (I)

3/15/72

LD (I)

NAME

ld

SYNOPSIS

ld [ -sulxr ] name 1 • • •
12 combines several object programs into one;
resolves external references; and searches libraries. In the simplest case the names of
several object programs are given, and ld combines them, producing an object module which can
be either executed or become the input for a
further ld run. In the latter case, the "-r"
option must be given to preserve the relocation
bits.

DESCRIPTION

link editor

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. Only those routines defini'ng 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.
ld understands several"f!ag arguments which are
written preceded by a - :
-s "squash" 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.
-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.
-1 This option is an abbreviation for a li-

brary name. "-1" alone stands for
"/usr/lib/liba.a", which is the standard
system libra~ for assembly language programs. " -lx " stands for " /usr/lib / libx.a "
where x is any character. There are libraries for Fortran (x="f"l, C (x="c"),
Explor (x="e") and B (x="b ).
-x Do not preserve local (non-.globl) symbols
in the output symbol table; only enter
external symbols. This option saves some
- 1 -

3/15/72

LD (I)

LD (I)

space in the output file.
-r generate relocation bits in the output file
so that it can be the subject of another 19
run.
The output of Id is left on a.out. This file is
executable onlY-if no errors occurred during the
load.
FILES

/usr/lib/lib?a libraries
a.out
output file

SEE ALSO

asCI), ar(I)

DIAGNOSTICS

"file not found"-- bad arqument
"bad format"-- bad argument

" relocation error " -- bad argument ( relocation
bits corrupted)
" multiply defined " -- same symbol defined twice in
same load
"un"- stands for "undefined symbol"

" symbol not found " ~

loader bug

"can't move output file"- can't move temporary
to a.out file
"no relocation bits"- an input file lacks relocation information
." too many symbols " - too many references to
external symbols in a given routine
" prem~ture EOF "
"can't create l.out"-- cannot make temporary file
"multiple entry point"-- more than one entry
pOint specified (not possible yet).
BUGS

2 -

LN (I)

3/15/72

LN (I)

make a link

NAME

In

SYNOPSIS

In name ' [ name ]
1
2
ln creates a link to an eXisting .file name. If
name 2 is given., the link, has that name; ot~erwise
it i~ placed in the current directory and its
name is the last component of name 1 •

DESCRIPTION

It is forbidden to link to a directory or to link
across file systems.
FILES
SEE ALSO

rm(I)

DIAGNOSTICS

"?

BUGS

There is nothing particularly wrong with ln, but
links ,don't work right with respect to the-backup
system: one copy i$ backed up ,for each link, and
(more serious) in case of a file system reload
both copies are restored and the information that
a link was involved is lost.

..

-

1 -

LOGIN (I)

3/15/72

LOGIN (I)

NAME

login

sign onto UNIX

SYNOPSIS

login

DESCRIPTION

The login command is used when a user initially
signs onto UNIX,or it may be used at any time to
change from one user to another. The latter case
is the onesummar1zed above and described here.
See "How to Get started" (P. vi) for how to dial
up initially.

[username [ password ] ]

If login is invoked without an argument, it will
ask for a user name, and, if appropriate, a password. Echoing is turned off (if possible) during
the typing of the password, so it will not appear
on the written record of the session.
After a successful login, accounting files are
updated and the user is informed of the existence
of mailbox and message-of-the-day files.
Login is recognized by the Shell and executed
directly (without forking).
accounting
accounting
mail
message-of-the-day
password file

FILES

/tmp/utmp
/tmp/wtmp
mailbox
/etc/motd
/etc/passwd

SEE ALSO

init(VII),getty(VII), mail(I)

DIAGNOSTICS

" login incorrect " , if the name or the password is
ead. "NO Shell,", "cannot open passw~rd file,"
.

no directory:
Cilor.

.

consult a UNIX programming coun-

BUGS

-

1 -

LS (I)

3/15/72

LS (I)

NAME

ls

SYNOPSIS

ls [ -ltasd ] name 1 •••
ls'lists the contents of one or more directories
\i'D:ier control of several options:

DESCRIPTION

list contents of directory

-1 list in long format, giving i-number, mode,
owner, size in bytes, and time of last
modification for each file. (see stat for
format of the mode)
~t

sort by time modified (latest first) instead
of by ~ame, as 1s normal

-a list all entries; usually those beginninq
with • are suppressed
'
H

H\

-s qive,size in blocKs for each entry
-d if argument ,is a directory, list only its
name, not its contents (mostly used with
"-1" to qet status on directory)
If no argument is given, " • " is listed. Ifan
argument is not a directory, its name is given.

FILES

/etc/passwd to get user ID's for ls -1

SEE ALSO

stat(I)

DIAGNOSTICS

"name nonex1stent"; "name unreadable"; " name
unsta table.

BUGS

-

1 -

M6 (I)

11/15/72

M6 (I)

NAME

m6

SYNOPSIS

m§ [

DESCRIPTION

m§ takes input from file arg2 (or standard input
if arg2 is missing) and places output on file
arq3 (or stangard o~tput). A workinq file of
definitions, m.def, is initialized from file
arq1 if that is supplied. M6 differs from the
standard [1J in these respects:

general purpose macro processor

=£

arg1 J [ arg2 [ arg3 ] J

.Itrace:, Isource: and lend: are not defined.
Imeta,arq1,arq2: transfers the role of metacharacter arg1 to character arq2. If two metacharacters become identical thereby, the outcome of
further processinq is not quaranteed. For example, to make [J{} play the roles of #:<> type
\#meta,<\#>,[:
[meta, < : >,] :
[meta,[substr,«»,1,1;,{]
[meta,[substr,{{»,2,1;,}]
Idel,arq1: deletes the definition of macro arq1.
#save: and #rest: save and restore the definition
table together with the current metacharacters on
file m.def.
#def,arq1,arq2,arg3: works as in the standard
with the extension that an integer may be supplied to arg3 to cause the new macro to perform
the action of a specified builtin before its
replacement text is evaluated. Thus all builtins
except #def: can be .retrieved even after deletion. Codes for arg3 are:

o-

no function
1,2,3,4,5,6 - qt,eq,ge,lt,ne,le
7,8 - seq,sne
9,10,11,12,13 - add,sub,mpy,div,exp
20 - if
21,22 - def,copy
23 - meta
24 - size
25 - substr
26,27 -go,gobk
28 - del
29 - dnl
30,31 - save,rest

FILES

m.def--working file of definitions
/usr/lang/mdir/m6a--m6 processor proper
(/usr/bin/m6 is only an initializer)
/usr/lanq/mdir/m6b--default initialization for
-

1 -

11/15/72

M6 (I)

M6 (I)

m.def
/bin/cp--used for copying initial value of m.def
SEE ALSO

[1] A. D. Hall, The M6 Macroprocessor, Bell Telephone· Laboratories, 1969

DIAGNOSTICS

" err " -- a bug, an unknown builtin or a bad definition table
" oprd " --can , t open input or initial definitions
" opwr " --can ., t open output
" ova " -- overflow of nested arguments
" ovc " -- overflow of calls
"ovd" -- overflow of definitions

" Try again " -- no process available for copying
.

m.def
BUGS

Characters in internal tables are stored one per
word. They really should be packed to improve
capacity. For want of space (and because of
unpacked formats) no file arguments have been
provided to Isave: or Irest:, and. no check is
made on the actual opening of file m.def. Again
to save space, garbage collection makes calls on
Isave: and 'rest: and so overwrites m.def.

- 2 -

MAIL (I)
NAME
SYNOPSIS

DESCRIPTION

10/25/72

mail

MAIL (I)

send mail to another user

mail [ -yn ]
letter person •••
mail person

maTI

mail without an argument searches for a file
called mailbox, prints it if present, e.n~ ask-s if
it should be saved. If the answer is y.f the
mail is renamed ~, otherwise it is deleted.
!:1!!1 with a -yn argument works the same way,
except that the answer to the question is supplied by the argument.
When followed by the ·names of a letter and one or
more people, the letter is appended to each
person's mailbox. When a person is specified
without a letter, the letter is taken from the
sender's standard ·input up' to an EOT. Each
letter is preceded by the sender's name and a
postmark.
A person is either a user name recognized by
login, in which case the mail is sent to the
default workinq directory of that user, or the
path. name of a directory, in which case mailbox
in that directory is used.
When a user logs in he is informed of the presence of mail.

FILES

/etc/passwd

to identify sender
to locate persons
input mail
saved mail

mailbox
mbox
SEE ALSO
DIAGNOSTICS

login(I)

. Who are yOU? ..
.

if the user cannot be identified
for some reason (a bug). "~annot send to user"
if mailbox cannot be opened.

BUGS

-

1 -

MAN (I)

3/15/72

MAN (I)

NAME

man -- run off section of UNIX manual

SYNOPSIS

m!n title [ section ]

DEseRI PTION.

ID!n is a shell command file that will locate and
runoff a particular section of this manual.
Title is the the desired part of the manual.
Section is the section number of the· manual. (In
ArabiC, not Roman numerals.) If section is missing, ! is assumed. For example,
man man

would reproduce this page.
FILES

/sys/man/man?/*

SEE ALSO

sh(I), roff(I)

DIAGNOSTICS

"File not found", " Usage •• "

BUGS

-

1 -

3/15/72

MESG (I)
NAME

mesg

MESG (I)

permit or deny messages

SYNOPSIS
DESCRIPTION

mesg n forbids messages via write by revoking
non-user write permission on the user·'s typewriter •. mesg ~ reinstates permission. mesq with no
argument reverses the current permission. In all
cases the previous state is reported.

FILES

/dev/tty?

SEE ALSO

write(I)

DIAGNOSTICS

" ? " if the standard input file 1s not a typewriter

BUGS

- 1 -

MKDIR (I)

3/15/72

MKDIR (I)

make a directory

NAME

mkdir

SYNOPSIS

mkdir dirname •••

DESCRIPTION

mkdir creates specified directories in mode 17.
The standard entries " • " and
tomatically.

FILES
SEE ALSO

rmdir(I)

DIAGNOSTICS

"dirname ?"

BUGS

-

1 -

W •• "

are made au-

MT (I)

MT (I)

6/1 2/72

NAME

mt

SYNOPSIS

~

DESCRIPTION

mt saves and restores selected portions of the
file system hierarchy on magtape. Its "actions
are controlled by the keyarqument. 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
file or directory names specifying "which files
are to be dumped, restored, or tabled.

manipulate magtape
[key] [ name ••• ]

The function portion of the key is specified by
one of the following letters:
r

The indicated files and directories, together with all subdirectories, are dumped
onto the tape. The old contents of the
tape are lost.

x

extracts' the named files from the tape to
the file system. The owner, mode, and
date-modified are restored to what they
were when the file was dumped. If no file
argument is given, the entire contents of
the tape are extracted.

t

lists the names of all files stored on" the
tape which are the same as or are hierarchically below the file arguments. If no
file arqument is given, the entire contents
of the tape are tabled.

1

is the same as ~ except that an"expanded
listing is produced giving all the available information about the listed files.

The following characters may be used in addition
to the letter which selects the function desired.
0, ••• , 7 This modifier selects the drive on
which the tape is mounted. "0" is the
default.
v

Normally ms does its work silently. The ~
(verbose) 'option causes it to type the name
of each file it treats preceded bya letter
to indicate what is happening.
a
x

file is being added
file is being extracted

The :! option can be used with
f

~

and ~ only.

causes new entries copied on tape to be
-

1

-

MT (1)

6/1 2/72

MT (I)

'fake' in that only the entries, not the
data associated w·ith the entries are updat. ed. Such fake entries cannot be extracted.
Usable only with £.
w

causes m! to pause before treating each
file, type the indicative letter and the
file name (as with.Yl tndawaik tht user~s
response. Response y means yes , so the
file is treated. Null response means "no",
and the file does not take nart in whatever
"
is being done. Response " x 'it means "
exit;
the IDS command terminates immediately. In
the ~ function, files previously asked
about have been extracted already. With~,
no change has been made to the tape.

m make (create) directories during an
necessary •

~

if

FILES

/dev/mt?

SEE ALSO

tap(I), tap(v)

DIAGNOSTICS

Tape open .error
Tape'read error
Tape write error
Directory checksum
Directory overflow
Seek error
Tape overflow .
Phase error (a file has changed after it was
selected for dumping rut before it was dumped)

BUGS

If, during an "x", the files are specified in a
different order than they are on the tape, seek
errors will result because the tape cannot be
rewound.

-

2, -

MV (I)

2/9/73

NAME

mv

SYNOPSIS

!uy

DESCRIPTION

move or rename a file

name 1 name 2
!uy chanqes the name of name
to name 2 • If name 2
1
is a directory, name! is moved
to th3t directory
with its original fi e-name. Directories may
only be moved within the same parent directory
(just renamed).

FILES
SEE ALSO

DIAGNOSTICS

MV (I)

yes

BUGS

-

1 -

NM (I)

3/15/72

NAME

nm

SYNOPSIS

1l!!! [ name ]

DESCRIPTION

1l!!!

NM (I)

print name list

prints the symbol table from the output file
of an assembler or lo·a~er run. Each symbol name
is preceded by its value iblanks· if undefined)
and one of the letters "u (undefined) "A" (absolute) "T" (text segment symbol), "0" (data segment symbol), or "B" (bss segment .symbol ). Global symbols have their first character underlined. The output is sorted alphabetically.
If no file is given, the symbols in a.out are
listed.

FILES

a.out

SEE ALSO

as ( I ), ld ( I )

DIAGNOSTICS

"?"

BUGS

-

1 -

NROFF ( I)

NROFF ( I)

1/15/73
REQUEST REFERENCE AND INDEX

Request
~

I.

Page ntrol

.pl
.bp
• pn
.po
• ne

.±N
.±N
.±N
.±N
N

• br
.fi
.nf
.ad c

N=66
ignored
N=prev
N=1

• na

Line Spacing

III.

N=1

.±N
N
N
N

~

IV •

N=prev
N=1
N=1
N=1

space
off
~

.11 .tN

• in .tN
• ti .±N

Page ~ength.
Begin fage •
fage liumber •
fage Qffset.
~ed N lines •

yes
yes
yes
no
no
yes

~eak.

£:111 output lines.
lio!:ill.
~just lrode on.
.t!0~djust •
gnter N input text lines.

Blank Lines

•rs
.xh

no .
yes
no
no
no

Filling, Ad 1usting, and Centering

fill
fill
adj,norm adjust
adjust
off
N=1

.ce N

• ls
.sp
.lv
.sv
• os
• ns

N=66
N=1
N=1
N=O

~

II•

Cause
If no
Argument Break Explanation

Initial
Value

no
yes
no
no
no
no
no
no

Line .§pacing •
SPace N lines

OR-

.§.aye N lines.
Qutput ~aved lines •
No-§.p ace mode on •
,Restore .§pacing •
~tra-1!alf-line mode on.

Length and 100 ent ing

N=65
N=O

N=prev
N=prev
N=1

no
yes
yes

!tine !tength.
~ent •
l:emporary.!ndent •

V.

Macros, Diversion, and Line Traps

.de
• rm
.d1
• wh
.ch
.ch
.ch
.ch

xx
xx
xx

VI.

ignored
end

=N xx
=N =M

xx -M
=N y

xx y

no
no
no
no
no
no
no
no

DEfine or redefine a macro.
ReJ:!ove macro name •
Rlvert output to macro " xx " •
WHen- set a line trap.
ORORORgange trap line.

no
no
no
no

ORl!umber Register.

-

,

Number Registers

.nr a +N -M

.nr ab-+N--M
.nc c - \n
• ar
arabic

\n

~umber ~haracter.

Arabic numbers •
A1 -

NROFF (I)

arabic
arabic

.ro
.RO

no
no

none
space

N,M, •••
c
space
c
•

•

N=1

N

c

••

••

.c2 c

.li N
• tr abcd ••••
VIII.

IX.

N=1

on
on
none
Three

~

none

output

~

Pseudolabs setting •
lab replacement ~haracter •
~eader replacement ~aracter •
UNderline input text lines.
Basic ~ontrol Character •
Nobreak control character.
Accept input lines y t erally.
TRanslate on output •

no
no
no

lIo liYPh en •

~yphenation

no
no

~ength of ~itle •

no
no

.Humber ,!1ode on or off, set parameters.
.Humber ~arameters set or reset.

off
reset

M S I

XI.

Ck>nditional Input

.ev N

indicator

no
no
·no
no

TitLe.

OROR-

OR-

1l true accept line of

N=O

N=prev

no

~nXironment

anything •

switched.

Insertions from the Standard Input Stream
bell

no
no

Exit •

• so filename
.nx filename
.sp
XV. Miscellaneous

no
no

!i~t

.1g
• fl

no
no
no

nush output buffer •
Mort.

.ab

""

Environment SWitching.

• rd prompt
• ex
XIV.

~aracter •

Acceptance

~

.if c anything
.1f !c anything
• if N anything
• if ! N anything
XII.

Hyphenate •

Numbering.

.nm .±N M S I

XIII.

no
no
no
no
no
no
no
no

Titles •

• tl 'left 'ceat.er'right·
• It N
N=65
N=prev

~np

Roman numbers.
ROMAN numbers.

Hyphenation.

• nh
• hy
• hc c

X.

NROFF (I)

Input 1!.!l9 Output CDnventions and Character Translations

VIr.
• ta
• tc
• lc
.ul
• cc

1/15/73

Input

~

ReaD insert •

SWitching
Switch

~urce

file (push down) •

file.

~nore.

A2 -

OD (I)

1/15/73

NAME

od

SYNOPSIS

29 [ -abcdho ] [ file ] [ [±] offset[.!.] []a] ]

DESCRIPTION

OD (I)

octal dump

od dumps file in one or more formats as selected
the fi~argument.
(If the first argument is
missing, =2 is default.) The meaninqs of the format arqument characters ares

bY

a interprets words·asPDP-11 instructions and
dis-assembles the operation code. Unknown
operation codes print as'???
b interprets bytes in octal.

S interprets bytes in' ascii. Unknown ascii
charac.ters are printed as \?

.9

interprets words in decimal •

l:!

interprets words in hex.

2 interprets words in octal.
The file arqument specifies which file is to be
dumped. If no file arqument is specified, the
standard inpu.t is used. Thus od can be used as a
filter.
The offset·argument specifies the offset in the
file where dumpinq is to commence. This arqument
is normally interpreted as octal bytes. I f ' . '
is.appended. the offset is.interpreted in decimal. If b' i8 appended, the offset is interpreted in blocks. (A block is 512 bytes.) If the
file argument is omitted, the offset argument
must be preceded by , +'. .
Dumpinq continues until an end-of-file condition
or until halted by sending an interrupt siqnal.
FILES

SEE ALSO

db(I)

DIAGNOSTICS
BUGS

-

1 -

OPR (I)

1/15/73

OPR (I)

NAME

opr -- off line print

SYNOPSIS

opr [=] [=] [±]

DESCRIPTION

opr will arrange,to have the 201 data phone daemon su1::mit a "job to the Honeywell 6070 to print
the file arguments. ' Normally, 'the' output appears
at the GCOS central site. If the first argument
is
the output is remoted to station R1 •
(Station R1 has a 1403 printer.)

I +-) file 1 •••

==.

Normally. each file is printed in the state it is
found when the data phone daemOn' reads it. If a
particular file' argument is preceded by ±, or a
preceding argument of ± has been encountered.
then opr will make ,a copy for the daemon to
print. If the file argument is preceded b¥
or
a preceding arqument of
has been encountered,
then opr will unlink (remove) the file.

=

=,

If there are no arguments except for the optional
==,
then the standard input is read and off-line
printed. Thus opr may be used as a filter.
spool area
pe'rsonal ident cards
daemon

FILES

/usr/dpd/*
/etc/passwd
/etc/dpd

SEE ALSO

dpd(I), passwd(V)

DIAGNOSTICS
BUGS

-

1 -

OV (I)

6/12/72

OV (I)

NAME

ov

overlay pages

SYNOPSIS

2Y [ file]

DESCRIPTION

ov is a postprocessor for producing double column
rormatted text when using nroff (I). Q.Y li terally
overlays successive pairs of 66-line pages.
If the file argument is missinq, the standard
input is used. Thus 2Y may be used as a filter.

FILES

none

SEE ALSO

nroff(I), pr(I)

DIAGNOSTICS

none

BUGS

Other page lengths should be permitted.

-

1 -

PASSWD '(I)

9/1/72

NAME

passwd

SYNOPSIS

passwd name password

PASSWD (I)

set loqin password

DESCRIPTION

The password is plac'ed on the given login name.
,This can only be done by the user ID corresponding to the login name or p.Y the super-user. An
explicit null argument ( "") for the password
argument will remove any password from the login
name.

FILES

, /etc/passwd

SEE ALSO

login( I ) t pa'sswd (V) t crypt (III)

DIAGNOSTICS

Diagnostics are given for a non-match of the
login name, lack of permission and for password
file format errors.

BUGS

-

1 -

PR (I)

1/15/73

NAME

pr

SYNOPSIS

:e.£ L=~]

DESCRIPTION

PR (I)

print file

[-h name] [=n] [±n] [file1 ••• ]
l2£ produces a printed listing of o·ne or more
files. The output is separated into pages headed
by a date, the name of the file or a header (if
any), and the page number. If there are no file
arguments, ~ prints the'standard input file, and
is thus usable as a filter.
Options apply to all following files but may be
reset between files:
=£ print current date

=m print date file last modified (default)
=n produce n-column output
±n.begin printing with page n

=b treats the next argument as a header
If there is a header in force, it is printed in
place of the file name.
Interconsole messages via write{I) are forbidden
during a.e.£.
FILES

/dev/tty? to suspend messages.

SEE ALSO

ca t ( I ), cp ( I) ,

DIAGNOSTICS

none (files not found are ignored)

BUGS.

In multi-column output, non-printing 'characters
other than new-line cause misalignment.

-

1 -

PROOF (I)

1/15/73

PROOF (I)

NAME

proof -- compare two text files

SYNOPSIS

proof oldfile newfile

DESCRIPTION

proof lists those lines of newfile that diffe'r
from corresponding lines in oldfile. The line
number in newfile is given. When changes, insertions or deletions have been made the program
attempts to resynchronize the text in the two
files by finding a sequence of lines in both
files that again agree.

FILES
SEE ALSO

cmp(I)

DIAGNOSTICS

yes, but they are undecipherable, e.g. " ?1 " •

BUGS
'"

proof is stillevolvinq. Any bugs discovered or
should be brought to ENP.

~sugqestions

-

1 -

RELOC (I)

2/7/73

RELOC (I)

NAME

reloc

SYNOPSIS

reloc file [=]octal [ = ]

DESCRIPTION

reloc modifies the named object program file so
that it will operate correctly at a different.,
core origin than the one for which it was assembled or loaded.

relocate object files

The new core origin is the old origin' increased
by the given octal number (or decreased if·the
num be r ha s a " - " sign).
If the object file was generated by the linkeditor ld, 'the " -r " ld option must have been
given to preserve the relocation information in
the file.
If the optional last argument is given, then any
"setd" instruction at the start of the file will
be replaced by a no-oPe
The purpose of this command is to simplify the
preparation of object programs for systems which
have .no relocation hardware. It is hard to imagine a situation in which it would be useful to
attempt directly to execute a program treated by
reloc.
FILES
SEE ALSO

asCI), ld(I), a.out{V)

DIAGNOSTICS

As appropriate

BUGS

-

1 -

1/15/73

REW (I)
NAME

rew

SYNOPSIS

~

DESCRIPTION

~

FILES

/dev/tap?
/dev/mt?

SEE ALSO

..? .

DIAGNOSTICS

REW (I)

rewind tape
[ [m]diq1t ]

rewinds DECtape or magtape drives. The digit
is the logical tape number, and should range from
o to 7. If the' digit 1.s preceded by 'm', ~
applies to magtape rather than DECtape. A missing digit indicates drive O.

if there is no tape mounted on the indicated
drive or if the file cannot be opened.

BUGS

- 1 -

RM (I)

1/20/73

RM (I)

NAME

rm

SYNOPSIS

•••
m 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.

DESCRIPTION

remove (unlink) files

If there is no write permission to a file designated to be removed,!m will print the file name,
its mode and then read a line from the standard
input. If· the line begins with 'y', the file is
removed, otherwise' it is not. The optional argument =! prevents the above interaction.
If a deSignated file is a directory, an error
comment is printed unless the optional argument
-rhas been used. In that case, !l!! recursively
deletes the entire contents of the specified
directory. To remove directories per se see
rmdir(I).
FILES

/etc/glob to implement :[ flag

SEE ALSO

rmdir(I)

DIAGNOSTICS

:name: non existent"
name: not removed" if cannot remove
" name: try again" error from fork

BUGS

When rm removes the contents of a directory under
the ~ flag, full pathnames are not printed in
diagnostics.

-

1 -

RMDIR (I)

3/15/72

RMDIR (I)

NAME

rmdir

SYNOPSIS

rmdir dir 1 •••

DESCRIPTION

rmdlr removes (deletes) directories. The directory must be empt~ (except for the standard entries" ." and " •• , which rmdir itself removes).
Write permission is required in the directory in
which the directory appears.

FILES

none

remove directory

SEE ALSO
DIAGNOSTICS

." dir? " is printed if directory dir cannot be
found, is not a directory, or is not removable.

" dir -- directory not empty " is printed if _dir
"
has entries other than ""
• or "•••
BUGS

-

1 -

6/12/72

ROFF (I)

ROFF (I)

format text

NAME

roff

SYOOPSIS

[ - h ] file 1 •••
~ formats text according to control lines
embedded in the text in files name t • • • •
Encountering a nonexistent file tetminates printing. The optional argument " ±number" causes
printing to begin at the first eag~ with that
number. The optional argument .::! causes printing to stop before each page including the first
to allow paper manipulation; printing is resumed
upon receipt of an interrupt signal. The optional argument " -h" causes the output to cont ain
horizontal tabs for two or more spaces that end
on a tab stop. An interrupt signal received during printing terminates all printing. Incoming
interconsole messages are turned off during
printing, and the original message acceptance
state is restored upon termination.

DESCRIPTION

roff [±number ]

[.:! ]

At the present t1me~ there is no document
describing ROFF in full~ A Request Summary is
attached.
FILES

/ etc/ suft ab
/tmp/rtm?

suffix hyphenation tables
temporary

SEE ALSO
DIAGNOSTICS

none

BUGS

1 -

ROFF (I)

1/15/73

ROFF (I)

REQUEST SUMMARY
Request Break

Initial Meaning

.br

yes
no
yes

• bl n

yes

• bp +n

yes

n=1

• cc c
.ce n

no
yes

c= •

.de xx

no

.ds
.ef t
• eh t

.hy n

yes
no
no
yes
no
no
no
no
no

.ig

no

• in +n
• ix +n
.li n
.11 +n

yes
no
no
no

n=65

.ls +n

yes

n=1

.m1 n

no

n=2

.m2 n

no

n=2

.m3 n

no

n=1

.m4 n

no

n=3

.na
.ne n

yes
no

no

• nn +n
.n1

no
no

no

• n2

no

no

• ni +n

no

n=O

• ad

.ar

.f1

.fo
• hc c
• he t
• hx

yes
arabic

no
t='" ,
t='" ,
yes
t="''''
none
t

=""

n=1

Begin adjusting right margins •
Arabic page numbers.
Causes a line break -- the filling of the
current line is stopped.
Insert cont iguous block of n bl ank lines •
If necessary, a new page will be started
to acconiodate the entire block •
Begin new page and number it n. If n is
not given, normal sequencing occurs.
Control character becomes 'c'.
Center the next n input lines, without
filling.
" "
Define macro named xx (definition ends
with a line beginning with " •• ") •
Doubl e space; same as " .ls 2 " •
Even foot title becomes t.
Even head title becomes t •
Begin filling output lines.
All foot titles are t.
Hyphenation character set to 'c' •
All head t itl es are t •
Title lines are suppressed •
HYphenation is done, if n=1; and is not
done, if n=O.
Ignore input lines until and including a
"
line beginning with"" •••
Indent n spaces from left margin •
Same as " .in" but without break •
Literal, treat nextn lines as text.
Line length including indent is n characters.
Line spacing set to n lines per output
line.
n blank lines are put between the top of
a new paqe and the head title.
n blanks lines put between head title and
beginning of text on page.
n blank lines put between the end of text
and the foot title.
n bl ank lines put between the foot t itl e
and the bottom of page.
Stop adjusting the right margin.
Begin new page, if n output lines cannot
fit on pre~ent page.
The next n output lines are not numbered •
Output lines are numbered' s"equent ially
beginning with 1 on each n"ew page. Head
am foot titles are not numbered •
Output lines are numbered sequentially
beginning with 1 on the next output line •
Line numbers are imented n.
- A1 -

(I)

ROFF

.nf
• nx
.of
.oh
• pa
.pl
.po

1/15/73

yes
filename
t
no
t
no
+n yes
+n no
+n no

• ro
.sk n

no
no

.sp n

yes

.ss

yes

.ta N
• tc c
.ti +n

M

no
yes

• tr abed •• no
no
.ul n

.

no
t=""
t=""
n=1
n=66
n=O
arabic

yes

•••
c=

ROFF (I)

..

"

stop filling output lines.
Change to input file " filename •
Odd foot title becomes t.
Odd head title becomes t.
Same as .bp •
Total paper length taken to be n lines.
Page offset. All lines are preceded by N
spaces.
Roman page numbers •
n pages with head and foot titles but
otherwise blank will be output beginning
with the next page containing text.
Insert block of n blank lines. If the
bottom of a page is reached, remaining
lines are.n2:!: put on next page.
Single n space output lines, equivalent to
..
.ls 1 •
Pseudotab settings. Initial tab settings
are columns 9,17,25,...
.
Tab replacement character becomes c •
Temporarily indent next output line n
spaces.
Translate a into b, c into d, etc •
Ur¥ierline the letters and numbers on the
next n input lines.

. .

.. .

- A2 -

SH (I)

1/15/73

NAME

sh

SYNOPSIS

!.b [ name [ arg 1 ••• [ arg 9 ] ] ]

SH (I)

shell (command interpreter)

DESCRIPTION
sh is the standard command interpreter. It is the program which reads and arranges the execution of the command lines typed by most users. It may itself be called
as a command to interpret files of commands. Before discussing the arguments to the shell used as a command,. the
structure of command lines themselves will be given.
Command lines
Command lines are sequences of commands separated by command delimiters. Each command is a sequence of non-blank
command arguments separated by blanks. The first argument specifies the name of a command to be executed.
Except for certain types of special arguments discussed
below, the arguments other than the command name are
passed without interpretation to the invoked command.
If the first argument is.the name of Han ex!cutable file,
it is invoked; otherwise the string /bin/ is prepended
to the argument.
(In this way most standard commands,
whlch reside in "/bin", are found.) If no .such command is
f,ound, the string"" /usr" is fu~ther prepended (to give
/usr/bin/command ) and another attempt is made to execute the resultini file. . (Certain " overflow " commands
live in "/usr/bin.) If the "/usr/bin" file exists, but
is not executable, it is used by the shell as a command
file. That is to say it is executed as though it were'
typed from the console. If all attempts fail, a diagnostic is printed.
The remaining non-special arguments are simply passed to
the command without further interpretation by the shell.
Command delimiters
There are three command se!imiters: the new-line, " ;",
and "&". The semicolon ; specifies sequential execution of the commands so separated; that is,
coma; comb
causes the execution first of command ~, then of
The ampersand "&" causes simultaneous execution:

~.

coma & comb
causes ~ to be called, followed immediately by ~
without waiting for £2m! to finish. Thus coma and comb
execute simultaneously. As a special case-;-coma &
-

1. -

SH (I)

1/15/73

SH (I)

causes coma to be executed and the shell immediately to
r·equest--ariOther command without waiting for ~ •.
Termination Reporting
Ifa command (not followed by ".&") terminates abnormally,
a message is printed.
(All terminations other than exit
and interrupt are considered abnormal.) The following is
a list of the abnormal termination messages:
Bus error
Trace/BPT trap
Illegal instruction
lOT trap.
Power fail trap
EMT trap
Bad system call
Quit
PIR trap
Floating exception
Memory violation
Killed
User I/O
Error
If a ~ore image is produced, n
ed to the appropriate message.
Redirection

--

Core dumped" is append-

2! !/Q

Three character sequences cause the immediately following
string to be interpreted as a special argument to the
shell itself, not passed to the command.
An argument of the form "
More generally, special arguments of the form
>f1 )f2 > ••• >
specify that output is to be passed successively through
the filters f! , f, , ••• , and end up on the standard output stream.
y s ying instead
,

>f 1 )f 2 )···)file
,the output finallt er.ds up in file.
(The last ") •• could
also have been a
to specify concatenation onto the
end of file.)

»

In exactly analogous manner input filtering can be specified via one of
,
ingful to the shell may be passed as part of arguments.
A special case of this feature allows the continuation of
,

'

-

4 -

SH (I)

SH (I)

1/15/73

commands onto more than one line:
"\" is translated into a blank.

a new-line preceded by

Sequences of characters enclosed in double (") or single
(') quotes are also taken literally.
Argument passing
When the shell is invoked as a command, it has additional
stringprocessinq capabilities. Recall that the form in
which the shell is invoked is
_sh [ name [ arq1 ••• [ arg g ] ] ]
The ~ is the name of a file which will be read and
interpreted. If not given', this subinstance- of the shell
will continue to read the standard input file.
In command lines in the file (not ip command input).
character sequences of the -form $n-, where.!! is a digit
0, ••• , 9. are replaced by th~ ~~h argument to the invocation of 'the shell (arg n ).
$0
is replaced ~~.
~ Q!

fil!

An end-of-file in the shell's input causes it to. exit.
side effect of this fact means that the way to log out
from UNIX is to type an end of file.

A

Special commands
Two commands are treated specially by the shell."Chdir"- is done without spawning a new process by executing the sys chdir primitive.
"Login" is done by executing /bin/login without creating
a new process.
These peculiarities are inexorably imposed upon the.shell
by the basic structure of-the UNIX process control system. It is a rewarding exercise to work out why.
Command fil! errors; interrupts
Any shell-detected error, or an interrupt signal, during
the execution· of a command file causes the shell to cease
execution of that file.
FILES

/etc/glob, which interprets "*", "?",. and "[".

SEE ALSO

"The UNIX Time-sharing system", which gives the
theory of operation of the shell.

DIAGNOSTICS
"Input not found", when a cQmmand
file 1s specified which
...
5

SH (I)

1/15/73

SH (I)

cannot be read;
"Arq count", if the number of arquments to the chdir
" ""
pseudo-command is not exactly 1, or if "*,
1 , or " ["
is used inappropriately;
"Bad directory", if the directory given in "chdir" cannot
be switched to;
"Try again", if no new process can be created to execute
the specified command;
"" #
imbalance" t if single or double quotes are not
matched;
"Input file", if an argument after "~" cannot be read;
"output file t if an argument after >" or "»" cannot be
written (or created);
" Command not found " , if the specified command cannot be
executed.
"NO match", if no ar~uments are generated for a command
which contains' "*", ?", or .. [" •
Termination messages described above.
BUGS

If any argument contains' a quoted "*", "1", or ". [", then
all instances of these characters must be quoted. This
is because sh calls the glob routine whenever an unquoted
"*", "?", orne" is noticed; the fact 'that other instances of these characters occurred quoted is not noticed by glob.
When output is redirected, particularly through a ,filter,
diagnostics tend to be sent down the pipe and are sometimes lost altogether.

-

6 -

9/2/72

SIZE (I)

SIZE (I)

NAME

size -- size of an object file

SYNOPSIS

~

DESCRIPTION

The .size, in bytes, of the object files are
printed. If no file is given, a.out is default.
The size is printed in octal for the text, data,
and bss portions of each file. The sum of these
is also printed in octal and decimal.

FILES

a.out

[object ••• ]

default

SEE ALSO
DIAGNOSTICS

" object not found " if·the input cannot be read.
"bad format: object" if the input file does not
have a valid object header.

BUGS

-

1

SNO (I)

2/9/73

SNO (I)

NAME

sno -- SNOBOL interpreter

SYNOPSIS

.!.D2 [ file- ]

DESCRIPTION

~

is a SNOBOL III (with slight differences) compiler and interpreter. ~obtains input from
the concatenation of file and the standard input.
All in~ut through a statementcontaininq the
label end' is considered proqram and is compiled. The rest is available to 'syspit'.
The followinq is a list of differences between
and SNOBOL III:

~

There are no unanchored searches.
same effect:
a ** b
a *x*' b

=x

To get the

unanchored search for b
unanchored assignment

c

No back referencinq
x = "abc"

unanchored search for "abc"

a *x* x

Different fUnction declaration. The function
declaration is done at compile time by the use
of the label 'define'. Thus there ·is no ability to define functions at runtime and the
use of the name 'define' is preempted. There
is also no provision for 'automatic' variables
other than the parameters.
define

f( )
or
define f(a,b,c)

All labels except 'define' (even 'end') must
have a non-empty statement.
If 'start' is a label in the program,. proqram
ex~cution- will start there.
If not, execution
beqinswith the first executable statement.
('define' is not an executable statement)
There are no builtin functions.
- Variable length patterns a-t -the end of a pattern match are not treated specially. They
still match the shortest rather than longest
text.
Parentheses for arithmetic are not needed.
Normal (eg FORTRAN) precedence applies. Because of this, the arithmetic operators '/'
and '*' must be set off by space.
-

1 -

2/9/73

SNO (I)

SNO (I)

The riqht side of assiqnments must be nonempty.
Either

#

or

"

may be used for literal quotes.

The pseudo-variable 'sysppt' is not available.
FILES
(~;

SEE ALSO

SNOBOL III manual.
1964; PP .21 )

DIAGNOSTICS

As appropriate

BUGS

Runtime di.aqnost.ics qive the last program line
number rather than the executing statement lirie
number.

-

2 -

Vol. 11 No.1; Jan

SORT (I)

.9/2/72

SORT (I)

NAME

sort -- sort a file

SYNOPSIS

.!.2tl [ =] [oinput [ ooutp~t ] ]

DESCRIPTION

sort will sorOt the °input file and write °the °sort'idfiole on the output file. If the output file
is not given, the input file is rewritten. If
the input file ismissinq, sort uses the standard
input as input and the standard output for output. Thus.!.2tl may be used as a filter.
The sort is l1ne-by-line in increasing- ASCII collating sequence, except that upper-case letters
aore· considered the same as the lower-case
letters.
O
The optional argument
will cause a reverse
sort •
.!.2tl is implemented in such a way that
sort /dev/mtO
works correctly provided the tape is not too big.

FILES

/tmp/stm?

SEE ALSO
DIAGNOSTICS
BUGS

The largest file that can be sorted is about 128K
bytes.

-

1 -

SPLIT (I)

1/15/73

SPLIT (I)

NAME

split

SYNOPSIS

split [ [ file1 ] file2 ]

DESCRIPTION

Split reads file1 and writes it in 1000-1ine
pieces, as many as are necessary, onto a set of
output f1les. The name of the first output file
1s f1le2 with an "a" appended, and so on through
the alphabet and beyond. If no output name is
given, "x" is default.

split a file into pieces

If no input file is given, or the first argument
is "-", then the standard input file is used.
FILES
SEE ALSO
DIAGNOSTICS

yes

BUGS

Watch out for 8-character file names.

-

1 -

SPEAK (I)

2/1/73

SPEAK (I)

NAME

speak

SYNOPSIS

speak [ =] [ vocabulary ]

DESCRIPTION

speak turns a stream of ascii words into utterances and outputs them to a voice synthesizer.
It has facilities for maintaining a vocabulary.
It receives, from the standard input

word to voice translator

workinq lines - text of words separated by
blanks.
- phonetic lines - strings of phonemes for one
word preceded and separated by commas. The
phonetic code is given in vsp(VII).
- empty lines
- command lines - beginning with l. The following forms are recognized:
Ir file replace.coded vocabulary from file

TW file write coded vocabulary on file

JR

II

1£
l!

print phonetics for working word
list vocabulary on standard output
with phonetics
word copy phonetics from working word to
specified word
file (save) append working word and phonetics to file in style of 11

Each working line teplaces its eredecessor. Its
first word is the· working word. Each phonetic
line replaces the phonetics stored for the working word. Each workinq line, phonetic line or
empty line causes the working line to be uttered.
The process terminates at the end of input.
Unknown words are spelled as strings of oneletter words. Unknown one-letter words burp.

A phonetic line of comma only will delete the
entry for the working word.
speak is initialized with a coded vocabulary
stored in file /!!£/speak.m. The vocabulary
option substitutes a different file for speak.m.
The

=

option suppresses all utterances.

FILES

/etc/speak.m

SEE ALSO

vsp(VII), speakm(V), vt{IV)

BUGS

Vocabulary overflow is unchecked. Exce.ssively
lonq words cause dumps. Space is not reclaimed
from deleted entries.

-

1 -

STAT (I)

3/15/72

STAT (I)

NAME

stat

SYNOPSIS

~

DESCRIPTION

stat gives several kinds of information about one
or-more files:

get file status
name 1 •••

i-number
access mode
number of links
owner
size in byte s
date and time of last modification
name (useful when several files are named)
All information is self-explanatory except the·
mode. The mode is· a six-character string whose
characters mean the following:
1 s: file is small (smaller than 4096 bytes)
1: file is large
2 d:
x:
us
-:

file is a directory
file is executable
set user ID on execution
none of the above

3 r: owner can read

-: owner cannot read
4 w: owner can write

--.

owner cannot write

5 r: non-owner can read

-: non-owner cannot read
6

w: non-owner can write
-: non-owner cannot write

The owner is almost always given in symbolic
form; however if he cannot be found in
"/etc/passwd" a number is given.
If the number of arguments to ~ is not exactly
1a header is generated identifying the fields of
the status information.
FILES

/etc/passwd

SEE ALSO

istat(I), lS{I) (-1 option)

DIAGNOSTICS

" name? " for any error.

-

1 -

STRIP (I)

3/15/72

STRIP (I)

remove symbols and relocation bits

NAME

str~p

SYNOPSIS

strip name 1 •••
strip removes the symbol table and relocation
bits ordinarily attached to the output of the
assembler and loader. This is useful to save
space after a program has been debugged.

DESCRIPTION

The effect of strip is the same as use of the .=!
option of ld.
temporary file

FILES

/tmp/stm?

SEE ALSO

ld(I), as(I)

DIAGNOSTICS

Diagnostic's are given for: non-existent argument;
inability to create temporary file;
improper format (not an.object file);
inability to re-read temporary file.

BUGS

-

1 -

STTY (I)

6/12/72

STTY (I)

NAME

stty -- set teletype options

SYNOPSIS

stty option 1 •••
Stty will set certain I/O options on the current
output teletype. The option strings are selected
from the following set:

DESCRIPTION

.!.Y.!.!!
-even
odd
-odd
~

-raw

::nr
nr

echo
-echo
lcase
-lcase
-tabs
tabs

delay

-delay
ebcdic
corres

allow even parity •
disallow even parity.
allow odd parity'
disallow odd parity
raw mode· input
(no erase/kill/lnterrupt/qult/EOT)
negate raw mode
allow cr for If (and echo If cr)
allow nl only
echo back every character typed.
do not, echo cha'racters.
map upper case to lower case
do not map case
replace tabs by spaces
preserve tab~
calculatecr and tab delays.
no cr/tab delays
ebcdic ball 'conversion (2741 only)
correspondence ball conversion (2741 only)

FILES

standard output.

SEE ALSO

stty(II)

DIAGNOSTICS

"Bad options"

BUGS

-

1 -

SUM (I)

3/15/72

NAME

sum

SYNOPSIS

.!.BID name 1 •••
~ sums the contents of the bytes (mod
one or more files 'and prints the answer
A separate sum is printed for each file
fied, along with the number of whole or
512-byte blocks read.

DESCRIPTION

SUM (I)

sum file

2~16) of

in octal.
specipartial

In practice, .!1!!!!' is often used to verify that all
of a special file can be read without error.
FILES

none

SEE ALSO
DIAGNOSTICS

" oprd " if the file cannot be opened; " ? " if an
error is discovered during the read.

BUGS

none

-

1 -

TAP (I)

3/15/72

TAP (I)

NAME

tap

SYNOPSIS

tap

DESCRIPTION

tap saves and restores selected portions of the
file system hierarchy on DECtape. Its actions
are controlled by the key arqument. The key is a
strinq of characters containinq at most one function letter and possibly one or more function
modifiers. Other arqumentsto the command are
file or directory names specifyinq which files
are to be dumped, restored, or tabled.

manipulate DECtape
[key] [name ••• ]

The function portion of the key is specified by
one of the followinq letters:
r

The indicated files and directories, toqether with all subdirectories, are dumped
onto the tape. If files with the same
names already exist, they are replaced
" is determined by
( hence the "
r "
• )"
same
strinq comparison, so "•/abc " can never be
the same as "/usr/dmr/abc" even if
"/usr/dmr" is the current directory. If no
file arqument is qiven, " • " 1s the default.
.

u

updates the tape. ~ is the same as ~t but
a file is replaced only if its modification
date is later than the date stored on the
tape; that is to say, if it has chanqed
since it was dumped. ~ is the default command if none is qiven.

d

deletes the named files and directories
from the tape. At least one file arqument
must be qiven.

x

extracts the named files from the tape to
the file system. The owner, mode, and
date-modified are restored to what they
were when the file was dumped. If no file
arqument is qiven, the entire contents of
the tape are extracted.

t

lists the names of all files stored on the
tape which are the same a·s or are hierarchically below the file arquments. If no
file arqument is qiven, the entire contents
of the tape are tabled.

1

is the same as ~ except that an expanded
listinq is produced qivinq all the available information about the listed files.

The followinq characters may be used in addition
to the letter which selects the function desired.
-

1 -

TAP (I)

3/15/72

TAP (I)

0, ••• , 7 This modifier selects the drive on
which the tape is mounted. " 0 " is the
default.
v

Normally tap does its work silently. The ~
(verbose) option causes it to type the name
of each file it treats preceded by a letter
to indicate what is happening.
r
a
x
d
The

file
file
file
file
~

is
is
is
is

beinq
beinq
being
being

replaced
.added (not there before)
extracted
deleted

option can be used with .It !!, d, and

as only.
c

means a fresh dump is being created; the
tape directory will be zeroed before beginning. Usable <;>nly with .I and !!.

f

causes new entries copied on tape to be
'fake' in that no data is present for these
entries. Such fake entries cannot be extracted. Usable only with!. and !:!.

w

causes tap to pause before treating each
file, type the indicative letter and the
file name (as with
~nd awai~ th~ user's
response. Response y means yes, s~ toe
file is treated. Null response means no,
and the file does not take Dart in whatever
"
is beinq done. Response " 'x'it means "
exit;
the tap command terminates immediately. In
the.! function, files previ.ously asked
about have been extracted already.' With!"
~, and g no chanqe has been made to the
tape.

yl

m

make (create) directories during an
necessary.

~

if

FILES

/dev/tap?

SEE ALSO

mt(I)

DIAGNOSTICS

Tape open error
Tape read error
.Tape write error
Directory cbecksum
Directory overflow
Tape overflow
Phase error (a file has·changed after it was
selected for dumpinq but before it was dumped)

BUGS

" when it should
ASKS a beut "fake" entries on " xw,

- 2

TAP (I)

3/15/72
ignore them. If a fake
the file already exists
does not take place (as
and user ID of the file

- 3 -

TAP (I)

entry is extracted, and
on disk, the extraction
is correct), but the mode
are set to O.

TIME (I)

10/26/72

NAME

time

SYNOPSIS

~

DESCRIPTION

TIME (I)

time a command
command

The qiven command is timed; after it is complete,
prints the time spent in the system, waitinq
for disk, and in execution of the command.

~

The disk I/O time can be variable dependinq on
other activity in the system.
FILES
SEE ALSO

tm (VIII)

DIAGNOSTICS

"? "
"command terminated abnormally"
"Command not found."

-

1 -

10/21/72

TMG (I)

NAME

tmg -- compiler compiler

SYNOPSIS

tmg, name

DESCRIPTION

tmq produces a translator for the language whose
parsing and translation rules are described in
file name~. The new translator appears in a.out
and may be used thus:
a.out input [ output]
Except in rare cases input must be a 'randomly
addressable file. If no output file is specified, the standard output file is assumed.

FILES

/sys/tmg/tmgl.o -- the compiler-compiler
/sys/tmg[abc} - libraries
alloc.d -- table storage

SEE ALSO

A Manual for the Tmg Compiler-writing Language,
MM-72-1271-8.

DIAGNOSTICS

Syntactic errors result in "???" followed by the
offending line.
Situations such as space overflow with which the
Tmg processor or a Tmg-produced processor cannot
cope resul~ in a descriptive comment and a dump.

BUGS

9.2 footnote 1 is not enforced, causing trouble.
Restrictions (7.'> against mixing bundling primitives should be lifted.
Certain hidden reserved words exist: gpar,
classtab, trans.
Octal digits include 8=10 and 9=11.

-

1 -

TSS (I)
NAME

3/15/72
tas

TSS (I)

interface to Honeywell TSS

SYNOPSIS
DESCRIPTION

will call the Honeywell 6070 on the 201 data
phone. It will then go into direct access with
TSS. Output generated by TSS is typed on the
standard output and input requested by TSS is
read from the standard input with UNIX typing
conventions.

~

An interrupt signal (ASCII DEL) is transmitted as
a "break" to TSS.
Input lines beginning with i-are interprete2 as
UNIX commands. Input lines beginning with _ ~re
interpreted as commands to the interface routine.
-(file

insert input from named UNIX file

-)fi1e

deliver tss output _to named UNIX file

-p

pop the output file

-q

disconnect from tss (quit)

-r

file receive from HIS routine CSR/DACCOPY

-s file send file to HIS routine CSR/DACCOPY
Ascii files may be most eft:iciently transmitted
using the HIS routine CSR/DACCOPY in this
fashion. Underlined text comes from TSS.
AFTname is the 6070 file to be dealt with.
SYSTEM? CSR/DACCOPY (s) AFTname
Send Encoded File -8 file
SYSTEM? CSR/DACCOPY (r) AFTname
Receive Encoded File -r file
FILES

/dev/dnO, /dev/dpO

SEE ALSO
DIAGNOSTICS

DONE when communication is broken.

BUGS

When diagnostic problems occur,
abruptly.

-

1 -

~

exits rather

TTY (I)

3/15/72

TTY (I)

NAME

tty

get tty name

SYNOPSIS

tty

DESCRIPTION

tty gives the name of the user~s typewriter in
the form nttyon, for .n andigit. The actual path
name is then /dev/ttyn.

FILES
SEE ALSO
DIAGNOSTICS

,.

n

not a tty if the standard input file is not a
typewriter.

BUGS

-

1 -

TYPE (I)

6/12/72

NAME

type

SYNOPSIS

~

DESCRIPTION

~

TYPE (1)

type on single sheet paper
file 1 •••

copies its input files to the standard output. Before each new page (66 lines) and before
each new file, type stops and reads the standard
input for a new line character before continuing.
This allows time for insertion of single sheet
paper.

FILES
SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

TYPO (I)

1/15/73

TYPO (I)

NAME

typo -- find possible typo's

SYNOPSIS

~ [= ]

DESCRIPTION

typo hunts through a document for unusual words,
typographic errors, and hapax legomena and prints
them on the standard output.

f1le 1 •••

All words used in the document are printed out in
decreasing order of peculiarity along with an
index of peculiarity. An index of 10 or more is
considered peculiar. Printing of certain very
common English words is suppressed.
The statistics for judging words a·re taken from
the document itself; with so!,e"help fJ:'om known
statistics. of English. The - option suppresses
the help from English and should be used 1f the
document is written in, for example, Urdu.
Roff and Nroff control lines are ignored. Upper
case is mapped into lower case. Quote marks,
vertical bars, hyphens, and ampersands are
stripped from within words. Words hyphenated
across lines are put back together.
FILES

/tmp/ttmp??, /etc/salt, /etc/w2006

SEE ALSO
DIAGNOSTICS

yes, lots

BUGS

Because of the mapping into lower case and the
stripping of special characters, words may be
hard to locate in the original text.

-

1 -

UN (I)

3/15/72

NAME

un

SYNOPSIS

!:m [ name]

DESCRIPTION

~

FILES

a.out

SEE ALSO

as ( I ), ld ( I )

DIAGNOSTICS

" ? " if the file cannot be found.

UN (I)

undefined symbols

prints a list of undefined symbols from an
assembly or loader run. If the file argument is
not specified, a.out ~s the default. Names are
listed alphabe'tically except that non-global symbols come first. Undefined global symbols (unresolved external' references) have their first
character underlined.

BUGS

-

1 -

UNIQ (I)

12/1/72

UNIQ (I)

NAME

uniq

SYNOPSIS

unig [ ~]

DESCRIPTION

unig reads the input file comparing adjacent
lines. In the normal case, the second and
s'ucceeding copies of repeated lines are removed;
the remainder is written on the output file.
Note that repeated lines must be adjacent in order to be found.
(see sort(I» If the ~ flag is
used, just the lines that are not repeated in the
original file are output. The =9.option specifies that one copy of just the repeated lines -is
to be written. Note that the normal mode output
is the union of the =y and =2 mode outputs.

report repeated lines in a file
[input [ output ] ]

The- following example will print one copy of all
lines in the file ~ that do not occur in E:
$ort a x
uniq x a1
sort b x
uniq x b1
cat &1 b1 >x
sort x
uniq -u x »&1
sort &1
uniq -d &1
FILES
SEE ALSO
DIAGNOSTICS

sort(I)

..cannot open

.. . cannot create output .

input,

BUGS

-

1 -

VS (I)

NAME

2/13/73
vs

VS(I}

phoneme list to voice synthesizer

SYNOPSIS
DESCRIPT ION

accepts phoneme descriptor lists and
translates them into byte strings suitable for
the Federal Screw Works Voice Synthesizer.
Phoneme descritors should ~e sep~rated b~ c~mmas
am have the general form %NIxx where xx is a
one or two character phoneme name, " I " is an
optional inflection parameter, and" %N" is an
optional count of the number of times the phoneme
is to be repeated (maximum 9). "I" can have the
values 0, 1, 2, 3 representing decreasing
strength (default is 2). A description of the
phonemes and their names can be found in the file
vsp(VII). For example,
~.

aO,o1,t,r,1ai,1ay,d,j,ih,u1,%2s

"
will generate the word " outrageous.
The output
is buffered; a newline will cause the buffered
output to be sent to the Voice Synthesizer.
FILES
SEE ALSO

vsp(VII), speak(I)

DIAGONOSTICS
BUGS

-

1 -

WC (I)

3/15/72

NAME

wc -- get (English) word count

SYNOPSIS

~

DESCRIPTION

WC (I)

name 1 •••

.~ provides a count of the words, text lines, and
control lines for each argument file.
text line i, I- s,qvence,,9' characters not·beginning with . , I or
and ended by a newline. A control line is a line beginning with
".", "I" or ",H. A word is a sequence of characters bounded by the beginning of a line, by the
end of a line, or by a blank or .a tab •

A

. When there is more than one input file, a grand
total is also printed.
FILES
SEE ALSO

roff(I)

DIAGNOSTICS

none; arguments not found are ignored.

BUGS

-

1 -

WHO (I)

3/15/72

NAME

who

SYNOPSIS

~

DESCRIPTION

~,

WHO (I)

who is on the system
[who-file]

without an arqument, lists the name, typewriter channel, and loqin time for each current
UNIX user.
Without an argument, ~ examines the /tmp/utmp
file to obtain its information. If a file is
qiven, that file is examined. Typically the
qiven file will be /tmp/wtmp, which contains a
record of all the loqins since it was created.
Then who will list loqins, loqouts, and crashes
since the creation of the wtmp file.
Each loqin is listed with user name, last character of input device name (with /dev/tty
suppressed), date and time. Certain loqouts produce a similar line without a user· name. Reboots
produce a line with "x" in the place of the device name, and a fossil time indicative of when
the system went down.

FILES

/tmp/utmp

SEE ALSO

loqin(I), init(VII)

DIAGNOSTICS

"?" if a named file cannot be read.

BUGS

-

1 -

WRITE (I)

3/15/72

WRITE (I)

NAME

write

write to another user

SYNOPSIS

write user

DESCRIPTION

write copies lines from your typewriter to that
of another user. When first called, write sends
the message
message from yourname •••
The recipient of the message' should write back at
this pOint. Communication conti"nues until an end
of file is read from the typewriter or an interrupt is sent. At that point write writes " EOT "
on the other terminal.
Permission to write may be denied or granted by
use of the mesg command. At the' outset writing
is allowed. Certain commands, in particular ~
and l2.!:, disallow messages in order to prevent
messy output.
If the character "I" is found at the beginning of
a line, write calls the mini-shell m!h 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 him to write back before starting to send.
Each party should end each messa~e with a distinctive signal ("(0)" for "ove, is conventional) that the other may reply.
(00)" (for "over
and out") is suggested when conversation is about
to be terminated.
to find user
to execute I

FILES

/tmp/utmp
/etc/msh

SEE ALSO

mesg(I), msh(VII)

DIAGNOSTICS

" user not logged in;
" " permission denied " •

BUGS

write should check the mode of the other user~s
typewriter and refuse to proceed unless non-user
write permission is given. Currently it is possible to write to another person with the same
user-ID even though he has forbi~den messages.
write should also allow specification of .the
typewriter name of a user who is logged in
several times instead of picking out the instance
with the lowest name.

-

1 -

BOOT (II)

BOOT (II)

7/29/72

NAME·

boot -

SYNOPSIS

sys boot

DESCRIPTION

UNIX will clean up outstanding I/O, and then execute the reboot read-only program. This call is
restricted to the super-user. All users will be
logged out.

SEE ALSO

boot procedures (VII)

DIAGNOSTICS

the c-bit is set if you are not the super-user

BUGS

It often doesn' t work (for unknown reasons).
It depends on switch settings.

reboot UNIX
/ boot

-

1 -

= 39.

not in assembler

BREAK (~I)

3/15/72

BREAK (II)

NAME

break

set. program break

SYNOPSIS

sys break; addr

DESCRIPTION

break set.s t.he syst.em's idea of t.he highest. location used by the program to .~. Locat.ions
greater than ~ and below the stack pointer are
not swapped and are thus liable t.o unexpected
modification.

/ break

= 17.

An argument of 0 is taken to mean 1 6K bytes.. If
the argument is higher than the stack pointer the
entire user core area 1s swapped.
When a program begins execution via ~ the
break is set at the highest location defined by
theproqram and data storage areas. Ordinarily,
. therefore, only programs with growing data areas
need to use break.
SEE ALSO

exec(II)

DIAGNOSTICS

none; strange addresses cause t.he break to be set
at 16K bytes.

BUGS

-

1 -

CEMT (II)

9/4/72

CEMT (II)

NAME

cemt

catch emt traps

SYNOPSIS

sys cemt; arg

DESCRIPTION

This call allows one to catch traps resulting
from the ~ instruction.- Arg is a location
within the program; emt traps are sent to that
location. The normar-iffect of ~ traps may be
restored by giving an arq equal to O.

/ cemt = 29.

To return after catching the
the !S! instruction.
SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

~

trap, execute

CHDIR (II)

CHDIR (II)

3/15/72

NAME

chd1r

SYNOPSIS

sys chdir; d1rname

DESCRIPTION

dirname is the address of the pathname of a
directory, terminated by a 0 byte. chdir causes
this directory to become the current working
directory •

SEE ALSO

chdir(I)

DIAGNOSTICS

The error bit (c-bit) is set 1f the given name is
not that of a directory or is not readable.

change

work~ng

BUGS·

- 1 -

directory

/ chdir = 12.

CHMOD (II)

3/15/72

CHMOD (II)

NAME

chmod

SYNOPSIS

sys chmod; name; mode. / chmod = 1 5.

DESCRIPTION

The file whose name is given as the nullterminated string pointed to by ~ has its mode
changed to~. Modes are constructed by 2!ing
together some combination of the following:
01

change mode of file

write, non-owner

02 read, non-owner
04 write, owner
10

read, owner

20 executable
40 set user ID on execution

Only the owner of a file (or the super-user) may
change the mode.
SEE ALSO

chmod{I)

DIAGNOSTICS

Error bit (c-bit) set if name cannot be found or
if current user is neithe~e owner of the file
nor the super-user.

BUGS

-

1 -

3/15/72

CHOWN (II)

CHOWN (II)

NAME

chown

SYNOPSIS

sys chown; name; owner

DESCRIPTION

The file whose name is given by the nullterminated string pointed to by ~ has its owner changed to owner. Only the present owner of a
file (or the super-user) may donate the file to
another user. Also, one may not change the owner
of a file with the set-user-ID bit on, otherwise
one could create Trojan Horses.

SEE ALSO

chown(I), uids(V)

DIAGNOSTICS

The error bit (c-bit) is set on illegal owner
changes.

change owner of file

BUGS

-

1 -

/ chown = 16.

CLOSE (II)

3/15/72

CLOSE (II)

close a file

NAME

close

SYNOPSIS

(file descriptor in rO)
sys close / close = 6.

DESCRIPTION

Given a file descriptor such as returned from an
open or creat call, close closes the associated
file. A close of all files is automatic on exit,
but st-nce processes are limited to 10 simultaneously open files, close is necessary for programs.
which deal with many files.

SEE ALSO

creat(II), open(II)

DIAGNOSTICS

The error bit (c-bit) is set for an unknown file
descriptor.

BUGS

-

1 -

CREAT (II)

CREAT (II)

3/15/72

NAME

creat

SYNOPSIS

sys
creat; name; mode
(file descriptor in rO)

DESCRIPTION

creat creates a new file or prepares to rewrite
an existing file called'~; ~ is the address
of a null-terminated·string. If the file did not
exist, it is given mode ~; if it did exist,
its mode and owner remain unchanged but it is
truncated to 0 length.

create a new file
/ creat

= 8.

The file is also opened for writing, and its file
descriptor is returned in rO.
The ~ given is arbitrary; it need not allow
wri ting • This feature is u sed by programs Which
deal with temporary files of fixed names. The
creation is done with a mode that forbids writinq.· Then if a second instance of the program
attempts a creat, an error is returned and the
program knows that the name is unusable for the
moment.
SEE ALSO
DIAGNOSTICS

BUGS

write(II). close(II)
The error bit (c-bit) may be set if: a needed
dire'ctory is not readable; the file does not
. exist and the directory in which it is to be
created is not writable; the file does exist and
1s unwr1table; the file is a directory; there are
already 10 files open.

CSW (II)

7/29/72

CSW (II)

NAME

csw -- read console switches

SYNOPSIS

sys csw / csw = 38. not in assembler
(value of csw in rO)
(value of buttons in r1 )

DESCRIPTION

The setting of: the console switches is returned
in rOe The setting of the external buttons is
returned in r1. The return is synced to a 30 CPS
clock for graphical applications.

SEE ALSO
DIAGNOSTICS

none

BUGS

CUrrently the buttons are unavailable.

-

1 -

DUP (II)

1/15/73

DUP (II)

NAME

dup -- duplicate an open file descriptor

SYNOPSIS

(file descriptor in rO)
sys dup / dup = 41.; not in assembler
(file descriptor in rO)

DESCRIPTION

Given a file descriptor returned from an open or
creat call, dup will allocate another file
descriptor synonymous with the original. The new
fi~e descriptor is returned in rOe
Dup is used more to manipulate the value of file
descriptors than to genuinely duplicate a file
descriptor. Since the algorithm to allocate file
descriptors is known to use the lowest available
valu·e between 0 and 9, combinations of dup and
close can be used to manipulate file descriptors
in a general way. This is handy for manipulating
stand~rd input and/or standard output.

SEE ALSO

creat(II), open(II), close(II)

DIAGOOSTICS

The error bit (c-bit) is set if: the qiven file
descriptor is invalid; there are a~ready 10 open
files •.

BUGS

-

1 -

EXEC (II)

3/15/72

NAME
SYNOPSIS

exec

EXEC (II)

execute a file

sys exec; name; args
•••
name: ( ••• \0)
•••
arqs: arg1; arg2; ••• ; 0
arg1: <••• \0)
•••

DESCRIPTION

/ exec

= 11.

oV$rlays the calling process with the named
file, then transfers to the beginning of the core
image of the file. The first argument to ~ is
a pointer, to the, name of the file to be executed.
The second is the address of a list of pointers
to arguments to be passed to the file. Conventionally, the first argument is the name of the
file. Each pOinter addresses a string terminated
by a null byte.

~

There can be no return from the file; the calling
core image is lost.
The program break is set from the executed file;
see the ,format of a.out.
Once the called file starts execution, the arguments are available as follows. The stack
pointer pOints to a word containing the number of
arguments. ' Just above this number is a list of
pOinters to the argument strings.
sp-)

nargs
arg1

...

'

argn
arg1:
argn:

(arq1 \0)
•••
(arqn\O)

The arguments are placed as high as possible in
core: just below 57000(8).
Files remain open across ~ calls. However,
the,illegal instruction, ~,quit, and interrupt
trap specifications are reset to the standard
values. (se'e ilgins, ~, quit, ~.)
Each user has a real user ID and an effective
user ID (The rearm identifies the person using
the system; the effective ID determines his access privileges.) ~ changes the effective user
ID to the owner of the executed file if the file
has the set-user-ID mode.' The real user ID is
not affected.

..

..

- 1 '-

ExEC (II)

3/15/72

EXEC (II)

SEE ALSO

fork(II)

DIAGNOSTICS

If the file cannot be read or if it is not executable, a return from exec constitutes the diagnostic. The error bit (c-bit) is set.

BUGS

Very high core and very low core are used by ~
to construct the argument list for the new core
image. If the original copies of the arguments
reside in these places, problems can result.

-

2 -

EXIT (II)

3/15/72

NAME

exit

SYNOPSIS

(status in rO)
sys exit / exit = 1

DESCRIPTION

terminate process

exit is the normal means of terminatinq a proExit closes all the process' files and
notifies the parent process if it is executing a
.~.
The low byte of rO is available as status
to the parent process.

cess.

This call can never return.
SEE ALSO

EXIT (II)

wait(II)

DIAGNOSTICS
BUGS

-

1 -

FORK (II)

3/15/72

FORK (II)

NAME

fork

SYNOPSIS

sys fork / fork = 2.
(new process return)
(old process return)

DESCRIPTION

~

SEE ALSO

waite II), exec(II)

DIAGNOSTICS

The error bit (c-bit) is set in' the old process
if a new process could not be created because of
lack of process space.

BUGS

See wait(II) for a subtile bug in process destruction.

spawn new process

is the only way new' processes are created.
The new.process's core image is a copy of that of
the caller of ~; the only distinction is the
return location and the fact that rO in the old
process contains' the process ID of the new process. This process ID is used by ~.

-

1 -

FPE (II)

9/2/72

FPE (II)

NAME

fpe -- set floating exception handling

SYNOPSIS

ays fpe; arg / fpe = 40. not in assembler

DESCRIPTION

This call allows one to catch traps resulting
from floating point exceptions. Arg is a location within the program; floating exception traps
are sent·to that location. The normal effect of
floating exception traps may be restored by giving an arg equal to O.
To return after catching the fpe trap, execute
the !!! instruction.

SEE ALSO
DIAGNOSTICS
BUGS

The floating pOint exception (FEC) register is
not saved per process. Examining this register
for possible remedial action after a floating
point exception trap is not guaranteed to work.

-

1 -

FSTAT (II)

FSTAT (II)

3/15/12

NAME

fstat

qet status of open file

SYNOPSIS

(file descriptor in.rO)
sys fstat; buf / fstat

DESCRIPTION

This call is identical to ~, except that it
operates on open·files instead of files qiven by
name. It is most often used to qet the status of
the standard input and output files, whose names
are unknown.

SEE ALSO

stat( II)

DIAGNOSTICS

The error bit (c-bit) is set if the f1le descriptor 1s unknown.

BUGS

-

1 -

= 28.

GETUID (II)

3/15/72

GETUID (II)

get user identification

NAME

getuid

SYNOPSIS

sys getuid / getuid = 24.
(user ID ,in rO)

DESCRIPTION

getuid returns the real user ID of the current
process. The real user ID identifies the person
who is logged in, in contradistinction to the
effective user ID, which determines his access
permission at each moment. It is thus useful to
"set user ID "
programs which operate using,
the
mode, to find out who invoked them.

SEE ALSO

setuid(II)

DIAGNOSTICS
BUGS

-

1 -

GTTY (II)

3/15/72

NAME

qtty

SYNOPSIS

(file descriptor in rO)
sys qtty; arq / gtty = 32 •
arg:

GTTY (II)

qet typewriter status

•• •
.=
.+6

DESCRIPTION

~ stores in the three words addressed by arg
.the statu$ of the typewriter whose file descriptor is' given in rOe The format is the same as
that passed by stty.

SEE ALSO

stty( II) .

DIAGNOSTICS

Error bit (c-bit) is set if the file descriptor
does not refer to a typewriter.

BUGS

-1 -

ILGINS (II)

3/15/72

ILGINS (II)

NAME

ilgins

catch illegal instruction trap

SYNOPSIS

sys ilgins; arq

DESCRIPTION

ilgins allows a program to catch illegal instruction traps. If arg is zero, the normal instruction trap handling is done: the process is terminated and a cpre image is produced. If arg is
a location within the program, control is passed
to arq when the trap occurs.

/ ilgins

= 33.

This call is used to implement the floating point
simulator, which catches and interprets 11/45
floating pOint instructions.
To return after catching the ilgins trap, execute
the !S! instruction.
SEE ALSO

PDP-11 manual

DIAGNOSTICS
BUGS

-

1 -

INTR (II)

3/15/72

INTR (iI)

NAME

intr

set interrupt handling

SYNOPSIS

sys intr; arg

DESCRIPTION

When arg is 0, interrupts (ASCII' 'DELETE) are
ignored. When arg is 1, interrupts cause their
normal result, that is, force an~. When arg
is a location within the program, control is
transferred to that location when ~n interrupt
occurs.

/ intr

= 27.

After an interrupt is caught, it is possible to
resume execution by means of an ~ instruction;
however, ,great care must be exercised, since all
I/O is terminated abruptly,upon an interrupt. In
particular, reads of the typewriter tend to return with 0 characters read, thus simulating an
end of file.
SEE ALSO

quit(II)

DIAGNOSTICS
BUGS

-

1 -

KILL (II)

6/12/72

KILL (II)

NAME

kill -- destroy process

SYNOPSIS

(process number in rO)
sys k i l l / k i l l = 37.; not in assembler

DESCRIPTION

~

destroys·a process, given its process
number. The process leaves a core image.

This call is restricted to the super-user, and is
intended only to kill an otherwise unstoppable
process.
SEE ALSO
DIAGNOSTICS

c-bit set if user is not the super-user, or if
process does not exist.

BUGS

Under strange circumstances,

-

1 -

~

is ineffective.

LINK (II)

3/15/72

LINK (II)

NAME

link -- link to a file

SYNOPSIS
DESCRIPTION

sys link; name 1 ; name 2 / link = 9.
A link to name 1 is created; the link has' name
~2.
Either name may be an arbitrary path
name.

SEE ALSO

link(I), unlink(II)

DIAGNOSTICS

'1'he error bit (c-bit) .is set when.!!!!!!.!!1 cannot be
found; when ~2 already exists; when the directory of ~2 cannot be written; when an attempt
is made to lxnk to a directory by a user other
than the super-user; when an attempt is made to
link to a file on another file system.

BUGS

1 -

MAKDIR (II)

3/15/72

MAKDIR (II)

NAME

makdir

SYNOPSIS

sys

DESCRIPTION

makdir creates an empty directory whose name is
the null-terminated string pOinted to by n!m!.
The modeftof the ~ir!ctory is~. The special
entries' • and •• are not present.

make a

dir~ctory

makdir; name; mode

/ makdir

makdir may be invoked only by the

= 14.

supe~-user.

SEE ALSO

mkdir(I)

DIAGNOSTICS

Error bit (c-bit) is set if the directory already
exists or if the user is not the super-user.

BUGS

-

1 -

MDATE (II)

3/15/72

NAME

mdate

SYNOPSIS

(time to rO-r1)
sys mdate; file

DESCRIPTION

MDATE (II)

set modified date on file
/ mdate = 30.

File is the address of a null-terminated strinq
giving the name of a file. The modified time of
the file is set to the time given in the rO-r1
register~ •
This call is allowed only to the super-user or to
the owner of the file.

SEE ALSO
DIAGNOSTICS

Error bit 1s set if the user is -neither the owner
nor the super-user or if the file cannot be
found.

BUGS

-

1 -

MOUNT (II)

MOUNT (II)

3/15/72

NAME

mount

mount file system

SYNOPSIS

sys

DESCRIPTION

mount announces to the system that a removable
fllesystem has been mounted on special file
special; from now on, references to file ~
will refe'r to the root file on the newly mounted
file system. Special and ~ are pointers to
null-terminated stripqs containing the appropriate path names.

mou.nt; special; name

/ mount = 21.

must exi'st already. If it had contents,
they are inaccessible while the file system is
mounted •

~

SEE ALSO

.mount (I), umount (II)

DIAGNOSTICS

Error bit (c-bit) set if: special is
inaccessible; ~ does not eXist; special is·
already mounted; ~ is not on the RF; there are
already four special files mounted.

BUGS

At most four removable devices can be mounted at
a time. This call should be restricted to the
super-used.

-

1 -

NICE (II)-

3/15/72

NICE (II)

NAME

nice -- set program in low priority

SYNOPSIS

sys nice, / nice = 34.

DESCRIPTION

The currently executing process is set into the
lowest priority execution queue. Background jobs
that'execute a very long time should do this.
Once done, thexe is no way to restore a process
to normal priority.

SEE, ALSO

formerly known as " hog "

DIAGNOSTICS
BUGS

-

1 -

OPEN (II)

OPEN (II)

3/15/72
open for reading or writinqr

NAME

open

SYNOPSIS

sys open; name; mode
(descriptor in rO)

DESCRIPTION

0yen opens the file n!!! for reading (if ~ is
o or writing (if ~ is non~zero). ~ is the
address of a string of ASCII characters
representing a path name, terminated by a null
character.

/ open = 5.

The file descriptor should be saved for subsequent calls to read (or wri te) and close.
In both the read and write c'ase the file' pOinter
is set to the beginning of the file.
SEE ALSO

creat(II), read(II), write(II), close(1I)

DIAGNOSTICS

The error bit (c-bit) is set if the file does not
exist, if one of the necessary directories ,does
not exist or is unreadable, if the file is not
readable (resp. writable), or if 10 files are
open.

BUGS

-

1 -

PIPE (II)

1/15/73

PIPE (II)

NAME

pipe

SYNOPSIS

sys pipe
/ pipe = 42.; not in assembler
(f1l~ descriptor in rO)

DESCRIPTION

The E.!.e.! system call creates an I/O mechanism
called a pipe. The file descriptor returned can
be used in both read and write operations. When
the pipe is written, the data is buffered up to
504 bytes at which time the writing process is
suspended. A read on the pipe will pick up the
buffered data.

create a pipe

It is assumed that after the ~ has been set
up, two (or more) cooperating processes (created
by subsequent ~ calls) will pass data through
the pipe with ~ and write calls.
The'shell has' a syntax to 'set up a linear array
of processes connected by pipes.
Read calls on an empty pipe (no buffered data)
with only one end (no synonymous file descriptors
resulting from ~ or dup) return an end~f­
file. Write calls under similar conditions are
ignored.
SEE ALSO

sh{I), read(II), write(II), fork{II)

DIAGNOSTICS

The. error bit (c-bit) i8 set if 10 files are
already .open.

BUGS

-

1 -

QUIT (II)

3/15/72

QUIT (II)

turn off quit signal

NAME

quit

SYNOPSIS

sye quit; flag

DESCRIPTION

When flag is 0, this call disables quit signals
from the typewriter (ASCII FS). When flag is
non-zero, quits are re-enabled, and cause execution to cease and a core image to be produced.

/ quit = 26.

Quits should be turned off only with due consideration.
SEE ALSO

intr{II)

DIAGNOSTICS
BUGS

-

1 -

READ (II)

3/15/72

NAME

read

SYNOPSIS

(file descriptor in rO)
sye read; buffer; nbytes
(nread in rO)

DESCRIPTION

READ (II)

read from file
/ read = 3.

A file descriptor is a word returned from a successful open or creat call.
Buffer is the location of nbytes contiguous bytes
into which the input will be placed. It is not
guaranteed that all nbytes bytes will be read;
for example if the file refers to a typewriter at
most one line will be returned. In any event the
number of characters read is returned in rOe
If rO returns with value 0, then end-of-file has
reached.

be~n

SEE ALSO

open(II), creat(II)

DIAGNOSTICS

As mentioned,rO is 0 on return when the end of
the file has been reached. If the read was
otherwise unsuccessful the error bit (c-bit) is
set. Many conditions, can generate an error:
physical I/O errors, ·bad buffer address, preposterous nbytes, file descriptor not that of an
input file.

BUGS

- 1 -

RELE (II)

RELE (II)

3/15/72

NAME

rele

release processor

SYNOPSIS

sys rele

/ rele = 0;

DESCRIPTION

This call causes the process to be swapped out
immediately if another process wants to run. Its
main reason for being is internal to the system,
namely to implement timer-runout swaps. However,
it can be used beneficially by programs which
wish to loop for some reason without consuming
more processor time than necessary.

SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

not in assembler

SEEK (II)
NAME

seek

SYNOPSIS

(file descriptor in rO)
sys seek; offset; ptrname

DESCRIPTION

SEEK (II)

3/15/72
move read/write pOinter
/ seek = 19.

The file descriptor refers to a file open for
reading or writing. The read (resp. write)
pointer for the file is set as follows:
1f ptrname is 0, the pOinter 1s set to offset.
1f ptrname is 1~ the pointer is set to its
current location plus offset.
if 'ptrname is 2, the pointer 1s set to the
size of the file plus offset.

SEE ALSO
DIAGNOSTICS

The error bit (c-bit) is set for an undefined
file descriptor.

BUGS

A file can conceptually be as large as 2**20
bytes. Clearly only 2**16 bytes can be addressed
by~.
The problem 1s most acute on the large
special files.

-

1 -

SETUID (II)

3/15/72

SETUID (II)

NAME

setuid

SYNOPSIS

(process ID in rO)
sys setu1d / setuid

DESCRIPTION

The user ID of the current process is set to the
argument in rO. Both the effective.and the real
user ID are set. This call is only permitted to
the super-user or if rO is the real user ID.

SEE ALSO

qetuid(II)

DIAGNOSTICS

Error bit (c-bit) is set as indicated.

set process ID

BUGS

- 1 -

= 23.

SLEEP (II)

9/4/72

SLEEP (II)·

NAME

sleep -- stop execution for interval

SYNOPSIS

(seconds in rO)
sys sleep / sleep = 35.; not in assembler

DESCRIPTION

The cur~ent process is suspended from execution
for the number of seconds specified by the contents of register O.

SEE ALSO
DIAGNOSTICS
BUGS

Due to the implementation, the sleep interval is
only accurate to 256 60ths of a second (4.26
sec). Even then, the process is placed on a low
priority queue and must be scheduled.

1

STAT (II)

STAT (II)

3/15/72

NAME

stat

SYNOPSIS

sys stat; name; buf

DESCRIPTION

~

qet file status
/ stat = 18.

pOints to a null-terminated strinq naminq a
file; ~ is the address of a 34(10) byte buffer
into which information is placed concerninq the
file. It is unnecessary to have any permissions
at all with respect to the file, but all directories leadinq to the file must be readable.

After

~,

~

has the followinq format:
i-number
flaqs (see below)
number of links
user ID of owner
size in bytes
first indirect block or contents block

OOf,.+1
+2,+3
+4
+5
+6,+7
+8,+9

•••

+22,+23
+24,+25,+26,+27
+28,+29,+30,+31
+32,+33

eiqhth indirect block or contents block
creation time
modification time
unused

The flaqs are as follows:
100000
040000
020000
010000
000040
000020
000010
000004
000002
000001

used {always on}
directory
..
file has been modified (always on)
large file
set user ID
executable
read, owner
write, owner
read, non-owner
write, non-owner

SEE ALSO

stat(I), fstat(II)

DIAGNOSTICS

Error bit (c-bit) is set if the file cannot be
fOUnd.

BUGS

-

1 -

STIME (II)

3/15/72

STIME (II)

NAME

stime

SYNOPSIS

(time in rO-r1)
sys stim~
/ stime = 25.

DESCRIPTION

st1me sets the system's idea of the time and
date. Only the super-user may use this call.

/SEE ALSO
DIAGNOSTICS

set time

date(I), time(II)
Error bit (c-bit) set if user is not the superuser.

BUGS

1 -

STTY (II)

6/12/72

NAME

stty

SYNOPSIS

(file descriptor in rO)
sys stty; arg / stty = 31 •
arq:

DESCRIPTION

STTY (II)

set mode of typewriter

•••

dcrsr; dctsr; mode
stty sets, mode bits for a typewriter whose file
descriptor is passed in rOe First, the system
delays until the typewriter is quiescent. Then,
the argument dcrsr is placed into the' typewriter's receiver control and status register, and
dctsr is placed in the transmitter control and
status registe~. The DC-11 manual must be consulted for the format of these words. For the
purpose ,of this call, the most important role of
these arguments is to adjust to the speed of the
typewriter.
The ~ ,argument contains several bits which
determine the system's treatment of the
typewriter:
200
100
040
020
010
004
002
001

even parity allowed on input (e. q. for M37s)
odd parity allowed on input
raw mode: wake up on all characters
map CRinto LF; echo LF or CR as LF-CR
echo (full duplex)
map upper case to lower on input (e. q. M33)
echo and print tabs as spaces
inhibit all function delays (e. g. CRTs)'

Characters with the wrong parity, as determined
by bits 200 and 100, are ignored.
In raw mode, every character is passed baCK immediately to the program. No erase or kill pro~
cessing is done; the end-of-file character (EOT),
the interrupt character (DELETE) and the 'quit
character (FS) are not treated specially,.
Mode 020 cause,s input carriage returns to be
turned into new-lines; input of, either CR or LF
causes LF-CR both to be echoed (used for GETermiNet 300's'and other terminals without the newline function).
Additional bits in the high order byte of the
mode argument are used to indicate that the terminal is an IBM 2741 and to specify 2741 modes.
These mode bits are:
400
1000
2000

terminal is an IBM 2741
the 2741 has the transmit interrupt feature
(currently ignored)
use correspondence code conversion on output
-

1 -

STTY (II)

6/12/72
4000

STTY (II)

use correspondence code conversion on input
(currently ignored)

Normal input and output code conversion for 2741s
is EBCDIC (e. g. 963 ball and corresponding keyboard). The presence of the transmit interrupt
feature permits the sys.tem to do read-ahead while
no output is in progress. In 2741 mode, the low
order bits 331 are ignored.
SEE ALSO

stty(I.). gtty(II)

DIAGNOSTICS

The error bit (c-bit) is set if the file descriptor does not refer to a typewriter.

BUGS

This call should be used with care.

-

2 -

SYNC (II)

6/12/72

SYNC (II)
NAME

sync -- update super-block

SYNOPSIS

ays sync

DESCRIPTION

sync causes the super block for all file systems
to be written out. It is only necessary on systems in which this writing may be delayed for a
long time, i.e., those which incorporate hardware
protection facilities.

/ sync

= 36.;

not in assembler

It should be used by programs which examine a
file system, for example check, df, tm, etc.
SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

TIME (II)

3/15/72

NAME

time

SYNOPSIS

sys time / time
(time rO-r1)

DESCRIPTION

!!m!

SEE ALSO

date(I). mdate(II)

TIME (II)

get time of year

= 13.

returns the time since 00:00:00, Jan. 1,
1972, measured in sixtieths of a second. The
high order word is in the rO register and the low
order is in the r1.

DIAGNOSTICS
BUGS

The time is stored in 32 bits.
crisis every 2.26 years.

-

1 -

This guarantees a

TIMES(II)

2/10/73

TIMES{II)

NAME

times -- get process times

SYNOPSIS

sys
•••

times; buffer

/ times = 43.; not in assembler

buffer: .=.+ [24. * 3]
DESCRIPTION

times returns time-accounting information for the
system as a who.!e, for the current process, and
for the terminated child processes of the current
process. All the times are 2-word (32-bit)
numbers, and the unit of measurement is 1/60
second.
After the call, the buffer will appear as
follows:
buffer:
system:
/ a·bsolute time

.=.+4
.=.+4
.=.+4
.=.+4
.=.+4
.=.+4

I total system time
I total swap time
/ other I/O wait time

I idle time

/ total user time

process:
/. (ignore)

.=.+4
.=.+4
.=.+4
.=.+4
.=.+4
.=.+4

I time in system
I (ignore)
/ I/O wait time
/ (ignore)
I processor time

child:
.=.+24.

The format of the "Child" times is the same as
that for the process times; the numbers are the
sum of the times for all terminated direct or
indirect·descendants of the current process.
.

w

.

w

The .absolute time returned i8 the same as that
given by time(II). The "total system times" are
times since the last cold boot.

FILES
SEE ALSO

time(II), time(I)

DIAGNOSTICS
BUGS

-

1 -

3/15/72

UMOUNT (II)

UMOUNT (II)

NAME

umount

SYNOPSIS

sys umount; special

DESCRIPTION

umount announces to the system that special file
special is. no long·er to contain a removable file
system. The file associated with the special
file reverts to its ordinary interpretation (see
mount) •

dismount file system
/ umount = 22.

The user' must take care that all activity on the
file system has ceased.
SEE ALSO

umount(I). mount(II)

DIAGNOSTICS

Error bit (c-bit) set if no file system was
mounted on the special file.

BUGS

Use of this call .should be restricted to the
super-user.

-

1 -

UNLINK (II)

3/15/72

UNLINK (II)

NAME

unlink

SYNOPSIS

sys unlink; name

DESCRIPTION

li!m!! points to a null-terminated string.

SEE ALSO

rm(~),

DIAGNOSTICS

The error bit (c-bit) is set to indicate that the
file does not.exist or that its directory cannot
be written. Write permission is not required on
the file itself. It is also illegal to unlink a
directory (except for the super-user).

remove directory entry
/ unlink = 10.

unlink
removes the entry for the file pOinted to by n!m!
from its directory. If this entry was the last
link to the file, the contents of the file .are
freed and the file is destroyed. If, howeve·r,
the file was open in any process, the actual destruction is· delayed until it· is closed, even
though the directory entry has disappeared.
rmdir(I), link(II)

BUGS

- 1 -

WAIT (II)

9/4/72

WAIT (II)

NAME

wait

SYNOPSIS

eye wait / wait = 7.
(process ID in rO)
(termination status/user status in r1)

DESCRIPTION

!!!.!! causes its caller to delay until. one of its

wait for process to die

child processes terminates. If any child has
died since the last !!!.!!, return is immediate; if
there are no children, return is immediate with
the error bit set. In the case of several children· several waits are needed to learn of all the
deaths.
---If the error bit is not set on return., the r1
high byte contains the low byte of the child process rO when it terminated. The r1 low byte contains the termination status of the process from
the following list:

o
1
2
3

4
5

6
7
8

9
10
11
12
13
14
+16

exit
bus error
illegal instruction
trace trap
lOT trap
power fail trap
EMT trap
bad system cal~
PIR interrupt
floating point exception
memory violation
quit
interrupt
kill (see kill(II»
User I/O {not currently possible}
core image produced

SEE ALSO

exit(II}, fork(II)

DIAGNOSTICS

error bit (c-bit) on if no children not previously waited for.

BUGS

A child which die·s·, but is never waited for consumes a slot in the process table. ',When this
table is full, the system is effectively hunq.

-

1 -

3/15/72

WRITE (II)
NAME
SYNOPSIS

write

write on file

(file descriptor in rO)
sys write; buffer; nbytes

(number written in rOJ

DESCRIPTION

WRITE (II)

/ write = 4.

A file descriptor iea' word returned from a successful open or creat call.
buffer is the address of nbytes contiguous,bytes
which are wri tten on the output file., The number
of characters actually written is returned in rOe
It should be regarded as an error if this is not
the s~me as requested.
Writes which are multiples of 512 characters long
and begin on a 512-byte boundary are more effiCient than any others.

SEE ALSO

c re at ( I I ), ope n ( I I )

DIAGNOSTICS

The error bit (c-bit) is set on an error: bad
descriptor, buffer address, or count; physical
I/O errors.

BUGS

-

1 -

ATAN, ATAN2 (III)

1/15/73

ATAN, ATAN2 (III)

NAME

atan

arc tangent fUnction

SYNOPSIS

jsr

r5,atan[2]

DESCRIPTION

The atan entry returns the arc tangent of frO in
frO. The range is -n/2 to n/2.
The atan2 entry returns the arc tangent of
frO/fr1 in frO. The range is ~ to n.

FILES

kept in /lib/l1ba.a

SEE ALSO
DIAGNOSTICS

there is no error return

BUGS

-

1 -

ATOF (III)

AToF (III)

1/15/73

NAME

atof

ascii to floating

SYNOPSIS

jsr

r5,ateSf; subr

DESCRIPTION

atof will· convert an ascii stream to a floating
number returned in frO.
The subroutine ~ (supplied by the caller) is
called on r5 for each character of the ascii
stream. subr should return the character in rOe
The first-cniracter not used in the conversion is
left in rOe
The only numbers recoqnized are: an optional
minus siqn followed by a strinq of diqits optionally containinq one decim!l"point, then followed
optionally by the letter e followed by a siqned
inteqer.
.
The subroutine
ters.

~

must not disturb any regis-

FILES

kept in /lib/liba.a

SEE ALSO

Calls a toi (III)

DIAGNOSTICS

There are none; overflow results in avery larqe
number and qarbaqe characters terminate the scan.

BUGS

The routine should accept initial "+", initial
blanks, and "E" for "e".
Overflow should be siqnalled with the carry bit.

- 1 -

ATOI (III)

1/15/73

NAME

atoi

ascii to integer

SYNOPSIS

jsr

r5,atoi; subr

"
DESCRIPTION

ATOI (III)

atoi will convert an ascii stream to a binary
number returned in r1.
The subroutine ~ (supplied ~ the caller) is
called on rS for each character of the ascii
stream. subr should return the character in rO.
The firstCharacter not used in the conversion is
left in rO.
The numbers recognized are: an optional minus
sign followed by a string of digits.
The subroutine
ters.

FILES

~

must not disturb any regis-

kept in /lib/liba.a

SEE ALSO
DIAGNOSTICS

There are none; the routine charges on regardless
of consequences; see BUGS.

BUGS

It pays no attention to overflow - you get whatever the machine instructions mul and div happen
to leave in the low order half - in fact, the
carry bit should be set and isn't.
The routine should accept initial " +" and initial
blanks.

-

1 -

COMPAR (III)

1/15/73

COMPAR (III)

NAME

compar -- default comparison routine for qsort

SYNOPSIS

jsr pC,compar·

DESCRIPTION

Compar is the default comparison routine called
by qsort and is separated out so that the user
can supply his own comparison.
The routine is called with the width (in bytes)
of an element in ·r3 and it compares byte-by~byte
the element pointed to by rO with the element
pOinted to by r4.
Return is via the. condition"ced!s, wh!ch ~re
tested by the instructions bIt and bgt. That
i·s, in the absence of overflow, then the condition (rO) < (r4) should leave the Z-bit off and
N-bit on while (rO) > (r4) should leave Z and N
off. Still another way of putting it 1s that
for elements of length 1 the instruction
cmpb

(rO},(r4)

suffices.
Only rO is changed by the call.
FILES

kept in /lib/liba.a

SEE ALSO

qsort (III)

DIAGNOSTICS
BUGS

It could be receded to run faster.

- 1 -

CRYPT (III)

1/15/73

CRYPT (III)

NAME

crypt

SYNOPSIS

mov $key,rO
jsr pc,crypt

DESCRIPTION

On entry, rO should point to a string of characters terminated by an ASCII NULL. The routine
performs an operation 'on the key which is diffic'ult to invert (i.e. encrypts it) and leaves the
resulting eight bytes' of ASCII alphanumerics in a
global cell called "word".

password encoding

Login uses this result as a password.
FILES

kept in /l1b/liba.a

SEE ALSO

passwd(I),passwd(V), login(I)

DIAGNOSTICS

there are none; garbage 1s accepted.

BUGS

- 1 -

CTIME (III)
NAME
SYNOPSIS

1/15/73
ctime

--

convert date and time to ASCII

time
$buffer,r2
pc,ctime

. ays
mov

jar
DESCRIPTION

CTIME (III)

The output buffer is 16 characters long and the
time has the format
.Oct

9 17:32:24\0

The input time must be in the rO and r1 registers
in the form returned by sys ~.
FILES

kept in /lib/liba.a

SEE ALSO

ptime(III), time(II)

DIAGNOSTICS
BUGS

The routine must be reassembled for leap year.
Dec 31 is followed by Dec 32 and so on.

-

1 -

DDS PUT , DDSINIT (III)

1/15/73

DDSPUT, DDSINIT (III)

NAME

ddsput -- put a character on display data set

SYNOPSIS

(file descriptor in rO)
jsr
pc,ddsinit
(character in rO)
jsr
pC,ddsput

DESCRIPTION

These. routines provide an interface to the
Display Data Set, a peculiar device which can be
called by Picturephone sets and. which will
display some of the ASCII character set and certain other graphics on the Picturephone screen.
If the DC11 or other interface hardware is not
already set up to talk to the Display Data Set,
the·ddsinit entry should be called with the appropriate file descriptor in rOe On the only
known DDS att.ached to UNIX,· the associated special file is called "/dev/ttyc". ddsinit also
clears the display.
Thereafter, characters may be displayed by .calling ddsput. To the extent possible, ddsput
simulates an ordinary terminal. Characters falling to the right of the 22X22 screen area are
. ignored; the 23rd line on the screen causes·· the
screen to be erased and that line to be put at
the top of the new display. Certain ASCII characters are interpreted specially as follows:
FF
HT
DC1
DC2
DC3
DC4
SO
S1
CR

clear screen, go to top left
expand to right number· of spaces
treat as reverse line feed (move N)
move cursor 1 place right (move E)
forward line. feed (move S)
backspace 1 position (move w)
enter graph mode .
leave graph mode
put cursor at start of current line

Graph mode allows display of the non-ASCII characters and will be described when hell freezes
over.
Lower-case ASCII·alphabetics are mapped into
upper case. Several ASCII non-alphabetic graphics are unavailable as well. Also the lower
right circle of the "I" character is miss·ing.
Also one of the circuit cards in the DDS has a
crack in it and sometimes it doesn't work. All
in all, it is best to avoid this device.
FILES

kept in /lib/liba.a

SEE ·ALSO

AT&T writeup on DDS
1 -

ECVT, FCVT (III)

1/15/73

NAME

ecvt, fcvt -- output conversion

SYNOPSIS

jsr pc,ecvt

ECVT, FCVT (III)

or
jsr pc,fcvt
DESCRIPTION

Ecvt is called with a floatinq point number in
frO.
O·n exit, the number has been converted into a
string·of ascii digits in a buffer pOinted to by
rO. The number of diiitsprod~ced is controlled
by a global variable _ndigits •
Moreover. the position of the decimal point is
contained in r2: r2=O means the d.p. is at the
left· hand end of the string of digits; r2)0 means
the d.p. is within or to the right of. the string.
The sign of the number is indicated by r1 (0 for
+; 1 for -).
The low order digit has suffered decimal rounding
(i. e. may have been carried into).
FCvt is identical to ecvt, except that the
correct digit has had decimal rounding for F!tyle outeut of the number of digits specified by
_ndigits •

FILES

kept in /lib/liba.a

SEE ALSO

ftoa(III)

DIAGNOSTICS
BUGS

-

1 -

EXP (III)

1/15/73

EXP (III)

NAME

exp

SYNOPSIS

jsr

DESCRIPTION

The exponential of frO is returned in frO.

FILES

kept in /lib/liba.a

exponential function
r5,exp

SEE ALSO
DIAGNOSTICS

If the result is not representable, the c-bit is
set and the largest positive number is returned.
Zero 1s returned if the result would underflow.

BUGS

-.1 -

FTOA (III)

FTOA (III)

1/15/73

NAME

ftoa

floating to ascii conversion

SYNOPSIS

jsr

r5,ftoa; subr

DESCRIPTION

ftoa will convert the floating pOint number in

~into ascii in the form

[-]ddddd.dd*
if poSSible, otherwise in the form

For each character generated by ftoa, the
subroutine ~ (supplied by the caller) is
called on register r5 with the character in rOe
The number of digits can be changed by changing
the value of "_ndigits" in ecvt (default is 10.).
The subroutine
ters.

~

FILES

kept in /11b/liba.a

SEE ALSO

ecvt(III), 1toa(III)

DIAGNOSTICS
BUGS

-

1 -

must not disturb any regis-

FTOO (III)

1/15/73

FTOO (III)

NAME

ftoo

floating to octal conversion

SYNOPSIS

jsr

r5,ftoo; subr

DESCRIPTION

ftoo wil convert the floating pOint number in frO
into ascii in the conventional octal form
000000;000000;000000;000000

For each character generated by ftoo, the
subroutine ~ (supplied by the caller) is
called on register r5 with the character in rO.
The subroutine
ters.
FILES

~

kept in /lib/liba.a

SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

must not disturb any regis-

CONNECT, GERTS (III)

3/15/72

CONNECT, GERTS (III)

NAME

connect, gerts -- Gerts communication over 201

SYNOPSIS

jsr
r5,connect
(error return) .

•••
jsr
r5,gerts; fc; oc; ibuf; obuf
(error return)

•••
other entry points:

gcset, gout

DESCRIPTION

The GCOS GERTS interface is so bad that a
description here is1nappropriate. A~one needing to use this interface should seek divine guidance.

FILES

/dev/dnO, /dev/dpO
kept in /lib/liba.a

SEE ALSO

dn(IV), dp(IV}, HIS documentation

DIAGNOSTICS
BUGS

- 1 -

3/15/72

GETC, GETW, FOPEN (III)
NAME

getw, getc, fopen

SYNOPSIS

mov
jsr

GETC, GETW, FOPEN (III)

buffered input

$filename,rO
rS,fopen; iobuf

jsr
rS,getc; iobuf
(character in rO)
jsr
rS,getw; iobuf
(word in. rO)
DESCRIPTION

These routines are used to provide a buffered
input facility. iobuf is the address of a
S"18( 1 0) byte buffer 'area whose contents are maintained by these routines. Its format is:.
ioptr:

.= .+2

/
/
/
/

.=.+2
.=.+2
.=.+S12.

file descriptor
characters left in buffer
ptr to next character
the buffer

fopen may be' called initially to open the file.·
On return', the error bit ·(c-bit) is set if the
ope·n fa·iled. If fopen is never· called, get will
read from the standard input file.
getc returns the'next byte from the file in rOe
The error bit is set on end of file or a read
error.
getw returns'· the next word i'n rOe getc and getw
may be used alternately; there are no odd/even
problems.
iobuf must be provided by the user; it must be on
a word boundary.
To reuse the same buffer for another file, it is
sufficient to close the original file and call
fopen again.
FILES

kept in /lib/liba.a

SEE ALSO

open(II}, read(II), putC(III)

DIAGNOSTICS

c-bit set on EOF or error

BUGS

-

1 -

HYPOT (III)

6/12/72

HYPOT (III)

calculate hypotenuse

NAME

hypot

SYNOPSIS

movf
movf
jsr
movf

DESCRIPTION

The square root of frO*frO + fr1*fr1 is returned
in frO. The calculation is done in such a way
that overflow will not occur unless the answer is
not representable in floating point.

FILES

kept in /l1b/liba.a

SEE ALSO

sqrt(III )"

DIAGNOSTICS

The c-bit is set if the result cannot be
represented.

a,frO
b, fr1
rS,hypot
frO, •••

BUGS

-

1 -

ITOA (III)

3/15/72

lTOA (III)

NAME

itoa

integer to ascii conversion

SYNOPSIS

jsr

rS,itoaj subr

DESCRIPTION

itoa will convert the number in rO into ascii
deCImal preceded by a - sign if appropriate. For
each character generated by itoa, the subroutine
~ (supplied by the caller) is called on register r5 with the character in rOe
The subroutine
ters.

FILES

~

kept in /lib/liba.a

SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

must not disturb any regis-

LOG (III')

3/15/72

LOG (III)

NAME

log

SYNOPSIS

jsr

DESCRIPTION

The logarithm (base e) of frO is returned in frO.

FILES

kept in /lib/liba.a

logarithm (base e)
rS,log

SEE ALSO
DIAGNOSTICS

The error bit (c-bit) is set if the input argument 1s less than or equal'to zero and the result
is set to the largest negative number.

BUGS

-

1 -

MESG (III)

3/15/72

MESG (III)

NAME

mesq

SYNOPSIS

jar

DESCRIPTION

mesg writes the string ·immediately following its
call onto the standard output file. The string
must be terminated by an ASCII NULL byte.

FILES

kept in /11b/l1ba.a

write message on typewriter
r5.mesg; (Now is the t1me\O); .even

SEE ALSO
DIAGNOSTICS
BUGS

- 1 -

NLIST (III)

6/12/72

NAME

nlist -- get entries from name list

SYNOPSIS

jsr rS,nlist; f1le; list

NLIST (III)

•••

file: '

F
N
V
,..
f
n

v

007
017
027
0·37
047
057
067
077
107
117
127
11 37
1147
1157
1167
1177

bel
8i
etb
us,

/

7

?
G
0

W
q
0

I1

1

wi

dell

DPD (VII)

3/15/72

DPD (VII)

NAME

dpd -- spawn data phone daemon

SYNOPSIS

/etc/dpd

DESCRIPTION

dpd is the 201 data phone daemon. It is designed
to submit jobs to the Honeywell 6070 computer via
the gerts interface.
~

uses the directory /usr/dpd.' The file lOCK
in that directory is used to prevent two daemons
from becoming active. After the daemon has successfully set the lOCK, it forks and the main
path exits, thus spawning the daemon. /usr/dpd
is scanned for any file beginning with df. 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

.2 directs' dpd to generate a unique,. snumb card.
This card is generated by incrementing the
first word of the file /usr/dpd/snumb and converting that to decimal concatenated with the
station ID.
~ specifies that the remainder of the line is

tO,be sent as a literal.
specifies that the rest of the line is a
file name. That file is to be sent as binary
cards.

~

!: is the same as !l except a form feed is
prepended to the file.

11 s'pecifies that the rest of the line is a
file name. After the job has been transmitted, the file is unlinked.
Any error encountered will cause the
drop the call, wait up to 20 minutes
over. This means that an improperly
df file may cause the same job to be
every 20 minutes.

daemon to
and start
constructed
submitted

While waiting, the·daemon checKs· to see that the
lock file still exists. If the lock is gone, the
daemon will exit.
FILES

/dev/dnO, /dev/dpO, /usr/dpd/*

SEE ALSO

opr(I)

DIAGNOSTICS
BUGS

-

1 -

12/11/72

GETTY (VII)

NAME

getty

-- set typewriter mode and get user's name

SYNOPSIS

/etc/getty

DESCRIPTION
getty is invoked by init (VII)· immediately after a typewriter is opened following a dial-in. The user's login
name is read and the 10gin(I) command is called with this
name as an argument. While reading this name getty attempts to adapt the system to the speed and type of terminal being used.
getty initially sets the speed of the interface to 150
baud, specifies that raw mode is to be used (break on
every character), that echo is' to be suppressed, and
either parity allowed. It types the "login:" message
(which includes the characters which put the 37 Teletype
terminal 'into full-duplex and unlock its keyboard). Then
the user's name is read, a character at a time. If a
null character is received, it is assumed to be the
result of the user pushing the ." break " ("
. inter;upt ") ~ey.
The speed is then changed to'300 baud and the login: is
typed again, this time w'i th the appropriate sequence
which puts a GE TermiNet 300 .into full-duplex. This
sequence is acceptable to other 300·baud terminals also.
If a subsequent null 'character is received, the speed is
changed again. The general approach is to cycle through
a set of speeds in response to n~ll characters caused by
breaks. The sequence at this installation is 150, 300,
and 134.5 baud.
Detection of IBM 2741s is accomplished while t~e seeed is
set to 150 baud. The user sends a 2741 style eot character by pushing the attention key or by typing rt'sHrn;
at 150 baud, this character lool<$

\

;

&

However, "*", "[", and "?" are recognized and
glob is called. The main use of msh is to provide a command-executing facility for various
interactive sUb-systems.
FILES
SEE ALSO

sh{I), glob(VII)

DIAGNOSTICS

"?"

BUGS

-

1 -

TABS (VII)

6/15/72

TABS (VII)

NAME

tabs

set tab stops

SYNOPSIS

cat /usr/pub/tabs

DESCRIPTION

When printed on a suitable terminal, this file
will set tab stops every 8 columns. Suitable
terminals include the Teletype model 37 and the
GE TermiNet 300.
These tab stop settings are desirable because
UNIX assumes them in calculating delays.

FILES
SEE ALSO
DIAGNOSTICS
BUGS

-

1 -

2/2/73

VSP (VII)

VSP (VII)

NAME

vsp -- voice synthesizer code

SYNOPSIS

cat /usr/pub/vsp

DESCRIPTION

vsp contains a list of phonemes understood by the
voice synthesizer on device vt. Phonemes are
usually written in the form
. comma inflection phoneme
T·he inflection and the phoneme codes are or-ed
together. The phoneme codes are as follows
(numbers in octal).

o = 300
1

2
3

aw

ie
eO
e1

e2

= 200
= 100
= 000
= 02
= 03
= 04
= 76
= 77
= 05
= 06

er
th
dh = 07
yu = 27
iu = 10
ju = 11
00 = 31

ae
ea
w

= 12
= 13
= 14
= 15
= 16
= 34
= 21
= 20
= 22

t

= 25

01

02
uO
u1
u2
u3

ee = 2'3·
r
= 24

ey
iO
i1
i2

SEE ALSO

= 26
= 30
= 64
= 65

stronq inflection

:eenny Eound
c,2nt·act c,!r
c52nnect
a1 = 52
name came
ai = 37
nimelyaj = 71'
seven' six'
s = 40
~o giet
d = 41
four five
f
= 42
9 = 43 . set grand
hello how.
h = 44
JUdge edge
j
= 45
came lock'
k = 46
hello light
1 = 47
look book
00 = 50
good. shOud
ou = 51
ri.!1Sl angle
ng = 53
zero ha~
z = 55
show shIp
sh = 56
chair £bime.
ch = 57
seven even
v = 60
ball bed
b = 61
nine
seven
n = 62
mile men
m = 63
lie
iy = 66
azure pleasure
zh = 70
station condition
ih =.72
may lay
ay = 36
p

aO

weak inflection
~ful

l~

z.!!:o
~nter

m,!!t

s~ven

sev!!n
weather
~ree·thick

':y:!i s . j:he n
~se yoy
!:!nite
n!!w YQu
,2nly nQ
hell,2
notice
but must
,!!nclest1rryp
app_le ab_le
c,!t s,!t
,!ntenna
won wish
three
!:adio ,Iada£
two time
sixtX eighty
s'ix mix
inept-inside
cryptic static·

= 33

-0 = 35

long space

-1' = 17

-2

-3

speak(I), vt(IV)

-

= 32

1 -

= 01
= 74

short delay

20BOOT (VIII)

1/25/73

20BOOT (VIII)

NAME

20boot

SYNOPSIS

20boot [ ~ ]

DESCRIPTION

This shell command file copies the current version of the 11/20 program used to run the VT01
display onto the /dev/vtO file.

install new 11/20 system

If no argument is given, the 11/20 program should
be executing b~t 'idlel the 11/20 program is sent
preceded by a reboot command. If an argument
is given, the 11/20 should have been restarted at
its ROM. location 777300.
FILES

/dev/vtO;
/sys/mdec/20.o (11/20 program)

SEE ALSO

vtO (IV)

DIAGNOSTICS

-

1 -

ACCT (VIII)

ACCT (VIII)

1/20/73

NAME

acct

SYNOPSIS

~

DESCRIPTION

~

FILES

/usr/adm/wtmp

SEE ALSO

init(VII), login( I), wtmp(V).

DIAGNOSTICS

"cannot open 'wtmp'" if argument is unreadable.

login accounting
[ ~ wtmp]

[~]

[ -d ] people

produces a printout giving connect time for
each user who has logged in during the life of
the current wtmp file. A total is also produced.
~ is used to specify an alternate wtmp file.
~
prints· individual totals; without this option,
only totals are printed. =9 causes a printout
for each midnight to midnight period. The people
argument will limit the printout to only the
specified login names. If no wtmp file is given,
lusr/adm/wtmp is used.

BUGS

-

1 -

BOOT PROCEDURES (VIII)

2/6/73

BOOT PROCEDURES (VIII)

bos, maKi, vcboot, mays, et ale

NAME

DESCRIPTION
On the RF disK, the highest 16K words are reserved for
stand-alone programs., These 1 6K words are allocated as
follows:
bos
Warm UNIX
Cold UNIX

(1 K)

(7K)
(8K)

The program 122.!! (Bootstrap Operating System) examines the
console switches and executes one of'several internal
programs depending on the settinq. The following settings are currently recognized:

???

Will read Warm UNIX from the RF into core location 0 and transfer to 600.

1

Will read Cold UNIX from the RF into core location 0 and transfer to 600.

10

Will dump all of memory from core location 0 onto
DECtape drive 7 and then halt.

20

Will read 256 words from RKO into core 0 and
transfer to zero. This 1s the procedure to boot
DOS from an RK.

40

This is the same as 10 above, but instead of
halting, UNIX warm is loaded.

o

Will load 'a standard UNIX binary paper tape into
core location 0 and transfer to O.

77500

Will load the standard DEC absolute and binary
loaders and transfer to 77500.

All manual methods 'of booting the system involve manipulation of the console switches. In order for this to be
possible, the panel" must be unloCked and the machine must
be halted. Also, remember that at the time UNIX comes
up, the console switches mustconta'in773030 for a
single-user system; anything else gives a multi-user system.
There are, four temperatures of boots.

They are:

Hot boot: restart the system without refreshing its
code, that is Simply by transferring to, its start.
The only use for this procedure is 1f the system has
been patched and one doesn't wish to redo the
patches. The procedure is:
600 in switches
Load address
-

1

BOOT PROCEDURES (VIII)

2/6/73

BOOT PROCEDURES (VIII)

(773030 in switches for single-user system)
start
Warm"boot:"refresh system code from the RF disk, but
the panic routine must be in core. Best for general use if it works,since outstanding I/O is
cleaned up. Procedure:
602 in switches
load address
(773030 ·in switches for single-user system)
start (flushes any I/O, then executes bos)
Cool boot: RF disk is OK, but nothing in core.
Procedure:
UTIL DECtape on drive 0
773030 in switches
load address
(602 -in switches for mul ti-user system)
start
type "boot" on console tty to load bos
Cold boot: nothing in core, nothinq on RF.Best to
have an expert aro~nd for this one. Procedure:
INIT DECtape on drive 0
773030 in switches
load address
1 ·in switches
start
(machine halts. last chance to preserve RF!)
773030 in switches
continue
(reads in basic files)
UNIX is then uP, but .for various reasons, one should
do a warm -boot \ single -user) right·. away. At this
pOint also, one might consider whether the 'INIT tape
UNIX is the latest version •. If there ·is reason for
doubt, mount She /sys dis~ pa'ck, ch-anqe to .directory
/sys/sys, do msys u unix, and reboot. Then get the
/bin-/etc-/lib tape which contains the rest of of the
RF -disk, and do an "mt x". Conceivably, "create
errors" due to lack of some directories will occur;
make the directories, then try again. Set the date
correctly; the system starts off at time O.
At this point UNIX is in full operation and can be
rebooted for a multi-user system.
Here is what happens during a cold boot: the INIT tapecontains a program calledvcboot. The ROM program reads
vcboot from the tape into core location 0 and transfers
to it. vcboot then reads 16K words from the DEC tape
(blocks 1-32) and copies the data to the highest 16K
-

2 -

BOOT PROCEDURES (VIII)

2/6/73

BOOT PROCEDURES (VIII)

words of the RF. Thus this initializes the read-only
part of the RF. vcboot then reads in bos and executes
it. B2! reads in Cold UNIX and executes that. Cold UNIX
halts for a last chance before it completely initializes
the RF file system. When continue is pressed, Cold UNIX
initializes the RF. It then reads the DECtape for initializa·tion files starting from block 33. Normal operation then commences with the execution of " /etc / init " •
The INIT tape is made by the program maki running under
UNIX. !!l21s.! writes vcboot on block 0 O'f7dev/tap7. It
then copies the RF 16K words (using /dev/rfO) onto blocks
1 thru 32. It has internally a list of files to be
copied from block 33 on. This list follows:
/etc/1nit
/bin/chmod
/bin/date
/bin/login
/bin/ls
/bin/mkdir
fete/mount
/bin/sh
/bin/tap
/bin/mt
Thus this is the set of programs available after a cold
boot. init and .!hare mandatory. For multi-user UNIX,
getty and login are also necessary. mkdir is necessary
due to a bug in.tap. IDS,· tap and mount are useful to
bring in new files. As soon'as possible, date should be
done. That leaves Is and chmod as fr.osting.
The last link in this incestuous daisy chain is the program msys.
msys char file
will copy the file !!!! onto the RF read only slot specified by the character~. Char is taken from the following set:

12

bos·
u Warm UNIX
1 Cold UNIX

FILES

/dev/rfO, /dev/tap?

SEE ALSO

init(VII), tap(I), sh(l), mkdir.(I)

DIAGNOSTICS
BUGS

This section is very configuration dependent.

-

3 -

CHECK (VIII)

1/20/73

CHECK (VIII)

NAME

check

SYNOPSIS

••• ] J
1
check will examine a file system, build a bit map
of used blocks, and compare this bit ,map against
the bit map maintained on the fil~ system. If
the file system is not specified, a check of all
of the normally mounted file' systems is performed. output includes the number ,of files on
the file system, the number of these that are
, large', the number of indirect blocks, the
number of used bloCks, and the number of free
blocks.

DESCRIPTION

file system consistency check

check [ filesystem [ blockno

check works by .examining the i-nodes on the file
system and is entirely independent of its directory hierarchy. The file system may be, but need
not be, mounted.
FILES

/dev/rf?, /dev/rk?, /dev/rp?

SEE ALSO

find ( I ), ds CI )

DIAGNOSTICS

Diagnostics are produced for blocks missing,
duplicated, and bad block addresses. Diagnostics
are also produced for, block numbers passed as
parameters. In each case, the block number,
i-number, and block class (~ = inode, ~ indirect,
! free) is printed.

BUGS

The checking process is two pass in nature. If
checking is done on an active file system, extraneous diagnostics may occur.

-

1 -

1/20/73

CHI< (VIII)

CHK (VIII)

NAME

chk -- check + dcheck

SYNOPSIS

chk

DESCRIPTION

This command file does a cheek and
dcheck of
all of the normally mounted file systems.

FILES

/dev/ [fkp]

SEE ALSO

check (VIII), dcheck (VIII)

DIAGNOSTICS

see " SEE ALSO

a

*

..

-

1 -

CLRI (VIII)

1/20/73

NAME

clri

SYNOPSIS

clri i-number [ file system ]

DESCRIPTION

£.!£!

CLRI (VIII)

clear i-node

writes zeros on the. 32 bytes occupied by the
i-node numbered i-number. If the file system
argument is given, the i-node resides·on the·
given device, otherwise on a default file system.
The file system argument must be a special file
name referring to a device containing a file system.
After £lri'nany bloSKs in the affected file will
show up as missing in a cheCK of the file system.
Read and write permission is required on the
specified file system device. The i-node becomes
allocatable.
The primary purpose of this routine is to remove
a file which for some reason appears in no directory.

DIAGNOSTICS

" error"

-

1 -

DCHECK (VIII)

1/20/73

DCHECK (VIII)

NAME

dcheck

SYNOPSIS

dcheck [ -1]

DESCRIPTION

dcheck builds an image of the directory hierarchy
o'f the specified device by reading all its directories (using physical I/O guided by the i-nodes
on the .device). A list entry is made for each
file encount.ered. A second pass reads the inodes and for each file compares the number of
links specified in its i-node with the number of
entries actually seen. All discrepancies are
noted.

directory consistency check
[ device ]

If no device is specified, a default device is
assumed.
The argument -1 causes a complete listing of the
file names on the device in i-node order.
FILES

/dev/rk?

SEE ALSO

check(VIII)

DIAGNOSTICS

inconsistent i-numbers, unnamed files, unreachable files, loops in directory "hierarchy".

BUGS

'Unreachabl! f~les and loops are discovered only
under the -1 option.

-

1 -

DLI (VIII)

3/15/72

DLI (VIII)

NAME

dli -- load DEC binary paper tapes

SYNOPSIS

dli output [input]

DESCRIPTION

dli will load a DEC binary paper 'tape into the
OUtput file. The binary format paper tape is
read from the input file (/dev/ppt is default.)

FILES

/dev/ppt

SEE ALSO
DIAGNOSTICS

"checksum"

BUGS

-

1 -

ISTAT (VIII)

1/20/73

NAME

istat

SYNOPSIS

istat [ filesystem ] inumber1 ..
istat gives information about one or more i-nodes
on the given file system or on /dev/rkO if no
file system is given.

DESCRIPTION

get inode status

ISTAT (VIII)

..

The inf·ormation is in exactly the same form as
that for stat(I), except that mode letter "a" is
used to indicate that the i-node is allocated,
"un that it is unallocated.
FILES

/etc/uids, /dev/rkO

SEE ALSO

stat(I), ls(I) (-1 option)

DIAGNOSTICS
BUGS

istatignores any read error and pretends to give
status even if the file system is not physically
present.

-

1 -

1/20/73

KILL (VIII)

KILL (VIII)

NAME

kill -- terminate process with extreme prejudice

SYNOPSIS

/usr/adm/kill processnumber

DESCRIPTION

~fter

.e.! (q.v.) has given you the unique ID of a
process, you can terminate it by this' command. A
core image is produced in the process's working
directory.

Only the super-user can exercise this privilege.
FILES
SEE ALSO

ps (VIII)

DIAGNOSTICS

yes

BUGS

If the process ha's executed sys nice (II) and
the,re is ·another· process which has not, but which
loops, the first process cannot be done in properly, since it has to be swapped in so as
cooperate in its own murder.
It would also be nice if ordinary people could
kill their own processes.

-

1 -

MOUNT (VIII)

1/20/73

MOUNT (VIII)

NAME

mount

mount file system

SYNOPSIS

/etc/mount special file

DESCRIPTION

mount 'announces to the system that a removable
file system is present on· the device corresponding to special file special (which must refer to
a disk or possibly DEctape). The file must exist
already; it becomes ,the name of the root of the
newly mounted file system.

FILES
SEE ALSO

umount(VIII)

DIAGNOSTICS

"?", if. the special file is already in use, can-

BUGS

Should be usable only by the super-user. Mounting file systems full of garbage can crash the
system.

not be read, or if !!l! does not exist.

-

1 -

PS (VIII)

1/20/73

NAME

ps -- process status

SYNOPSIS

/usr/adm/ps [ ~ ]

PS (VIII)

DESCRIPTION

2! prints certain facts about active processes.

The

information is columnar and consists of:
The (numerical) ID of the user associated with t,he
process;
The last character of·the control typewriter of the
process or "x" if there is no cootiol typewriter; "x"
lines are suppressed unless the x option is given.
The number of 512-byte disk blocks holding the core
image of the process;
The process's unique ID (only with "1" option)
The number of hours (m~ 100) and minutes of system,
disk, and user-process time accumulated by the"Ptocess
and all its terminated descendants (only with t
option)
An' educated guess as to the command line which caused
the process to be created.
Some caveats:
The guess as to the command name and arguments· is obtained by examining the process's stack. The process is
entitled to destroy this information. Also, onl.y
processes whose core images·are on disk have visible
names. The.e.!' ~ommand in particular does not, nor does
any other process which happens to be in core at the same
time. E.! tries to overcome· this limitation bY. spawning a
subprocess designed :to take up the'other core slot, and
is usually successful. Because E.! examines a dynamically
changing data structure, it can produce incorrect
results; for example if a process's core image moves
between the time E! gets i~s disk address and reads its
stack.
Besides its utility for simple spying, B! is the only
plausible way to find the process number of someone you
are trying to kill (VIII).
FILES

/dev/rfO, /sys/sys/unix (to get magic numbers).

SEE ALSO

kill (VIII)

DIAGNOSTICS

if a bad swap address turns up; various
missing-file diagnostics.

BUGS

As described.

..Bad RF . ,

-

1 -

SALV (VIII)

1/20/73

NAME

salv -- file system salvage

SYNOPSIS

/etc/salv filesystem [ -akfs ]

DESCRIPTION
salv

SALV (VIII)

place a given file system in a consistent state
almost no loss of information.' This is the first
step in putting things together after a bad crash. Salv
performs the following functions:

WIt'h

wil~

A valid free list is constructed.
The previous step is always performed; the following
steps are performed only if the "a" option is given.
the file system·s only defect is missing blocks, "a"
should not be specified.

If

All bad pointers in the file system are zeroed.
All duplicate pointers to the same block are resolved
by changing one Qf the pointers to point at a new
block containing a copy of the data.
Inodes . (not directory entries) for special files are
generated (mode 16).
File's whose size, is too large for the number of blocks
they contain (after bad pOinters are zeroed) have
their size revised downward.
The file system should be unmounted while it is being
salvaged. In cases of extreme need the permanently
mounted file system may be salvaqed; in such a case the
system must be rebooted before it has a chance to write
out the old, bad super-block.
" "f" t and " s " options tell salvwhat magic
The' "k,
numbers to use to generate the size of the free list and
the i-node map. !'k" 1s default (RK disk); "f" .is RF; '"s"
isRK with swap space on it. If sa1vis to be used away
from the mother system its code should be checked to verify the numbers.
,

'

After a salv, files may be safely created and.removed
without causing more trouble. If the "a" option had to
be used, a dcheck (VIII) should be done to find the degree of the damage to the hierarchy.
SEE ALSO check(VIII), dcheck(VIII)
BUGS

In only one (known) way does salv destroy information: if
some rand0W block appea,s to be an indirect block for a
file, all bad pOinters (for example, ASCII text) in it
will be zeroed. If the block also appears in another
file, it may be scribbled on before it is copied.
-

1

SU (VIII)
NAME

. 1/20/73

su

SU (VIII)

become privileged user

SYNOPSIS
DESCRIPTION

su allows one to become the super-user, who has
all sorts of marvelous (and correspondingly
dangerous) powers. In order for su to do its
magic, the user must supply a password •. If the
password is correct, su will execute the shell
with the UID set to that of th~·super-user. To
restore normalUID privileges, type an end-offile to the super-user shell.
To remind the super-user of his responsibilities,
the shell substitutes "," for its usual prompt

"%" •
FILES
SEE ALSO

sheIl

DIAGNOSTICS

" Sorry " if password is wrong

BUGS

-

1 -

SWTMP (VIII)

2/11/73

SWTMP (VIII)

NAME

swtmp -- update accounting file

SYNOPSIS

swtmp

DESCRIPTION

This shell sequence concatenates /tmp/wtmp onto
/usr/adm/wtmp and truncates /tmp/wtmp. It should
be used before using acct{VIII). and every so
often in any case if accounting is to be maintained.
.

FILES

/tmp/wtmp, /usr/adm/wtmp

SEE ALSO

acct(VIII), wtmp(V)

- 1 -

UMOUNT (VIII)

1/20/73

NAME

umount

SYNOPSIS

/etc/umount special

DESCRIPTION

UMOUNT (VIII)

dismount file system

umount announces to the system that the removable
·file system previously mounted on special file
special 1s to be removed.
The u'ser must take care not only that all I/O
activity on the file system has ceased, but that
no one has his current directory on it.
Only the super-user may issue this command.

FILES
SEE ALSO

mount(VIII)

DIAGNOSTICS

"?"

BUGS

This command 1s not, in fact, restricted to the
super-user.

-

1 -

TM (VIII)

TM (VIII)

3/15/72

provide time information

NAME

tm

SYNOPSIS

.En

DESCRIPTION

tm is used to provide timing information.
like the following is given:
tim 371 :51:09
. ovh 20:00:33
swp 13 :43 :20
dsk 27:14:35
.idl 533:08:03
usr 24:53:50
der
0, 54

Output

2:00.8
17.0
4.6
4.5
1 : 33.3
1 .2
0
0,

The first' column of numbers gives totals in the
named categories since the last time the system
was cold-booted; .the second column gives .the
changes since the lasttimetm- was invoked •. The
top left number is badly truncated and should be
ignored. ~ is time spent executing in the
system; swp is time waiting for swap I/O; dsk is
time spent waiting for file syst.em disk I;O:;-idl
is idle time; ~ is user execution time; der is
RFdisk error count (left number) and RK disk
error count (riqht number).
FILES

/dev/rfO (for absolute times); /tmp/ttmp for differential timing history.

SEE ALSO

time(I), file system(V)

DIAGNOSTICS
BUGS

-

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:21 14:08:08-08:00
Modify Date                     : 2013:11:21 14:57:26-08:00
Metadata Date                   : 2013:11:21 14:57:26-08:00
Producer                        : Adobe Acrobat 9.55 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:d1f4fad7-10a1-1448-a5da-89d67eb03cc4
Instance ID                     : uuid:74102f57-b96c-7d4b-91b7-a3424c394ae5
Page Layout                     : SinglePage
Page Mode                       : UseOutlines
Page Count                      : 276
EXIF Metadata provided by EXIF.tools

Navigation menu