4.2_BSD_Section_1 4.2 BSD Section 1

4.2_BSD_Section_1 manual pdf -FilePursuit

4.2_BSD_Section_1 4.2_BSD_Section_1

User Manual: 4.2_BSD_Section_1

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

Download4.2_BSD_Section_1 4.2 BSD Section 1
Open PDF In BrowserView PDF
INTRO(I)

UNIX Programmer's Manual

INTRO(l)

NAME

intro - introduction to commands
DESCRIPTION

This section describes publicly accessible commands in alphabetic order. Certain distinctions of
purpose are made in the headings:
(I)
Commands of general utility.
(I C)

Commands for communication with other systems.

(10)

Commands used primarily for graphics and computer-aided design.

N.B.: Commands related to system maintenance used to appear in section 1 manual pages and
were distinguished by (1M) at the top of the page. These manual pages now appear in section

8.
SEE ALSO

Section (6) for computer games.

How to get started, in the Introduction.
DIAGNOSTICS

Upon termination each command returns two bytes of status, one supplied by the system giving
the cause for termination, and (in the case of 'normal' termination) one supplied by the program, see wait and exit(2). The former byte is 0 for normal termination, the latter is customarily 0 for successful execution, nonzero to indica~e troubles such as erroneous parameters,
bad or inaccessible data, or other inability to cope with the task at hand. It is called variously
'exit code', 'exit status' or 'return code', and is described only where special conventions are
involved.

7th Edition

18 January 1983

1

ADB (1)

ADS (1 )

UNIX Programmer's Manual

NAME

adb - debugger
SYNOPSIS
adb [-w] [ - k] [ -Idir ] [objfil [ corfil ] ]
DESCRIPTION
Adb is a general purpose debugging program. It may be used to examine files and to provide a
controlled environment for the execution of UNIX programs.
Obi/il is normally an executable program file, preferably containing a symbol table; if not then
the symbolic features of adb cannot be used although the file can still be examined. The
default for obi/il is a.out. Corjil is assumed to be a core image file produced after executing
obj/it, the default for corjil is core.

Requests to adb are read from the standard input and responses are to the standard output. If
the - w flag is present then both obi/il and corjil are created if necessary and opened for reading
and writing so that files can be modified using adb.
The - k option makes adb do UNIX kernel memory
UNIX crash dump or Idevlmem

mapping~

it should be used when core is a

The -I option specifies a directory where files to be read with $< or $< < (see below) will be
sought~ the default is lusrllibladb.
Adb ignores QUIT; INTERRUPT causes return to the next adb command.

In general requests to adbare of the form
[address] [, count] [command] [;]

If address is present then dot is set to address. Initially dot is set to O. For most commands
count specifies how many times the command will be executed. The default count is 1. Address
and count are expressions.

The interpretation of an address depends on the context it is used in. If a subprocess is being
debugged then addresses are interpreted in the usual way in the address space of the subprocess. If the operating system is being debugged either post-mortem or using the special file
Idevlmem to interactive examine and/or modify memory the maps are set to map the kernel virtual addresses which start at Ox80000000 (on the VAX). ADDRESSES.
EXPRESSIONS

The value of dot.

+

The value of dotincremented by the current increment.
The value of dot decremented by the current increment.

"

The last address typed.

integer A number. The prefixes 00 and 00 (u zero oh") force interpretation in octal radix~ the
prefixes Ot and OT force interpretation in decimal radix; the prefixes Ox and OX force
interpretation in hexadecimal radix. Thus 0020 = 0t16 = Ox10 == sixteen. If no
prefix appears, then the default radix is used; see the $d command. The default radix i~
initially hexadecimal. The hexadecimal digits are 0123456789abcdefABCDEF with the
obvious values. Note that a hexadecimal number whose most significant digit would
. otherwise be an alphabetic character must have a Ox (or OX) prefix (or a leading zero if
the default radix is hexadecimal).
integer.fraction
A 32 bit floating point number.
, ecce'

The ASCII value of up to 4 characters. \ may be used to escape a '.

4th Berkeley Distribution

18 July 1983

ADB (1)

UNIX Programmer's Manual

ADB (I )

< name

The value of name, which is either a variable name or a register name. Adb maintains a
number of variables (see VARIABLES) named by single letters or digits. If name is a
register name then the value of the register is obtained from the system header in
corji!. The register names are those printed by the $r command.

symbol A symbol is a sequence of upper or lower case letters, underscores or digits, not starting
with a digit. The backslash character \ may be used to escape other characters. The
value of the symbol is taken from the symbol table in obj/il. An initial _ will be
prepended to symbol if needed.

_ symbol
In C, the 'true name' of an external symbol begins with _. It may be necessary to utter
this name to distinguish it from internal or hidden variables of a program.

routine. name
The address of the variable name in the specified C routine. Both routine and name are
symbols. If name is omitted the value is the address of the most recently activated C
stack frame corresponding to routine. (This form is currently broken on the V AX~ local
variables can be examined only with dbx(I).)

.(exp ) The value of the expression expo
Monadic operators

",. exp The contents of the location addressed by exp in corfi!.
@exp The contents of the location addressed by exp in obj/il.
- exp Integer negation.
- exp
# exp

Bitwise complement.
Logical negation.

Dyadic operators are left associative and are less binding than monadic operators.

e1 + e2 Integer addition.
e1- e2 Integer subtraction.
e1*e2 Integer multiplication.
e1%e2 Integer division.
e1&e2 Bitwise conjunction.
eJi e2 Bitwise disjunction.
e1#e2 E1 rounded up to the next multiple of e2.
COMMANDS
Most commands consist of a verb followed by a modifier or list of modifiers. The following
verbs are available. (The commands '?' and '/' may be followed by '*'~ see ADDRESSES for
further details.)

?I

Locations starting at address in obj/il are printed according to the formal f. dot is incremented by the sum of the increments for each format letter (q. v.).

/1

Locations starting at address in corfi! are printed according to the format land dot is
incremented as for '?'.

== I

The value of address itself is printed in the styles indicated by the format f. (For i format'?' is printed for the parts of the instruction that reference subsequent words,)

4th Berkeley Distribution

18 July 1983

2

ADS (1)

UNIX Programmer's Manual

ADB (1)

A format consists of one or more characters that specify a style of printing. Each format character may be preceded by a decimal integer that is a repeat count for the format character. While
stepping through a format dot is incremented by the amount given for each format letter. If no
format is given then the last format is used. The format letters available are as follows.
o 2

04
q 2
Q4
d 2
D4
x 2
X4
u 2
U4
f 4
F 8
b 1
c 1
C 1

s n

S

n

Y4

i n

a 0
/
?

==

p

Print 2 bytes in octal. All octal numbers output by adb are preceded by O.
Print 4 bytes in octal.
Print in signed octal.
Print long signed octal.
Print in decimal.
Print long decimal.
Print 2 bytes in hexadecimal.
Print 4 bytes in hexadecimal.
Print as an unsigned decimal number.
Print long unsigned decimal.
Print the 32 bit value as a floating point number.
Print double floating point.
Print the addressed byte in octal.
Print the addressed character.
Print the addressed character using the standard escape convention where control characters are printed as "X and the delete character is printed as A?
Print the addressed characters until a zero character is reached.
Print a string using the " X escape convention (see C above). n is the length of
the string including its zero terminator.
Print 4 bytes in date format (see ctime(3».
Print as machine instructions. n is the number of bytes occupied by the
instruction. This style of printing causes variables 1 and 2 to be set to the
offset parts of the source and destination respectively.
Print the value of dot in symbolic form. Symbols are checked to ensure that
they have an appropriate type as indicated below.
local or global data symbol
local or global text symbol
local or global absolute symbol

4

Print the addressed value in symbolic form using the same rules for symbol
lookup as a.
t 0
When preceded by an integer tabs to the next appropriate tab stop. For example, 8t moves to the next 8-space tab stop.
r 0
Print a space.
n 0
Print a newline.
• ...• 0 Print the enclosed string.
Dot is decremented by the current increment. Nothing is printed.
Dot is incremented by 1. Nothing is printed.
+
Dot is decremented by 1. Nothing is printed.
newline
Repeat the previous command with a count of 1.

[ ? I] I value mask
Words starting at dot are masked with mask and compared with value until a match is
found. If L is used then the match is for 4 bytes at a time instead of 2. If no match is
found then dot is unchanged~ otherwise dot is set to the matched location. If mask is
omitted then -1 is used.
[ ? Ih... value ...

4th Berkeley Distribution

18 July 1983

3

ADB (1)

UNIX Programmer's Manual

ADB (1)

Write the 2-byte value into the addressed location. If the command is W, write 4 bytes.
Odd addresses are not allowed when writing to the subprocess address space.
[111m bl el j1[1/1

New values for (bl, el, j1) are recorded. If less than three expressions are given then
the remaining map parameters are left unchanged. If the ~?' or ~I' is followed by ~*'
then the second segment (b2, e2, 12) of the mapping is changed. If the list is terminated by ~?' or ~I' then the file (obj/ilor codil respectively) is used for subsequent
requests. (So that, for example, ~/m?' will cause ~I' to refer to obj/i/J

> name Dot is assigned to the variable or register named.
A shell Ubin/ sh) is called to read the rest of the line following ~!'.

Smodifier
Miscellaneous commands. The available modifiers are:

I
1
r
b
c

d
e

w
s
o
q
v
m
p

Read commands from the file t If this command is executed in a file, further
commands in the file are not seen. If lis omitted, the current input stream is
terminated. If a count is given, and is zero, the command will be ignored. The
value of the count will be placed in variable 9 before the first command in lis
executed.
'
Similar to < except it can be used in a file of commands without causing the
file to be closed. Variable 9 is saved during the execution of this command,
and restored when it completes. There is a (small) finite limit to the number
of < < files that can be open at once.
Append output to the file f, which is created if it does not exist. If lis omitted,
output is returned to the terminal.
Print process id, the signal which caused stoppage or termination, as well as the
registers as Sr. This is the default if modifier is omitted.
Print the general registers and the instruction addressed by pc. Dot is set to pc.
Print all breakpoints and their associated counts and commands.
C stack backtrace. If address is given then it is taken as the address of the
current frame instead of the contents of the frame-pointer register. If C is
used then the names and (32 bit) values of all automatic and static variables are
printed for each active function. (broken on the VAX). If countis given then
only the first count frames are printed.
Set the default radix to address and report the new value. Note that address is
interpreted in the (old) current radix. Thus "lOSd" never changes the default
radix. To make decimal the default radix, use "Otl0Sd".
The names and values of external variables are printed.
Set the page width for output to address (default 80).
Set the limit for symbol matches to address (default 255).
All integers input are regarded as octal.
Exit from adb.
Print all non zero variables in octal.
Print the address map.
(Kernel debugging) Change the current kernel memory mapping to map the
designated user structure to the address given by the symbol _u. The address
argument is the address of the user's user page table entries (on the VAX).

: modifier
Manage a subprocess. Available modifiers are:
be

Set breakpoint at address. The breakpoint is executed counr-l times before
causing a stop. Each time the breakpoint is encountered the command c is executed. If this command is omitted or sets dot to zero then the breakpoint

4th Berkeley Distribution

18 July 1983

4

ADB (1 )

UNIX Programmer's Manual

ADB (1)

causes a stop.
d

Delete breakpoint at address.

r

Run objfil as a subprocess. If address is given explicitly then the program is
entered at this point~ otherwise the program is entered at its standard entry
point. count specifies how many breakpoints are to be ignored before stopping.
Arguments to the subprocess may be supplied on the same line as the command. An argument starting with < or > causes the standard input or output
to be established for the command.

cs

The subprocess is continued with signal s, see sigvec(2). If address is given
then the subprocess is continued at this address. If no signal is specified then
the signal that caused the subprocess to stop is sent. Breakpoint skipping is the
same as for r.
'

ss

As for c except that the subprocess is single stepped count times. If there is no
current subprocess then objfil is run as a subprocess as for r. In this case no
signal can be sent; the remainder of the line is treated as arguments to the subprocess.

k

The current subprocess, if any, is terminated.

VARIABLES

Adb provides a number of variables. Named variables are set initially by adb but are not used
subsequently. Numbered variables are reserved for communication as follows.

o
1
2
9

The
The
The
The

last value printed.
last offset part of an instruction source.
previous value of variable 1.
count on the last $< or $< < command.

On entry the following are set from the system header in the cor./il. If cor./il does not appear to
be a core file then these values are set from objfil.
b
d
e
m
s
t

The
The
The
The
The
The

base address of the data segment.
data segment size.
entry point.
\magic' number (0407, 0410 or 0413).
stack segment size.
text segment size.

ADDRESSES

The address in a file associated with a written address is determined by a mapping associated
with that file. Each mapping is represented by two triples (bl, el, fl) and (b2, e2, /2) and the
./ile address corresponding to a written address is calculated as follows.

bl ~ address< el => ./ile address= address + fl-bl, otherwise,
b2~ address< e2 = > ./ile address= address + P - b2,
otherwise, the requested address is not legal. In some cases (e.g. for programs with separated I
and D space) the two segments for a file may overlap. If a ? or / is followed by an • then only'
the second triple is used.
The initial setting of both mappings is suitable for normal a.out and core files. If either file is
not of the kind expected then, for that file, bl is set to 0, e 1 is set to the maximum file size and
f1 is set to 0; in this way the whole file can be examined with no address trans.lation.
FILES

a.out
core

4th 'Berkeley Distribution

18 July 1983

5

ADD (1)

UNIX Programmer's Manual

ADD (1 )

SEE ALSO

ceO), dbxO), ptrace(2), a.out(S), core(S)
DIAGNOSTICS

'Adb' when there is no current command or format. Comments about inaccessible files, syntax
errors, abnormal termination of commands, etc. Exit status is 0, unless last command failed or
returned nonzero status.
BUGS

Since no shell is invoked to interpret the arguments of the :r command, the customary wildcard and variable expansions cannot occur.

4th Berkeley Distribution

18 July 1983

6

ADDBIB(l)

UNIX Programmer's Manual

ADDBIB (1)

NAME

add bib - create or extend bibliographic database
SYNOPSIS

addbib [-p promptfile] [-a] database
DESCRIPTION

When this program starts up, answering "y" to the initial "Instructions?" prompt yields directions; typing "n" or RETURN skips them. Addbib then prompts for various bibliographic fields,
reads responses from the terminal, and sends output records to a database. A null response
(just RETURN) means to leave out that field. A minus sign (-) means to go back to the previous field. A trailing backslash allows a field to be continued on the next line. The repeating
"Continue?" prompt allows the user either to resume by typing "y" or RETURN, to quit the
current session by typing "n" or "q", or to edit the .database with any system editor (vi, ex,
edit, ed).

The -a option suppresses prompting for an abstract; asking for an abstract is the default.
Abstracts are ended with a CTRL-d. The -p option causes addbib to use a new prompting
skeleton, defined in promp{jiie. This file should contain prompt strings, a tab, and the key-letters
to be written to the database.
The most common key-letters and their meanings are given below. Addbib insulates you from
these key-letters, since it gives you prompts in English, but if you edit the bibliography file later
on, you will need to know this information.
%A
%B
%C
%D
%E
%F

Author's name
Book containing article referenced
City (place of publication)
Date of publication
Editor of book containing article referenced
Footnote number or label (supplied by refer)
Government order number
%0
%H
Header commentary, printed before reference
Issuer (publisher)
%1
%J
Journal containing article
Keywords to use in locating reference
%K
Label field used by - k option of refer
%L
Bell Labs Memorandum (undefined)
%M
Number within volume
%N
Other commentary, printed at end of reference
%0
Page number(s)
%P
Corporate
or Foreign Author (unreversed)
%Q
Report, paper, or thesis (unpublished)
%R
%S
Series title
%T
Title of article or book
%V
Volume number
Abstract - used by roJlbib, not by refer
'¥oX
%Y,Z ignored by refer

Except for 'A', each field should be given just once. Only relevant fields should be supplied.
An example is:
%A
%T
%1

Bill Tuthill
Refer - A Bibliography System
Computing Services

4th Berkeley Distribution

18 July-1983

1

UNIX Programmer's Manual

ADDBIB (1)

%C
%D
%0

ADDBIB (1)

Berkeley
1982
UNX 4.3.5.

FILES

promptfile

optional file to define prompting

SEE ALSO
refer (I) , sortbib(I), roftbib(I), indxbib(I), lookbib(I)
AUTHORS
Al Stangenberger, Bill Tuthill

4th Berkeley Distribution

18 July 1983

2

AI,l ,USERS( 1)

UN IX Programmer's Manual

ALLUSERS (1)

NAME

aBusers - print list of all authorized users
SYNOPSIS

aBusers
DESCIUPTION
Aflusers prints a neatly formatted list of authorized users of this .Unix system, giving login name

and lltH nalllC. Those accounts that thc program can rccognize as non-human are notcd.
If you want the resul tl) sortcd, you can typc
al1uscrs I sort
to gct the list sortcd alphabetically by uscr-namc.
Heuristic to recognize non-humans is simpJc"mindcd
Sorting by last name is hard to do, so this program can't.

7th Edition

1

ALTOLOt\D(l)

UNIX Programmer's Manual

AI:l'OLOAI)( I)

NAME

altoload - load files from an AltoFTP "dump" format file
SYNOPSIS

altolmld dumpfile
DEScnlPTION

The AltoVrp program can write collections of files into a single host file (called "dumping"), and
can retrieve files from a dump file (called "loading".) The a//u/o(fd program allows you to "load"
lex/fi/es only from a dump file.
The dump file must be on the Unix filesystem; this can be done either by lIsing jip(1) to retrieve a
dump-folmat file from another host, or by lIsing t.he Alto FTP program to write a dump me
directly on the Unix filesystem.
\\'hen invoked with the name of the dump file as an argument, a/lo/vad will" prompt you with the
name of each component file, at which point you can do one of three things: .
Type the name of a file to be written with the dump component file.
Type a newline; this will cause the a file to be written with the name of the component.
Type a ._'; this will cause t.he·component file to be skipped.

1\11 filenames are interpreted relative to the current working directory, and will be truncated to the
lIsual maximum length.
SEE ALSO

ftp(1)
DIAGNOSTICS .

Mostly self-explanatory (failure to open, read, or write a file). Input files in improper format will
give error messages about "Unknown block types".
AUTlIOl{

Jeffrey Mogul
BUGS

Text files only.
Dump component Illes 11l.b assembler component of cc68

SYNOPSIS

as6S [ -godspe11 filename
DESCIUPTION

As68 is the 68000 assemblcr. The input is taken from filename.a68, if present, otherwise from
filename. The output is sent to filenamc.b. More than one input file can be specified, but only a
single output is generat.ed. The available flags are
-g
Undefined symbols are automatically declared global for later resolution by the loader.
';-o:filcn~i;mc

-d
-s
-I)
-c
-I

';

Direct output to filename.
Print info helpful for debugging the assembler
Put symbol t.able in list.out (rc1ocawblc values only)
Print listing on stdout
External symbols only in output
produces a listing, filename. list

FILES

lusrlsun/a68 lusr/bin/as68 lusrlsun/doc/aG8opcodcs
SEE ALSO

cc68 0), pc68(l), IdG8 (1).

7th Edition

MC68000

1

AT(I)

UNIX Programmer's Manual

AT( 1)

NAME

at - execute commands at a later time
SYNOPSIS

at time [ day ] [file ]
DESCRIPTION
At squirrels away a copy of the named file (standard input default) to be used as input to sh(1)
(or csh(1) if you normally use it) at a specified later time. A cd command to the current direc-

tory is inserted at the beginning, followed by assignments to all environment variables (excepting the variable TERM, which is useless in this context.) When the script is run, it uses the
user and group ID of the creator of the copy file.
The time is 1 to 4 digits, with an optional following 'A', 'P', 'N' or 'M' for AM, PM, noon or
midnight. One and two digit numbers are taken to be hours, three and four digits to be hours
and minutes. If no letters follow the digits, a 24 hour clock time is understood.
The optional day is either (1) a month name followed by a day number, or (2) a day of the
week; if the word 'week' follows invocation is moved seven days further off. Names of months
and days may be recognizably truncated. Examples of legitimate commands are
at 8am jan 24
at 1530 fr week
At programs are executed by periodic execution of the command lusrlliblatrun from cron(8).
The granularity of at depends upon how often atrun is executed.
Standard output or error output is lost unless redirected.
FILES

/usr /libl atrun

executor (run by cron(8».

in lusr/spool/at:
yy .ddd.hhhh.•
lasttimedone
past

activity for year yy, day dd, hour hhhh.
last hhhh
activities in progress

SEE ALSO

calendar(1), pwd(1), sleep(1), cron(8)
DIAGNOSTICS

Complains about various syntax errors and times out of range.
BUGS

Due to the granularity of the execution of lusrlliblatrun, there may be bugs in scheduling things
almost exactly 24 hours into the future.

4th Berkeley Distribution

18 January 1983

1

AWK(I)

UNIX Programmer's Manual

AWK (1)

NAME

awk - pattern scanning and processing language
SYNOPSIS

.1fk [ - Fe] [prog] [file ] ...
DESCRIPTION
Awk scans each input file for lines that match any of a set of patterns specified in prog. With
each pattern in prog there can be an associated action that will be performed when a line of a
file matches the pattern. The set of patterns may appear literally as prog, or in a file specified as
-f file.

Files are read in order; if there are no files, the standard input. is read. The file name '-'
means the standard input. Each line is matched against the pattern portion of every patternaction statement; the associated action is performed for each matched pattern.
An input line is made up of fields separated by white space. (This default can be changed by
using FS, vide infra.) The fields are denoted SI, S2, ... ; SO refers to the entire line.
A pattern-action statement has the form
pattern { action }
A missing { action} means print the line; a missing pattern always matches.
An action is a sequence of statements. A statement can be one of the following:
if ( conditional ) statement [ else statement ]
while ( conditional ) statement
for ( expression; conditional; expression) statement
break
continue
{ [ statement ] ... }
variable .. expression
print [ expression-list] [ >expression ]
printf format [ , expression-list] [ >expression ]
next
# skip remaining patterns on this input line
exit
# skip the rest of the input
Statements are terminated by semicolons, newlines or right braces. An empty expression-list
stands for the whole line. Expressions take on string or numeric values as appropriate, and are
built using the operators +, -, ., /, %, and concatenation (indicated by a blank). The C
operators + +, - -, +:111, - =-, • =-, / .. , and %.. are also available in expressions. Variables
may be scalars, array elements (denoted xli» or fields. Variables are initialized to the null
string. Array subscripts may be any string, not necessarily numeric; this allows for a form of
associative memory. String constants are quoted "... ".
The print statement prints its arguments on the standard output (or on a file if > file is present),
separated by the current output field separator, and terminated by the output record separator.
The prinifstatement formats its expression list according to the format (see printj(3S».
The built-in function length returns the length of its argument taken as a string, or of the whole
line if no argument. There are also built-in functions exp, log, sqrt, and into The last truncates
its argument to an integer. substr(s, m, n) returns the n-character substring of s that begins at
position m. The function sprintj(fmt, expr, expr, .. .) formats the expressions according to the
printj(3S) format given by Imt and returns the resulting string.
Patterns are arbitrary Boolean combinations 0, II, &&, and parentheses) of regular expressions
and relational expressions. Regular expressions must be surrounded by slashes and are as in
egrep. Isolated regular expressions in a pattern apply to the entire line. Regular expressions
may also occur in relational expressions.

7th Edition

18 January 1983

1

AWK(I)

UNIX Programmer's Manual

AWK(l)

A pattern may consist of two patterns separated by a comma; in this case, the action is performed for all lines between an occurrence of the first pattern and the next OCcurrence of the
second.
A relational expression is one of the following:
expression matchop regular-expression
expression relop expression
where a relop is any of the six relational operators in C, and a matchop is either" (for contains)
or r (for does not contain). A conditional is an arithmetic expression, a relational expressio'n,
or a Boolean combination of these.
The special patterns BEGIN and END may be used to capture control before the first input line
is read and after the last. BEGIN must be the first pattern, END the last.
A single character c may be used to separate the fields by starting the program with
BEGIN { FS -= "cIt }
or by using the - Fe option.
Other variable names with special meanings include NF, the number of fields in the current
record; NR, the ordinal number of the current record; FILENAME, the name of the current
input file; OFS, the output field separator (default blank); ORS, the output record separator
(default newline); and OFMT, the output format for numbers (default "%.6g").
EXAMPLES

Print lines longer than 72 characters:
length> 72
Print first two fields in opposite order:
{ print $2, $1 }
Add up first column, print sum and average:
{ s + =- $1 }
END {print "sum is", s, " average is", s/NR }
Print fields in reverse order:
{ for (i -= NF; i

>

0; -- -0 print $i )

Print all lines between startlstop pairs:

Istattl, Istopl
Print all lines whose first field is different ftom previous one:
$1 !:II prev { print; prev = $1 }
SEE ALSO

lex(l), sed(l)
A. V. Aho, B. W. Kernighan, P. J. Weinberger, Awk ..... a pattern seamting and processing
language

BUGS
There are no explicit conversions between numbers and strings. To force an expression to be
treated as a number add 0 to it; to force it to be treated as a' string concatenate"" to it

7th Edition

18 January 1983

2

BACKUP(I)

UNIX Programmer's Manual

NAME

backup - make a backup version copy of a

BACKUi> ( 1).

me

SYNOPSIS
b~lCkup [ -q ] [

-w ] [ -u ] files ...

DESCRIPTION

This command is lIsed to generate a backup version of a file, according to the convention we have
adopted: backup versions have the original filename, tnll1cated if necessary, with the characters" .v"
and a digit string appended. The version numbers run in increasing order, starting at one.
For example, given the input filename "program.c", backup will copy it to "progrmn.c.vl" if no file
with that name exists already. Otherwise, it will attempt successively higher version numbers until

it finds an unused one.
The resultant copy will normally have the same access mode as the originat except that 110 users
will have write access. I f the access mode of the original file cannot be detcrlnined, the resultant
file will have a mode of 0444 (1'- -r- -1'.- -)~ that is, read access to all, only.

If all goes well, the name and access mode of the new file will be reported on the
unless the - q (quiet) option is given ..

~landard

output,

The following options are recognized:

.,

-q

(Quiet) -- do not report anything on the standard output (errors still go to
the standard error stream.
.

-w

(a1\ow Write) -- do not remove write access from backup file; that is, the
backup file gets the same access that Lhe original had.

-u

(Uns
A

_ + <__ >=- ._ /_ 0/0- A_

.. ==

Statements
E
{S; ... ;S}
if ( E ) S
while ( E ) S
for ( E ; E ; E ) S
null statement
break
quit
Function definitions
define L ( L ,... , L ) {
auto L, ... , L
S; ... S
return ( E )
Functions in
s(x)
c(x)
e (x)
l(x)
a (x)
j (n,x)

7th Edition

-I math library
sine
cosine
exponential
log
arctangent
Bessel function

1 April 1981

1

BC(l)

UNIX Programmer's Manual

J;\C ( 1 )

All function arguments are passed by value.
The value of a statement that is an expression is printed unless the main operator is an assignment. Either semicolons or newlines may separate statements. Assignment to scale influences
the number of digits to be retained on arithmetic operations in the manner of de(I). Assignments to ibase or obase set the input and output number radix respectively.
The same letter may be used as an array, a function, and a simple variable simultaneously. All
variables are global to the program. 'Auto' variables are pushed down during function calls.
When using arrays as function arguments or defining them as automatic variables empty square
brackets must follow the array name.
For example
scale" 20
define e(x) {
auto a, b, c, i, s
a =- 1
b = 1
s= 1
for(i-I; 1==1; i++){
a == a.x
b == b*i
c == alb
if(c == 0) return(s)
s == s+c
:III

defines a function to compute an approximate value of the exponential function and
for (i = 1; i < .. 10; i + +) e (i)
prints approximate values of the exponential function of the first ten integers.
Be is actually a preprocessor for de(I), which it invokes automatically, unless the -c (compile
only) option is present. In this case the dc input is sent to the standard output instead.
FILES

lusrllib/lib.b mathematical library
dc(l)
desk calculator proper
SEE ALSO

dc(I)
L. L. Cherry and R. Morris,

Be ..... An arbitrary precision desk-calc"llator language

BUGS
No &&, 1.1, or ! operators.
For statem.ent must have all three E's.
Quit is interpreted when read, not when executed.

7th Edition

I April 1981

2

BIBTEX(l)

UN IX Programmer's Manual

BIBTEX(l)

NAME

bibtex - lnake a LaTeX bibliography
SYNOPS1S

hibtcx auxnmnc
DESCRIPTION

Bib/ex reads the top-level auxilliary (.aux) file output during the running of latex (1) and creates a
bibliography (.bbl) file that can be included in the I,aTeX source file. The auxnamc on the command line should be given without an extension. Each \cite in the source file is looked up in
bibliography files to gather together those lIsed in the document. Then a bibliography style file is
executed to write a \thebibliography environment.

The source file should have defined the bibliography (.bib) files to search with the \bibliography
command. and the bibliography style (.bst) file to execute with the \bibsty1e conllnand. Biblex
incorporates the path searching mechanism described in the manual page for ·lex (I). It searches the
TEXINPU'fS path for .aux, .bbl. and .bst files.
The bibliography file format is a subset of that allowed in Scribe bibliographies. Only the delimiter
pairs {... } and ....... are allowed inside entries. Rntries themselvcs can be dclimil·::!d by (. .. ) also.
The = sign between field names and ficld valucs is not optional.
It is intended that there will eventually be bibliography style files capablcs of handling all the entry
types and field names allowed in Scribe bibliographies. At thc moment, ther.e is only a very preliminary style file called cacm.bst, available in the standard TeX directory.
SEE ALSO

latcx( 1), tcx(l).

BUGS
The cacm style file is really just a skeleton so far.
IIISTORY

Written by Oren Patashnik under lhe direction of Lcslie Lamport. Ported to Uj\;IX by Howard
Trickcy, June 1984. .

7th Edition

1 .

BIFF (1)

UNIX Programmer's Manual

BIFF ( 1 )

NAME

biff - be notified if mail arrives and who it is from
SYNOPSIS

biff [ yn ]
DESCRIPTION

BiD'informs the system whether you want to be notified when mail arrives during the current
terminal session. The command

biff y
enables notification; the command

biff n
disables it. When mail notification is enabled, the header and first few lines of the message will
be printed on your screen whenever mail arrives. A Hbiff y" command is often included in the
file . login or .profile to be executed at each login.
BiD' operates asynchronously. For synchronous notification use the MAIL variable of sh( 1) or
the mail variable of csh(1).
SEE ALSO

csh(I), sh(I), maiI(l), comsat(SC)

4th Berkeley Distribution

IS July 1983

1

BINMAIL(l)

UNIX Programmer's Manual

BINMAIL (1)

NAME

binmail - send or receive mail among users
SYNOPSIS

Ibin/mail [ + ] [ -I ] [ person] ...
Ibln/mail I + I [ -i ] -f file

DESCRIPTION

Note: This is the old version 7 UNIX system mail program. The default mail command is
described in Mai!(I), and its binary is in the directory /usr/ucb.
mail with no argument prints a user's mail, message-by-message, in last-in, first-out order; the
optional argument + displays the mail messages in first-in, first-out order. For each message,
it reads a line from the standard input to direct disposition of the message.
newline
Go on to next message.
d
Delete message and go on to the next.
p
Print message again.
Go back to previous message.
s [file] ...
Save the message in the named files ('mbox' default).
w [file] ...
Save the message, without a header, in the named files ('mbox' default).
m [person] ...
Mail the message to the named persons (yourself is default).
EOT (control-D)
Put unexamined mail back in the mailbox and stop.
q
Same as EOT.
!command
Escape to the Shell to do command.
•
Print a command summary.
An interrupt normally terminates the mail command; the mail file is unchanged. The optional
argument -I tells mail to continue after interrupts.
When persons are named, mail takes the standard input up to an end-of-file (or a line with just
'. ') and adds it to each person's 'mail' file. The message is preceded by the sender's name and a
postmark. Lines that look like postmarks are prepended with '>'. A person is usually a user
name recognized by login (I). To denote a recipient on a remote system, prefix person by the
system name and exclamation mark (see uucp(IC».
The -f option causes the named file, for example, 'mbox', to be printed as if it were the mail
file.
When a user logs in he is informed of the presence of mail.
nLES

/etc/passwd
/usr/spool/mail/.
mbox
/tmp/ma/usr/spool/mail/• .Iock
dead.letter

7th Edition

to identify sender and locate persons
incoming mail for user •
saved mail
temp file
lock f()r mail directory
unmailable text

16 November 1979

1

BINMAIL(1 )

UNIX Programmer's Manual

BINMAIL(l)

SEE ALSO

Mait(I), write(1), uucp(1C), uux(1C), xsend(1), sendmail(8)

BUGS
Race conditions sometimes result in a failure to remove a lock file.
Normally anybody can read your mail, unless it is sent by xsend(l). An installation cart overcome this by making mail a set-user.. id command that owns the mail directory.

7th Edition

16 November 1979

2

nO[SE( 1)

BOISE(l)

UNIX Programmer's Manual

NAME

boise -- send files to the HP2680a printer using TCP
SYNOPSIS

boise [ options] [ files]
DESCRIPTION

.

rrhe boise program reads each fi]e specified, prepends a header, and sends it off to the Boise printer.
If no files are specified, boise sends its standard input to the printer.
Currently, the Boise printer can print text and DVI files. Please do not scnd it Press files. The program will recognize filenrune extensions ".dvi" and ".press" (currently, Press files arc thrown away
by the printer).
The available options include:
-b banner
Uses "banner" to label the output. It will appear on the cover page on the
line labeled "File:".

-c n
-n name

-r

Causes n copies of the output to be printed. The defitllit is to print one
copy.
Causes the given name to be used as the delivery address of your output
(the "For user:" field on the cover sheet). This default') to your full name.
Causes the output to be rotated 90 degrees on the page (landscape mode).
This is good for output that requires a wide page.

-v

-w
-s server
-p port
-m mode

Verbose mode. Boise will print a line on the standard error describing
what was done with each file.
Specifics that the files to be printed are in 'Vaits (Sail) Ascii instead.of
standard Ascii.
Specifies what server the files are to be sent to. Server may be the name
. of allY Internet host. The default is, of course, "boise".
Specifics which port on the server nwchine the Ales are to be sent to, in
decimal. The dcf~lll1t is 35. .It is probably not lIseful to change this.
Specifies a print moor other than derault, where 1 is DVl, 2 is Press, and 3
is l-l P2680a.

SEE ALSO

pl(l), cat(l)
DIAGNOSTICS

Most are self-explanatory. The message "Connection timed out" means the printer server did not
respond, probably because it is down.

7th Edition

LOCAl.

1

B'fROFF(l)

UNIX Programmer's Manual

BTROFF(l)

NAME

btrotT - troff to the ItnPrint printer
SYNOPSIS

btrolT [ /rvffopt.ions ] [ flags] [file ... ]
DESCRIPTION

Rtroff nl11S trqlJ(l) in an environment to produce typeset output .on the Boise printer. It uscs the
calboise pf()gram to convert to DVr fbrmat.
Besides the Iro.tTflags, the following is recognized:
- ell
Print n copies.
Jroff(l), .boise(I), catboise(l).
BUGS

Not all characters are handled optimally. Italic spacing tends to be a little tight. Cut marks fall
just outside the page boundaries, thus t.he tlrst set 0 f cut marks is lost and all subsequent ones fall at
the bottom of the prcceeding page. Backwards motion across page boundaries, as is sometimes
done in Ibl. will calise errors.

7th Edition

LOCAL

1

BUILDMAKE( 1)

UN IX Programmer's Manual

nu ILDMAKE ( 1)

NAME

buildmakc - preprocessor to provide extended syntax for Inakefiles
SYNOPSIS

bnildnmkc [ -f filename -Dxl = yl -Dx2 = y2 ... ]
DE..l5CI{IPTJON

Buildll1ake is a preprocessor that translates "buildfiles" into makefiles for use by the make(1) program. A btlildfUe has the same syntax as a makcfile, with the addition of two features. A line of
the form" #inc1ude filename" causes the named file to be inserted in the output, replacing the
# include directive. An # ifllcfi' #elsel # cndif construct is also available, allowing sections of a
buildfile to be conditionally included in the constl1lcted makcfile depending on whether it has
;d~fiQe<;l ~! given symbol. ~t the point the, # if\tcf is seen, as showp ))cl~)w.

NAMEl=yes
#ifoef NAME!
This will be included in the output
·#else NAMEl
This will not be included
#endif NAMEl
#iflief N'/\ME2
This will not be included unless NAME2 is defined elsewhere
#cndif NAME2
The - D command line option is used to define symbols on the command line. The option
-DNAME=valuc calls,,~s the line "NAME:::: value" to be inserted in the constructed make file. and
callsesNAME to hc considered "defined" in subsequent #,ifdcf~ti.llemenls.
Th(.~

- f option is lIsed to speci fy the' name of lhe input file, which defaults to "buildfile." The output file is always named "makcl1lc."

SEE AI.SO

make(l)
AlJTUOI{

Marvin Theimer, Stanford.

7th Edition

4 April 1984

1

CAL (1)

CAL (1)

UNIX Programmer's Manual

NAME

cal - print calendar
SYNOPSIS

cal [ month] year
DESCRIPTION
Cal prints a c.alendar for the specified year. If a month is also specified, a calen~ar just for that

month is printed. Year can be betweep,land 9999. The month is a
The calendar produced is that for England and her colonies.

num~r

between 1 and 12.

Try September 1752.

BUGS
The year is always considered to start in January even though this is historically naive.
Beware that 'cal 78' refers to the early Christian era, not the 20th century.

7th Edition

29 March 1982

1

CALEN(l)

UNIX Programmer's Manual

Ci\tJ~N (1.)

NAME

calcn - print largc-format calendar
SYNOPSIS

c(llen [ month ] year [ length] [ -

0 ]

DFBCRIPTION

Calell ptints a calendar, one page per month, on the standard output. You can pipe the output into
a program such as boise(I) or cz(l) to get hardcopy, but since the (}utputis 132 columns wide, you
should use "landscape" mode (i.e~, the - r flag) with either of these programs.
If only one numeric argument is specified, it is assumed to be the year; a calendar is generated for
the entire year. If two numeric arguments are given, the first is k1ken to be a Inonth, and the calendar is generated for that month only. I f three numeric arguments are given, the last one specifics
the number of months for which a calendar should be printed, starting with the month specified by
the first two argument').
A mOl1th argument should be between 1 (January) and 12 (December). A ycar argument should be
between 1753 (the start of the Gregorian calendar) and 9999: if it is less than 100, then it is treated
as part of the 20th century. For example, "84" corresponds to 1984.
If the - () flag is given, the output will contain backspaces and overstrikes to emphasize month and
year. Note that neither Boise nor the Dover can handle this.
EXAf\11PLES

ealen 84
printl\ a calendar for 1984
ealen 6 84
printl\ a calendar for June. 1984
ealen 7 1984 6
prints a calendar for July through December, 1984
AUTII()I~

1\. W. Rogers

7th Edition

1 .

CALENDAR ( 1 )

UNIX Programmer's Manual

CALENDAR ( 1 )

NAME

calen.dar - reminder service
SYNOPSIS

calendar [ - ]
DESCRIPTION

Calendar consults the file 'calendar' in the current directory and prints out lines that contain
today's or tomorrow's date anywhere in the line. Most reasonable month-OaY dates such as
'Dec. 7,' 'december 7,' '12/7,' etc., are recognized, but not '7 December' or '7112'. If you
give the month as "." with a date, i.e. ". 1", that day in any month will do. On weekends
'tomorrow' extends through Monday.
When' an argument is present, calendar does its job for every user who has a file 'calendar' in
his login directory and sends him any positive results by rnai/O). Normally tbis is done daily in
the wee hours under control of cron(8).
The file 'calendar' is first run through the "C" preprocessor, /Iiblcpp, to include any other
calendar files specified with the usual "#include" syntax. Included calendars will usually be
shared by all users, maintained and documented by the local administration.
FILES

calendar
/usr/lib/calendar to figure out today's and tomorrow's dates
/ etc/passwd
,/tmp/cal.
/lib/cpp, egrep, sed, mail as subprocesses
SEE ALSO

at(1), cron(S), maiI(l)

BUGS

Calendar's extended idea of 'tomorrow' doesn't account for holidays.

Provisional4.2BSD

29 March 1982

1

CAT(I)

UNIX Programmer's Manual

CAT ( 1)

NAME

cat - catenate and print
SYNOPSIS

cat [ -u ] [

-0 ] [

-s ] [ -v ] file ...

DESCRIPTION

Cat reads each file in sequence and displays it on the standard output. Thus
cat file
displays the file on the standard output, and
cat file 1 file2

> file3

concatenates the first two files and places the result on the third.
If no input file is given, or if the argument '-' is encountered, cat reads from the standard
input file. Output is butTered in 1024-byte blocks unless the standard output is a terminal, in
which case it is line butTered. The -u option makes the output completely unbuffered.

The - 0 option displays the output lines preceded by lines numbers, numbered sequentially
from 1. Specifying the -b option with the - 0 option omits the line numbers from blank lines.
The -5 option crushes out multiple adjacent empty lines so that the output is displayed single
spaced.
The -v option displays non-printing characters so that they are visible. Control characters
print like AX for control-x; the delete character (octal 0177) prints as A? Non-ascii characters
(with the high bit set) are printed as M- (for meta) followed by the character of the low 7 bits.
A -e option may be given with the -v option, which displays a '$' character at the end of
each line. Specifying the -t option with the -v option displays tab characters as AI.
SEE ALSO

cp(I), ex(I), moreO), pr(I), tail(I)

BUGS
Beware of 'cat a b

4th Berkeley

Distrib~tion

> a' and

'cat a b

> b',

which destroy the input files before reading them.

18 January 1983

1

CATHO ISf~ ( 1 )

UNIX Programmer's Manual

CATBOlSE( 1)

NAME
catboise - convert CI A/T files to DVr format and print on Boise
SYNOPSIS

cathoisc [ options] [ file ]
DESCIlIPTION

ea/boise converts jill'. which should be in C/ A/T format (Le. IndToutput); to DVI format foj' printing on the Boise printer. If no file name is given, the standard input is used. The options are:
-- ell
-:- h

Prints n copies.
The next argument is printed on the banner page to identify this listing.

- i

The next argument is the name of the output file.

- v

Produces more verbose output..

- d

Produces extensive oUfput for debugging.

- C

The Ilext argument is the name of a character mapping table. It will be assumed to be in a
standard directory ullless it begins with I. If not given, "catab" is used.

If the - i nag is not lI~ed. the output is wrilten to a temporary file and. upon completion of processing. buise(l) is called to pl'oCCSS the output of ell/boise. The - v and -- d nags will be passed on to
boise if specified.

Since the - band - c nags are mcrely passed to boise, they have no effect if

~i

is used.

FIL"~S

Itmp/dvi??????
SEE ALSO

boise( 1), btroftlO

BUGS
Not all symbols are handled property.
Boxes generated by fbi sometimes are drawn over several pages, the text being filled in separately.
This is impossihle to do Oil 'a page printer without ext.ellsive sorting, which is not done.
Many millor pmbl~H1s occur because of the dillcrcllce in resolution hetween the CI AIT phototypcsl'lter and Boise.
AlJ11101~S

This program has been rewritten morc times than you want t() know.

7th Edition

LOCAl.

1 .

CATDVI(l)

UN lX Programmer's Manual.

CAT))VI (1)

NAMI~:

catdvi - convert CI A/T files to DV[ format
SYNOPSIS

catdvi [ options 1[ file ]
DESCIUPTJON
caldvi converts file. which should be in CI A/T format (i.e.

In!!! olltput), to DVI format for printing on an Imprint-IO printer. If no file name is given, the standard input is used. The options arc:
- ell

Print')

- b

The next argument is printed on the banner page to identify this listing.

- i

The next argument is the name of the,o~~tput file!

- v

Produces more verbose output.

- d

Produces extensive output for debugging.

-C

The Ilext argument is the Ilame of' a character mapping table. It will be assumed· to be in a
standard directory unless it begins with I. If not given, "catab" is used.

II

copies.

I f the - i nag is not used, the oUlput is writtell to a temporary file and, upon completion of processing, the input (CI All') file is unlinked and dviimp is called to process the output of caldvi. The - v
and -d /lags will be passed on to t/viill1jJ if spec Hied.

Since the - band - c

nag~

arc merely passed to dviilnp. thcy have no encct if - i is used.

FILES

Ilmp/dvi???'r!?
SEE ALSO

dvi imp(1), itroll{ l)
BUGS

Not all symbols are handled properly.
Boxes generated by, fbI sometimes are drawn ovcr several pages, thc text being filled ion sClKlratcly.
This is impossibk'. to do' 011 " page printer withollt exlcnsive sorting, which is not donc.

Many minor problems occur because of the dillcrence in resolulion belweell the CI A/T phototypesetter and thc I M PI{ I NT-I O.
AUTII()I~

Imagcn Corp.

7th Edition

LOCAL

1

UNiXProgrammer~s,Manual

CB(I)

'CB·(l)

NAME

cb -Cprogrambeautifter
SYNOPSIS

cb
DESCRIPTION

Cbplacesa copy of the C program from the s.tandardinput on .the standard ,output with spacing
and indentation that displays the structure of the ,program.

7th Edition

18' .January 1983

1

CC(l)

UN[X Programmer's Manual

CC(l)

NAMI~

cc -- C compiler
SYNOPSIS
C(.' [

option] ... fi1e ...

DESCHIPTION

Cc is the UNIX C compiler. Cc accepts several types of arguments:

Arguments whose names end with' .c' arc taken to be C source progrmns; tl1ey ('ire compiled, and
each object program is left on the me whose name is that of the sourcc with '.0' substituted for '.c'.
Thc '.0' file is normally deleted, howcver, if a single C progranl is compiled and loaded all at one
go,

1n: the' same w'lY,' ,~rgllnlents' wh~)sc ;laiilcs 'c,~d 'with
and arc assembled, producing a ',0' me.

'.s' (I,:e la~dl to' be asscmbly sourcc programs

The f()llowing options arc interprctcd by cc. Sce /d(l) for load-lime opti~)\1s.
- c

Suppress the loading phase of the compilation, and f()rce an object file to be produced
even if only one program js compiled.

- g

I-lave the compiler produce additional symbol table information for db.x(I). Also pass the
-Ig nag to hl( 1).

- go

J-'Iavc t.he compiler produce additional symbol table inf()nn,ltion for the obsolete dcbugger
sdb( 1). t\ Iso pass t.he -Ig flag to IdeO.

- w

Suppress warning diagnostics.

- p

Arrange for the compiler to produce code which COllnts the number of tillll.!s each routine
is called. If loading takes place, replace the standard startup routine by one which
automatically calls lIlollitorU) at the slmt and arranges to write out a IIIOII.Out file at norIllal tcnnirlr a V kernel environment.
This is
- i/usrlsun/lib/tcmnfoot.b - T 10000 and -IV at the end.

equivalent

to

specifying

Link for a Macintosh environment.
This is equivalent to specifying
- i/usrlsun/lib/crtmac.b - T 0 - c _shut - r - d and -lm4lc -Ie at the end.
- 0 output
Name the final output file ou/put. ]f this option is lIsed and the file 'b.out' already exists
it will be left undisturbed.
-Ix
Include libx.a as a library Id68 should search in for undefined functions. x may he more
than one letter, as in -Ipup.
-m

- T org Org specifics in hexadecimal where to begin loading the program.

- c cn/rypoilll
Entrypoint specifics where to begin execution.
-()name=de!
-DnallZe

DeHne the name to the preprocessor, as if by '#define'. If no definition is given, the
name is defined as "1".
-Ullame

Remove any initial definition of name.
-Idi,.

'ltincludc' files whose names 0'0 not begin with 'I'are always sought first in the direc.tory
of the .file argument, thcn iti directories named in -I options, thell in directories 011 a
standard list. The standard list. is (in order of search) l/ls,.lsUI/I ;nclude and lusrl ;/ldtule.

-Us/ring

Find substitute compiler passes in the nics named slr;ng with the suflixes cpp, ccom and
c2. If slr;ng is empty, usc a standard backup vcrsion.IWhich doesn't work!]
- t[r)012]
I'ind only the des~gnated compiler passes in the files whose names ,Ire constructcd by a
- n option. In the absence of a - B option, the slrillg is tlken to be '/usr/c/'.
- - x

By deHllIlt, cc68 passes a - x flag to Id68, in order to suppress local symbols from thc final
symbol table. The - - x flag inhibits this def:'U11t.
Other ilrgllll1ents ,Ire taken to he either loader option argulllents, or C-col11p.s translator component of cc68

SYNOPSIS

ccom68 [ -lXp ]
11ESCUII)TION

Ccom68 is the UN IX C compiler modified for the MC68000. It takes its input from stdin and the
resulting assembly code is printed on stdout.
The -1 option generates line numbers in the output. The -p option causes the profile forming
instruction ttjbsr mcount" to be insclted at the entry to each function; The latter option must be
preceded by X, which signals that it is a pass 2 option.

-: Fi L~i'; -:

.~

."

. -

•

t. 1

lusrlsun/c68 lusr/bin/ccom68
SEE

AL..~O

cc68 (I)

7th Editioll

MC68000

1

CD(l)

UNIX Programmer's Manual

CD(l)

NAME

cd - change working directory
SYNOPSIS

cd directory
DESCRIPTION

Directory becomes the new working directory. The process must have execute (search) permission in directory.
Because a new process is created to execute each command, cd would be ineffective if it were
written as a normal command. It is therefore recognized and executed by the shells. tn csh(I)
you may specify a list of directories in which directory is to be sought as a subdirectory if it is
not a subdirectory of the current directory; see the description of the cdpath variable in csh (1) .
SEE ALSO

csh(l), sh(I), pwd(l), chdir(2)

4th Berkeley Distribution

5 April 1980

1

CHECKNEWS ( 1 )

UNIX Programmer's Manual

CHECKNEWS ( 1 )

RAIlE

checknews - check to see if user has news
SYNOPSIS

checJmewa [ ynqevv] [readne'UB options ]
DBSCldPllON

chec1cnews reports to the user whether or not he bas news.
y
Reports "There is news" if the user has news to read.
n
Reports "No news" if there isn't any news to read.
q
causes checknews to be quiet. Instead of printing a message, the exit
status indicates news. A status of 0 means no news, 1 means there is
news.
alters the y message to show the name of the first newsgroup containing unread news. Doubling v (e.g. vv) will cause an explanation of any
claim of new news, and is useful if checknews and readnews disagree
on whether there is news.
e
Executes readneus(l) if there is news.
If there are no options, yis the default.
-/.newsrc
/usr/lib/news/active

Active newsgroups
Options and list of previously read articles

SEE ALSO

inews(l). postnews(l), readnews(l)

4th Berkeley Distribution

28 ~uly 1983

1

CHECKNR(l)

UNIX Programmer's Manual

CHECKNR(l)

NAME

checknr - check nroff/troff files
SYNOPSIS

ehecknr [

-5 ] [

-f) [ -a.x1.y1.x2.y2 ..... xn.yn] [ -c.x1.x2.x3 .... xn ] [file .. _

DESCRIPTION

Checknr checks a list of nroff(I) or troff(I) input files for certain kinds of errors involving
mismatched opening and closing delimiters and unknown commands. If no files are specified,
checknr checks the standard input. Delimeters checked are:
Font changes using \fx ... \fP.
(2)
Size changes using \sx ... \sO.
(3)
Macros that come in open ... close forms, for example, the .TS and .TE macros which
must always come in pairs.
Checknr knows about the ms(7) and me(7) macro packages.
Additional pairs of macros can be added to the list using the -a option. This must be followed
by groups of six characters, each group defining a pair of macros. The six characters are a
period, the first macro name, another period, and the second macro name. For example, to
define a pair .BS and .ES, use -a.BS.ES
(1)

The -c option defines commands which would otherwise be complained about as undefined.
The -f option requests checknr to ignore \f font changes.
The -s option requests checknr to ignore \s size changes.

Checknr is intended to be used on documents that are prepared with checknr in mind, much the
same as lint. It expects a certain document writing style for \f and \s commands, in that each
\fx must be terminated with \fP and each \sx must be terminated with \sO. While it will work
to directly go into the next font or explicitly specify the original font or point size, and many
existing documents actually do this, such a practice will produce complaints from checknr. Since
it is probably better to use the \fP and \sO forms anyway, you should think of this as a contribution to your document preparation style.
SEE ALSO

nroff( 1), troff( 1), checkeq (1), ms (7), me (7)
DIAGNOSTICS

Complaints about unmatched delimiters.
Complaints about unrecognized commands.
Various complaints about the syntax of commands.
AUTHOR

Mark Horton
BUGS

There is no way to define a 1 character macro name using - a.
Does not correctly recognize certain reasonable constructs, such as conditionals.

4th Berkeley Distribution

5 April 1980

1

CHFN (I)

UNIX Programmer's Manual

CHFN (1)

NAME

chfn - change finger entry
SYNOPSIS

chfn [loginnameJ
DESCRIPTION

C/ifn is used to change information about users. This information is used by the" finger program, among others. It consists of the user's "real life" name, office room number, office
phone number, and home phone number. C/ifn prompts the user for each field. Included in
the prompt is a default value, which is enclosed between brackets. The default value is
accepted simply by typing . To enter a blank field, type the word 'none'. Below is a
sample run:
Namta (BUf Studsworth III:
Room number (Exs: 597E or 197C) II: 521E
Office Phone (Ex: 1632) II: 1863
Home Phone (Ex: 987532) (57715461: none

C/ifn allows phone numbers to be entered with or without hyphens. Because finger only knows
about VCB extensions, c/ifn will insist upon a four digit number (after the hyphens are
removed) for office phone numbers. Also, room numbers must be in Evans or Cory~ again,
this is because of finger.
It is a good idea to run finger after running c/ifn to make sure everything is the way you want it.
The optional argument loginname is used to change another person's finger information. This
can only be done by the super-user.
FILES

letc/passwd, letc/ptmp
SEE ALSO

finger (I ), passwd (5)

BUGS
The encoding of the office and extension information is installation dependent.
For historical reasons, the user's name, etc are stored in the passwd file. This is a bad place to
store the information. Rumors are that a data base is being developed to store this information.
but don't hold your breath.
Because two users may try to write the passwd file at once, a synchronization method was
developed. On rare occasions, a message that the password file is "busy" will be printed. In this
case, c/ifn sleeps for a while and then tries to write to the passwd file again.

4th Berkeley Distribution

17 March 1982 deprecated

CHGRp·(·l )

UNIX Programmer's Manual

tHORP (1·)

NAME

chgrp - change group
SYNOPSIS

chirp [ -f ] group file ...
DESCRIPTION

Chgrp changes the group~ID 'of the jilestogroup. The group
'group name found in thegroup-ID file.

may be either ·a decimalGID or a

The user invoking chgrp .must belong to the specified group and be the owner of the Hie, or be
the super-user.
No errors are reported when the - f (force) option is given.
FILES

letc/group
SEE ALSO

chown(2) ,passwd(S), group(S)

4th Berkeley Distribution

28 A,pril 1982

UNIX Programmer's Manual

CHMOD(l)

CHMOD(I)

NAME

chmod - change mode
SYNOPSIS

chmod mode file ...
DESCRIPTION

The mode of each named file is changed according to mode, which may be absolute or· symbolic.
An absolute mode is an octal number constructed from the OR of the following modes:
4000
2000
1000
0400
0200
0100
0070
0007

set user ID on execution
set group ID on execution
sticky bit, see chmod(2)
read by owner
write by owner
execute (search in directory) by owner
read, write, execute (search) by group
read, write, execute (search) by others

A symbolic mode has the form:
[who] op permission lop permission] ...

The who part is a combination of the letters u (for user's permissions), I (group) and 0 (other).
The letter a stands for all, or 010. If who is omitted, the default is a but the setting of the file
creation mask (see umask (2» is taken into account.
Op can be + to add permission to the file's mode, permission absolutely (all other bits will be reset).

to take away permission and - to assign

Permission is any combination of the letters r (read), w (write), x (execute), s (set owner or
group id) and t (save text - sticky). Letters u, I or 0 indicate that permission is to be taken
from the current mode. Omitting permission is only useful with - to take away all permissions.

EXAMPLES

The first example denies write permission to others, the second makes a file executable:
chmod 0 - w file
chmod +x file
Multiple symbolic modes separated by commas may be given. Operations are performed in the
order specified. The letter s is only useful with u or g.
Only the owner of a file (or the super-user) may change its mode.
SEE ALSO

Is(1), chmod(2), stat(2) , umask(2), chown(8)

7th Edition

18 January 1983

1

CHSH (1)

UNIX Programmer's Manual

CHSH(1 )

NAME

chsh - change default login shell
SYNOPSIS

chsh name [ shell·]
DESCRIPTION

Chsh is a cOlnmand similar to passwd( 1) except that it is used to change the login shell field of
the password file rather than the password entry. If no shell is specified then the shell reverts to
the default login shell Ibinlsh. Otherwise only Ibin/Csh, Ibinloldcsh, or lusrlnewlcsh can be specified
as the shell unless you are the super-user.
An example use of this command would be
chsh bill Ibinl csh
SEE ALSO

csh(1), passwd(1) , passwd(S)

4th Berkeley Distribution

21 October 1980

CI(l)

UNIX Programmer's Manual

CI(l)

NAME

ci - check in RCS revisions
SYNOPSIS

d [ options ] file ...
DESCRIPTION

Ci stores new revisions into RCS files. Each file name ending in ',v' is taken to be an ReS file,
all others are assumed to be working files containing new revisions. Ci deposits the contents of
each working file into the corresponding RCS file.
Pairs of RCS files and working files may be specified in 3 ways (see also the example section of
co

(1».

1) Both the RCS file and the working file are given. The RCS file name is of the form
pathl/work/ile, v and the working file name is of the form path2Iwork/ile, where pathl/ and path2/
are (possibly different or empty) paths and work/ile is a file name.
2) Only the RCS file is given. Then the working file is assumed to be in the current directory
and its name is derived from the name of the RCS file by removing pathl/and the suffix ',v'.
3) Only the working file is given. Then the name of the ReS file is derived from the name of
the working file by removing path2/ and appending the suffix ',v'.
If the RCS file is omitted or specified without a path, then ci looks for the ReS file first in the
directory .IRCS and then in the current directory.
For ci to work, the caller's login must be on the access list, except if the access list is empty or
the caller is the superuser or the owner of the file. To append a new revision to an existing
branch, the tip revision on that branch must be locked by the caller. Otherwise, only a new
branch can be created. This restriction is not enforced for the owner of the file, unless locking
is set to strict (see res (1». A lock held by someone else may be broken with the res command.
Normally, ci checks whether the revision to be deposited is different from the preceding one. If
it is not different, ci either aborts the deposit (if -q is given) or asks whether to abort (if -q is
omitted). A deposit can be forced with the -f option.
For each revision deposited, ci prompts for a log message. The log message should summarize
the change and must be terminated with a line containing a single '.' or a control-D. If several
files are checked in, ci asks whether to reuse the previous log message. If the std. input is not a
terminal, ci suppresses the prompt and uses the same log message for all files. See also em.
The number of the deposited revision can be given by any of the options -r, -f, -k, -1, -u, or -q
(see -r).
If the RCS file does not exist, ci creates it and deposits the contents of the working file as the
initial revision (default number: 1.1). The access list is initialized to empty. Instead of the log
message, ci requests descriptive text (see -t below).
-r[rev] assigns the revision number rev to the checked-in revision, releases the corresponding lock, and deletes the working file. This is also the default.

If rev is omitted, ci derives the new revision number from the caller's last lock. If
the caller has locked the tip revision of; a branch, the new revision is appended to
that branch. The new revision number is obtained by incrementing the tip revision
number. If the caller locked a non-tip revision, a new branch is started at that revision by incrementing the highest branch number at that revision. The default initial
branch and level numbers are 1. If the caller holds no lock, but he is the owner of
the file and locking is not set to strict, then the revision is appended. to the trunk.
If rev indicates a revision number, it must be higher than the latest one on the

Purdue University

6/29/83

1

CI(l)

UNIX Programmer's Manual

CI(l)

branch to which rev belongs, or must start a new branen.
~ppen4~~ to th~t
branch. The level number is obtained by incrementing the tip r~vision number of
that branch. If rev indicates a non-existing branch, that branch is created with the
initial revision numbered rev. I.

If rev indicates a branch instead of a revision, the new revision is

-f[rev)
-k[rev)

-I[rev]

-.[rev]
-q[rev)
-mmsg

Exception: On the trunk, revisions can be appended to the end, but not i~serted.
forces a deposit; the new revision is deposited even it is not different from the
preceding one.
searches the working file for keyword values to determine its revision number, creation date, author, and state (see co (1», and assigns these values tp the deposited
revision, rather than computing them locally. A revision number given by a command option overrides the number in the working file. This option is useful for
software distribution. A revision that is sent to several sitessho.ldd be cb~cked in
with the ·k option at these sites to preserve its original number, date, author, and
state.
works like ·f, except it performs an additional co -I for the deposited revision. Thus,
the deposited revision is immediately checked out again and locked. This is useful
for saving a revision although one wants to continue editing it after the checkin.
works like -I, except that the deposited revision is not locked. This is useful if one
wants to process (e.g., compile) the revision immediately after checkin.
quiet mode; diagnostic output is not printed. A revision that is not different from
the preceding one is not deposited, unless -f is given.
uses the string msg as the log message for all revisions checked in.

-nname assigns the symbolic name name to the number of the checked-jn revision. Ci prints
an error message if name is already assigned to another number.

- N name same as-a, except that it overrides a previous assignment of name.
-sstate sets the state of the checked-in revision to the identifier state. The default is Exp.
-t[tx(/ile] writes descriptive text into the RCS file (deletes the existing text). If txtfileis omitted,ci prompts the user for text supplied from the std. input, terminated \Vith a line
containing a single '.' or control-D. Otherwise, the descriptive text is copied from
the file IXffile.During initialization, descriptive text isrequ~tedevenif .-t isno~
given. The prompt is suppressed if std. input is not a terminal.
DIAGNOSTICS
For each revision, ci prints the RCS file, the working file, and the number of both tJ;ledeposited
and the preceding revision. The exit status always refers to the last file cbeckep in, and is 0 if
the operation was successful, 1 otherwise.
nLEMODES
An RCS .file .created by ci inherits the read and execute pennissions Jrom ·the working file. If
the ReS file exists already,cipreserves its read and . e~ecute permi~sions. Cialways turns off all
write. pe~issions of .ReS files.
riLES
The:caller of the command must have read/writepermission Jor thedir~tories c()ntai~ingithe
.RCS file and the working .file, and read permission for the RCSfile :itself. A .number .of tem;poraryftles are created. A semaphore file is created In thedirectoryconWJling theR(JS~file. Ci
always creates anew ReS file and unlinks the old one. Tbis :suategymakes links toRCSfiles
useless.

Purdue· University

CI(l)

UNIX Programmer's Manual

CI(I)

IDENTIFICATION
Author: Walter F. Tichy, Purdue Universiiy, West Lafayette, IN, 47907.
. Revision Number: 3.1 ; Release Date: 83/04/04 .
Copyright 0 1982 by Walter F. Tichy.
SEE ALSO
co (1), ident (1), res (1), rcsdiif (1), rcsintro (1), rcsmerge (1), rlog (1), rcsfile (5), sccstorcs

(8).
Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
Proceedings 0/ the 6th International Conference on Software Engineering, IEEE, Tokyo, Sept. 1982.

BUGS

Purdue University

6/29/83

3

CLEAR (1)

UNIX Programmer's Manual

CLEAR (1)

NAME

clear - clear terminal screen
SYNOPSIS

clear
DESCRIPTION

Clear clears your screen if this is possible. It looks in the environment for the terminal type
and then in letcltermcap to figure out how to clear the screen.
FILES

letc/termcap

terminal capability data base

3rd Berkeley Distribution

24 February 1979

1

eMP (1)

UNIX Programmer's Manual

CMP(l)

NAME

cmp - compare two files
SYNOPSIS

emp [ -1] [ -s ] file1 fUe2
DESCRIPTION

The two flies are compared. (If .Ii1el is '-', the standard input is used.) Under default options,
. cmp makes no comment if the files are the same; if they differ, it announces the byte and line

number at which the difference occurred. If one file is an initial subsequence of the other, that
fact is noted.
Options:
-1

Print the byte number (decimal) and the differing bytes (octal) for each difference.

-s

Print nothing for differing files; return codes only.

SEE ALSO

diff(1), comm(l)
DIAGNOSTICS

Exit code 0 is returned for identical fUes, 1 for different flies, and 2 for an inaccessible or missing argument.

7th Edition

18 January 1983

1

CNES'r(I)

UNIX Programmer's Manual

NAME

cnest - check for nested comments in C code
SYNOPSIS

cn(!st [ files ... ]

DESCnll)TION

('nest checks for nested comments in C code, since these are not supported by the C compiler and
invariably cause obscure problems. It complains about successive "begin comment" fields (1*), end
comment fields that do not f{)llow a begin comment field, or comment fields that are not closed
before the end of the file. If no itlput filenames are specifieci, it reads from the standard input.
SEE ALSO

ccO)
DIAGNOSTICS

Ir the program has no nested comments, no diagnostics will be printed. Otherwise, you will sec
self-explanatory messages giving the line number at which an error was detected.
BUGS

Does not understand about C pre-processor commands, and so can get confused by stuff that is
#ifdefed out. To get around this, you can use the pipeline
cc -E -C Hlename.c I cnest
to have the C pre-processor commands executed but without removing the remaining comments.
AUTHOR

Tom Anderson, John Fluke Mfg. Co., Inc.

7th Edition

loc~t1

1 .

CO(!)

UNIX Programmer's Manual

CO(l)

NAME

co - check out RCS revisions
SYNOPSIS

co [ options ] file ...
DESCRIPTION

Co retrieves revisions from RCS files. Each file name ending in ',v' is taken to be an RCS file.
All other files are assumed to be working files. Co retrieves a revision from each RCS file and
stores it into the corresponding working file.
Pairs of RCS files and working files may be specified in 3 ways (see also the example section).
1) Both the RCS file and the working file are given. The RCS file name is of the form
path 1lworkfile, v and the working file name is of the form path2lworkfile, where path11 and path21
are (possibly different or empty) paths and workfile is a file name.
2) Only the RCS file is given. Then the working file is created in the current directory and its
name is derived from the name of the RCS file by removing path11 and the suffix', v'.
3) Only the working file is given. Then the name of the RCS file is derived from the name of
the working file by removing path21 and appending the suffix ',v'.
If the RCS file is omitted or specified without a path, then co looks for the RCS file first in the
directory .IRCS and then in the current directory.
Revisions of an RCS file may be checked out locked or unlocked. Locking a revision prevents
overlapping updates. A revision checked out for reading or processing (e.g., compiling) need
not be locked., A revision checked out for editing and later checkin must normally be locked.
Locking a revision currently locked by another user fails. (A lock may be broken with the res
(1) command.) Co with locking requires the caller to be on the access list of the RCS file,
unless he is the owner of the file or the superuser, or the access list is empty. Co without locking is not subject to accesslist restrictions.
A revision is selected by number, checkin date/time, author, or state. If none of these options
are specified, the latest revision on the trunk is retrieved. When the options are applied in
combination, the latest revision that satisfies all of them is retrieved. The options for
date/time, author, and state retrieve a revision on the selected branch. The selected branch is
either derived from the revision number (if given), or is the highest brancb on the trunk. A
revision number may be attached to one of the options -1, -p, -CI, or -r.
A co command applied to an RCS file with no revisions creates a zero-length file. Co always
performs keyword substitution (see beloW).
-I[rev]
locks the checked out revision for the caller. If omitted, the checked out revision
is not locked. See option -r for handling of the revision number rev.
-p[rev]
prints the retrieved revision on the std. output rather than storing it in the working
file. This option is useful when co is part of a pipe.
-q[rev]
quiet mode; diagnostics are not printed.
-ddate
retrieves the latest revision on the selected branch whose checkin date/time is less
than or equal to date. The date and time may be given in free format and are converted to local time. Examples of formats for date:

22-April-1982, 17:20-CDT,
2:25 AM, Dec. 29. 1983.
Tue-PDT, 1981, 4pm Jul21
(free forma!),
Fri, April 16 15:52:25 EST 1982 (output of ctime).

Purdue University

6/29/83

1

CO(I)

UNIX Programmer's Manual

CO(I)

Most fields in the date and time may be defaulted. Co determines the defaults in
the order year, month, day, hour, minute, and second (most to least significant>.
At least one of these fields must be provided. For omitted fields that are of higher
significance than the highest provided field, the current values are assumed. For all
other omitted fields, the lowest possible values are assumed. For example, the date
"20, 10:30" defaults to 10:30:00 of the 20th of the current month and current year.
The date/time must be quoted if it contains spaces.
-r[rev)
retrieves the latest revision whose number is less than or equal to rev. If rev indicates a branch rather than a revision, the latest revision on that branch is retrieved.
Rev is composed of one or more numeric or symbolic fields separated by '.'. The
numeric equivalent of a symbolic field is specified with the -n option of the commands ci and res.
-.stllte
retrieves the latest revision on the selected branch whose state is set to state.
-w[login] retrieves the latest revision on the selected branch which was checked in by the
user with login name login. If the argument login is omitted, the caller's login is
assumed.
-Jjoin/isl generates a new revision which is the join of the revisions on joiniisl. Join/is! is a
comma-separated list of pairs of the form rev2:rev3, where rev2 and rev3 are (symbolic or numeric) revision numbers. For the initial such pair, rev} denotes the
revision selected by the options -I, ... , -We For all other pairs, rev} denotes the revision generated by the previous pair. (Thus, the output of one join becomes the
input to the next.)
For each pair, co joins revisions rev} and rev3 with respect to rev2. This means that
all changes that transform rev2 into rev} are applied to a copy of rev3. This is particularly useful if rev} and rev3 are the ends of two branches that have rev2 as a
common ancestor. If rev} < rev2 < rev3 on the same bral'lch, joining generates a
new revision which is like rev3, but with all changes that lead from rev} to rev2
undone. If changes from rev2 to rev} overlap with changes from rev2 to rev), co
prints a warning and includes the overlapping sections, delimited by the lines
«««< rev}, - - - - - - - , and »»»> rev3.
For the initial pair, rev2 may be omitted. The default is the common ancestor. If
any of the arguments indicate branches, the latest revisions on those branches are
assumed. If the option -I is present, the initial rev} is locked.
KEYWORD SUBSTITUTION

Strings of the form $keyword$ and $keyword:... $ embedded in the. text are replaced with strings
of the form $keyword: value $, where keyword and value are pairs listed below. Keywords may
be embedded in literal strings or comments to identify a revision.
Initially, the user enters strings of the form $keyword$. On checkout, co replaces these strings
with strings of the form $keyword: value $. If a revision containing strings of the latter form is
checked back in, ,the value fields will be replaced during the next checkout. Thus, the keyword
values are automatically updated on checkout.
Keywords and their corresponding values:
SAuthorS
The login name of the user who checked in the revision.
SDateS
The date and time the revision was checked in.
A standard header containing the RCS file name, the revision number, the date,
SHeaderS
the author, and the state.

Purdue University

6/29/83

2

CO(I)

UNIX Programmer's Manual

SLockerS
SLogS

SRevisionS
SSourceS
SStateS

CO(I)

The login name of the user who locked the revision (empty if not locked).
The log message supplied during checkin, preceded by a header containing the
RCS file name, the revision number, the author, and the date. Existing log messages are NOT replaced. Instead, the new log message is inserted after $Log:... $.
This is useful for accumulating a complete change log in a source file.
The revision number assigned to the revision.
The full pathname of the RCS file.
The state assigned to the revision with rcs -s or ci -so

DIAGNOSTICS

The RCS file name, the working file name, and the revision number retrieved are written to the
diagnostic output. The exit status always refers to the last file checked out, and is 0 if the
operation was successful, 1 otherwise.
EXAMPLES

Suppose the current directory contains a subdirectory 'RCS' with an RCS file 'io.c, v'. Then all
of the following commands retrieve the latest revision from 'RCS/io.c, v' and store it into 'io.c'.
co io.c; co RCS/io.c, v; co io.c, v;
co io.c RCS/io.c, v; co io.c io.c, v;
co RCS/io.c, v io.c; co io.c, v io.c;
FILE MODES

The working file inherits the read and execute permissions from the RCS file. In addition, the
owner write permission is turned on, unless the file is checked out unlocked and locking is set
to strict (see rcs (1».
If a file with the name of the working file' exists already and has write permission, co aborts the
checkout if -q is given, or asks whether to abort if -q is not given. If the existing working file is
not writable, it is deleted before the checkout.
FILES

The caller of the command must have write permission in the working directory, read permission for the RCS file, and either read permission (for reading) or read/write permission (for
locking) in the directory which contains the RCS file.
A number of temporary files are created. A semaphore file is created in the directory of the
RCS file to prevent simultaneous update.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.1 ; Release Date: 83/04/04 .
Copyright c 1982 by Walter F. Tichy.
SEE ALSO
ci (1), ident(l), rcs (1), rcsdifT (1), rcsintro (1), rcsmerge (1), rlog (1), rcsfile (5), sccstorcs
(8).

Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in

, Proceedings o/the 6th International Cotiference on Software Engineering, IEEE, Tokyo, Sept. 1982.
LIMITATIONS

The option -d gets confused in some circumstances, and accepts no date before 1970. There is
no way to suppress the expansion· of keywords, except by writing them differently. In nrofT and
trofT, this is d!>ne by embedding the null-character '\&' into the keyword.

Purdue University

6/29/83

3

CO(l)

BUGS

UNIX Programmer's Manual

CO (1)

The option -J does not work for files that contain lines with a single '.'.

Purdue Univel'Sity

6/29183

4

COL (I) .

UNIX Programmer's Manual

COL (I)

NAME
col - filter reverse line feeds
SYNOPSIS

eol [ -bl. ]
DESCIUPTION

Col reads the standard input and writes the standard output. It performs the line overlays
implied by reverse line feeds (ESC·7 in ASCD) and by forward and reverse half line feeds
(ESC-9 and ESC-8). Col is particularly useful for filtering multicolumn output made with the
'.rt' command of nroJland output resulting from use of the tbl(1) preprocessor.
Although col accepts half line motions in its input, it normally does not emit them on output.
Instead, text that would appear between lines is moved to the next lower full line boundary.
This treatment can be suppressed by the -I (fine) option; in this case the output from col may
contain forward half line feeds (ESC·9), but will still never contain either kind of reverse line
motion.
If the - b option is given, col assumes that the output device in use is not capable of backspacing. In this case, if several characters are to appear in the same place, only the last one read
will be taken.
The control characters SO (ASCD code 017), and SI (016) are assumed to start and end text in
an alternate character set. The character set (primary or alternate) associated with each printing
character read is remembered; on output, SO and SI characters are generated where necessary
to maintain the correct treatment of each character.
Col normally converts white space to tabs to shorten printing time. If the -x option is given,
this conversion is suppressed.
All control characters are removed from the input except space, backspace, tab, return, newline, ESC (033) followed by one of 7, 8, 9, SI, SO, and VT (013). This last character is an
alternate form of full reverse line feed, for compatibility with some other hardware conventions. All other non-printing characters are ignored.
SEE ALSO

trotr(l), tbl (1)

BUGS
Can't back up more than 128 lines.
No more than 800 characters, including backspaces, on a line.

7th Edition

181anuary 1983

1

COLCRT(I)

UNIX Programmer's Manual

COLCRT(I)

NAME

colert - filter nroff output for CRT previewing
SYNOPSIS

colen [ - ] [ -2 ] [file ... ]
DESCRIPTION

Colcrt provides virtual half-line and reverse line feed sequences for terminals without such
capability, and on which overstrikina is destructive. Half-line characters and underlining
(changed to dashing '- ') are placed on new lines in between the normal output lines.
The optional - suppresses all underlining. It is especially useful for previewina allboxed tables
from tb/(l).
The option -2 causes all half-lines to be printed, effectively double spacina the output. Normally, a minimal space output format is used which will suppress empty lines. The proaram
never suppresses two consecQ,tive empty lines, however. The -2 option is useful for sending
output to the line printer when the output contains superscripts and subscripts which would
otherwise be invisible.
A typical use of colcrt would be
tbl exum2.n Inroff -ms Icolcrt -

Imore

SEE ALSO

nroff/troff(l), coHO, more(l), ul(l)
AUTHOR

William Joy

BUGS
Should fold underlines onto blanks even with the '-' option so that a true underline character
would show; if we did this, however, colcrt wouldn't get rid of cu'd underlinina completely.
Can't back up more than 102 lines.
General overstriking is lost; as a special case 'I' overstruck with '-' or underline becomes '+'.
Lines are trimmed to 132 characters.
Some provision should be made for processing superscripts and subscripts in documents which
are already double-spaced.

3rd Berkeley Distribution

24 Februtary 1979

1

COLRM(I)

UNIX Programmer's Manual

COLRM(I)

NAME

colrm - remove columns from a file
SYNOPSIS

eolrm [ startcol [ endcol ] ]
DESCRIPTION

Colrm removes selected columns from a file. Input is taken from standard input. .Output is
sent to standard output.
If called with one parameter the columns of each line will be removed starting with the
specified column. If called with two parameters the columns from the first column to the last
column will be removed.
Column numbering starts with column 1.
SEE ALSO

expand(1)
AUTHOR

Jeff Schriebman

4th Berkeley Distribution

18 January 1983

1

COMM(I)

UNIX Programmer's Manual

COMM(I)

NAME

comm - select or reject lines common to two sorted files
SYNOPSIS

eomm [ - [113 ] ] file 1 fUe2
DESCRIPTION

Comm reads filel and fi1e2, which shOllld be ordered in ASCII collating sequence, and produces
a three column outPllt: lines only in filel,' lines only in file],· and lines in both files. The
filename '-' means the standard input.
Flags 1, 2, or 3 supprep printing of the corresponding column. Thus eollUll -11 prints only
the lines common to the two files; eolQlD -23 prints only lines in the first file but not in the
se.cond; eomm -113 is a nO-OPe
SEE ALSO

cmp(l), di1f(l), uniq(t)

7th Edition

18 J.$ll~ 1983

1

COMP( 1)

UNIX Programmer's Manual

COMP( 1)

comp - compose a message
SYNOPS[S

comp [ -editor editor] [ -form formtne ] [ tile ] [ -use ] [ -nouse ] [ -help ]
DESCRIPtION

Cam.p is used to create a new message to be mailed. If file is not specified.. the
tlle named "draft" in the user's MH directory will be used. Camp copies a message form to the file being composed and then invokes an editor on the file. The
default editor is /bin/ned.. which may be overridden with the '-editor' switch or
with a profile entry"Editor:". The default message form contains the following
elements:
To:
cc:
Subject:
If the flle named "components" exists in the user's MH directory. it will be used
instead of this form. If I-form formtile' is specified, the specified forrnfile (from
the MH directory) will be used as the skeleton. The line of dashes or a blank line
must be left between the header and the body of the message for the message to
be identified properly when it is sent (see send(l». The switch I-use' directs
camp to continue editing an already started message. That is, if a camp (or dist,
repl, or lorw) is terminated without sending the message, the message can be
edited again via "comp -use".
If the specified file (or draft) already exists, cam.p will ask if you want to delete it
before continuing. A reply of No will abort the camp, yes will replace the existing draft with a blank skeleton, list will display the draft, and use will use it for
further composition.
Upon exiting from the editor, cam.p ,will ask "What now?". The valid responses
are list. to list the draft on the terminal; quit. to terminate the session and
preserve the draft; quit delete, to terminate, then delete the draft; send, to
send the message; send verbose, to cause the delivery process to be monitored;
edit . to invoke  for further editing; and edit. to re-edit using
the same editor that was used on the preceding round unless a profile entry
-next: " names an alternative editor.
Cam.p does not atYect either the current folder or the current message.
II

/etc/nih/components
or /components
.$HOME/mh-profile
 / draft
/usr /new/send

The message skeleton
Rather than the standard skeleton
The user profile
The default message tile
To send the composed message

PROftLE COMPONENTS

Path:
Editor:
-next:

To determine the user's MH directory
To override the use of /bin/ned as the default editor
editor to be used after exit from 

DEFAULTS

Itile defaults to draft
I

4th Berkeley Distribution

3 August 1983

1

COMP( 1)

UNIX Programmer's Manual

COMP( 1)

'-editor' defaults to Ibin/ned
'-nouse'

4th Berkeley· Distribution

3 August 1983

2

UNIX Programmer's Manual

COMPACT(l)

COMPACT (1)

NAME

compact, uncompact, ccat - compress and uncompress files, and cat them
SYNOPSIS

eompaet [ name ... ]
uncompaet [ name ...
ecat [ file ... ]
DESCRIPTION

Compact compresses the named files using an adaptive Huffman code. If no file names are
given, the standard input is compacted to the standard output. Compact operates as an on-line
algorithm. Each time a byte is read, it is encoded immediately according to the current prefix
code.. This code is an optimal Huffman code for the set of frequencies seen so far. It is
unnecessary to prepend a decoding tree to the compressed flle since the encoder and the
decoder start in the same state and stay synchronized. Furthermore, compact and uncompact can
operate as filters. In particular,

... Icompact I uncompact I...
operates as a (very slow) no-oPe
When an argument file is given, it is compacted and the resulting file is placed in file. C; file is
unlinked. The first two bytes of the compacted file code the fact that the file is compacted.
This code is used to prohibit recompaction.
The amount of compression to be expected depends on the type of file being compressed. Typical values of compression are: Text (38%), Pascal Source (43%), C Source (36%) and Binary
(19%). These values are the percentages of flle bytes reduced.

Uncompact restores the original flle from a file compressed by compact. If no file names are
given, the standard input is uncompacted to the standard output.
Ccat cats the original file from a file compressed by compact, without uncompressing the file.
RESTRICTION

The last segment of the filename must contain fewer than thirteen characters to allow space for
the appended '.C'.
FILES

·.C

compacted file created by compact, removed by uncompact

SEE ALSO

Gallager, Robert G., 'Variations on a Theme of Huffman', I.E.E.E. Transtlctions on lriformation
Theory, vol. IT-24, no. 6, November 1978, pp. 668 - 674.
AUTHOR

Colin L. Me Master

4th Berkeley Distribution

18 January 1983

1

CONGRAPH(l)

UNIX Programmer's Manual

CONGRAPH(l)

NAME

congraph - plot connectivity of a graph
SYNOPSIS

eongmph [-SI1 -e -n -a] [files ...J
DESCRIPTION

Congraph is a general-purpose utility for plotting the connectivity of graphs. Graphs are described
by text files made up of lines describing directed (or non-directed) edges. The format of a line is

 
indicating a connection bet\~een the twp pamep nodes. ,The node-names are taken as ascii text
(unless the -11 option is given, see below) and a're' scpar~ltcd by spaces or tabs . .-' .,
Th(~

standard output of cOl/graph consists of plot commimds (see p!ot(5» which should be piped
into p!o/{lG). The plots thus produced have t.he points given in the input description labeled and
connected by straight lines; the point'! are arranged about a circle in the order first seen in the input
file.

For example, here is a three-edge, fOlllo-node input file
dog cat
cat mouse
house mouse
If no file arguments are given, the standard input is read. Otherwise, a separate plot is made fbr
each input filename specified. Plots are labeled with the inplIt filename.
OPTIONS

-snnn

This sets the scale of the plot produced to nnn; the default scale is 1000.
so a scale of 500 gives a half-sized plot.

-n

This is used when the input node names are a11 integers, and it is desired
to arrange the points on the plot so that they appear in proper numeric
. order. With this option, if an node Ilumbered between 0 and the highest
fiHlIld in the input me is not on any edge, it still will be plotted (and
labeled) in ito;; proper position Oil the plot.

-c

This is used to take ,111 input file where the nodes arc described by ascii
labels, and convert it into an equivalent description whose nodes arc
labeled by integers, starting at zero. The nodes are assigned numbers in
order of their appearance ill the input me. The output description (lPpears
Oil the standard output, and no plot is made. For example, the input HIe
shown above gives the converted description
o1
12

32
-a

By default, the graph is considered to be non-directed. This option draws
arrowheads to- indicate the directions of the edges: the edges are considered to run from the first point on the input line to the second.

SEE ALSO

plot(1)
DIAGNOSTICS

A warning appears. if an input (ile is empty; if too many pointe; or edges are given, the excess ones
are silently ignored.
o .

7th Edition

1

CONGRAPH(l)

UNIX Programmc,"s Manual

CONGRAPH ( 1)

BUGS
The plots produced for large graphs arc often too complex for the Dover to print.

On complex plots, t.he node labels may run together.

7th Edition

2

COURIER(1)

UNIX Programmer's Manual

COURIER( 1)

NAIIE

courier - Courier remote procedure call compiler
SYNOPSIS

courier [ -l[] specification
DESCRIPTION

Cburier is a compiler for the Mesa-like specification language associated with
the Courier remote procedure call protocol.
Program..cr

Courier specification tile for Program

The following files are generated. by courier from the above:
Program.h
Prog ramJ tubs. c
PrograrnJerver.c
Program~lient.c

definitions and typedefs
mappings between C and Courier
server routines
client routines

SEE ALSO

"Writing Distributed Programs with Courier" by Eric C. Cooper.
"Courier: The Remote Procedure Call Protocol," Xerox System Integration Standard 038112, December 1981.

4th Berkeley Distribution

2B July 1983

1

CP(l)

UNIX Proarammer's Manual

CP(l)

NAME

cp - copy
SYNOPSIS

ep [ -I ] [ -r ] fUel fUe2
ep [ -I] [ -r ] file ... directory
DESClUPTION

Filel is copied onto fi1e2. The mode and owner of file2 are preserved if it already existed; the
mode of the source fUe is used otherwise.
In the second form, one or more files are copied into the directory with their original file-names.
Cp refuses to copy a fUe onto itself.

If the -I option is specified, cp will prompt the user with the name of the file whenever the
copy will cause an old fUe to be overwritten. An answer of 'y' will cause cp to continue. Any
other answer will prevent it from overwritina the fUe.
If the -r option is specified and any of the source files are directories, cp copies each subtree
rooted at that name; in this case the destination must be a directory.
SEE ALSO

cat(1), prO), mv(1)

4th Berkeley Distribution

1 April 1982

1

CP AREN ( 4/12/83 )

UNIX ProgrammertsManual

CPAREN ( 4/12/83)

NAME

cparcn - add parentheses to C expressions
SYNOPSIS

cparcn [ - t types]
DESCRIPTION

Written for those of us who can never remember the precedence and associativity of operators in C,
Cflurcn reads lines of C code from standard-in, adds parentheses to indicate operator binding in
expressions, then writes the resultant code to standard-out.
The input code fragment need not contain complete statements. For example, the following line is
valid input to cparcn:
} else if (x->d_prep > 56 && x->d_assoc = =;; LEFT)

a

Normally, cparcn considers identifiers in expressions to be variable nantes. The - t option allows
you to specify a whitespace-separated list of types. For example. .
cparen -t 'amap ~1I10p'
Declares "amap" and "anop" as type names rather than variable names.
DIAGNOSTICS

Exit status is 2 if cp~lfcn was invoked improperly, 1 if some other error occurred, 0 if all went well.
AUTI·IOR

Brad Needhmn, Tektronix, Inc.
Copyright (c) 1984 by Tektronix, Incorporated Beaverton, Oregon 97077 AlI rights reserved.
Permission is hereby granted ror personal, non-commercial reproduction and use of this program,
provided that this notice is induded in any copy.
BUGS

assumes that the input code th1gmcnt came from a syntactically correct C program -~ it docs
not attempt to give rea~onable syntax-error messages.
.
Because Cilarcn focuses on C statments it does not recognize other const.ructs e.g. variable or function declarations. It canno( process a whole C program.

CI)ilfCn

The input is not filtered through the C preprocessor.

7th Edition

Tck local

1 .

CREF(l)

UNIX Programmer's Manual

NAME

crcf -- cross reference program
SYNOPSIS
cf{~f

[-

II

J [ -t ] file ...

DESCI{IPTION

Crefgenerates a complete cross reference listing of one or more C programs, printing the result on
the standard output. 1\ Jisting of the programs with line numbers is printed first, th\1owcd by the
actual cross reference listing. This latter contains all the programs's symbols alphabetically
arranged, one to a line, with each line containing the numbers of the Jines in the programs where
the symbol was referenced. If the symbol was defined on a given line, that line number will be followed by (I '.ft'. Symbols with more t.han approximately 15 references occupy multiple lines.
There is no limit on the number of symbols that erefwill handle, nor on the number of references
per symbol.
.
Cnfstores its symbols in a hash tahle whose size is determined by ete/based on the total number
of characters in the lites to be processed. For almost all programs, this turns out to be an excellent

approximation. However, fhr a few programs, generally short header files, there may be too many
symbols for the hash table, and the diagnostic "Hash table uverHowed!" will be prill ted out. Since
the output of eref is piped through p/~ it is not real1y possible for cref to recover from this condit.ion. Instead, ffrfshould be rerun with the -0 option, where 11 is some number. This will multiply
the starti ng size of the hash table by It times.
If enlis invoked with the -t option, instead of its rcgul,II' output it produces ~111 output identical in
f()nn to that produced by the ('Iags(!) program. The advantage of the CI'l:tOUlput over ('lags is that
er(/will tbg all variable and macro definitions as welt as all function definitions.
AUTIIOI{

Steve Zimmerman
SI':E ALSO

ctags( 1)
HUGS

Cr~roccasioll(llly nags

"ncr a strllct.

7th Edition

cypher
crypt key ' '(' ')' form separate words. If doubled in '&&', 'I '< <' or
'> >' these pairs form single words. These parser metacharacters may be made part of other
words, or prevented their special meaning, by preceding them with '\'. A newline preceded by
a '\' is equivalent to a blank.

r,

In addition strings enclosed in matched pairs of quotations, "', ," or "", form parts of a word~
metacharacters in these strings, including blanks and tabs, do not form separate words. These
quotations have semantics to be described subsequently. Within pairs of ," or ,n' characters a
newline preceded by a '\' gives a true newline character.
When the shell's input is not a terminal, the character' #' introduces a comment which continues to the end of the input line. It is prevented this special meaning when preceded by '\' and
in quotations using .,,, .,,, and '"'.
Commands
A simple command is a sequence of words, the first of which specifies the command to be executed. A simple command or a sequence of simple commands separated by '~ characters forms
a pipeline. The output of each command in a pipeline is connected to the input of the next.
Sequences of pipelines may be separat~d by';', and are then executed sequentially. A
sequence of pipelines may be executed without immediately waiting for it to terminate by following it with an •&'.
Any of the above may be placed in '(' ')' to form a simple command (which may be a component of a pipeline, etc.) It is also possible to separate pipelines with 'I ~ or '&&' indicating, as
in the C language, that the second is to be executed only if the first fails or succeeds respectively. (See Expressions.)

4th Berkeley Distribution

18 July 1983

eSH (1)

UNIX Programmer's Manual

eSH (1 )

Jobs
The shell associates a job with each pipeline. It keeps a table of current jobs, printed by the jobs
command, and assigns them small integer numbers. When a job is started asynchronously with
'&', the shell prints a line which looks like:
[1] 1234
indicating that the jobs which was started asynchronously was job number 1 and had one (toplevel) process, whose process id was 1234.
If you are running a job and wish to do something else you may hit the key "z (control-Z)
which sends a STOP signal to the current job. The shell will then normally indicate that the job
has been 'Stopped', and print another prompt. You can then manipulate the state of this job,
putting it in the background with the bg command, or run some other commands and then
eventually bring the job back into the foreground with the foreground command fg. A" Z takes
effect immediately and is like an interrupt in that pending output and unread input are discarded when it is typed. There is another special key "Y which does not generate a STOP signal
until a program attempts to read(2) it. This can usefully be typed ahead when you have
prepared some commands for a job which you wish to stop after it has read them.

A job being run in the background will stop if it tries to read from the terminal. Background
jobs are normally allowed to produce output, but this can be disabled by giving the command
"stty tostop". If you set this tty option, then background jobs will stop when they try to produce output like they do when they try to read input.
There are several ways to refer to jobs in the shell. The character '%' introduces a job name.
If you wish to refer to job number 1, you can name it as '%1 '. Just naming a job brings it to
the foreground~ thus '% l' is a synonym for 'fg %1', bringing job 1 back into the foreground.
Similarly saying '% 1 &' resumes job 1 in the background. Jobs can also be named by prefixes
of the string typed in to start them, if these prefixes are unambiguous, thus '%ex' would normally restart a suspended ex(1) job, if there were only one suspended job whose name began
with the string 'ex'. It is also possible to say '%?string' which specifies a job whose text contains string, if there is only one such job.
The shell maintains a notion of the current and previous jobs. In output pertaining to jobs, the
current job is marked with a '+' and the previous job with a '-'. The abbreviation '% +'
refers to the current job and '% -' refers to the previous job. For close analogy with the syntax
of the history mechanism (described below), '%%' is also a synonym for the current job.

Status reporting
This shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints
a prompt. This is done so that it does not otherwise disturb your work. If, however, you set
the shell variable notify, the shell will notify you immediately of changes of status in background jobs. There is also a shell command notify which marks a single process so that its
status changes will be immediately reported. By default notify marks the current process~ simply
say 'notify' after starting a background job to mark it.
When you try to leave the shell while jobs are stopped, you will be warned that 'You have
stopped jobs. ' You may use the jobs command to see what they are. If you do this or immediately try to exit again, the shell will not warn you a second time, and the suspended jobs will be
terminated.

4th Berkeley Distribution

18 July 1983

2

UNIX Programmer's Manual

CSH (1)

CSH (1 )

Substitutions
We now describe the various transformations the shell performs on the input in the order in
which they occur.
History substitutions
History substitutions place words from previous command input as portions of new commands,
making it easy to repeat commands, repeat arguments of a previous command in the current
command, or fix spelling mistakes in the previous command with little typing and a high degree
of confidence. History substitutions begin with the character 'I' and may begin anywhere in the
input stream (with the proviso that they do not nest.) This 'I' may be preceded by an '\' to
prevent its special meaning~ for convenience, a '!' is passed unchanged when it is followed by a
blank, tab, newline, '=-' or '('. (History substitutions also occur when an input line begi ns
with 'T'. This special abbreviation will be described later.) Any input line which contains history substitution is echoed on the terminal before it is executed as it could have been typed
without history substitution.
Commands input from the terminal which consist of one or more words are saved on the history list. The history substitutions reintroduce sequences of words from these saved commands
into the input stream. The size of whi"ch is controlled by the history variable~ the previous command is always retained, regardless of its value. Commands are numbered sequentially from 1.
For definiteness, consider the following output from the history command:
9
10
11
12

write michael
ex write.c
cat oldwrite.c
diff *write.c

The commands are shown with their event numbers. It is not usually necessary to use event
numbers, but the current event number can be made part of the prompt by placing an '!' in the
prompt string.
With the current event 13 we can refer to previous events by event number '! 11 " relatively as
in '! - 2' (referring to the same event), by a prefix of a command word as in •!d' for event 12
or '!wri' for event 9, or by a string contained in a word in the command as in '!?mic?' also
referring to event 9. These forms, without further modification, simply reintroduce the words
of the specified events, each separated by a single blank. As a special case 'I!' refers to the previous command~ thus '!!' alone is essentially a redo.
To select words from an event we can follow the event specification by a ':' and a designator for
the desired words. The words of a input line are numbered from 0, the first (usually command) word being 0, the second word (first argument) being 1, etc. The basic word designators are:

o
n

1
$
%
x- y
- y
•

x·
x-

first (command) word
n'th argument
first argument, i.e.' l'
last argument
word matched by (immediately preceding) ? s? search
range of words
abbreviates '0- y'
abbreviates '1- $', or nothing if only 1 word in event
abbreviates' x-$'
like' x.' but omitting word '$'

4th Berkeley Disiribution

18 July 1983

3

CSH (1)

UNIX Programmer's Manual

CSH (1 )

The ':' separating the event specification from the word designator can be omitted if the argument selector begins with a 'T', '$', '*' '-' or '%'. After the optional word designator can be
placed a sequence of modifiers, each preceded by a ':'. The following modifiers are defined:
h
r
e
sl 1/ rl
t
&
g
p
q
x

Remove a trailing pathname component, leaving the head.
Remove a trailing '.xxx' component, leaving the root name.
Remove all but the extension' .xxx' part.
Substitute Ifor r
Remove all leading pathname components, leaving the tail.
Repeat the previous substitution.
Apply the change globally, prefixing the above, e.g. 'g&'.
Print the new command but do not execute it.
Quote the substituted words, preventing further substitutions.
Like q, but break into words at blanks, tabs and newlines.

Unless preceded by a 'g' the modification is applied only to the first modifiable word. With
substitutions, it is an error for no word to be applicable.
The left hand side of substitutions are not regular expressions in the sense of the editors, but
rather strings. Any character may be used as the delimiter in place of 'I'~ a '\' quotes the delimiter into the I and r strings. The character '&' in the right hand side is replaced by the text
from the left. A '\' quotes '&' also. A null luses the previous string either from a lor from a
contextual scan string sin '!? s?~. The trailing delimiter in the substitution may be omitted if a
newline follows immediately as may the trailing '?' in a contextual scan.
A history reference may be given without an event specification, e.g. '!$'. In this case the
reference is to the previous command unless a previous history reference occurred on the same
line in which case this form repeats the previous reference. Thus '!?foo?T !$' gives the first
and last arguments from the command matching '?foo?'.
A special abbreviation of a history reference occurs when the first non-blank character of an
input line is a 'T'. This is equivalent to '! :sT' providing a convenient shorthand for substitutions on the text of the previous line. Thus 'f1bTlib' fixes the spelling of 'lib' in the previous
command. Finally, a history substitution may be surrounded with 'I' and 'I' if necessary to
insulate it from the characterS which follow. Thus, after 'Is -ld -paul' we might do '!{Ila' to
do 'Is -Id -paula', while '!la" would look for a command starting 'Ia'.

Quotations with' and·
The quotation of strings by 4" and '"' can be used to prevent all or some of the remaining substitutions. Strings enclosed in ," are prevented any further interpretation. Strings enclosed in
'"' may be expanded as described below.
In both cases the resulting text becomes (all or part of) a single word~ only in one special case
(see Command Subslililion below) does a '"' quoted string yield parts of more than one word~ ,"
quoted strings never do.

Alias substitution
The shell maintains a list of aliases which can be established, displayed and modified by the
alias and unalias commands. After a command line is scanned, it is parsed into distinct com-'
mands and the first word of each command, left-to-right, is checked to see if it has an alias. If
it does, then the text which is the alias for that command is reread with the history mechanism
available as though that command were the previous input line. The resulting words replace
the command and argument list. If no reference is made to the history list, then the argument
list is left unchanged.

4th Berkeley Distribution

18 July 1983

4

CSH (1)

UNIX Programmer's Manual

CSH (1 )

Thus if the alias for ~Is' is ~Is -I' the command ~Is /usr' would map to ~ls -I lusr', the argument list here being undisturbed. Similarly if the alias for ~lookup' was ~grep !1 letc/passwd'
then ~lookup bill' would map to ~grep bill/etc/passwd'.

If an alias is found, the word transformation of the input text is performed and the aliasing process begins again on the reformed input line. Looping is prevented if the first word of the new
text is the same as the old by flagging it to prevent further aliasing. Other loops are detected
and cause an error.
Note that the mechanism allows aliases to introduce parser metasyntax. Thus we can
print 'pr \!. Ilpr" to make a command which pr's its arguments to the line printer.

~alias

Variable substitution
The shell maintains a set of variables, each of which has as value a list of zero or more words.
Some of these variables are set by the shell or referred to by it. For instance, the argv variable
is an image of the shell's argument list, and words of this variable's value are referred to in
special ways.
The values of variables may be displayed and changed by using the set and unset commands. Of
the variables referred to by the shell a number are toggles~ the shell does not care what their
value is, only whether they are set or not. For instance, the verbose variable is a toggle which
causes command input to be echoed. The setting of this variable results from the - v command line option.
Other operations treat variables numerically. The ~@' command permits numeric calculations
to be performed and the result assigned to a variable. Variable values are, however, always
represented as (zero or more) strings. For the purposes of numeric operations, the null string
is considered to be zero, and the second and subsequent words of multiword values are ignored.
After the input line is aliased and parsed, and before each command is executed, variable substitution is performed keyed by ~$' characters. This expansion can be prevented by preceding
the ~$' with a ~\' except within ~"'s where it always occurs, and within ~"s where it never
occurs. Strings quoted by ~., are interpreted later (see Command substitution below) so ~$' substitution does not occur there until later, if at all. A ~$' is passed unchanged if followed by a
blank, tab, or end-of-line.
Input/output redirections are recognized before variable expansion, and are variable expanded
separately. Otherwise, the command name and entire argument list are expanded together. It
is thus possible for the first (command) word to this point to generate more than one word, the
first of which becomes the command name, and the rest of which become arguments.
Unless enclosed in ~"' or given the ~:q' modifier the results of variable substitution may eventually be command and filename substituted. Within ~"' a variable whose value consists of multiple words expands to a (portion of) a single word, with the words of the variables value
separated by blanks. When the ~:q' modifier is applied to a substitution the variable will expand
to multiple words with each word separated by a blank and quoted to prevent later command or
filename substitution.
The following metasequences are provided for introducing variable values into the shell input.
Except as noted, it is an error to reference a variable which is not set.
$na.me
${name}
Are replaced by the words of the value of variable name, each separated by a blank.
Braces insulate name from following characters which would otherwise be part of it. Shell
variables have names consisting of up to 20 letters and digits starting with a letter. The
underscore character is considered a letter.
If name is not a shell variable, but is set in the environment, then that value is returned

4th Berkeley Distribution

18 July 1983

5

CSH (1)

UNIX Programmer's Manual

CSH (1 )

(but: modifiers and the other forms given below are not available in this case).
$name [selector]
${name [selector]}
May be used to select only some of the words from the value of name. The selector is
subjected to 4$' substitution and may consist of a single number or two numbers separated
by a 4- '. The first word of a variables value is numbered 41'. If the first number of a
range is omitted it defaults to 41'. If the last member of a range is omitted it defaults to
4$#name'. The selector 4.' selects all words. It is not an error for a range to be empty if
the second argument is omitted or in range.
$#name
${#name}
Gives the number of words in the variable. This is useful for later use in a 4[selectod'.
$0
Substitutes the name of the file from which command input is being read. An error
occurs if the name is not known.
$number
${numberl
Equivalent to 4$argv[number]'.
Equivalent to 4$argv[.]'.
The modifiers 4:h" 4:t', 4:r', 4:q' and 4: X' may be applied to the substitutions above as may 4:gh',
4:g1' and 4: gr '. If braces 'I' 'I' appear in the command form then the modifiers must appear
within the braces. The current implementation allows only one ':' modifier on each '$'
expansion.
The following substitutions may not be modified with 4:' modifiers.
$?name
${?name}
Substitutes the string 41' if name is set, 40' if it is not.
$?O
Substitutes 41' if the current input filename is known, 40' if it is not.
$$
Substitute the (decimal) process number of the (parent) shell.

$<
Substitutes a line from the standard input, with no further interpretation thereafter. It
can be used to read from the keyboard in a shell script.

Command and filename substitution
The remaining substitutions, command and filename substitution, are applied selectively to the
arguments of builtin commands. This means that portions of expressions which are not
evaluated are not subjected to these expansions. For commands which are not internal to the.
shell, the command name is substituted separately from the argument list. This occurs very
late, after input-output redirection is performed, and in a child of the main shell.
Command substitution
Command substitution is indicated by a command enclosed in 4". The output from such a
command is normally broken into separate words at blanks, tabs and newlines, with null words
being discarded, this text then replacing the original string. Within 4"'S, only newlines force
new words~ blanks and tabs are preserved.

4th Berkeley Distribution

18 July 1983

6

CSH (1)

UNIX Programmer's Manual

CSH (1 )

In any case, the single final newline does not force a new word. Note that it is thus possible for
a command substitution to yield only part of a word, even if the command outputs a complete
line.
Filename substitution
If a word contains any of the characters '*', '1', '[' or '{' or begins with the character ~-\ then
that word is a candidate for filename substitution, also known as 'globbing'. This word is then
regarded as a pattern, and replaced with an alphabetically sorted list of file names which match
the pattern. In a list of words specifying filename substitution it is an error for no pattern to
match an existing file name, but it is not required for each pattern to match. Only the metacharacters ~*" '1' and' [' imply pattern matching, the characters ,-, and '(' being more akin to
abbreviations.
In matching filenames, the character '.' at the beginning of a filename or immediately following
a '/', as well as the character '/' must be matched explicitly. The character '*' matches any
string of characters, including the null string. The character '1' matches any single character.
The sequence 'L..1' matches anyone of the characters enclosed. Within' L..1', a pair of characters separated by '-' matches any character lexically between the two.
The character ,-, at the beginning of a filename is used to refer to home directories. Standing
alone, i.e. ,-, it expands to the invokers home directory as reflected in the value of the variable
home. When followed by a name consisting of letters, digits and '-' characters the shell
searches for a user with that name and substitutes their home directory~ thus '-ken' might
expand to '/usr/ken' and '-ken/chmach' to '/usr/ken/chmach'. If the character ,-, is followed
by a character other than a letter or '/' or appears not at the beginning of a word, it is left
undisturbed.
The metanotation 'a{b,c,d}e' is a shorthand for 'abe ace ade'. Left to right order is preserved,
with results of matches being sorted separately at a low level to preserve this order. This construct may be nested. Thus '-source/sl/{oldls,ls).c' expands to· '/usrlsource/sl/oldls.c
lusrlsource/sllls.c' whether or not these files exist without any chance of error if the home
directory for 'source' is '/usrlsource'. Similarly ' .. /{memo,*box)' might expand to ' ..lmemo
..lbox ..lmbox'. (Note that 'memo' was not sorted with the results of matching '*box;'> As a
special case '(', ')' and '{)' are passed undisturbed.
Input/output
The standard input and standard output of a command may be redirected with the following
syntax:

< name
Open file name (which is first variable, command and filename expanded) as the standard
input.

«

word
Read the shell input up to a line which is identical to word. Word is not subjected to variable, filename or command substitution, and each input line is compared to word before
any substitutions are done on this input line. Unless a quoting '\', '"\ ," or ", appears in
word variable and command substitution is performed on the intervening lines, allowing
'\' to Quote '$" '\' and "". Commands which are substituted have all blanks, tabs, and
newlines preserved, except for the final newline which is dropped. The resultant text is
placed in an anonymous temporary file which is given to the command as standard input.

> name
>! name
>& name

4th Berkeley Distribution

18 July 1983

7

CSH (1)

UNIX Programmer's Manual

CSH (1 )

>&! name
The file name is used as standard output. If the file does not exist then it is created~ if the
file exists, its is truncated, its previous contents being lost.
If the variable noclobber is set, then the file must not exist or be a character special file
(e.g. a terminal or ~/dev/null') or an error results. This helps prevent accidental destruction of files. In this case the ~!' forms can be used and suppress this check.
The forms involving ~ &' route the diagnostic output into the specified file as well as the
standard output. Name is expanded in the same way as ~ <' input filenames are.

» name
» & name
» ! name
»&! name
Uses file name as standard output like 10 >' but places output at the end of the file. If the
variable noclobber is set, then it is an error for the file not to exist unless one of the ~!'
forms is given. Otherwise similar to ~ > '.
A command receives the environment in which the shell was invoked as modified by the
input-output parameters and the presence of the command in a pipeline. Thus, unlike some
previous shells, commands run from a file of shell commands have no access to the text of the
commands by default; rather they receive the original standard input of the shell. The 4 < <'
mechanism should be used to present inline data. This permits shell command scripts to function as components of pipelines and allows the shell to block read its input. Note that the
default standard input for a command run detached is not modified to be the empty file
~/dev/null'~ rather the standard input remains as the original standard input of the shell. If this
is a terminal and if the process attempts to read from the terminal, then the process will block
and the user will be notified (see Jobs above.)
Diagnostic output may be directed through a pipe with the standard output. Simply use the
form ~I&' rather than just ~t.
Expressions
A number of the builtin commands (to be described subsequently) take expressions, in which
the operators are similar to those of C, with the same precedence. These expressions appear in
the @, exit, if, and while commands. The following operators are available:

II

&&

It

< .. > == < > < < > > + - . . I % ! right,. ~ .. ==' I.! ==' ~ == -, and r', ~ < ==' ~ > ==' <'

& = == != -'"' !'"

( }

Here the precedence increases to the
and
4> " 4< <' and ~ > > " 4+' and 10 - " 10.' ~ /' and '%' being, in groups, at the same level. The
~ == ==' ~! ==' ~ == -, and ~ !-' operators compare their arguments as strings~ all others operate on
num bers. The operators 4 == -, and 4 r' are like I.! ==' and 4 == ==' except that the right hand side is
a pattern (containing, e.g. 4.'S, '?'s and instances of 'L.1') against which the left hand operand
is matched. This reduces the need for use of the switch statement in shell scripts when all that
is really needed is pattern matching.
4

4

Strings which begin with '0' are considered octal numbers. Null or missing arguments are considered 40'. The result of aU expressions are strings, which represent decimal numbers. It is'
important to note that no two components of an expression can appear in the same word;
except when adjacent to components of expressions which are syntactically significant to the
parser (10&' lot '<' I.>' '(' I.) ') they should be surrounded by spaces.
Also available in expressions as primitive operands are command executions enclosed in 10 {' and
IoJ' and file enquiries of the form ~-I name' where lis one of:

4th Berkeley Distribution

18 July 1983

8

CSH (1)

UNIX Programmer's Manual

r
w
x
e
0

z
f
d

CSH (1 )

read access
wri te access
execute access
existence
ownership
zero size
plain file
directory

The specified name is command and filename expanded and then tested to see if it has the
specified relationship to the real user. If the file does not exist or is inaccessible then all
enquiries return false, i.e. 40'. Command executions succeed, returning true, i.e. ~ 1" if the
command exits with status 0, otherwise they fail, returning false, i.e. ~O'. If more detailed
status information is required then the command should be executed outside of an expression
and the variable status examined.
Control flow
The shell contains a number of commands which can be used to regulate the flow of control in
command files (shell scripts) and On ~imited but useful ways) from terminal input. These commands all operate by forcing the shell to reread or skip in its input and, due to the implementation, restrict the placement of some of the commands.
The /oreach, switch, and while statements, as well as the i/-then-else form of the i/statement
require that the major keywords appear in a single simple command on an input line as shown
below.
If the shell's input is not seekable, the shell buffers up input whenever a loop is being read and
performs seeks in this internal buffer to accomplish the rereading implied by the loop. (To the
extent that this allows, backward goto's will succeed on non-seekable inputs.)
Builtin commands
Builtin commands are executed within the shell. If a builtin command occurs as any component of a pipeline except the last then it is executed in a subshell.
alias
alias name
alias name wordlist
The first form prints all aliases. The second form prints the alias for name. The final
form assigns the specified wordlist as the alias of name; wordlist is command and filename
substituted. Name is not allowed to be alias or unalias.
alloc

,
Shows the amount of dynamic core in use, broken down into used and free core, and
address of the last location in the heap. With an argument shows each used and free
block on the internal dynamic memory chain indicating its address, size,' and whether it is
used or free. This is a debugging command and may not work in production versions of
the shell~ it requires a modified version of the system memory allocator.

bg
bg Ofojob ...
Puts the current or specified jobs into the background, continuing them if they were
stopped.

break
Causes execution to resume after the end of the nearest enclosing /oreach or while. The
remaining commands on the current line are executed. Multi-level breaks are thus possible by writing them all on one line.

4th Berkeley Distribution

18 July 1983

9

CSH (1 )

UNIX

Progr~mp1er's

Manual

CSH (1 )

breaksw
Causes a break from a switch, resuming after the endsw.
case label:
A label in a switch statement as discussed below.
cd
cd name
chdir
chdir name
Change the shells working directory to directory name. If no argument is given then
change to the home directory of the user.
If name is not found as a subdirectory of the current directory (and does not begin with
'/', './' or '.'/'), then each component of the variable cdpath is checked to see if it has a
subdirectory name. Finally, if all else fails but name is a shell variable whose value begins
with '/', then this is tried to see if it is a directory.
continue
Continue execution of the nearest enclosing while or /oreach. The rest of the commands
on the current line are executed.
default:
Labels the default case in a switch statement. The default should come after all case
labels.
dirs
Prints the directory stack~ the top of the stack is at the left, the first directory'in the stack
being the current directory.
echo wordlist
echo - n wordlist
The specified words are written to the shells standard output, separated by spaces, and terminated with a newline unless the - n option is specified.
else
end
endif
endsw
See the description of the /oreach,if, switch, and while statements below.
eval arg ...
(As in sh(I).) The arguments are r,ead as input to the shell and the resulting command(s)
executed in the context of the current shell. This is usually used to execute commands
generated as the result of command or variable substitution, since parsing occurs before
these substitutions. See tset( 1) for an example of using eva/.
exec command
The specified commanf:i is exe,cuted in place of the current shell.
exit
.exit(expr)
The shell exits either With the value of the status variable (first form) or with the value of
t~e specified expr (second form).
.
fg
fg%job ...
Brings the current or specified jobs into the foreground, continuing them if they were
stopped.

4th Berkeley Distribution

18 July 1983

10

CSH (1)

UNIX Programmer's Manual

CSH (1 )

foreach name (wordlist>
end
The variable name is successively set to each member of wordlist and the sequence of
commands between this command and the matching end are executed. (Both /oreach and
end must appear alone on separate lines.)
The builtin command continue may be used to continue the loop prematurely and the builtin command break to terminate it prematurely. When this command is read from the
terminal, the loop is read up once prompting with '?' before any statements in the loop
are executed. If you make a mistake typing in a loop at the terminal you can rub it out.
glob wordlist
Like echo but no '\' escapes are recognized and words are delimited by null characters in
the output. Useful for programs which wish to use the shell to filename expand a list of
words.
goto word
The specified word is filename and command· expanded to yield a string of the form
'label'. The shell rewinds its input as much as possible and searches for a line of the form
'label:' possibly preceded by blanks or tabs. Execution continues after the specified line.
hashstat
Print a statistics line indicating how effective the internal hash table has been at locating
commands (and avoiding exec's). An exec is attempted for each component of the path
where the hash function indicates a possible hit, and in each component which does not
begin with a 'I'.
history
history n
history -r n
history - h n
Displays the history event list~ if n is given only the n most recent events are printed.
The - r option reverses the order of printout to be most recent first rather than oldest
first. The - h option causes the history list to be printed without leading numbers. This
is used to produce files suitable for sourceing using the - h option to source.
if (expr) command
If the specified expression evaluates true, then the single commandwith arguments is executed. Variable substitution on command happens early, at the same time it does for the
rest of the if command. Command must be a simple command, not a pipeline, a command list, or a parenthesized command list. Input/output redirection occurs even if expr
is false, when command is not executed (this is a bug).
if (expr) then
else if (expr2) then
else
end if

If the specified expr is true then the commands to the first else are executed~ else if expr2
is true then the commands to the second else are executed, etc. Any number of else-if
pairs are possible~ only one endifis needed. The else part is likewise optional. (The words
else and endifmust appear at the beginning of input lines~ the ifmust appear alone on its
input line or after an else.)

4th Berkeley Distribution

18 July 1983

11

CSH (1)

UNIX Programmer's Manual

CSH (1 )

jobs
jobs -I
Lists the active jobs; given the -I options lists process id's in addition to the normal
information.
kill O/ojob
kill -sig Ofojob ...
kill pid
kill -sig pid ...
kill -I
Sends either the TERM (terminate) signal or the specified signal to the specified jobs or
processes. Signals are either given by number or by names (as given in
/usrlinclude/signal.h, stripped of the prefix HSIG"). The signal names are listed by Hkill
-I". There is no default, saying just ~kill' does not send a signal to the current job. If
the signal being sent is TERM (terminate) or HUP (hangup), then the job or process will
be sent a CONT (continue) signal as well.

limit
limit resource
limit resource maximum-use
Limits the consumption by the current process and each process it creates to not individually exceed maximum-use on the specified resource If no maximum-use is given, then the
current limit is printed; if no resource is given, then aU limitations are given.
Resources controllable currently include cputime (the maximum number of cpu-seconds to
be used by each process), jilesize (the largest single file which can be created), datasize
(the maximum growth of the data + stack region via sbrk(2) beyond the end of the program text}, stacksize (the maximum size of the automatically-extended stack region), and
coredumpsize (the size of the largest core dump that will be created).
The maximum-use may be given as a (floating point or integer) number followed by a
scale factor. For all limits other than cputime the default scale is 'k' or 'kilobytes' (I 024
bytes)~ a scale factor of 'm' or 'megabytes' may also be used. For cputime the default
scaling is 'seconds', while 'm' for minutes or 'h' for hours, or a time of the form 'mm:ss'
giving minutes and seconds may be used.
For both resource names and scale factors, unambiguous prefixes of the names suffice.
login
Terminate a login shell, replacing it with an instance of /bin/login. This is one way to log
off, included for compatibility with shU).
logout
Terminate a login shell. Especially useful if ignoreeojis set.
nice
nice +number
nice command
nice +number command
.
The first form sets the nice for this shell to 4. The second form sets the nice to the given
number. The final two forms run command at priority 4 and number respectively. The
super-user may spec.ify negative niceness by using 'nice -number ... '. Command is
always executed in a sub-shell, and the restrictions place on commands in simple {{statements apply.

nohup

4th Berkeley Distribution

18 July 1983

12

CSH (1)

UNIX Programmer's Manual

CSH (1 )

nohup command
The first form can be used in shell scripts to cause hangups to be ignored for the
remainder of the script. The second form causes the specified command to be run with
hangups ignored. All processes detached with '&' are effectively nohup'ed.
notify
notify Ofojob ...
Causes the shell to notify the user asynchronously when the status of the current or
specified jobs changes~ normally notification is presented before a prompt. This is
automatic if the shell variable notify is set.
onintr
onintr onintr label
Control the action of the shell on interrupts. The first form restores the default action of
the shell on interrupts which is to terminate shell scripts or to return to the terminal command input level. The second form 'onintr -' causes all interrupts to be ignored. The
final form causes the shell to execute a 'goto label' when an interrupt is received or a
child process terminates because it was interrupted.
In any case, if the shell is running detached and interrupts are being ignored, all forms of
onintr have no meaning and interrupts continue to be ignored by the shell and all invoked
commands.
popd
popd +n
Pops the directory stack" returning to the new top directory. With a argument '+ n' discards the nth entry in the stack. The elements of the directory stack are numbered from
o starting at the top.
pushd
pushd name
pushd +n
With no arguments, pushdexchanges the top two elements of the directory stack. Given a
name argument, pushd changes to the new directory (ala cd) and pushes the old current
working directory (as in csw) onto the directory stack. With a numeric argument, rotates
the nth argument of the directory stack around to be the top element and changes to it.
The members of the directory stack are numbered from the top starting at O.
rehash
Causes the internal hash table of the contents of the directories in the path variable to be
recomputed. This is needed if new commands are added to directories in the path while
you are logged in. This should only be necessary if you add commands to one of your
own directories, or if a systems programmer changes the contents of one of the system
directories.
repeat count command
The specified command which is subject to the same restrictions as the command in the
one line jfstatement above, is executed count times. 1/0 redirections occur exactly once,
even if count is O.
set
set name
set name -word
set name [index] -word
set name == (wordlist)
The first form of the command shows the value of all shell variables. Variables which

4th Berkeley Distribution

18 July 1983

13

CSH (1)

UNIX Programmer's Manual

CSH (1 )

have other than a single word as value print as a parenthesized word list. The second
form sets name to the null string. The third form sets name to the single word. The
fourth form sets the index'th component of name to word~ this component must already
exist. The final form sets name to the list of words in wordlist. In all cases the value is
command and filename expanded.
These arguments may be repeated to set multiple values in a single set command. Note
however, that variable expansion happens for all arguments before any setting occurs.
setenv name value
Sets the value of environment variable name to be value, a single string. The most commonly used environment variable USER, TERM, and PATH are automatically imported
to and exported from the csh variables user, term, and path; there is no need to use setenv
for these.
shift
shift variable
The members of argvare shifted to the left, discarding argv[J). It is an error for argv not
to be set or to have less than one word as value. The second form performs the same
function on the specified variable.
source name
source - h name
The shell reads commands from name. Source commands may be nested~ if they are
nested too deeply the shell may run out of file descriptors. An error in a source at any
level terminates all nested source commands. Normally input during source commands is
not placed on the history Iist~ the - h option causes the commands to be placed in the history list without being executed.
stop
stop %job .. ,
Stops the current or specified job which is executing in the background.
suspend
Causes the shell to stop in its tracks, much as if it had been sent a stop signal with
This is most often used to stop shells started by suO).

"z.

switch (string)
case strl:
breaksw
default:
breaksw
endsw
Each case label is successively matched~.against the specified string which is first command
and filename expanded. Thefilemetacnaracters ' .• ', '?' and '[.. .1' may be used in the case.
labels, which are variable expanded. If none of the 'labels match before a 'default' label is
fQund, then the execution begins after the default label. Each case label and the default
label must appear at thebeginningofa Hne. The command breaksw causes execution to
continue after the endsw. Otherwise contro'lmay fall through case labe.ls and default labels
as in C. If no label matches and there is no default, execution continues after the endsw.
time
time command
With no argument, a summary of time used by this shell and its children is printed. If

4th Berkeley Distribution

18 July 1983

14

CSH (1)

UNIX Programmer's Manual

CSH (1 )

arguments are given the specified simple command is timed and a time summary as
described under the time variable is printed. If necessary, an extra shell is created to print
the time statistic when the command completes.
umask
umask value
The file creation mask is displayed (first form) or set to the specified value (second form).
The mask is given in octal. Common values for the mask are 002 giving all access to the
group and read and execute access to others or 022 giving all access except no write access
for users in the group or others.
unalias pattern
All aliases whose names match the specified pattern are discarded. Thus all aliases are
removed by ~unalias .'. It is not an error for nothing to be unaliased.
un hash
Use of the internal hash table to speed location of executed programs is disabled.
unlimit resource
unlimit
Removes the limitation on resource If no resource is specified, then all resource limitations are removed.
unset pattern
All variables whose names match the specified pattern are removed. Thus all variables
are removed by ~unset .'~ this has noticeably distasteful side-effects. It is not an error for
nothing to be unset.
unsetenv pattern
Removes all variables whose name match the specified pattern from the environment.
See also the setenv command above and printenv(I).
wait
All background jobs are waited for. It the shell is interactive, then an interrupt can disrupt the wait, at which time the shell prints names and job numbers of all jobs known to
be outstanding.
while (expr)
end
While the specified expression evaluates non-zero, the commands between the while and
the matching end are evaluated. Break and continue may be used to terminate or continue
the loop prematurely. (The while and end must appear alone on their input linesJ
Prompting occurs here the first time through the loop as for the joreach statement if the
input is a terminal.
%job
Brings the specified job into the foreground.
%job &
Continues the specified job in the background.
@
@ name = expr
@ name [index] =- expr

The first
specified
least this
value of

form prints the values of all the shell variables. The second form sets the
~&' or ~~ then at
part of the expression must be placed within ~ {' '}'. The third form assigns the
expr to the index'th argument of name. Both name and its index'th component

name to the value of expr. If the expression contains ~ <', ~ >',

4th Berkeley Distribution

18 July 1983

15

CSH (1)

UNIX Programmer's Manual

CSH (1 )

must already exist.
The operators 4", =', 4+ =', etc are available as in C. The space separating the name from
the assignment operator is optional. Spaces are, however, mandatory in separating components of expr which would otherwise be single words.
Special postfix
i.e. 4 @ i + + '.

4

+ +'

and

4 -

-'

operators increment and decrement name respectively,

Pre-defined and environment variables
The following variables have special meaning to the shell. Of these, argv, cwd, home, path,
prompt, shell and status are always set by the shell. Except for cwd and status this setting occurs
only at initialization~ these variables will not then be modified unless this is done explicitly by
the user.
This shell copies the environment variable USER into the variable user, TERM into term, and
HOME into home, and copies these back into the environment whenever the normal shell variables are reset. The environment variable PATH is likewise handled~ it is not necessary to
worry about its setting other than in the file .cshrc as inferior csh processes will import the
definition of path from the environment, and re-export it if you then change it.

argv

Set to the arguments to the shell, it is from this variable that positional parameters are substituted, i.e. 4$1' is replaced by 4$argv [1]', etc.

cdpath

Gives a list of alternate directories searched to find subdirectories in chdir commands.

cwd

The full pathname of the current directory.

echo

Set when the - x command line option is given. Causes each command and
its arguments to be echoed just before it is executed. For non-builtin commands all expansions occur before echoing. Builtin commands are echoed
before command and filename substitution, since these substitutions are then
done selectively.

histchars

Can be given a string value to change the characters used in history substitution. The first character of its value is used as the history substitution character, replacing the default character!. The second character of its value replaces
the character T in quick substitutions.

history

Can be given a numeric value to control the size of the history list. Any command which has been referenced in this many events will· not be discarded.
Too large values of history may run the shell out of memory. The last executed command is always saved on the history list.

home

The home directory of the invoker, initialized from the environment. The
filename expansion of 4-' refers to this variable.

ignoreeof

If set the shell ignores end-of-file from input devices which are terminals.
This prevents shells from accidentally being killed by control-D's.

mail

The files where the shell checks for mail. This is done after each command
completion which will result in a prompt, if a specified interval has elapsed.
The shell says 4you have new mail.' if the file exists with an access time not
greater than its modify time.

If the first word of the value of mail is numeric it specifies a different mail
checking interval, in seconds, than the default, which is 10 minutes.
If multiple mail files are specified, then the shell says 4New mail in name'
when there is mail in the file name.

4th Berkeley Distribution

18 July 1983

16

CSH (1)

UNIX Programmer's Manual

CSH (1 )

noclobber

As described in the section on Input/output, restrictions are placed on output
redirection to insure that files are not accidentally destroyed, and that ~ > > '
redirections refer to existing files.

noglob

If set, filename expansion is inhibited. This is most useful in shell scripts
which are not dealing with filenames, or after a list of filenames has been
obtained and further expansions are not desirable.

nonomatch

If set, it is not an error for a filename expansion to not match any existing
files~ rather the primitive pattern is returned. It is still an error for the primitive pattern to be malformed, i.e. 'echo [' still gives an error.

notify

If set, the shell notifies asynchronously of job completions. The default is to
rather present job completions just before printing a prompt.

path

Each word of the path variable specifies a directory in which commands are to
be sought for execution. A null word specifies the current directory. If there
is no path variable then only full path names will execute. The usual search
path is ~.', '/bin' and ~/usr/bin', but this may vary from system to system. For
the super-user the default search path is '/etc', '/bin' and '/usr/bin'. A shell
which is gi ven neither the - c nor the - t option will normally hash the contents of the directories in the path variable after reading . cshrc, and each time
the path variable is reset. If new commands are added to these directories
while the shell is active, it may be necessary to give the rehash or the commands may not be found.

prompt

The string which is printed before each command is read from an interactive
terminal input. If a ~!' appears in the string it will be replaced by the current
event number unless a preceding ~\' is given. Default is ~% '. or •# • for the
super-user.

savehist

is given a numeric value to control the number of entries of the history list
that are saved in -I.history when the user logs out. Any command which has
been referenced in this many events will be saved. During start up the shell
sources -I.history into the history list enabling history to be saved across
logins. Too large values of savehist will slow down the shell during start up.

shell

The file in which the shell resides. This is used in forking shells to interpret
files which have execute bits set, but which are not executable by the system.
(See the description of Non-builtin Command Execution below.) Initialized to
the (system-dependent) home of the shell.

status

The status returned by the last command. If it terminated abnormally, then
0200 is added to the status. Builtin commands which fail return exit status ~1',
all other builtin commands set status ~O'.

time

Controls automatic timing of commands. If set, then any command which
takes more than this many cpu seconds will cause a line giving user, system,
and real times and a utilization percentage which is the ratio of user plus system times to real time to be printed when it terminates.

verbose

Set by the - v command line option, causes the words of each command to be
printed after history substitution.

Non-builtin command execution
When a command to be executed is found to not be a builtin command the shell attempts to
execute the command via execve(2). Each word in the variable path names a directory from
which the shell will attempt to execute the command. If it is given neither a - c nor a - t
option, the shell will hash the names in these directories into an internal table so that it will

4th Berkeley Distribution

18 July 1983

17

CSH (1)

UNIX Programmer's Manual

CSH (1 )

only try an exec in a directory if there is a possibility that the command resides there. This
greatly speeds command location when a large number of directories are present in the search
path. If this mechanism has been turned off (via unhash), or if the shell was given a - c or - t
argument, and in any case for each directory component of path which does not begin with a
'/', the shell concatenates with the given command name to form a path name of a file which it
then attempts to execute.
Parenthesized commands are always executed in a subshell. Thus' (cd ; pwd) ; pwd' prints the
home directory; leaving you where you were (printing this after the home directory), while 'cd ~
pwd' leaves you in the home directory. Parenthesized commands are most often used to
prevent chdir from affecting the current shell.
If the file has execute permissions but is not an executable binary to the system, then it is
assumed to be a file containing shell commands and a new shell is spawned to read it.
If there is an alias for shell then the words of the alias will be prepended to the argument list to
form the shell command. The first word of the alias should be the full path name of the shell
(e.g. '$shell'). Note that this is a special, late occurring, case of alias substitution, and only
allows words to be prepended to the argument list without modification.

Argument list processing
If argument 0 to the shell is '-' then this is a login shell. The flag arguments are interpreted
as follows:
- c Commands are read from the (single) following argument which must be present. Any
remaining arguments are placed in argv.

-e The shell exits if any invoked command terminates abnormally or yields a non-zero exit
status.
-f

The shell will start faster, because it will neither search for nor execute commands from
the file '.cshrc' in the invokers home directory.

-i

The shell is interactive and prompts for its top-.level input, even if it appears to not be a
terminal. Shells are interactive without this option if their inputs and outputs are terminals.

- n Commands are parsed, but not executed. This aids in syntactic checking of shell scripts.

- s

Command input is taken from the standard input.

- t

A single line of input is read and executed. A '\' may be used to escape the newline at
the end of this line and continue onto another line.

- v Causes the verbose variable to be set, with the effect that command input is echoed after
history substitution.

-x Causes the echo variable to be set, so that commands are echoed ·immediately before execution.

- V Causes the verbose var.iable to be set even before '.cshrc' is executed.
-X Is to -x as -V is to -v.
After processing of flag arguments if arguments remain but none of the - c, - i, - s, or - t
options was given the first argument is taken as the name of a file of commands to be executed.
The shell opens this file, and saves its name for possible resubstitution by '$0'. Since many
systems use either the standard version 6 or version 7 shells whose shell scripts are not compatible with this shell, the shell will execute such a 'standard'shell if the first character of a script
is not a '#', i.e. if the script does not start with a c()mment. Remaining arguments initialize the

variableargv.

4th Berkeley Distribution

18 July 1983

18

CSH (1)

UNIX Programmer's Manual

CSH (1 )

Signal handling
The shell normally ignores quit signals. Jobs running detached (either by '&' or the bg or %•••
& commands) are immune to signals generated from the keyboard, including hang ups. Other
signals have the values which the shell inherited from its parent. The shells handling of interrupts and terminate signals in shell scripts can be controlled by onintr. Login shells catch the
terminate signal; otherwise this signal is passed on to children from the state in the shell's
parent. In no case are interrupts allowed when a login shell is reading the file '.logout'.
AUTHOR

William Joy. Job control and directory stack features first implemented by J.E. Kulp of
I.I.A.S.A, Laxenburg, Austria, with different syntax than that used now.
FILES

-I.cshrc
-/.login
-/.logout

Ibin/sh
Itmp/sh*
I etcl passwd

Read at beginning of execution by each shell.
Read by login shell, after' .cshrc' at login.
Read by login shell, at logout.
Standard shell, for shell scripts not starting with a '#'.
Temporary file for' < <'.
Source of home directories for '-name'.

LIMITATIONS

Words can be no longer than 1024 characters. The system limits argument lists to 10240 characters. The number of arguments to a command which involves filename expansion is limited
to 1I6'th the number of characters allowed in an argument list. Command substitutions may
substitute no more characters than are allowed in an argument list. To detect looping, the shell
restricts the number of alias substitutions on a single line to 20.
SEE ALSO

shU), access(2), execve(2), fork(2), killpg(2), pipe(2), sigvec(2), umask(2), setrlimit(2),
wait(2), tty(4), a.out(S), environ(7), 'An introduction to the C shell'
BUGS

When a command is restarted from a stop, the shell prints the directory it started in if this is
different from the current directory~ this can be misleading (i.e. wrong) as the job may have
changed directories internally.
Shell builtin functions are not stoppable/restartable. Command sequences of the form 'a ~ b ~
c' are also not handled gracefully when stopping is attempted. If you suspend 'b', the shell will
then immediately execute 'c'. This is especially noticeable if this expansion results from an
alias. It suffices to place the sequence of commands in O's to force it to a subshell, i.e. '( a; b·
; c)'.

Control over tty output after processes are started is primitive~ perhaps this will inspire someone to work on a good virtual terminal interface. In a virtual terminal interface much more
interesting things could be done with output control.
Alias substitution is most often used to clumsily simulate shell procedures; shell procedures
should be provided rather than aliases.
Commands within loops, prompted for by '?', are not placed in the history list. Control struc;
ture should be parsed rather than being recognized as built-in commands. This would allow
control commands to be placed anywhere, to be combined with '~, and to be used with '&' and
';' metasyntax.
It should be possible to use the ':' modifiers on the output of command substitutions. All and
more than one ':' modifier should be allowed on '$' substitutions.

4th Berkeley Distribution

18 July 1983

19

CSH (1)

UNIX Programmer's Manual

CSH (1 )

Symbolic links fool the shell. In particular., dirs and 'cd .. ' don't work properly once you've
crossed through a symbolic link.

4th Berkeley Distribution

18 July 1983

20

CTAGS(I)

UNIX Programmer's Manual

CTAGS(I)

NAME

ctags - create a tags file
SYNOPSIS

ctqs [ - BF.tuwvx ] name ...
DESCIUPTION

Ctags makes a tags file for exU) from the specified C, Pascal and Fortran sources. A tags file
gives the locations of specified objects (in this case functions and typedefs) in a group of files.
Each line of the tags file contains the object name, the file in which it is defined, and an address
specification for the object definition. Functions are searched with a pattern, typedefs with a line
number. Specifiers are given in separate fields on the line, separated by blanks or tabs. Using
the tags file, ex can quickly find these objects definitions.
If the - x flag is given, ctags produces a list of object names, the line number and file name on
which each is defined, as well as the text of that line and prints this on the standard output.
This is a simple index which can be printed out as an off-line readable function index.
If the -v flag is given, an index of the form expected by ,grind(1) is produced on the standard
output. This listing contains the function name, file name, and page number (assuming 64 line
pages) . Since the output will be sorted into lexicographic order, it may be desired to run the
output through sort -f. Sample use:
ctags -v files Isort - f > index
vgrind - x index
Files whose name ends in .c or .h are assumed to be C source files and are searched for C routine and macro definitions. Others are first examined to see if they contain any Pascal or Fortran routine definitions; if not, they are processed again looking for C definitions.
Other options are:
- F use forward searching patterns (I ••• /) (default).
- B use backward searching patterns (1 ... 1).
-a append to tags file.
-t create tags for typedefs.
-w suppressing warning diagnostics.
-u causing the specified files to be updated in tags, that is, all references to them are deleted,
and the new values are appended to the file. (Beware: this option is implemented in a
way which is rather slow; it is usually faster to simply rebuild the tags file.)
The tag main is treated specially in C programs. The tag formed is created by prepending M to
the name of the file, with a trailing .c removed, if any, and leading pathname components also
removed. This makes use of ctags practical in directories with more than one program.
FILES

tags

output tags file

SEE ALSO
ex(1), vi(1)

AUTHOR
Ken Arnold; FORTRAN added by Jim Kleckner; Bill Joy added Pascal and -x, replacing cxre.f;
C typedefs added by Ed Pelegri-Llopart.

BUGS
Recognition of functions, subroutines and procedures for FORTRAN and Pascal is done is a
very simpleminded way. No attempt is made to deal with block structure; if you have two Pascal procedures in different blocks with the same name you lose.

4th Berkeley Distribution

2S August 1982

1

CTAGS(l)

UNIX Programmer's Manual

CTAGS(1)

The method of deciding whether to look for C or Pascal and FORTRAN functions is a hack.
Does not know about #ifdefs.
Should know about Pascal types. Relies on the input being well formed to detect typedefs. Use
of -tx shows only the last line of typedefs.

4th Berkeley Distribution

2S August 1982

2

CXREF(l)

UNIX Programmer's Manual

CXREF( 1) .

NAME

cxref - cross reference C source files
SYNOPSIS

ex f(~f [ - SCcfis ] [ - w width] [files]
DEscnIPTION

Cxref reads the named C source filcs and produces on the standard output a cross reference of all
the identifiers and constants in the files. Constants arc integer constanl~ (12,042], Oxl"), floating
point constants (123.45, O.2e-4), string constants ("this is a string\nlt), and character constants ('a',
'\033'). Identifiers, character constants, and string constants arc sorted lexicographically, i.e. according to the machine collating scqucnce (7-bit I\SCII 011 the Vax or Pyramid). Intcger and floating
point constants arc sorted nUlllerically.Tlle tr(,!iling T or 't' on long intcgcr constants will not
show lip in the output listing:
.~
>

'.

.'

" ' .

..'

"

•

_.

..

If no files arc namcd, c.xTl{rcads t.he standard input. For multiple files, thc argument" dash) indicates that lhe standard input should hc rcad at that point.
If arguments are givcn, they must come before any tHc names.

.'

It

(a single

Cxnif'recognizes the f()l1owing argument.;;:
- S

Cross reference all files separatcly. The default action is to cross reference all
named files together.

- e

r.eave charactcr constants out of t.he cross reference listing.

-r

I_cave Iloating point constants out of the cross refcrence listing.

- i

I.eave integer constants out of the cross reference listing.

- s

I_cave string constants out of thc cross reference listing.

~C

Leave all constants, charactcr, string, integer, and l10ating point, out of the cross
reference listing. By dcHlult, all types of constants arc includcd in the cross reference.
-w width
M:lkc the output hc widllt colullllls wille. The output width will never he less than
51 or more than 1J2 columns. ('xrrf silently adjusts incorrcct settings to the
ncarest allowable selling. II' no width is spccilicd, the output will ucfault to 80
columns wide.
Cxrrf docs /lot include it include files, or expand macro dcl-initiolls. Files named in # include lines
call be listed on the command line if thcy should also be cross rcfcrcnced.
If a quoted string has an escaped newline in it (see "The C Programming I,anguage", page 18 L, or
Section 2.5 of lhe C Ref~rence Manual), it will show up insidc the string in the output listing as
\N. This is to make it visible to the programmer, and to keep thc various filters which ('xreluses
to actually do the work from gt,lting terrihly confilsed.
('):rcfis best rUIl i.n the background, with its outpul rcdirected into a filc or the line prillter spooler
11'1'(1), since it rcads all the named fIlcs, lIsing sort(l) as an intermcdiate pass. The sorting can take
timc which the USCI' can probably put to more produclive lISC.
DIAGNOSTICS

Self exp1anatory.
BUGS
Sysh:~ms running UNIX 4.0 and laler already have a program named cxrr/ . Thcrefore. on those
systems, this program should be renamed.

7th

I~dition

Georgia Tech .

1

CXREF(l)

UNIX Programmer's Manual

CXREF(l)

Cxref docs not do any formatting on its output (othcr than to insure that it writcs the proper
number of columns), so it should probably be run piping its output into prO).

Floating point constants arc cOllveltcd to a common format for sorting, therefore they may appear
in the output in a format dilfercnt from (but numcrically equivalent to) their form in the original
source code.
SEE ALSO

[ex(1), [pr(l), prO), soYl( 1)
FIL£.'i

Itmp/cxr.$$.*
temporary files fbI' integer and Ilo(lting point contstants. Cxrcf removes these files when it
'~ ':. " is th rough:
AUTHOR

Arnold Robbins
School of Inf(l\'mation and Computer Science
Gcorgia I nstitute of Technology
Atlanta, Geogia 30332
UUCP: gatech!arnold
CSNET:
arnoldCipgatech

ARPAN ET:

arnold%gatech.csnet(i{Jtsllet-relay.arpa

Copyright (c) 1984 by Arnold Robbins. ;\ 11 rights reserved. This program may not be sold, but
may be distributed provided this nolicc is included.

7th Edition

Georgia Tech

2

CZ(1)

UNIX Progratllnler's Manual

CZ(l)

NAME

cz (czarina) - convert files to press format and print them on the Dover.
SYNOPSIS

cz [ options] [ files]
DESCRIPTION

cz (czarina -- the VAX version of the Alto progratn empress) reads in text files, converts them to
press format and ships them to the Dover.
The environment variable CZ may be used to specify defaults. The value of CZ is parsed as a
string of arguments before the arguments that appear on the command line. For example "CZ= '-f
TirncsRoman8'" sets your default body font to 8 point Times Roman.
If a file is already in press format czarina will discover this fact by examinatlon. Such files will be
shipped as-is with minor changes to the document directory to make the coyer sheet of the fim:ll
output agree with the sc1ected options.
" fhnt name has three part~: " flllnily name (from the set TimesRoman, Helvctica, Gacha, and
Sail: Gacha and Sail are fixcd width), an optional point size (l point=: 1/72 inch -- 8 point is a
good small font), and an optional t11cing (b=bold, i=italic, nothing=roman). So Gacha8b is 8
point bold Gacha, lIclvetica12i is 12 point italic Helvetica.
The possible options are:
-2
-b banner

-c n

-f t()Ilt

-F font

-g

-h header

-I
-n name

-N
-0

7t.h Edition

Set<; two column mode.
Uses "banner" to label the output. It will appear on the cover page on the
line labeled "File:".
Causes 11 copies of the output to be produced. The deflllllt is one.
Sets the f<.mt to be used fbI' the body of each page~ De"tillilts to Gacha 10.
unless two column rotated mode is used, in which case it dcfaults to
O jilenalllc'l
Start executing ()~Uil(', passing args as command line arguments; < or ) can be used to
redirect input or output ill the usual manner. When rel'llil is used wit.hout any arguments
the previolls Hrgulllent. list is passed to the program: otherwise it is kknt.ical to nm. If
o/~ilil{' has been written since the last timc the syrnbolic intormation was read in, dbx will
read in the new int()rmation.

run [args]

truce [in proccdure/jilllclioll] [if condition]
trace source-line-number [if cOlldition]
trace procedure(/illlclioll [in proccdure/function] [if condition]
traCl~ expressiol1 fit source-lille-number [if cOlldiliol1]
tntce variable rin procedure/./illle/ioll] [if c0l1difion1
.
Have tracing information printed when thc program is executed. t\ number is associated
wilh the command that is lIsed to tur.n the lracing on' (s~e the delete command).

4th Berkeley Distribution

17 May' 1984

1 .

UN IX Programmcr'sManual

DBX(l)

DBX( 1)

The first argument describes what is to be traced. If it is a source-lille-IlUInber, then the
line is printed immediately prior to being executed. Source line numbers in a fi1e other
than the current one muSl be preceded by the namc of the liIe in quotes and a colon, c.g.
"mumble.p": 17 .
. If the argument is a procedure or function name then every time it is called, information is
printed telling what routine called it, from what source linc it was called, and what parameters were passed to it. [n addition, its return is noted, and if it's a function then the value it
is returning is also printed.
1f the argument is an expression with an ,It clause then the value of the expression is
printed whenever the identified source -lifle is reached.

If the argument is a variable then the name and value of the variable is printed whenever it
changes. Execution is substantially slower during this form of tracing.
If no argument is specified then all source lines are printed bcf()re they are executed. Execution is subsl(lntially slower during this form of t.racing.
The clause "in procedure/jilllelion" restricts tracing information to be printed only while
executing inside the given procedure or function.
COllditiOI1 is a boolean expression and is evaluated prior to printing the tracing information; if it is false then the inf<'>rJllatioll is not printed.
stol) if cOlldilion

stOI) at source-lille-nulllber [if condilion]
st:op in

proccdurrlfullcliull [if condilion)

stOI) vlIri([ble [if COIIC/ilioni

Stop execution when the given line is reached, procedure or funct.ion called, variable
changed, or condition true.
status

[> ./11cllallle]
Print out the currently active (race and stol) cOllllnands.

delete (,UlIlllllllfd-lIulllb{'r ...
The traces or stops corresponding to the given numbers are removed. The Ilumbers associated wit.h traces and stops are printed by the status command.
catch number
ignore number
Start or slop trapping signal number bef{)re it is sent to the program. This is lIseful when a
program being debugged handles signals such as interrupts. Init.ially all signals are trapped
excepl SIGCONT, SIGel III.D, SIGALRM and SIGKILL.
cont

Continuee.xeclition from where it stopped. I~xeclition cannot be continlled if the process
has "finished", that is, called the standard procedure "exit". Dbx does not allow the process to exit, thereby letting the USCI' to examine the program state.

step

I ~xecllte one source linc.

next

Execute up to the next source line. The dHlcrence between t.his and stef) is that if the line
contains a call to a procedure or function the stel) command will stop at the beginning ()f
that block, while the next commalld will not.

return [procrdure]
Continue until a return to procedure is executed, or until the current procedure returns if

4tJ1 Berkeley Distribution

17 May 1984 -

2

DnX( 1)

UN IX Programmer's .Manual

nBX( 1)

none is specified.
l>iSI)laying and Naming

D~lhl

print expression [, expression ...]
Print out the values of t.he expressions. Array expressions are always subscripted by brackel<; "("[ r). Variables having the same identifier as one in' the current block may be rdcrenced as "block-lIallle. variable". The field reference operator e':') can be used with
pointers as well as records, making the C operator H_)" unnecessary (alt.hough it is supported). The construct expressio/l \ lypellame can be lIsed to print the expression out in the
tb~mat of the type nllnlcd .(ypell,amfJ., ., .
.
i. t
whatis name
Print the declaration of the given name, which may he qualified with block names as
above.
which identifier
Print the full qualification of lhe given identifer. i.e. the outer blocks that t.he identil1er is
associated with.
whercis identifier
Print the full qualification of all the symbols whose name matches the given identifier. The
order in which the symbols arc printed is not meaningful.
assign variable = expression
S('t variable = expression
" Assign the value of the expression to the variable.
ell II procedu re(pa mille/en))
Execute the object code associated with t.he named procedure or thllctioll. Currently. calls
to a procedure with a variable nmnher of arguments arc not possible. I\lso, string parameters arc not passed properly for C.
where Print out a list of the active procedures and function.
duml) [) filename]
Print t.he names and values or all active variables.
lip [counl]
7

down [count]

Move the current function. which is used for resolving names, up or down the stack
levels. The dc.fault COUIIL is 1.

COUflt

Accessing Source Files
edit: [fill'll([me]
edit procedure/function-name
Invoke an editor on filename or the current source file if none is specified . .If a procedure
or function name is specified. the editor is invoked on the file that contains it. Which editor is invoked by default depends on the installation. The default can be overridden by
setting the environment variable EDITOR to the name of.the desired editor.

file (filename]
Change the .current source file name to filcname. If none is specified then the current
source file name is printed.

rune [procedu refiii lie lion]

4th Berkeley Distribution

17 May 1984

.3

nnx( I)

UNIX Programmer's Manual

DI1X( 1)

Change the current function. I f none is specified then print the current function. Changing t.he current function imp1icitly changes the current source file to the one that contains
the function: it a1so changes the current scope lIsed for name resolution.
.
list: [sourcc-line-number [, source-!ine-nwllbedl
list procedure/fUllction
. l.ist the lines in the currcnt source me from the first 1ine number to thc second inclusive.
If no Jines are speciHed, the next 10 lines are listed. If the name ora procedure or function
is given lines n-k to 11-1·· k are lisled where II is the first statement in the proc(~dllre or function and k is small.
usc directory-list
Set the 1ist of directories to be searched when 100king fhl" source files.

Mi.lchinc Levcl Commands
tmcri [addrcssl [if cOlldl
tnlcci [variable] [at addressl [if cond]
stopi [addressl [if condj
Shll)i [at] [mldre~:\'l [if condj
Turn on tracing or set a stop lIsing a machine instruction address.

stCIJi
nextj Sing1e step as in step or next, but do a single instruction rather than source line.
address ,addrc.\~')/ [mode]
[address1 / [cOUIII] [lIwdd
Print the contents of memory starting at the I1rst address and cont.inuing up to the second
address or until COUIlI items ar~ prillted. I f no address is specified, the address f()lIowing
the one printed most recently is used. The mode specifics how memory is to be printed: if
it is omitted t.he previolls mode specified is used. The initial mode 'is "X"" The ()lIowing
modes are support~d:
i
d
I)

()

o
x
X

b
c
s
f
g

print the machine instruction
print a short word in decimal
print. a long word in decimal
print a short word in octal
print. (l long word in octal
prinl a short word in hexadecimal
print a long word in hexadecimal
print a byte in octal
print a byte as a character
print a string of ch,tnlct{~rs tcrmin;Ited by a null byte
prinl a single precision real Ilumber
prinl a doub1e precision real number

Symbo1ic addresses are specified by preceding the name with an "&". Registers are denoted by
H$rN" where N is the number of the register. Addresses may be expressions ma~le up of other
addresses and the operators" + ", "-", andilldirectioll (unary "*").

4th Berkc1ey Distribution

l7May'1984

4 .

DnX( 1)

UN IX Programmer's Manual

DnX(l)

Miscclhmcous Commands
sh COlllfJwll(i-line
Pass the command Iinc to the shell for execution. The SH ELL environment variable determines which shell is used.
alhls lleW-COI11I1Wlld-lll1me old-c0I1111Wll(i-llame
Respond to new-colllmand-llame as though it were old-col11l'nand-name.
help

Print out a synopsis of dbx commands.

grille

Invoke a Inail program to send a message to the person in charge of dbx.

source jilcllal'ne
;.'.,
Read dbx commands from the given filename.
x -x
v

e
I
o

7th Edition

The top two elements of the stack are popped and compared. Register x is executed if
they obey the stated relation.
replaces the top element on the stack by its square root. Any existing fractional part of
the argument is taken into account, but otherwise the scale factor is ignored.
interprets the rest of the line as a UNIX 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. I
pushes the input base on the top of the stack.
The top value on the stack is popped and used as the number radix for further output.

18 January .1983

1

DC(I)

UNIX Programmer's Manual

DC(l)

o

pushes the output base on the top of the stack.
the top of the stack is popped, and that value is used as a non-negative scale factor: the
k
appropriate number of places are printed on output, and maintained during multiplication, division, and exponentiation. The interaction of scale factor, input base, and output base will be reasonable if all are changed together.
The stack level is pushed onto the stack.
z
replaces the number on the top of the stack with its lellith.
Z
A line of input is taken from the input source (usually the terminal) and executed.
are used by be for array operations.
t •
An example which prints the first ten values of n! is
[1al +dsa*plal0>y]sy

.,
..

Osal
lyx
SEE ALSO
bc(1), which is a preprocessor for de providina infix notation and a C-like syntax which imple-

ments functions and reasonable control structures for programs.
DIAGNOSTICS
'x is unimplemented' where x is an octal number.

'stack empty' for not enough elements on the stack to do what was asked.
'Out of space' when the free list is exhausted (too many digits).
'Out of headers' for too many numbers being kept around.
'Out of pushdown' for too many items on the stack.
'Nesting Depth' for too many levels of nested execution.

7th Edition

18 January 1983

2

DCA'r{l)

DCAT{ 1)

UN IX Programmer's Manual

NAME

dcat - convelt tron' phototypesetter output files to press format and print them on the Dover.
SYNOPSIS

de at [ options] [ files]
DESCI~IPTION

The program deal reads in phototypesetter files (produccd by lrofj( 1) with the - t option), converts
them to press tormat, and ships them to the Dover. The press files are usually fairly large, however, and cause the Dover to grunt hard when printing t.hem.
If no files are given, dcal reads from the standard input. Thus dlroj/(1) causes lrojlto create a press
file by giving it the - t option and piping the output into dcal.
Tile:~eI1vtro'nment' ~ariablc ("icA:i' in~y
used to spcci fydef~~ufts: The value of neAT is parsed as
a string of arguments before the arguments that appear on the command line. For example,
DCA.'\'= , -n "Reag.lIl, Ronald'" sets your user name to ""Reagan, Ronald".

be

The possible options are:
Use ballner to label the output. It will appear on the cover page on the line
- b banner
labeled ""File:".
Calise Ii copies of the output to bc produced. Thedcf~llllt is -c 1.
-c fl
Cause Ilame to be used as the delivery address of your output (the "For:" field on
-n name
the cover sheet). This usually defaults to your full name, causing output to be HIed
by the first chanlctcr of your first name. If you'd rather go by your last name, then
use - n "Bovik, Ilarold". You can arrange to have this done by def~lult by using
the DCA'!' environmcnt variable.
.

o.

- ox dis/alice

Move all characters dis/al1c(' to the right. The default is - ox

- oy dis/alice

Move (111 characters dis/allcc upward. The def~lUlt is - oy O.
Write the press file Oil jill' and do not ship it to the Dover. Press flies produced by
dca/ consume a rather large amount of disk space, however, and should not be
saved on disk as a long term policy.
.

-I) jill'

-q

Supprcsses idle chit-chat on stderr: nunnally, dClI/ gives page Ilumber and font
inf()fJlIation, but /ndT lIsers who depend upon diversions to stderr f()r creation of
index entries will want to avoid contamination.

-s

Do not attempt to please Spruce by substituting f'(lIlts. Normally, deal will read
the Spruce fonts listing file and will substitute a similar font i r one of the exact
desired size and face cannot be found.
Set the maximum tolerable horizontal character posit.ioning error.

-tx dis/alice

Set the maximurn tolerable vertical character positioning error.
The desired positioll ror each character 011 the page is computed hy track ing phototypesetter motioll
commands. This position is compared with the actual position which resulted from the last chanlcter writ.ten to the press file. For variolls reasons, not the least of which is that the positioning units
or t.he phototypesetter and of press files arc incommensurate, the desired position and the actual
position will probably not be identical. - tx allows up to dis/alice of absolute error in t.he horizontal component of a character position before an explicit set-x command is emitted into the press
file .. - ty does the same f'(lf the vertical component.
- ty dis/alice

Note that t.heactwll position can ollly he estimated, because the width in({lfIllation in the
fbnts.widths filcis only an insufliciclltly accurate approximation to what Spruce (lctually docs.
Allowing more tolerance causes t.he generated press file to be smaller because fewer set-x and set-y
commands need to be emitted. The defllult is - tx -·l - ty 0, which causes a set-x command to

7th 1~dition

4/29/81

.1

DCAT(l)

UNIX Programmer's Manual

DcA'i'( 1)

be emitted for every character.
Distances arc specified by giving a fixed-point real number optionally followed by a units. measure.
r:"or example. lin means nne inch, 15mm means fifteen millimeters, and O.3fcel means three-lenths
of a foot If no units arc indicated, micas (which are 2540 to an inch) arc assumed~
ENVII{ONMENT

neAT

string of options to be used by deal.

FONTFILE

the path name of a fi]e to use in preference to lusrlstantbrd/lib/tbnts.widths

SPRUCEFONTS

the path name of a fi]e to use in preference to/usrlstanrbrd/lib/sprllce.fonts

FILES

lusrlstanfordllib/fonts.widths

width inf(:>rmation for all of the available thnts.

lusrlstanfoi'd/lib/spruceJbnt'i
11Isr/tmp/Dcat XXXXXX

an exact listing of all of the nmts available on Spruce.
defllult press file output

SEE ALSO

cz( 1), dtroff(l), dpr( 0, dpq( 1), trotTO)
OIA(jNOSTICS
LOL'), but they should be self explanatory.

BUGS
No check is made for overflow when computing the internal representation of a distance measure
specified in an option.
Entity list lengths arc not checked. It turns out that Spruce cannot print a press file which contains
an enlity list over J2767 bytes long. It is not legal for an entity list to be over 65535 bytes loilg.
Signals are not caught. This means that if you interrupt deal, it wi11 quit, leaving a partially-written
press file on the disk.
dcal attemps to pert<>nn a n,ithful translation from lhe Bell I,aboratories Times Roman photolypeselter character sel-into the available fiHlts on the Dover. This is not always possihle, particularly in lhe larger point sizes.
deal determines where page breaks should occur by assuming that each page is exactly II inches
long. There is no indication of page boundaries in the phototypesetler command script. Needless
to say, should you change the length of a page, dcal will no longer paginate the output properly.
The Spruce ()ilL';; listing is not currently avai1 DYJ converter and a DVI => PRESS convclter. Thc
latter was written by W. l. Nowicki of Stanford Univcrsity.

7th Edition

4/29/81

3

DD(I)

UNIX Programmer's Manual

DD(l)

NAME

dd - convert and copy a file
SYNOPSIS

dd [option - value] ...
DESCRIPTION

Dd copies the specifted input file to the specified output with possible conversions. The standard input and output are used by default. The input and output block size may be specified to
take advantage of raw physical 1/0.
option

values

ifofibs-n

input file name; standard input is default
output file name; standard output is default
input block size n bytes (default 512)
output block size (default S12)
obs-n
bs-n
set both input and output block size, supersedilll ibs and obs; also, if no
conversion· is specified, it is particularly efficient since no copy need be done
cbs-n
conversion buffer size
skip-n
skip n input records before starting copy
files-n
copy n input files before terminating (makes sense only where input is a
magtape or similar device).
seek n records from beginning of output file before copying
seek - n
copy only n input records
count - n
conv-ascii
convert EBCDIC to ASCII
ebcdic convert ASCII to EBCDIC
ibm
slightly different map of ASCII to EBCDIC
block
convert variable length records to fixed length
unblock convert fixed length records to variable length
lease
map alphabetics to lower case
uease
map alphabetics to upper case
swab
swap every pair of bytes
noerror do not stop processing on an error
sync
pad every input record to ibs
... , ...
several comma-separated conversions
Where sizes are specified, a number of bytes is expected. A number may end with k, b or w to
specify multiplication by 1024, 512, or 2 respectively; a pair of numbers may be separated by x
to indicate a product.
Cbs is used only if ascii, unblock, ebcdic, ibm, or block conversion is specified. In the first two
cases, cbs characters are placed into the conversion buffer, any specified character mapping is
done, trailing blanks trimmed and new-line added before sending the line to the output. In the
latter three cases, characters are read into the conversion buffer, and blanks added to make up
an output record of size cbs.
After completion, dd reports the number of whole and partial input and output blocks.
For example, to read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into
the ASCII file x:
dd if-/dev/nntO of-x ibs-800 cbs-80 conv-ascii,lcase
Note the use of raw magtape. Dd is especially suited to 110 on the raw physical devices because
it allows reading and writing in arbitrary record sizes.

4th Berkeley Distribution

18 January 1983

1

DD(I)

UNIX Programmer's Manual

DD(I)

SEE ALSO

cpU), tr(1)
DIAGNOSTICS

f+p records in(out): numbers of full and partial records read(written)
. BUGS

The ASCII/EBCDIC conversion tables are taken from the 256 character standard in the CACM
Nov, 1968. The 'ibm' conversion, while less blessed as a standard, corresponds better to certain IBM print train conventions. There is no universal solution.
One must specify "conv-noerror,sync" when copying raw disks with bad sectors to insure dd
stays synchronized.

4th Berkeley Distribution

18 January 1983

2

DDT68(l)

UNIX Programmer's Manual

DDT68(1)

NAME

ddt68, fddt68 --- symbolic debugger for 68000
SYNOPSIS

t,(ldt68 b.out
cc68 ... -Iddt (Sun)
OESCR IPTION
jiJdl68 is a symbolic disassembler for b.out files created by the 68000 linker (ld68). Its main purpose

is to allow testing of ddt logic in a more hospitable environment thaI) the 68000. It also gives a
way of inspecting the assembly language fhrlll of a program without having to produce a .s file. In
,aqdiJiQl1 Jt£ivcs '-\ check, on th<;: opcratiqn o~ as()8 and Id68. It ~\) PJIl~dby typing:
fddt68 filename
on the Vax.

ddl68 is a symbolic debugger fbr t.he 68000. It is loaded at link edit time with the cc68 flag -Iddt.
On starting a program with ddt loaded the user will be at the ddt command level. Breakpoints may
be set, and the program started, using the cOlllmands described below.
COM"'lANDS
ddl68 recognizes the following commands ($ is used for (esc»: .
expressioll /
expressioll \

open t.he location at expressioll and display the contents in the current typeout mode. The
user may then optionally type an expression, whose vallie replaces the content.s of t.he open
location. Finally the location is closed by typing one of re/urn (to return to ddt's main
command loop), / (to open the next location), or \ (to open t.he previous location).
expressioll$g

go - pl. 1\ string constant has from 1 to 4 characters which are packed right
jusllricd. into one long to form a nUllleric constant; thlls "did" = 646i\(l4. String constants are par~
ticularly lIseful in conjunclion witht the search COlllllllllld fhr searching f()r a string. The single
charactl~r . (dot) as a symbol on its own represents the address or the currently open memory location. !\.ll operations arc carried out lIsing 32 bit arithmetic and evaluated strictly left to right

7th Edition

MC68000

2

DDT68(1)

AUTHORS
lim

7th I~dition

UN IX Programmer's, Manual

I~awson

})m'68(1)

and Vaughan Pratt

MC68000

3

DEROFF(I)

UNIX Programmer's Manual

DEROFF(I)

NAME

derotT - remove nrotT, trotT, tbl and eqn constructs
SYNOPSIS

derotf [ -w ] file ...
DESCRIPTION

Deroff reads each file in sequence and removes all nroff and troff command lines, backslash constructions, macro definitions, eqn constructs (between '.EQ' and '.EN' lines or between delimiters), and table descriptions and writes the remainder on the standard output. Derofffollows
chains of included files ('.so' and '.nx' commands); if a file has already been included, a '.so' is
ignored and a '.nx' terminates execution. If no input file is given, deroffreads from the standard input file.
If the -w flag is given, the output is a word list, one 'word' (string of letters, digits, and apostrophes, beginning with a letter; apostrophes are removed) per line, and all other characters
ignored. Otherwise, the output follows the original, with the deletions mentioned above.
SEE ALSO

trotT(1), eqn (1), tbl (1)
BUGS

Deroff is not a complete troff interpreter, so it can be confused by subtle constructs. Most
errors result in too much rather than too little output.

7th Edition

18 January 1983

1

DETEX(I)

DETEX(I)

UNIX ProgramlTIer'S Manual

NAME

detex - remove TeX constructs
SYNOPSIS

dctcx file •••
DE...,)CRIPTION

Delex reads each file in sequence and removes all TeX control scquences and math mode constlllctions, prodilcing a list of the words on sL1ndard output, one word per line. (f no arguments are
given, standard input is read. A 'word' is a sequence of letters, apostrophes, and discretionary
hyphens. Apostrophes and discretionary hyphcns ~\re removed. Singlp letter words and word., all
in uppercase letters arc not output, nor arc any othcr characters.
The intended use is as a filter "bcf()rc' ;~l)ell (1):, "

. :

t.·t

SEE ALSO

spen(1), tex(l), tcx78(1)

BUGS
It is assumcd that only dollar signs are used to indicate math modc.
HISTORY

Installed at Stanford .by Howard Trickey, JlInc 1983.

7th Edition

1

DF(I)

UNIX Programmer's Manual

DF(I)

NAME

df - disk free
SYNOPSIS

elf [ -I ] [fllesystem ... ] [flle ... ]
DESCRIPTION

D/ prints out the amount of free disk space available on the specified filesystem, e.g.
"/dev/rpOa", or on the fllesystem in which the specified file, e.g. "SHOME", is contained. If
no flle system is specified, the free space on all of the normally mounted flle systems is printed.
The reported numbers are in kilobytes. .
Other options are:
-I
Report also the number of inodes which are used and free.
FILES

letc/fstab

list of normally mounted ftlesystems

SEE ALSO

fstab(S), icheck(8), quot(8)

4th Berkeley Distribution

18 January 1983

1

DICTION(I)

UNIX Programmer's Manual

DICTION(I)

NAME

diction, explain - print wordy sentences; thesaurus for diction
SYNOPSIS
dlet100 [

-ml ] [

-IBID ] ( -0 ] (

-f pfile ] file ...

explain
DESCRIPTION

Diction finds all sentences in a document that contain phrases from a data base oC bad or wordy
diction. Each phrase is bracketed with ( ]. Because diction runs derojf before looking at the
text, formatting header files should be included as part of the input. The deCault macro package
-ma may be overridden with the flag -IBID. The flag -ml which causes dero. to skip lists,
should be used if the document contains many lists of non-sentences. The user may supply
her/his own pattern file to be used in addition to the default file with -f pflie. If the flag - 0 is
also supplied the default file will be suppressed.
Explain is an interactive thesaurus for the phrases found· by diction.
SEE ALSO

dero1f(l)

BUGS
Use of non-standard formatting macros may cause incorrect sentence breaks. In particular, diction doesn't grok -me.

7th Edition

18 January 1983

1

DIFF (1)

UNIX Programmer's Manual

DIFF (1)

NAME

diff - differential file and directory comparator
SYNOPSIS

dlff [ -1 ] [ -r] [ - s] [ -eefh] [ - b ] dirl dir2
dlfl' [ ~ eefh ) I - b ] file 1 file2
dlff [ -Dstring] [-b) filel file2
DESCRIPTION

If both arguments are directories, diU sorts the contents of the directories by name, and then
runs the regular file diU algorithm (described below) on text files which are different. Binary
files which differ, common subdirectories, and files which appear in only one directory are
listed. Options when comparing directories are:

-1
-r

long output format; each text file diff is piped through prO) to paginate it, other
differences are remembered and summarized after all text file differences are reported.
causes application of djffrecursively to common subdirectories encountered.
causes diUto report files which are the same, which are otherwise not mentioned.

-s
-Sn.me
starts a directory diJfin the middle beginning with file name.
When run on regular files, and when comparing text files which differ during directory comparison, diU tells what lines must be changed in the files to bring them into agreement. Except
in rare circumstances, diU finds a smallest sufficient set of file differences. If neither filel nor
file2 is a directory, then either may be given as '-', in which case the standard input is used.
If filel is a directory, then a file in that directory whose file-name is the same as the file-name
of file2 is used (and vice versa).
There are several options for output format; the default output format contains lines of these
forms:
nl a n3,n4
nl,n2 d n3
nl,n2 c n3,n4

These lines resemble ed commands to convert filel into file2. The numbers after the letters
pertain to file2. In fact, by exchanging 'a' for 'd' and reading backward one may ascertain
equally how to convert file2 into filel. As in ed, identical pairs where nl - n2 or n3 - n4 are
abbreviated as a single number.
Following each of these lines come all the lines that are affected in the first file flagged by '<',
then all the lines that are affected in the second file flagged by '>'.
Except for -b, which may be given with any of the others, the following options are mutually
exclusive:
-e
producing a script of a, c and d commands for the editor ed, which will recreate file2
from filel. In connection with -e, the following. shell program may help maintain
multiple versions of a file. Only an ancestral file ($1) and a chain of version-toversion ed scripts ($2,$3, ... ) made by diU need be on hand. A 'latest version' appears
on the standard output.
(shift; cat $-; echo "1,$p") I ed - $1
Extra commands are added to the output when comparing directories with -e, so
that the result is a shU) script for converting text files which are common to the two
directories from their state in dirl to their state in dir2.
-f
produces a script similar to that of -e, not useful with ed, and in the opposite order.

4th Berkeley Distribution

18 January 1983

1

DIFF (1)

-e

- h

UNIX Programmer's Manual

DIFF(1 )

produces a diff with lines of context. The default is to present 3 lines of context and
may be changed, e.g to 10, by -eIO. With -e the output format is modified slightly:
the output beginning with identification of the files involved and their creation dates
and then each change is separated by a line with a dozen .'s. The lines removed
from .filel are marked with '-'; those added to file2 are marked '+'. Lines which are
changed from one file to the other are marked in both files with '!'.
does a fast, half·hearted job. It works only when changed stretches are short and well
separated, but does work on files of unlimited length.

-Dstrinl
causes d(jfto create a merged version of filel and file2 on the standard output, with C
preprocessor controls included so that a compilation of the result without defining
string is equivalent to compiling filel, while defining string will yield fi1e2.
- b

causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to
Compare equal.

FILES

Itmp/d?????
lusr/lib/diftb for -h
Ibin/pr
SEE ALSO

cmp(l), ce(1), comm(l), ed(1), diff3(l)
DIAGNOSTICS

Exit status is 0 for no di1f'erences, 1 for some, 2 for trouble.
BUGS

Editing scripts produced under the -e or -f option are naive about creating lines consisting of
a single '.'.
When comparing directories with the - b option specified, d(jf first compares the files ala cmp,
and then decides to run the diD' algorithm if they are not equal. This may cause a small amount
of spurious output if the files then tum out to be identical because the only differences are
insignificant blank string differences.

4th Berkeley Distribution

18 January 1983

2

DIFF3 (l)

UNIX Programmer's Manual

DIFF3 (1)

NAME

dUD - 3-way differential file comparison
SYNOPSIS

dUD [ -ex3 ] filel file2 file3
DESCRIPTION

Di1/3 compares three versions of a file, and publishes disagreeing ranges of text flagged with
these codes:
all three files differ
filel is different
fUe2 is different
file3 is different
The type of change suffered in converting a given range of a given file to some other is indicated in one of these ways:
f: nl a
Text is to be appended after line number nl in file J, where f- 1, 2, or 3.
f: nl , n2 c:
Text is to be changed in the range line nl to line n2. If nl - n2, the range
may be abbreviated to nl.
The original contents of the range follows immediately after a c: indication. When the contents
of two files are identical, the contents of the lower-numbered file is suppressed.
Under the -e option, djff3 publishes a script for the editor ed that will incorporate into filel all
changes between file2 and file3, i.e. the changes that normally would be flagged - - - - and
- - - -3. Option -x (-3) produces a script to incorporate only changes flagged - - - ( - - - - 3). The following command will apply the resulting script to 'filel'.
(cat script; echo 'l,$p') I ed - filel

-------1
----2
----3

FILES

Itmp/d3?????
lusr/lib/di1f3

SEE ALSO

diff(l)

BUGS
Text lines that consist of a single '.' will defeat -e.

7th Edition

18 January 1983

1

DIST( 1)

UNIX Programmer's Manual

DIST( 1)

NAIIE

dist - redistribute a message to additional addresses
SYNOPSIS

dist [ +folder ] [ msg ] [ -form formtile ] [ -editor editor ] [ -annotate ] [
-noannotate ] [ -inplace ] [ -noinplace ] [ -help ]
DESCRIPtiON

JJist is similar to /orw. It prepares the specified message for redistribution to
addresses that (presumably) are not on the original address list. The file
"distcomps" in the user's MH directory. or a standard form, or the file specified
by I-form formfile' will be used as the blank components file to be prepended to
the message being distributed. The standard form has the components
"Distribute-to:" and "Distribute-cc:". When the message is sent, "DistributionDate: date", "Distribution-From: name", and "Distribution-Id: id" (if I-msgid'
is specified to send;) will be prepended to the outgoing message. Only those
addresses in "Distribute-To", "Distribute-cc", and "Distribute-Bee" will be sent.
Also, a "Distribute-Fcc: folder" will be honored (see send;).
Send. recognizes a message as a redistribution message by the existence of the
field "Distribute-To:", so don't try to redistribute a message with only a
"Distribute-cc:" .
If the I-annotate' switch is given, each message being distributed will be annotated with the lines:

Distributed: date
Distributed: Distribute-to: names
where each lito" list contains as many lines as required~ This annotation will be
done only if the message is sent directly from d:ist. If the message is not sent
immediately from d.ist (Le., if it is sent later via send.,·) , "comp -use" may be
used to re-edit and send the constructed message, but the annotations won't
take place. The '-inplace' switch causes annotation to be done in place in order
to preserve links to the annotated message.
See camp for a description of the I-editor' switch and for options upon exiting
from the editor.
.
If a +folder is specified, it will become the current 'folder, and the current message will be set to the message being redistributed.
/etc/nih/components
or /components
$HOME/mh.profile
/ draft
/usr/bin/send
PROnLE COIIPONENTS
Path:

Editor:
-next:

The message skeleton
Rather than the standard skeleton
The user profile
The default message file
To send the composed message

To determine the user's MH directory
To override the use of /bin/ned as the default editor
editor to be used after exit from 

DEFAULTS

'+folder' defaults to the current folder
'msg' defaults to cur
I-editor' defaults to Ibin/ned

4th Berkeley Distribution

3 August 1983

1

DIST( 1)

UNIX Programmer's Manual

DIST( 1)

I-no annotate ,
'-noinplace'

4th Berkeley Distribution

3 August 1983

2

DL68 ( 1)

UN IX Progratnmer's Manual

DL68(1)

NAME
dI6S - b.out -) .ell downloader component of cc68
SYNOPSIS

dl68 [ -T -v

-0

-s ] filename

DESCRIPTION

Dl68 is a downloader for the Motorola 68000 l)esign Module. It takes its input, a b.ol1t format file,
from filename and in the absence of the -0 option sends its output to stdout.
If there are any symbols these are loaded, starting at Ox6BA on vm (the Design Module) or
OxlFOOO on vI (the Suol prototype). The start and end of the symbol table are stored at Ox570
and Ox574 respectively on either board.
The options are:

- T lex/origin
specifics where the text (code) is to be loaded.
-VII

specifics the board version. Default is vI (Sunl prototype). vm denotes the Motorola
DesignM odule.

- () filename
specifics the output file. Defaults to stdout.

-sDE specifics the datal end record types to generate. The default is 828, 24 bit addresses. The
s19 (brmat, 16 bit addresses, is used by the Data I/O programmers.
FlLFS

lusrlsun/ld68/down.c lusr/bin/dl68

7th Edition

MC68000

1.

DLX(l)

UN IX Programmer's Manual

DLX(l)

NAME

dlx - download with elTor correction - 68000 Sunl monitor
SYNOPSIS

dlx filename
DESCUIPTION

Dlx downloads to the Sunl monitor a file produced with the -d option of cc68(l). Aner sending
each record (Le. one line) dlx checks the monitor's acknowledgment and rctrans111its the record if
nccesscuy.
Dlx is intended to be invoked from the Sunl monitor, so precede with 1, as in
1 dlx

filename
~

..:0..

•

;/'~"

,,:

'

If the filenamC'· ii1c1udes an ex.tension (i.e., '.' embedded in the tail of the pathname), then it is taken verbatim. Otherwise, if the
fi1ename specified docs not exist (or exists, but is not in S-record f()rmat), dlx will attempt to usc
ji/l'llallJc.dl instead. In any case, it witl give up if the file it finally chooses is not in S-record format.
D/x is "smart" about the filename argument, to a certain extent.

The dlx program first does stty cbreak -echo. It then prints out '\ \' followed by some commands
that cause echoing of channel B (host) input on challnel A (tty) and send monitor output to channel
B so that dlx can read it. It then waits for two )'s, which is what the monitor will send to the host
after the channel switch. Then it sends the records from the input file. After sending each record
it checks that the response was Y>.
] f the response was anything but Y> it assumes the worst and tries to get everything back into
synch. First it sends BEl, (control G) to alert the user that there has been an error. Then it sends
a unique hex id (starting from 5007c as it happens, and counting lip by 1 for each erroneous
record), followed by return and q (for quit), then looks for this id to be printed out by the monitor
(which it does as part of opening this location). When the unique id finally arrives. it skips to the
next >, and resends the record.
On exit from d/x, whether caused by interrupt or termination, reset (of the Vax tty) is perfi)rmed,
anel control is passed back to the monitor via i A. If the monitor is not working correctly it may be
necessary to interrupt dl:x: (with tC) to return to the Vax shell.
.
The echoing of the text on the user's terminal contains no linefceds, so that each record overwrites
th~ precedi ng one.

Aunlons
V. R. Pralt, Jen'rey Mogul
BUGS

If the synchronizing unique id is garbled in either direction dlx will hang. 'fhis may require resetting the monitor.

7th Edition

1.

DPQ( 1)

UNIX Programmer's Manual

NAl\lE

dpq -- prints the Dover printer queue
SYNOPSIS

dpq [- t]
DE.~CnIPTION

Dpq prints the Dover printer queue. Each entry in the queue is printed showing the owner of the
queue entry, an iuentificatioll Humber, the size of the ent.ry in dl:l rae ters, the file which is to be
printed, and the tag specified when queued. The iff is lIseful It)r removing a specific entry from the
printer queue usillg dprm( l).

i"r the - t option is given, the time that the file was queued is printed instead of the name of the
spooler temporary file.
The program also attempts to determine the status of the printing server (default server-name is
Tahoe.)
.
FILE..')

/usr/spooll dpd/ *

Spool area

SEE AI,SO

dpr(l), dprm(l)
BUGS

Needs to be able to handle multiple servers.

7th Edition

1 .

UN IX Programmcr's Manual

J)PR( 1)

DPR( 1)

NAME
dpr -- dover printer spoolcr
SYNOPSIS

dpr [ - III .1 [ -11 ] [ - t t~lgnamc ] [ - r ] r name ... ]
DESCRIPTION

Opt causes thc named fllcs to bc queued le)r printing on the Dover. If no files arc named, the standard input is read. Thc options are:

causes notification via mai!( 1) to be sent wi1rl1 the job complctes.

-nl
-n

causes a message to

-r

causes the named f11c(s)· . .l(; bc ren~~lVcd aftcr-hdng printc·d.'

-t tagnmnc

causcs tagnal1le lo be the 'tag' associated with the print job in the qucuc.
You can rind out what this tag is with dj){j( I) and thc notifkation sent by
-Ill or - n includes this tag. If you do not specify a tag, it dcl~iu1ts to thc
last filename given; also, only the last lag specificd is used. If no files are
nallled, the t(lg is blank.

b~

written to your terminal when thc job completes ..

If the me is a press me in PDP-II byte order, it will be byte-swapped during transmission; othcrwise, it will be sent without byteswapping.
FILES
/usr/spool/dpd/*
lusr/lib/dpd
/lIsr/lib/dwritc

spool arca
printer daemon
lIsed to send message to tcrminal

SEE ALSO

dpq( I), dprm( 1.)
IJUGS

Quellcd jobs print in dircctory (seemingly random) order.
This program inherits any undiscovered bugs of Ipr.

If it looks likc not.hing is getting sent to the printer, try rellloving the filc /usr/spool/dpd/lock (if it
is there.) Then, run /usr/lih/dpd. \)0 not do this if a process namcd dpd is already running.
The - n ()ptioll is st.upid about which terminal to writc to if you arc logged in more than once. In
particular, it behaves the same way Ills are indicated); and the rot}
Remember the current position under the given index.
\speciat{join    .. }
Draw straight line segmenL'i joining points  and ,
 anu  (in units
of dover pixels). It on ty recognizes certain sizes (2, 4, 6, 8, 12, 16, )2). The
smallest size is not known to work properly. Any size not in the list is converted to 4.
\special{rectangle    }
The four low order bill;) of  'describe the lower row of a 4*4 square
bit pattern. The next higher four bilS describe the third row from the top of
that bit patlern, and so on for the next two groups or fOllr biL.,. The bilmap
given in this way will be n:plicated to fill the rectangular area whose opposite
corners arc point  and point . The character argument
. must be '0' at the moment, and it means to do the logicnl "or" of the new rectangle with the previous page content., (same as overstriking). CAVEAT: the
Dover Spruce server can only handle bitmaps of certains sizes.
FILES

/usr/stanford/lib/tex82/fbnts

metric information for all of the available fontl).

SEE AIBO

cz(l), dpr(l), dpq(l)

7th Edition

1

DVIP(lL)

UNIX Programmer's Manual

DVIP'(lL)

DIAGNOSTICS

Lots. but they should be self explanatory.
HISTORY

September 1983, UNIX Pascal version by Howard Trickey. after the SAIL version by Ignazio
Zabala.

7th Edition

2 .

E(:HO(I)

UNIX Programmer's Manual

ECHO(I)

NAME

echo - echo arguments
SYNOPSIS

ecbo [

-8 ]

[arg] ...

DESCRIPTION

Echo writes its arguments separated by blanks and terminated by a newline on the standard out- '
put. If the flag - 8 is used, no newline is added to the output.
Echo is useful for producing diagnostics in shell programs and for writing constant data on
pipes. To send diagnostics to the standard error file, do 'echo ..• 1 >&2'.

7th Edition '

18 January 1983

1

ED(l)

UNIX Programmer's Manual

ED (1)

NAME
ed -text editor
SYNOPSIS
ed [ - ] [

-x ] [name]

DESCRIPTION

Ed is the standard text editor.
If a name argument is given,ed simulates an e command '(see below) on the named file; that is
to say, the file is read into ed's buffer so that it can be edited. If -x is present, an x command
is simulated first to handle an encrypted file. The optional- suppresses the printing of explanatory output and should be used when the standard input is an editor script.

Ed operates on a copy of any file it is editing; changes made in the copy have no effect on the
file until a w (write) command is given. The copy of the text being edited resides in a temporary file called the btdfer.
Commands to ed 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. Missing addresses are supplied by default.
In general,
text to the
commands
, .' alone at

only one command may appear on a line. Certain commands allow the addition of
buffer. While ed is accepting text, it is said to be in input mode. In this mode, no
are recognized; all input is merely collected. Input mode is left by typing a period
the beginning of a line.

Ed supports a limited form of regular expression notation. A regular expression specifies a set of
strings of characters. A member of this set of strings is said to be matched by the regular
expression. In the following speCification for regular expressions the word 'character' means
any character but newline.
1.

Any character except a special character matches itself. Special characters are the regular expression delimiter plus \ [. and sometimes A. $.

2.

~

3.

A \ followed by any character except a digit or () matches that character.

4.

A nonempty string s bracketed [s] (or s]) matches any character in (or not in) s. In
s, \ has no special meaning, and ] may only appear as the first letter. A substring a-b,
with a and b in ascending ASCII order, stands for the inclusive range of ASCII characters.
.

5.

A regular expression of form 1-4 foUowed by • matches a sequence of 0 or more
matches of the regular expression.

6.

A regular expression, x, of form. 1-8, bracketed \(x\) matches what x matches.

7.

A \ followed by a digit n matches· a copy of the string that the bracketed regular expression.beginning with the' nth \( matched.

8.

Ao regular expression of form· 1-8, x, followed by a regular expression of form 1-7, y
matches a match fot x followed by a match for" with the x match being as long as possible while still permitting a y match.

9.

A regular expression of form 1-8 preceded by ,. (or followed by $), is constrained to
matches that begin at the left (or end at the right) end of a line.

10.

A regular expression of form 1-9 picks out the longest among the leftmost matches in a
line.
An empty regular expression stands for a' copy of the last regular expression encoun-

11.

• matches any character.

r

tered~

3rd Berkeley Distribution

14 September 1979

1

ED(I)

UNIX Programmer's Manual

ED (1)

Regular expressions are used in addresses to specify lines and in one command (see s 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 an ordinary character, that character may be preceded by '\'. This
also applies to the character bounding the regular expression (often '1') and to '\' itself.
To understand addressing in ed it is necessary to know that at any time there is a current line.
Generally speaking, the current line is the last line affected by a command; however, the exact
effect on the current line is discussed under the description of the command. Addresses are
constructed as follows.
1.

The character '.' addresses the current line.

2.

The character '$' addresses the last line of the buffer.

3.

A decimal number n addresses the n-th line of the buffer.

4.

"x addresses the line marked with the name x, which must be a lower-case letter.
Lines are marked with the k command described below.

5.

A regular expression enclosed in slashes 'I' addresses the line found by searching forward from the current line and stopping at the first line containing a string that matches
the regular expression. If necessary the search wraps around to the beginning of the
buffer.
A regular expression enclosed in queries '?' addresses the line found by searching backward from the current line and stopping at the first line containing a string that matches
the regular expression. If necessary the search wraps around to the end of the buffer.

6.

7.

An address followed by a 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.

If an address begins with '+' or '-' the addition or subtraction is taken with respect to
the current line; e.g. '- 5' is understood to mean '. - 5' .

If an address ends with '+' or '-', then 1 is added (resp. subtracted). As a consequence of this rule and rule 8, the address '-' refers to the line before the current line.
Moreover, trailing '+' and '-' characters have cumulative effect, so '- -' refers to
the current line less 2.
10.
To maintain compatibility with earlier versions of the editor, the character , .. , in
addresses is equivalent to '-'.
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 are given than such a
command requires, the last one or two (depending on what is accepted) are used.

9.

Addresses are separated from each other typically by a comma ','. They may also be separated
by a semicoion ';'. 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 starting line for forward
and backward searches ('I', '?'). The second address of any two-address sequence must
correspond to a line following the line corresponding to the first address. The special form '%'
is an abbreviation for the address pair 'I,S'.

In the following list of ed 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 generally illegal for more than one command to appear on a line. However,
most commands may be suffixed by 'p' or by '1', in which case the current line is either printed
or listed respectively in the way discussed below. Commands may also be suffixed by 'n'.

3rd Berkeley Distribution

14 September 1979

2

ED (1)

ED (1)

UNIX Programmer's Manual

meaning the output of the command is to be line numbered. These suffixes may be combined
in any order.
I

(.) a

The append command reads the given text and appends it after the addressed line. '.' is
left on the last line input, if there were any, otherwise at the addressed line. Address '0'
is legal for this command; text is placed at the beginning of the buffer.
(., .)c


The change command deletes the addressed lines, then accepts input text which replaces
these lines. ' .' is left at the last line input; if there were none, it is left at the line preceding the deleted lines.
(., .)d
The delete command deletes the addressed lines from the buffer. The line originally 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 w command. If 'filename' is missing, the remembered name is used.
E filename
This command is the same as e, except that no diagnostic results when no w has been
given since the last buffer alteration.
f filename
The filename command prints the currently remembered file name. If 'filename' is given,
the currently remembered file name is changed to 'filename'.
(1,$) g/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-line list except the last line must
be ended with '\'. A, i, and c commands and associated input are permitted; the'.' terminating input mode may be omitted if it would be on the last line of the command list.
The commands g and v 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, or, if there were none, at the line before the addressed line. This command differs
from the Q command only in the placement of the text.
(., .+l)j

This command joins the addressed lines into a single line; intermediate newlines simply
disappear. ' .' is left at the resulting line.
( • ) kx
The mark command marks the addressed line with name x, which must be a lower-case

3rd Berkeley Distribution

14 September 1979

3

ED (1)

UNIX Programmer's Manual

letter. The address form

ED (1)

"x then addresses this line.

(., .)1

The list command prints the addressed lines in an unambiguous way: non-graphic characters are printed in two-digit octal, and long lines are folded. The I command may be
placed on the same line after any non-i/o command.
(., .) ma

The move command repositions the addressed lines after the line addressed by a. The
last of the moved lines becomes the current line.
(., .)n

The number command prints the addressed lines with line numbers and a tab at the left.
(., .)p

The print command prints the addressed lines. ' .' is left at the last line printed. The p
command may be placed on the same line after any non-i/o command.

(., .)P
This command is a synonym for p.
The quit command causes ed to exit. No automatic write of a file is done.
This command is the same as q, except that no diagnostic results when no w has been
given since the last buffer alteration.
($) r filename
The read command reads in the given file after the addressed line. If no file name is
given, the remembered file name, if any, is used (see e and f commands). The file name
is remembered if there was no remembered file name already. Address '0' is legal for r
and causes the file to be read at the beginning of the buffer. If the read is successful, the
number of characters read is typed. ' .' is left at the last line read in from the file.
( ., .) s/regular expression/replacement/
or,
( ., .) s/regular expression/replacement/g
The substitute command searches each addressed line for an occurrence of the specified
regular expression. On each line in which a match is found, all matched strings are
replaced by the replacement specified, if the global replacement indicator 'g' appears after
the command. If the global indicator does not appear, only the first occurrence of the
matched string is replaced. It is an error for the substitution to fail on all addressed lines.
Any punctuation character may be used instead of 'I' to delimit the regular expression
and the replacement. '.' is left at the last line substituted.
An ampersand '&' appearing in the replacement is replaced by the string matching the
regular expression. The special meaning of '&' in this context may be suppressed by
preceding it by '\'. The characters '\n' where n is a digit, are replaced by the text
matched by the n-th regular subexpression enclosed between '\ (' and '\)'. When nested,
parenthesized subexpressions are present, n is determined by counting occurrences of '\ ('
starting from the left.

q
Q

Lines may be split by substituting new-line characters into them. The new-line in the
replacement string must be escaped by preceding it by '\'.
One or two trailing delimiters may be omitted, implying the 'p' suffix. The special form
's' followed by no delimiters repeats the most recent substitute command on the
addressed lines. The's' may be followed by the letters r (use the most recent regular
expression for the left hand side, instead of the most recent left hand side of a substitute
command), p (complement the setting of the p suffix from the previous substitution), or
g (complement the setting of the g suffix). These letters may be combined in any order.
(., .)ta

3rd Berkeley Distribution

14 September 1979

4

ED (1)

UNIX Programmer's Manual

ED (I)

This command acts just like the m command, except that a copy of the addressed lines is
placed after address a (which may be 0). '.' is left on the last line of the copy.
(., .)u

The undo command restores the buffer to it's state before the most recent buffer modifying command. The current line is also restored. Buffer modifying commands are a, c, d,
g, i, k, and 11. For purposes of undo, g and 11 are considered to be a single buffer modifying
command. Undo is its own inverse.

(1,

(1,

(1,
(1,

x

When ed runs out of memory (at about 8000 lines on any 16 bit mini-computer such as
the PDP-II) This full undo is not possible, and u can only undo the effect of the most
recent substitute on the current line. This restricted undo also applies to editor scripts
when ed is invoked with the - option.
$) v/regular expression/command list
This command is the same as the global command g except that the command list is executed g with '.' initially set to every line except those matching the regular expression.
$) w filename
The write command writes the addressed lines onto the given file. If the file does not
exist, it is created. The file name is remembered if there was no remembered file name
already. If no file name is given, the remembered file name, if any, is used (see e and f
commands). ' .' is unchanged. If the command is successful, the number of characters
written is printed.
$) W filename
This command is the same as w, except that the addressed lines are appended to the file.
$) wq filename
This command is the same as wexcept that afterwards a q command is done, exiting the
editor after the file is written.
A key string is demanded from the standard input. Later r, e and w commands will
encrypt and decrypt the text with this key by the algorithm of crypt (I ). An explicitly
empty key turns off encryption. (. + 1) z
or,

(. +0 zn
This command scrolls through the buffer starting at the addressed line. 22 (or n, if given)
lines are printed. The last line printed becomes the current line. The value n is sticky, in
that it becomes the default for future z commands.
($) -

The line number of the addressed line is typed. ' .' is unchanged by this command.

! < shell command>
The remainder of the line after the '!' is sent to shU) to be interpreted as a command.
,.' is unchanged.
(. + 1,. + 1) 
An address alone on a line causes the addressed line to be printed. A blank line alone is
equivalent to '. + Ip'; it is useful for stepping through text. If two addresses are present
with no intervening semicolon, ed prints the range of lines. If they are separated by a
semicolon, the second line is printed.
If an interrupt signal (ASCII DEL) is sent, ed prints '?interrupted' and returns to its command
level.
Some size limitations: 512 characters per line, 256 characters per global command list, 64 characters per file name, and, on mini computers, I28K characters in the temporary file. The limit
on the number of lines depends on the amount of core: each line takes 2 words.

3rd Berkeley Distribution

14 September 1979

5

ED (1)

UNIX Programmer's Manual

ED (1)

When reading a file, ed discards ASCII NUL characters and all characters after the last newline.
It refuses to read files containing non-ASCII characters.
FILES

/tmp/eedhup: work is saved here if terminal hangs up
SEE ALSO

B. W. Kernighan, A Tutorial Introduction to the ED Text Editor
B. W. Kernighan, Advanced editing on UNIX
ex(1), sed(1), crypt(1)
DIAGNOSTICS

'?name' for inaccessible file; '?self-explanatory message' for other errors.
To protect against throwing away valuable work, a q or e command is considered to be in error,
unless a w has occurred since the last buffer change. A second q or e will be obeyed regardless.
BUGS

The I command mishandles DEL.
The undo command causes marks to be lost on affected lines.
The x command, -x option, and special treatment of hangups only work on UNIX.

3rd Berkeley Distribution

14 September 1979

6

EFL (1)

UNIX Programmer's Manual

EFL (1)

NAME

eft - Extended Fortran Language
SYNOPSIS

eft [ option ... ] [filename ... ]
DESCRIPTION

E;/I compiles a program written in the EFL language into clean Fortran. E;/I provides the same
control ftow constructs as does raifor(1), which are essentially identical to those in C:
statement grouping with braces;
decision-making with if, if-else, and switch-case; while, for, Fortran do, repeat, and
repeat. .. untilloops; multi-level break and next. In addition, EFL has C-like data structures, and more uniform and convenient input/output syntax, generic functions. EFL
also provides some syntactic sugar to make programs easier to read and write:
free form input:
multiple statements/line; automatic continuation statement label names (not just
numbers),
comments:
# this is a comment
translation of relationals:
>, > -, etc., become .GT., .GE., etc.
return (expression)
returns expression to caller from function
define: define name replacement
include:
include filename
The Eft command option -w suppresses warning messages. The option -C causes comments
to be copied through to the Fortran output (default); -# prevents comments from being
copied through. If a command argument contains an embedded equal sign, that argument is
treated as if it had appeared in an option statement at the beginning of the program. E;/I is best
used with 177(1).
SEE ALSO
fi7(1), ratfor(1).

S. I. Feldman, The Programming Language EFL, Bell Labs Computing Science Technical Report
#78.

7th Edition

14 September 1979

I

UNIX Programmer's Manual

EF'l'PREC (1)

EI7 1'PREC( 1)

NAM.E

eftprec - receive-only PUPIEF'rp file transfer program with routing
SYNOPSIS

eftprec hostnamc fHcnamc [ du ]
DESCR]PTION
Fjiprec is a replacement for eflp(1) which provides reception of files via this protocol across a Pup

intemet. The old cfip program is somewhat more flexible (it understands more about lext files) but
is not capllble of routing across gateways, and the table of host names is wired in. The eflprec program, on the other hand, does proper Pup routing and hostname lookup, but does not send files,
nor does it do end-of-line convention formatting; it merely moves bytes. For sending files via eftp •
.sep cjipsrn(iO). .'
. . . .
. : t l
.
The hoslname and filename arguments arc fairly obvious; the file named by the latter is sent to the
host named by the i()rmer. (If the hoslname argument is 0, then etlprec will accept the first file sent
by any host.) The oplional "key" argument can be any combination of lhc following letters:
d

(debug) - prints out a lot of usekss information.

(unswap) - causes odd and even bytes to be sW(lppcd (wrt to network standard hyte order,
see bylcorder(9» during transmission: this is useful when you've got a me to receive to a
host which uses the non-standard byte ordering (c.g., another Vax).
1'wo examples are given to iIIustmte the lise of this prognlm, as a replacement for ejlp:
cflprec sail me. press
.
is roughly the same as
eftp xesq sail file.press
u

ertprec sai I file. press u
is roughly the same as
cftp xeq sail file.press
AUTlions

Jelfrcy Mogul and Erik Hcdberg
SEE ALSO

ellp( 1), ~ flpsend( I)
DIAGNOSTICS

Many self-explanatory diagnostics: typically, they might involve nlilurc to open a nctwork channel,
Hlilure to find a route to the host or the address of the host. f~lilure to open the file, or protocol
fllilufes.
HUGS

Relatively untested.
Relatively useless.

7th Edition

1

UN IX Programmer's Manual

EFTPSEND( 1)

EFTPSEr\Jl)( 1)

NAMI!:

dlpsend - send··only PUP/EFrp file transfer program with routing
SYNOPSIS

eftpsend hostnamc filcnmnc [ du ]
DESCJ~ I PTION

Fflpscnd is a rephlcemcnt for eflp(l) which supports our most important use of this protocol (sending files to a Press-printer) across a Pup intel11et. The old (,Jip program is somewhat more fiexible
(it understands more about texl Hlcs) but is not capable of routing across gateways, and the table of
host names is wired in. The Ijip.S'(,lId program, on the other hand, docs proper Pup rouling and
hostname lookup, but docs not receive Hies, !lor docs it do end-or-line convention formalling; it
merely moves bytes. For receiving files via cnp, sec ejlprec(I).
The hOSIIWIIl(' <1nd filenalllc arguments arc Hlirly obvious: the file named by the latter is sent to t.he
host named by the f()nner. If the filename is "_If then the standard input is used. [f the hostname
includes a port specification, then lhl' lIIe is sent to that port, instead of the standard one.
The optional "key" argument can be any combination of the following letters:
d

(debug) -- prints out a lot of useless information.

tI

(unswap) - causes odd and even bytes to be swapped (wrt to network standard byte order,
sec by/cort/('r(9») during transmission: t.his is lIseful when you've got a file to send to a host
which uses the non-standard bytc ordering (c.g., another Vax).

Two examples arc given to illustrate the usc of t.his program, as a replacement for eftp:
ellpsend dover me.press
is roughly the S(\IlH.~ as
eltp resq dover IIIe.press
ertpsend dover me.press u
is roughly the same as
eftp req dover nIe.press·
AlJTIIOI~

Jeffrey Mogul
SEE ALSO

eltp(l), eftprec(l)
DIA(;NOSTICS

Many sclf-explan:llory diagnostics: typica1ty, they might involve fililure to open a network channel,
fililure to fInd a route to the host or the address of the host, f~tillire to open the file, or protocol
fit i III res.

BUGS
Relat.ively untested.

7th Edition

1 .

EMACS(l.)

EMACS( 1)

UN IX Programmer's Manual

NAME

em(lCS - a screen editor
SYNOPSIS

emacs files ...

teachemacs
DESCRIPTION

Unix HI/Ules is a text editor styled aner the editors of the same name that exist on ITS, Twenex and
Mliltics. Invoking emacs with a Jist of files causes enmcs to start lip and do a vjsit-file on each of
the named files. For more inf()rmation, read the manual.
Teachemacs is a command which gives the user a hands-:on tutoriaL introduction to Hmacs. It is
nowhere ncar complete, but should make the manual less mysterious to the naive user, and may be
sufficient education fi.)r the casual liseI'.

A one-page reference card, suitable for pnntlllg on a Press-format
lusrlstanti.)rd/doc/EmacsRefCard.press, and can be printed with cz(l).

printer,

is

FUJi'S

lusl'Istanfhrd/lib/emacs/*
ENVlIlONMENT

LO/\DPATH is a path used when locating files with the load command or using the start-up .com
feature. This is lusrlstanfi.)rd/lih/etlUlcs/maclib here.
SEU: ALSO

The Unix Emacs manual, which should be
VAX.

011

lusrlstanford/doc/emacs.press on your favorite

[f you don't have a Press-me printer, lusrlst.lI1ford/doc/emacs.doc is an ASCII version of the
manual. .
Changes
to
Emacs
arc
doculllcnted
/usrlstan fi.mJ/l ibl etnac~/Clwngel_og.
BU(~S

I jnes

or length 79 are printed on two lincs, wilh \

(in

reverse

chronological

order)

in

ill column 79.

With track-eol-on-tN-tP set lo 1. typing tl~tP docs indeed lake you to the end
line unless you happen lo be on the last and empty line of t.he file. (Picky, picky.)

or the

preceding

Emacs's extension language, M Lisp, has the t()l\owing bugs.
(if x y) fails to evaluate x when x is a variable, whence x looks like a string to ·if, resulting in y
always being selected.

Comparisons (including equality) hctwl'en a string and a number, and numeric operations on
strings (including the logical operations) yield wh~lt. would be ohtained if the string were replaced
by O. (Ill all other contexL\), the string "23" is treated as idenlical to the numbcr 23, so this is a
point of incollsislC"ncy as much as a gelluine bug.)
If error-occlIred [sic] is lIseo to trap errors, the error messHge is neither printed nor made available,
making diagnosis impossible.
IIiSTOIIY

08-Jan-81 James Gosling (jag) at Carnegie-Mellon University
Created.
19-Jan-82 JerTrey Mogul at Slnnford University
Added tutorial.
.

7t.h Edition

1

EQN (1)

EQN (1)

UNIX Programmer's Manual

NAME

eqn, neqn, checkeq - typeset mathematics
SYNOPSIS

eqn [ - dxy ] [ - pn] [ - sn ] [ - fn ] [file ] ...
checkeq [ file ] ...
DESCRIPTION

Eqn is a troff(1) preprocessor for typesetting mathematics on a Graphic Systems phototypesetter, neqn on terminals. Usage is almost always
eqn file ... I troff
neqn file ... I nroff
If no files are specified, these programs reads from the standard input. A line beginning with
'.EQ' marks the start of an equation; the end of an equation is marked by a line beginning with
'.EN'. Neither of these lines is altered, so they may be defined in macro packages to get
centering, numbering, etc. It is also possible to set two characters as 'delimiters'; subsequent
text between delimiters is also treated as eqn input. Delimiters may be set to characters x and y
with the command-line argument -dxy or (more commonly) with 'delim xy' between .EQ and
.EN. The left and right delimiters may be identical. Delimiters are turned off by 'delim off'.
All text that is neither between delimiters nor between .EQ and .EN is passed through
untouched.
The program checkeq reports missing or unbalanced delimiters and .EQ/.EN pairs.
Tokens within eqn are separated by spaces, tabs, newlines, braces, double quotes, tildes or
circumflexes. Braces () are used for grouping; generally speaking, anywhere a single character
like x could appear,· a complicated construction enclosed in braces may be used instead. Tilderepresents a full space in the output, circumflex" half as much.
Subscripts and superscripts are produced with the keywords sub and sup. Thus x sub i makes
a sub i sup 2 produces a?, .and e sup Ix sup 2 + y sup 2} gives ex2+y2 •

Xi'

Fractions are made with over: a over b yields .: .
sqrt makes square roots: lover sqrt {ax sup 2 +bx+c} results in.J

21

ax +bx+c

.

The keywords from and to introduce lower and upper limits on arbitrary things: lim

,,-00

made with lim from {n -

"
LX;
0

is

> in!} sum from 0 to n x sub i.

Left and right brackets, braces, etc., of the rilht hei~ht are made with left and right: left [x sup
2

+y

sup 2 over alpha right J - -- 1 produces

x2+..;-] - 1.

The riabt clause is optional. Legal

characters after left and right are braces, brackets, bars, c and f for ceiling and floor, and "" for
nothing at all (useful for a right-side-only bracket).
Vertical ,piles of things are made with pile, lpile, cpile, andrpile: pile {a above b above c} proa
.duces b. There can be an arbitrary number of elements in .a pile. Ipile left-justifies, pile and

c

cpile center, with different vertical spacing,. and rpile right justifies.
Matrices are made with matrix: matrix { Icol { x sub i above y sub 2 } cco/{ 1· above 2 } } proXi 1
duces Y2 2' In additioIl, there is reol for a right-justified column.

7th Edition

18 January 1983

1

EQN (1)

UNIX Programmer's Manual .

EQN (1)

Diacritical marks are made with dot, dotdot, hat, tilde, bar, vee, dyad, and under: x dot - j(t)
bar is x-/(t), y dotdot bar - -- n under is y - .!!, and x vee - -- y dyad is x - y.
Sizes and font can be changed with size n or size ± n, roman, italic, bold, and font n. Size and
fonts can be changed globally in a document by gslze nand gfont n, or by the command-line
arguments -sn and -fn.
Normally subscripts and superscripts are reduced by 3 point sizes from the previous size; this
may be changed by the command-line argument -pn.
Successive display arguments can be lined up. Place mark before the desired lineup point in
the first equation; place lineup at the place that is to line up vertically in subsequent equations.
Shorthands may be defined or existing keywords redefined with define: define thing % replacement % defines a new token called thing which will be replaced by replacement whenever it
appears thereafter. The % may be any character that does not occur in replacement.
Keywords like sum (1:) int (f) inj' (00) and shorthands like > - (~) - > (-), and !- (¢)
are recognized. Greek letters are spelled out in the desired case, as in alpha or GAMMA.
Mathematical words like sin, cos, log are made Roman automatically. Troff(l) four-character
escapes like \ (bs (@) can be used anywhere. Strings enclosed in double quotes "... " are passed
through untouched; this permits keywords to be entered as text, and can be used to communicate with troffwhen all else fails.
SEE ALSO

troff(l), tbI(l), ms(7), eqnchar(7)
B. W. Kernighan and L. L. Cherry, Typesetting Mathematics-User's Guide
J. F. Ossanna, NROFFITROFF User's Manual

BUGS
To embolden digits, parens, etc., it is necessary to quote them, as in 'bold "12.3"'.

7th Edition

18 January 1983

2

ERROR(I)

UNIX Programmer's Manual

ERROR(1 )

NAME

error - analyze and disperse compiler error messages
SYNOPSIS

error [ - 0 ]

[

-s ] [ -q] [ -v] [ -t suflixlist) [ -I ignorefile ] [name]

DESCRIPTION

Error analyzes and optionally disperses the diagnostic error messages produced by a number of
compilers and language processors to the source file and line where the errors occurred. It can
replace the painful, traditional methods of scribbling abbreviations of errors on paper, and permits error messages and source code to be viewed simultaneously without machinations of multiple windows in a screen editor.
Error looks at the error messages, either from the specified file name or from the standard
input, and attempts to determine which language processor produced each error message, determines the source file and line number to which the error message refers, determines if the
error message is to be ignored or not, and inserts the (possibly slightly modified) error message
into the source file as a comment on the line preceding to which the line the error message
refers. Error messages which can't be categorized by language processor or content are not
inserted into any file, but are sent to the standard output. Error touches source files only after
all input has been read. By specifying the -q query option, the user is asked to confirm any
potentially dangerous (such as touching a file) or verbose action. Otherwise error proceeds on
its merry business. If the -t touch option and associated suffix list is given, error will restrict
itself to touch only those files with suffices in the suffix list. Error also can be asked (by specifying -v) to invoke vi(1) on the files in which error messages were inserted; this obviates the
need to remember the names of the files with errors.
Error is intended to be run with its standard input connected via a pipe to the error message
source. Some language processors put error messages on their standard error file; others put
their messages on the standard output. Hence, both error sources should be piped together
into error. For example, when using the csh syntax,
make -s lint 1& error -q -v
will analyze all the error messages produced by whatever programs make runs when making
lint.
Error knows about the error messages produced by: make, cc, cpp, ccom, as, Id, lint, pi, pc and
177. Error knows a standard format for error messages produced by the language processors, so
is sensitive to chariges in these formats. For all languages except Pascal, error messages are
restricted to be on one line. Some error messages refer to more than one line in more than
one files; error will duplicate the error message and insert it at all of the places referenced.

Error will do one of six things with error messages.
synchronize

discard

nUllify

Some language processors produce short errors describing which file it is processing.
Error uses these to determine the file name for languages that don't include the file
name in each error message. These synchronization messages are consumed entirely
by error.
Error messages from lint that refer to one of the two lint libraries, Iusrlliblllib-Ic and
lusrlliblllib-port are discarded, to prevent accidently touching these libraries. Again,
these error messages are consumed entirely by error.
Error messages from lint can be nullified if they refer to a specific function, which is
known to generate -diagnostics which are not interesting. Nullified error messages
are not inserted into the source file, but are written to the standard output. The
names -of functions to ignore are taken from either the file named .errorrc in the

4th Berkeley Distribution

18 January 1983

1

UNIX Programmer's Manual

ERROR(I)

ERROR ( 1)

users's home directory, or from the file named by the -I option. If the file does
not exist, no error messages are nullified. If the file does exist, there must be one
function name per line.

not file specific
Error messages that can't be intuited are grouped together, and written to the standard output before any files are touched. They will not be inserted into any sQurce
file.
file specific Error message that refer to a specific file, but to no specific line, are written to the
standard output when that file is touched.

true errors Error messages that can be intuited are candidates for insertion into the file to which
they refer.
Only true error messages are candidates for inserting into the file they refer to. Other error
messages are consumed entirely by error or ~e written to the standard output. Error inserts the
error messages into the source file on the line preceding the line the language processor found
in error. Each error message is turned into a one line comment for the language, and is internally flagged with the string "###" at the beginning of the error, and "%%%" at the end of
the error. This makes pattern searching for errors easier with an editor, and allows the messages to be easily removed. In addition, each error message contains the source line number
for the line the message refers to. A reasonably formatted source program can be recompiled
with the error messages still in it, without having the error messages themselves cause future
errors. For poorly formatted source programs in free format languages, such as C or Pascal, it
is possible to insert a comment into another comment, which can wreak havoc with a future
compilation. To avoid this, programs with comments and source on the same line should be
formatted so that language statements appear before comments.
Options available with error are:
- D

Do not touch any files; all error messages are sent to the standard output.

-q The user is queried whether s/he wants to touch the file. A "y" or "n" to the question is
necessary to continue. Absence of the -q option implies that all referenced files (except

those referring to discarded error messages) are to be touched.
-v After all files have been touched, overlay the visual editor vi with it set up to edit all files
touched, and positioned in the first touched file at the first error. If vi can't be found, try
ex or ed from standard places.
-t

Take the following argument as a suffix list. Files whose suffixes do not appear in the
su1Bx list are not touched. The suffix list is dot separated, and "." wildcards work. Thus
the suffix list:
".c.y.foo•. h"
allows error to touch files ending with ".c", ".y", ".foo." and ".y".

-s Print out statistics regarding the error categorization. Not too useful.
Error catches interrupt and terminate signals, and if in the insertion phase, will orderly terminate what it is doing.
AUTHOR
Robert Henry
FILES

-I.errorrc
Idev/tty

4th Berkeley Distribution

function names to ignore for lint error messages
user's teletype

18 January 1983

2

ERROR (1)

UNIX Programmer's Manual

-ERROR(l)

BUGS
Opens the teletype directly to do user querying.
Source files with links make a new copy of the file with only one link to it.
Changing a language processor's format of error messages may cause error to not understand
the error message.
Error, since it is purely mechanical, will not filter out subsequent errors caused by 'floodgating'
initiated by one syntactically trivial error. Humans are still much better at discarding these
related errors.

Pascal error messages belong after the lines affected (error puts them before). The alignment
of the 'I' marking the point of error is also disturbed by erfor.
Error was designed for work on CRT's at reasonably high speed. It is less pleasant on slow
speed terminals, and has never been used on hardcopy terminals.

4th Berkeley Distribution

18 January' 1983

3

ETHERPORT( 1)

UN IX Programmer's Manual

ETHERPORT(l)

NAME

ethcrport -- show status of ethcrnet minor devices
SYNOPSIS

cthcfl)Ort
DESCRIPTION
Hllicrport is lIsed to find out the status of the Ethernet minor dcyic~s on the system.

When you run it. you get a list that looks like this:
Idcv/enet (3mb):
0-15 busy; 16-31 frce
IclcY/eneta (lOmb):
none busy; 0-31 free
·64 ethCt11ct minor devices-.;16 bllsy.~48 frce ..

.

;

t. 1

Minor devices listed as "busy" arc in usc; those listed as "f)'cc" arc not.
SEE ALSO

enet(4). cnstat(8)
AUTHOll

.Jctfrey Mogul (after John Seamons)
BUGS

Absolutely none.

7th Edition

LOCAL

1

EX(l)

UNIX Programmer's Manual

.EX (1)

NAME

ex, edit - text editor
SYNOPSIS
ex [ - ] [ -v] [ -t tag] [ -r] [ +command] [ -1] name ...

edit [ ex options ]
DESCRIPTION

Ex is the root of a family of editors: edit, ex and vi. Ex is a superset of ed, with the most notable
extension being a display editing facility. Display based editing is the focus of vi.
If you have not used ed, or are a casual user, you will find that the editor edit is convenient for
you. It avoids some of the complexities of ex used mostly by systems programmers and persons very familiar with ed.
If you have a CRT terminal, you may wish to use a display based editor; in this case see vi(1),
which is a command which focuses on the display editing portion of ex.
DOCUMENTATION

The document Edit: A tutorial provides a comprehensive introduction to edit assuming no previous knowledge of computers or the UNIX system.
The Ex Reference Manual - Version 3.5 is a comprehensive and complete manual for the command mode features of ex, but you cannot learn to use the editor by reading it. For an introduction to more advanced forms of editing using the command mode of ex see the editing
documents written by Brian Kernighan for the editor ed; the material in the introductory and
advanced documents works also with ex.

An Introduction to Display Editing with Vi introduces the display editor vi and provides reference
material on vi. All of these documents can be found in volume 2c of the Programmer's Manual.
In addition, the Vi Quick Reference card summarizes the commands of vi in a useful, functional
way, and is useful with the Introduction.
FILES

/usr/lib/ex? ?strings
/usr/lib/ex? ?recover
/usr/lib/ex? ?preserve
/ etc/termcap
-/.exrc

/tmp/Exnnnnn
/tmp/Rxnnnnn
/usr/preserve

error messages
recover command
preserve command
describes capabilities of terminals
editor startup file
editor temporary
named buffer temporary
preservation directory

SEE ALSO

awk(l), ed(1), grep(l), sed(l), grep(1), vi(l), termcap(S), environ(7)
AUTHOR

Originally written by William Joy
Mark Horton has maintained the editor since version 2.7, adding macros, support for many
unusual terminals, and other features such as word abbreviation mode.
BUGS

The undo command causes all marks to be lost on lines changed and then restored if the
marked lines were changed.
Undo never clears the buffer modified condition.
The z command prints a number of logical rather than physical lines. More than a screen full
of output may result if long lines are present.

4th Berkeley Distribution

26 August 1980

1

EX(I)

UNIX Proarammer's Manual

EX (I)

File input/output errors don't print a name if the command line '-' option is used.
There is no easy way to do a single scan ignoring case.
The editor does not warn if text is placed in named bu1rers and not used before exiting the editor.
Null characters are discarded in input files, and cannot appear in resultant files.

4th Berkeley Distribution

26 August 1980

2

EXLOG(l)

UNIX Programl1ler's Manual

EXL,QO( 1)

NAME

ex tog - extract data ti'Olll system load log file
SYNOPSIS
l~xlog

[ - fllill ] [ fromdate [ todate ] 1

DEscnlPTION

Ex/og extracts data from the system load log file logged between jrol1ulate and Iodate and outputs it
to standard output. Frumdate and Iodate Hre of the form: month/day[/year], where month, day,
and year arc decim ~ >, yields '1' if the indicated comparison is
true, '0' if false. The comparison is numeric if both expr are integers, otherwise lexicographic.

expr + expr
expr - expr
addition or subtraction of the arguments.
expr - expr
expr I apr
expr % expr
multiplication, division, or remainder of the arguments.
apr: expr
The matching operator compares the string first argument with the regular expression
second argument; regular expression syntax is the same as that of ed(1). The \(. •• \)
pattern symbols can be used to select a portion of the first argument. Otherwise, the
matching operator yields the number of characters matched ('0' on failure).
( expr)
parentheses for grouping.
Examples:
To add 1 to the Shell variable a:
a-'expr Sa + l'
To find the filename part (least significant part) of the pathname stored in variable a, which
mayor may not contain 'I':
expr Sa : '.-1\(.-\)' 't Sa
Note the quoted Shell metacharacters.
SEE ALSO

shU), test(l)
DIAGNOSTICS
Expr returns the following exit codes:

o
1
2

7th Edition

if the expression is neither null nor '0',
if the expression is null or '0',
for invalid expressions.

18 January 1983

1

EYACC(I)

UNIX Programmer's Manual

EYACC(I)

NAME

eyacc - modified yacc allowing much improved error recovery
SYNOPSIS
eyaee [ -v ] [grammar]
DESCRIPTION

Eyacc is an old version of yacc(1), which produces tables used by the Pascal system and its ,
error recovery routines. Eyacc fully enumerates test actions in its parser when an error token is
in the look-ahead set. This prevents the parser from making undesirable reductions when an
error occurs before the error is detected. The table format is different in eyacc than it was in
the old yacc, as minor changes had been made for efficiency reasons.
SEE ALSO

yacc(1)
"Practical LR Error Recovery" by Susan L. Oraham, Charles B. Haley and W. N. Joy; SIOPLAN Conference on Compiler Construction, August 1979.
AUTHOR

S. C. Johnson
Eyacc modifications by Charles Haley and William Joy.
BUGS

Pc and its error recovery toutines should be made into a library of routines for the new yacc.

4th Berkeley Distribution

18 January 1983

1

F77 (1)

UNIX Programmer's Manual

F77 (1)

NAME

f77 - Fortran 77 compiler
SYNOPSIS

177 [ option ] ... file ...
DESCRIPTION

F77 is the UNIX Fortran 77 compiler. It accepts several types of arguments:
Arguments whose names end with '.f' are taken to be Fortran 77 source programs; they are
compiled, and each object program is left on the file in the current directory whose name is that
of the source with '.0' substituted for '.f'.
Arguments whose names end with '.F' are also taken to be Fortran 77 source programs; these
are first processed by the C preprocessor before being compiled by .177.
Arguments whose names end with '.r' or '.e' are taken to be Ratfor or EFL source programs
respectively; these are first transformed by the appropriate preprocessor, then compiled by f77.
Arguments whose names end with '.c' or '.s' are taken to be C or assembly source programs
and are compiled or assembled, producing a '.0' file.
The following options have the same meaning as in cc(1). See 1d(1) for load-time options.
-e
Suppress loading and produce '.0' files for each source file.
-I
Have the compiler produce additional symbol table information for dbx(1). Also pass
the -II flag to Id(l).
-0 output
Name the final output file outpUt instead of 'a.out'.
-p
Prepare object files for profiling, see proj(l).
-PI
Causes the compiler to produce counting code in the manner of -p, but invokes a
run-time recording mechanism that keeps more extensive statistics and produces a
gmon. out file at normal termination. An execution profile can then be generated by use
of gproj(l).
-w
Suppress all warning messages. If the option is '-w66', only Fortran 66 compatibility
warnings are suppressed.
-Dname-de/
-Dname
Define the name to the C preprocessor, as if by '#define'. If no definition is given, the
name is defined as "1". ('.F' suffix files only).
-Idir '#include' files whose names do not begin with 'I' are always sought first in the directory of the file argument, then in directories named in -I options, then in directories
on a standard list. (' .F' suffix files only).
-0
Invoke an object-code optimizer.
-S
Compile the named programs, and leave the assembler-language output on corresponding files suffixed '.s'. (No '.0' is created.).
The following options are peculiar to .177.
-12 On machines which support short integers, make the default integer constants and variables short. (-14 is the standard value of this option). All logical quantities will be
short.
-m
Apply the M4 preprocessor to each '.r' file before transforming it with the Ratfor or
EFL preprocessor.

4th Berkeley Distribution

13 May 1983

1

F77 (1)

UNIX Programmer's Manual

F77 (1)

-onetrip

Compile DO loops that are performed at least once if reached. (Fortran 77 DO loops
are not performed at all if the upper limit is smaller than the lower limit.)
-&
Make the default type of a variable 'undefined' rather than using the default Fortran
rules.
-v
Print the version number of the compiler, and the name of each pass as it executes.
-C
Compile code to check that subscripts are within declared array bounds.
- r Apply the C, EFL, or Ratfor preprocessors to relevant files, put the result in the file
with the suffix changed to '.r, but do not compile.
-Ex Use the string x as an EFL option in processing '.e' files.
-Rx Use the string x as a Ratfor option in processing '.r' files.
- N [qxsen] nnn
Make static tables in the compiler bigger. The compiler will complain if it overflows its
tables and suggest you apply one or more of these flags. These flags have the following
meanings:
q
Maximum number of equivalenced variables. Default is 1SO.
x
Maximum number of external names (common blOck names, subroutine and
function names). Default is 200.
s
Maximum number of statement numbers. Default is 401.
e
Maximum depth of nesting for control statements (e.g. DO loops). Default is
20.
n
Maximum number of identifiers. Default is 1009.
- U
Do not convert upper case letters to lower case. The default is to convert Fortran programs to lower case except within character string constants.
Other arguments are taken to be either loader option arguments, or F77-compatible object programs, typically produced by an earlier run, or perhaps libraries of F77 -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'.
FILlS

file. [fFresc]
file.o
a.out
lusr/libln7passl
llib/fi
Ilib/c2
llib/cpp
lusrIlib/libF77.a
lusrIlib/libl77.a
lusr/lib/libU77.a
lusr/lib/libF77..p.a
lusrIlib/libl77"p.a
lusr/lib/libU77..p.a
llib/libc.a
mon.out
gmon~out

4th Berkeley'Distribution

input file
object file
loaded output
compiler
pass 2
optional optimizer
C preprocessor
intrinsic function library
Fortran 110 library
UNIX interface library
profiling intrinsic function library
profiling Fortran 1/0 library
profiling UNIX interface library
C library, see section 3
file produced for analYSis by prof0).
file produced for analysis by Iprof(1).

13 May-1983

2

F77 (1)

. UNIX Programmer's Manual

F77 (1)

SEE ALSO

S. I. Feldman, P. J. Weinberger, A Portable Fortran 77 Compiler
D. L. Wasley, Introduction to the .177 110 Library
prof(1), gprof(t), cc(t), ld(t), eO(1), ratfor(1)
DIAGNOSTICS

The diagnostics produced by .177 itself are intended to be self-explanatory. Occasional messages
may be produced by the loader.
BUGS

This compiler is still somewhat experimental. The optimizer occasionally makes mistakes; it
should be avoided when debugging if apparently incorrect results are obtained Because of an
assembler error, complaints about long branches may occur with very large source files; such
errors can be avoided by splitting the sources into smaller sections. If necessary, the old version of .177 can be resurrected from lusrlsrc/old.

4th Berkeley Distribution

13 May 1983

3

FALSE(I)

UNIX Programmer's Manual

FALSE(I)

NAME

false, true - provide truth values
SYNOPSIS

true
false
DESCRIPTION

True and false are usually used in a Bourne shell script. They test for the appropriate status
"true" or "false" before running (or failing to run) a list of commands.
EXAMPLE

while false
do
command list
done
SEE ALSO

csh(1) , sh(1) , true(1)
DIAGNOSTICS

False has exit status nonzero.

7th Edition

11 January 1982

1

FED(I)

UNIX Programmer's Manual

FED (1)

NAME

fed - font editor
SYNOPSIS

fed [ -I] [ -q ] name
DESCRIPTION

Fed is an editor for font files. It is display oriented and must be used on an HP 2648 graphics
terminal. Fed does the necessary handshaking to work at 9600 baud on the 2648.
The -I flag requests inverse video mode, where all dots are dark and the background is bright.
This provides a setting similar to the hardcopy output of the plotter, and is useful for fonts
such as the shadow font where shading is important.
The -q flag requests quiet mode, where all graphic output is suppressed. This mode is useful
on terminals other than the HP 2648 (assuming you are editing blindly) and for operations such
as the # and A commands, since these operations do not make essential use of graphics, and
since suppression of the graphic output speeds of fed considerably.
FONTS

A font is a collection of up to 256 glyphs, each of which is some pattern or design. Glyphs are
represented on Unix as a rectangular array of dots, each of which is either dark or blank. Each
location in the array is called a pixel. There are 200 pixels per inch due to the hardware of the
Versatec and Varian plotters.
Each glyph has, in addition to its bit pattern, a base and a width. The base is a point, typically
near the lower left of. the array, that represents the logical lower left point of the glyph. The
base is not restricted to be within the array, in fact, it is usually a few locations to the left of
the edge. The vertical position of the base defines the baseline, which is· held constant for all
glyphs when a line is typeset. Letters with descenders, such as "g", go below the baseline.
Other glyphs typically rest on the baseline.
The width is used by troJf{l) to determine where to place the next glyph. It need not be the
same as the width of the array, although it is usually about the same.
The size of the array, location of the base, and the width can vary among glyphs in a font.
Fonts where all glyphs have the same width are called fixed width fonts, others are variable width
fonts.
Attributes which do not vary among glyphs include the font name, which can be up to 11 alphabetic characters, and the point size, which is a positive integer indicating the overall size of the
font. A point is 1/72 inch. The point size of a font is the distance, in points, from the top of
the tallest glyph to the bottom of the lowest. The software of troff currently restricts point
sizes to 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, and 36 point. Normal text is usually
10 point.
Font files conventionally have names of the form
name.pointsize
for example, "bocklin.14" to indicate 14 point bocklin. Fed will look for such a file in both the
current directory and lusr/lib/vfont. Vtroff will only look in lusr/lib/vfont.
There is a correspondence between glyphs and characters in a font. For a given font, each glyph
has an ASCII character associated with it. The glyph is obtained in troff by typing the associated character, and in fed glyphs are also referred to by their character. However, it is not
required for all characters to have a glyph, fonts never have more than 128 glyphs and usually
have fewer.
There is usually a natural correspondence between glyphs and characters. For example, the
glyph which is a roman lower case 'a' will generally have the ascii character 'a' as its
corresponding character. In the special font, the Greek lower case alpha has 'a' as it's

4th Berkeley Distribution

21 September 1980

1

FED (1)

UNIX Programmer's Manual

FED (1)

corresponding character, upper case delta has 'D' as it's corresponding character, etc. However,
special fonts such as the chess font have glyphs that do not appear to be related to their
corresponding characters.
It is easy to confuse glyphs and characters. Note, however, that the three glyphs roman a, bold
a, and italic a, are all different, yet all three correspond to the character 'a'. When this is multiplied by the large number of font styles and point sizes, there are many glyphs that match a
single character, (but only one in a particular font).
FED ORGANIZATION

Fed organizes the screen into 21 windows in a 3 by 7 array. Each window is 100 by 100 pixels,
meaning that the maximum height and width of a glyph is 100 pixels. Since the HP 2648 has a
resolution of 100 dots per inch, glyphs displayed on the screen and printer will be double the
actual height and width, even when fully zoomed out. There is a current window, which will be
marked with a square border. There are two pens, called fine and bold. The fine pen is one
pixel wide, the bold pen can range from two pixels to ten pixels in diameter. The default width
of the bold pen is taken from the point size implied by the file name. The point size is not otherwise used. There are also fine and bold erasers.
There are two locations in the window, called the cursor and the mark. These tools are used to
draw on glyphs.
Sometimes the cursor is on, in which case it is indicated by the hardware graphics cursor of the
terminal, a cross. The cursor is considered to be located at the center of the cross. Sometimes
the rubber band line is turned on, showing the path a line drawn would traverse. This line runs
from the mark to the cursor, and is the only way the mark is graphically visible.
COMMANDS

Commands to fed are single characters, sometimes followed by any needed arguments. The
commands used by fed were chosen to be as similar to viOl commands as was reasonable.
Another distinction is that certain commands are in upper case. These commands were deliberately made hard to type because they cause a large change in the state of the editor and
should not be done by accident. In a few cases there are both upper and lower case commands
with the same letter.

Alphanumeric Keypad: Note that this is the keypad on the far right. The graphics keypad on the
near right will not work. These keys are each synonyms for other commands. They are
arranged in a manner that causes the five arrow keys to behave sensibly, but the others need to
be memorized or stickers placed on the keys. They are provided for convenience only, and the
user can avoid memorization simply by using the mnemonic letter keys instead.
The layout is as follows:
undo (u)
fillin(O
rezoom ()
up (k)
move (m)
draw (d)
left (h)
right (I)
base (b)
setdot (.)
down G)
cleardot (»
The arrow keys move the cursor one pixel in the indicated direction. The cursor is turned on if
it was off. Note that the alphanumeric keys (far right) must be used. The graphics keys (near
right) will appear to move the cursor but it will not be moved internally. The cursor cannot be
moved outside the current window.

"L: Redraw the screen. This is useful if an 110 error or background process has caused the
screen to get messed up.
b: Move the cursor to the base of the window. This is the default location of the cursor.

4th Berkeley Distribution

21 September 1980

2

FED (1)

UNIX Programmer's Manual

FED (.1)

c: If the cursor is on, turn it off. Otherwise, tum it on.
d: Draw a line from the mark to the cursor. The currently selected tool (fine pen, bold pen,
fine eraser, bold eraser) is used. The cursor is turned off. The mark is moved to the location
of the cursor.
f. Fill in the current hole. The cursor must be in a completely enclosed empty (white) area.
The area is set to black. If this command is invoked on the outside or there are any leaks to
the outside, the entire outside will be filled in. (Undo is useful in this case.) Filling in cannot
jump diagonals, but can rather only spread in the four orthogonal directions.
g : Get a glyph. X can be any character. The glyph cottesponding to x is put in a window, and this window is made the current window. The glyph is centered horizontally in the
window. The baseline is located at row 70 from the top of the window. The pen and cursor are
placed at the base, and the cursor is turned off. The glyph must exist.
h, j, k, and I are accepted to mean left, down, up, and right, respectively. They are
synonymous with the alphanumeric arrow keys. They have the same meanings as in via).
m: Move the mark to the current location of the cursor. The cursor is turned on.
n < x>: New glyph. This is similar to g, except that the glyph must not exist. It is used to
create a new glyph. A blank window is created, centered at (SO, 70) as in g.

p: Print the contents of the screen. An HP 2631 printer must be connected to the terminal.
The screen is copied to the printer. If in inverse video mode, the screen is changed to normal
video mode before the print, and then changed back after the print.
r: If the rubber band line is on, turn it off. Otherwise, tum it on.

s < what> {< where> J: Set  to . What and where are single characters.
The possibilities are:
spf. Set pen fine. ('1' for light is also accepted.)
spb: set pen bold. ('h' for heavy is also accepted.)
sd: Set draw. The pen is used instead of the eraser.
se: Set erase. The eraser is used instead of the pen.
ss< n>: Set size of bold pen.  is a digit from 1 to 9. The size of the bold pen is
set accordingly. This also affects the bold eraser.
u: Undo. The previous change to the current window is undone. Note that undo is on a window by window basis, so that commands that affect characters or more than one window cannot
be undone.
z < n>: Zoom to level n. The screen is blown up by a factor of n. This only affects the
appearance of the screen to make it easy to see the individual dots, and does not affect the size
of the glyph or the result of a print command. Zooming to 1 shows the entire screen, a level of
3 or 4 is probably good for editing glyphs. When a message is printed on the screen, fed
automatically zooms out to level 1 so you can read the message. Hitting space will zoom back.
z followed by  zooms out without changing the previous zoom.
space: Zoom back to the level most recently requested by the z command.

A < i/e/r>  < last> {< oldps> < newps> J:
Artificially italicize/embolden/resize a range of glyphs in the current font. Enter i for italicize,
e for embolden, or r for resize, and- the first and last character in the range desired. If you are
resizing you will also have to enter the old and new point size, each terminated by a return.
Each glyph is gotten and changed on the screen visibly. Glyphs are italicized by slanting them
to the right at a slope of 1/5. They are emboldened by smearing them to the right a number if
pixels equal to the current heavy pen size. They are resized with an algorithm which translates

4th Berkeley Distribution

21 September 1980

3

FED (1)

UNIX Programmer's Manual

FED (1)

all on bits to the new position. These operations will be considerably faster if the -q option is
in effect, since much overhead is involved in the graphic display.

B: Move the base to the cursor. The cursor is turned on.
C  : Copy the glyph in character  to character . If  has
a window on the screen, that window is given to < to >.
D  : Delete a range of characters in the font, from  through
 inclusive. To delete a single character type it twice.
E : Edit the named file. If changes have been made to the current file, confirmation will
be requested. (Either 'y' or 'E' is accepted.) The file name is terminated with return.
F  < last>: Show the font on the screen. The characters in the specified range are
shown. The width values are used to get natural spacing. The display will remain until another
command is typed, at which time the previous display will be redrawn and the new command
will be executed. As a special case, a "p" command will print the results of the "F" command
instead of the previous display.
I < hlv>: Invert the current glyph about a horizontal or vertical axis, as indicated by h or v.
The axis runs up the center of the window. The base can be subsequently positioned with the
Bcommand.
K: Kill the current glyph. All dots are set to blank. The glyph is not removed from the font.
This is used for redrawing a glyph from scratch or replacing it with another glyph.

M  : Move a glyph from  to . This is just like the copy command but the original is deleted.
N : Write out the current file, if necessary, and edit the new file specified. The file
name is terminated with return.
P  < last> : Partial read from a file. A file and the first and last characters in
the range are prompted for. Characters not in the range are left unmodified, characters in the
range are handled as in the R command.
Q: Quit the editor, without saving any work. If changes have been made confirmation will be
required (either 'Q' or 'y' is taken as 'yes'.)

R : Read in the named file on top of the current file. Glyphs are merged wherever possible. If there is a conflict, you will be asked whether fed should take the glyph from the file
(f) or buffer (b). Responding with F or B will lock in that mode for the remainder of the read.
The file name is terminated with a return.

T:
Typeset the line of text on the terminal. This is similar to the F command except that the
given text is arranged on the screen, so you can see how some particular combination of characters would look.
V: Toggle whether editing is being done in inverse video mode.
W  : Write the buffer out onto the named file, which is terminated by return. A null file
name means the current file name.
ZZ: Exit fed. A write is done, if necessary, followed by a quit. This is the normal way to leave
fed. The Z must be doubled for compatibility with vi.
. : Turn on the dot under the cursor. The cursor is turned off.
>: Tum off the dot under the cursor. The cursor is turned off.

4th Berkeley Distribution

21 September 1980

4

FED (1)

UNIX Proll'ammer's Manual

FED (1)

# < char>  < value>: Edit a numerical field. This only makes sense if the glyph has
not been gotten (g or n) yet, since otherwise the values are taken from window specific things
such as the base. Fed does not do any sanity checking, but just substitutes the value input.
Fields are the first letter of any field from the dispatch structure (see vfont(S», specifically,
these fields are addr, nbytes, left, right, up, down, and width. The number, which may be
signed, is terminated by a newline.
FILES

lusr/lib/vfont/*.*
SEE ALSO

vfont(S), vfontinfo(l), vtroff(l), vwidth(l)
AUTHOR

Mark Horton
BUGS

Attempting to use the second 128 characters would be folly. Fed has never been tested on
such fonts, and at a bare minimum there would be problems trying to input 8 bit characters.
The character DEL is interpreted by the tty driver to mean interrupt. Hence the corresponding
glyph cannot be accessed. The start, stop, and quit characters are turned off, but other characters used by the new tty driver must be quoted with "V.
Changed widths are not copied to the width table used by troff. This only matters if logical
widths are changed, or if glyphs are moved around. For these cases, vwidth(J) must be used.
The artificial operations don't do a very good job. The quality possible from blowing a font up
is in general poor. Italicizing tends to make edges that were previously slanted very ragged.
However, these operations are better than nothing at all and are a reasonable first approximation for hand fixing.
The HP 2648 Terminal on which this runs has been stolen.

4th Berkeley Distribution

21 September 1980

S

FILE (1 )

UNIX Programmer's Manual

FILE (1)

NAME

file - determine file type
SYNOPSIS

flle file ...
DESCRIPTION

File performs a series of tests on each argument in an attempt to classify it. If an argument
appears to be ascii, file examines the first 512 bytes and tries to guess its language.

BUGS
It often makes mistakes. In particular it often suggests that command files are C programs.
Does not recognize Pascal or LISP.

7th Edition

18 JanlijU'f 1983

1

FIND (1)

UNIX Programmer's Manual

" FIND (1)

NAME

find - find files
SYNOPSIS

Ind pathname-Iist expression
DESCRIPTION

Find recursively descends the directory hierarchy for each pathname in the pathname-list (i.e.,
one or more pathnames) seeking files that match a boolean expression written in the primaries
given below. In the descriptions, the argument n is used as a decimal integer where +n means
more than n, - n means less than n and n means exactly n.
-name filename
True if the filename argument matches the current file name. Normal Shell argument syntax may be used if escaped (watch out for '[" '?' and '.').
-perm onum
True if the file permission flap exactly match the octal number onum (see
chmod(1». If onum is prefixed by a· minus sign, more flag bits (017777, see stat(2»
become significant and the flags are compared: (jIags&.onum) - -onum.
-type c True if the type of the file is c, where cis b, c, d, for 1 for block special file, character special file, directory, plain file, or symbolic link.
-links n True if the file has n links.
-user uname
True if the file belongs to the user uname (login name or numeric user ID).
-arou, gname
True if the file belongs to group gname (group name or numeric group ID).
-size n True if the file is n blocks long (512 bytes per block).
-inum n True if the file has inode number n.
- .time n True if the file has been accessed in n days.
-mtime n
True if the file has been modified in n days.
-exec command
True if the executed command returns a zero value as exit status. The end of the
command must be punctuated by an escaped semicolon. A command argument '()'
is replaced by the current pathname.
-ok command
Like -exec except that the generated command is written on the standard output,
then the standard input is read and the command executed only upon response y.
- print
Always true; causes the current pathname to be printed.
-newer file
True if the current file has been modified more recently than the argument file.
The primaries may be combined using the following operators (in order of decreasing precedence):
1) A parenthesized group of primaries and operators (parentheses are special to the Shell and
must be escaped).
2) The negation of a primary ('!' is the unary not operator).
3) Concatenation of primaries (the and operation is implied by the juxtaposition of two primaries).

7th Edition

18 January 1983

1

UNIX Programmer's Manual

FIND (1)

4)

FIND (1)

Alternation of primaries ('-0' is the or opor.tor).

EXAMPLE

To remove all files named 'a.out' or ' •.0' that have not been accessed for a week:
find / \( -name a.out -0 -name ' •. 0' \) -atime +7 -e:xec nn () \;
FILES

/ etc/passwd
/etc/group
SEE ALSO

sh(1), test(1), fs(S)
BUGS
The syntax is painful.

7th Edition

18. January 1983

2

FING ( LOCAl,)

UNIX Programmer's Manual

FIN G ( LOCAL)

NAME

flng - front end for finger
SYNOPSIS

flng [ optiolls ] [jillgeropls] namcstr ...
DESCRIPTION

.

Ping is a front end for jinger(l) that understands about system-wide mail aliases and networks. Its
functionality is an exact superset of finger; any flags or arguments for finger will work with jing.

[n addition, the nmnestr argument may be a system-wide mailing list (e.g. sia/f), or may be of the
form userC
DESCRIPTION
Since the MH environment is the shell, it is easy to lose track of the current
folder from day to day. FoLder will list the current folder, the number of messages in it, the range of the messages (low-high), and the current message
within the folder, and will fiag a selection list or extra files if they exist. An
example of the output is:
inbox+ has 16 messages ( 3- 22); cur= 5.

If a '+folder' and/or 'msg' are specified, they will become the current folder
and/or message. An '-all' switch will produce a line for each folder in the user's
MH directory, sorted alphabetically. These folders are preceded by the readonly folders, which occur as mh.proflle "cur-" entries. For example,
Folder
/fsd/rs/m/tacc
/md/phyl/Mail/EP
ff
inbox+
mh
notes
ucom

II of message(s range
has
has
has
has
has
has
has

35 message(s
82 message(s
4 message(s
16 message(s
76 message(s
2 message(s
124 message(s

);
1- 35);
1-10B);
1- 4.):
3- 22):
1- 76):
1- 2):
1-124}:

cur msg (other tiles)
cur= 23.
cur= 82.
cur= 1.
cur= 5.
cur= 70.
cur= 1.
cur= 6; {select}.

TOTAL= 339 messages in 7 Folders.
The u+ .. after inbox indicates that it is the current folder. The "(select)" indicates that the folder ucom has a selection list produced by pick. If "others" had
appeared in parentheses at the right of a line, it would indicate that there are
files in the folder directory that don't belong under the MH file naming scheme.
The header is output if either an '-all' or a '-header' switch is specified; it is
suppressed by '-noheader'. Also, if lolder is invoked by a name ending with "s"
(e.g., lold.ers), '-all' is assumed. A '-total' switch will produce only the summary line.
If '-fast' is given, only the folder name {or names in the case of '-all'} will be
listed. {This is faster because the folders need not be read.}
The switches '-up' and '-down' change the folder to be the one above or below
the current. folder. That is, "folder -down" will set the folder to
"/select", and if the current folder is a selection-list folder,
"folder -up" will set the current folder to the parent of the selection-list. (See
pick for details on selection-lists.)
The '-pack' switch will compress the message names in a folder, removing holes
in message numbering.

4th Berkeley Distribution

3 August 1983

1

FOLDER{ 1)

UNIX Programmer's Manual

$HOME/mh..protile
/binjIs

FOLDER{ 1)

The user protue
To fa$t-list the folders

PRDm..E COIlPONENTS

Path:
Current-Folder:

To determine the us~r' s MH directory
To find the default current folder

DEFAULTS

I+ folder' defaults to the current folder
'msg' defaults to none
'-nofast'
'-noheader'
I-nototal'
'-nopack'
OONTEXT
If '+folder' and/or 'msg' are given. they will become the current folder and/or

message.

4th Berkeley Distribution

:3 August 1983

2

FORW{ 1)

UNIX Programmer's Manual

FORW( 1)

NAIIE

forw - forward messages
SYNOPSlS

forw [ +folder ] [ msgs ] [ -editor editor ] [ -form formtile ] [ -annotate ] [
-noannotate ] [ -inplace] [-noinplace] [ -help ]
DESCRIPtION

Forw may be used to prepare a message containing other messages. It constructs the new message from the components tile or I-form formfile' (see
comp(l», with a body composed of the message(s) to be forwarded. An editor is
invoked as in com.p, and after editing is complete, the user is prompted before
the message is sent.
If the I-annotate' switch is given, each message being forwarded will be annotated with the lines
Forwarded: date
Forwarded: To: names
Forwarded: cc:names
where each liTo:" and "cc:" list contains as many lines as required. This annotation will be done only if the message is sent directly from /onv. If the message
is not sent immediately from /orw, .. comp -use" may be used in a later session
to re-edit and send the constructed message, but the annotations won't take
place. The '-inplace' switch permits annotating a message in place in order to
preserve its links.
See com.p for a description of the '-editor' switch.
/etc/mh/components
or  /components
$HOME/mh-protile
 / draft
/usr /bin/send

The message skeleton
Rather than the standard skeleton
The user profile
The default message file
To send the composed message

PHOnLE COIIPONEN1.'S

Path:
Editor:
Current-Folder:
-next:

To determine the user's MH directory
To override the use of /bin/ned as the default editor
To find the default current folder
editor to be used after exit from 

DEFAULTS

'+folder' defaults to the current folder
'msgs' defaults to cur
'-editor' defaults to /bin/ned
I-no annotate ,
'-noinplace'
alNTEXT
If a +folder is specified, it will become the current folder, and the current mes-

sage will be set to the first message being forwarded.

4th Berkeley Distribution

3 August 1983

1

FP (1)

UNIX Programmer's Manual

FP(l)

NAME

fp -

Functional Programming language compiler/interpreter

SYNOPSIS
fp
DESCRIPTION

Fp is an interpreter/compiler that implements the applicative language proposed by John
Backus. It is written in FRANZ LISP.
In a functional programming language intent is expressed in a mathematical style devoid of
assignment statements and variables. Functions compute by value only; there are no sideeffects since the result of a computation depends solely on the inputs.

Fp "programs" consist of junctional expressions - primitive and user-defined fp functions combined by junctional forms. These forms take functional arguments and return functional results.
For example, the composition operator '@' takes two functional arguments and returns a function which represents their composition.
There exists a single operation in fp - application. This operation causes the system to evaluate
the indicated function using the single argument as input (all functions are monadic).
GETTING STARTED

Fp invokes the system. Fp compiles functions into Jisp(l) source code; lisp(I) interprets this
code (the user may compile this code using the liszt (1) compiler to gain a factor of 10 in performance). Control D exits back to the shell. Break terminates any computation in progress
and resets any open file units. )help provides a short summary of aU user commands.
FILES

/usr/ucb/lisp
/usr/ucb/liszt
/usr/doc/fp

the FRANZ LISP interpreter
the liszt compiler
the User's Guide

SEE ALSO

lisp (I ), Iiszt (1 ) .

The Berkeley FP user's manual, available on-line. The language is described in the August
1978 issue of CACM (Turing award lecture by John BackUS).
BUGS

If a non-terminating function is .applied as the result of loadin.g a :file, then control is returned
to the user immediately ,everything after that position in ·tbefite is ignored.
FP incorrectly marks the .Iocation .of a syntax error ,on large, ·multi-line function definitions or
applications.
AUTHOR

Scott B. Baden

4th Berkeley Distribution

28 April 1983

1

FPR(1 )

UNIX Programmer's Manual

FPR (1)

NAME

fpr - print Fortran file
SYNOPSIS
fpr
DESCRIPTION

Fpr is a filter that transforms files formatted according to Fortran's carriage control conventions
into files formatted according to UNIX line printer conventions.
Fpr copies its input onto its output, replacing the carriage control characters with characters that
will produce the intended effects when printed using ~r(1). The first character of each line
determines the vertical spacing as follows:
Character
Blank
0
1

+

Vertical Space Before Printing
One line
Two lines
To first line of next page
No advance

A blank line is treated as if its first character is a blank. A blank that appears as a carriage control character is deleted. A zero is changed toa newline. A one is changed to a form feed. The
effects of a "+" are simulated using backspaces.
EXAMPLES

a.out Ifpr Ilpr
fpr < n7.output Ilpr

AUTHOR

Robert P. Corbett
BUGS

Results are undefined for input lines longer than 170 characters.

4th Berkeley Distribution

S May 1983

1

FROM (1)

UNIX Prosrammer's Manual

FROM(l)

NAME

from - who is my mail from?
SYNOPSIS

from [ - s sender] [ user ]
DESCRIPTION

From prints out the mail header lines in your mailbox file to show you who your mail is from.
If user is specified, then user's mailbox il examined instead of your own. If the -s option is
given, then only headers for mail sent by sender are printed.
'
FILES

/usr/ spool/mail/.
SEE ALSO

bitr(1), mail (1), prmail (1)

4th Berkeley Distribution

1

FSPLIT (1)

UNIX Programmer's Manual

FSPLIT (1 )

NAME

fsplit - split a multi-routine Fortran file into individual files
SYNOPSIS

fsplit [ -e efile] ... [file]
DESCRIPTION

Fsplit takes as input either a file or standard input containing Fortran source code. It attempts
to split the input into separate routine files of the form name./. where name is the name of the
program unit (e.g. function, subroutine, block data or program). The name for unnamed block
data subprograms has the form blkdtaNNN.fwhere NNN is three digits and a file of this name
does not already exist. For unnamed main programs the name has the form mainNNN.f. If
there is an error in classifying a program unit, or if name.falready exists, the program unit will
be put in a file of the form zzzNNN./where zzzNNN./does not already exist.
Normally each subprogram unit is split into a separate file. When the -e option is used, only
the specified subprogram units are split into separate files. E.g.:
fsplit -e readit -e doit prog.f
will split readit and doit into separate files.
DIAGNOSTICS

If names specified via the -e option are not found, a diagnostic is written to standard error.
AUTHOR

Asa Romberger and Jerry Berkman
BUGS

Fsplit assumes the subprogram name is on the first noncomment line of the subprogram unit.
Nonstandard source formats may confuse /split.

It is hard to use -e for unnamed main programs and block data subprograms since you must
predict the created file name.

4th Berkeley Distribution

2 May 1983

FTP(IC)

UNIX Programmer's Manual

FTP (IC)

NAME

ftp - file transfer program
SYNOPSIS
ftp [ - v] [ - d) [ - i] [ - n] [ - g) [ host ]
DESCRIPTION
Ftp is the user interface to the ARPANET standard File Transfer Protocol. The program allows

a user to transfer files to and from a remote network site.
The client host with which ftp is to communicate may be specified on the command line. If this
is done, ftp will immediately attempt to establish a connection to an FTP server on that host~
otherwise, ftpwill enter its command interpreter and await instructions from the user. When ftp
is awaiting commands from the user the prompt uftp>" is provided the user. The following
commands are recognized by ftp:
Invoke a shell on the local machine.
append local-file [ remote-./ile]
Append a local file to a file on the remote machine. If remote-file is left unspecified,
the local file name is used in naming the remote file. File transfer uses the current settings for type, format, mode, and structure.
ascii

Set the file transfer type to network ASCII. This is the default type.

bell

Arrange that a bell be sounded after each file transfer command is completed.

binary Set the file transfer type to support binary image transfer.
bye

Terminate the FTP session with the remote server and exit ftp.

cd remote-directory
Change the working directory on the remote machine to remote-directory.
close

Terminate the FTP session with the remote server, and return to the command interpreter.

delete remote-file
Delete the file remote-file on the remote machine.
Jebug [ debug-value]
Toggle debugging mode. If an optional debug-value is specified it is used to set the
debugging level. When debugging is on~ Itp prints each command se.nt to the remole
>".
machine, preceded by the string
H __

dir [ remote-directory] [ local-file]
Print a listing of the directory contents in the directory, remote-direClfJry, and, optionally, placing the output in local-file. If no directory is specified, the current working
directory on the remote machine is used. If no local file is specified, output comes to
the terminal.

form/ormat
Set the file transfer form to format. The default format is "file".
get remote-./ile [ local-file] .
Retrieve the remote-file and store -it on the jocalmacnine. If the local file name is not
specified, it is given the same name it bas on the re,mote machine. The current settings
for type, /orm,mode, and structureare used while transferring the file.
hash Toggle hash-sign ("#H) printing for ·each data bloc,k transferred. The size of a data
block is 1024 bytes.
Toggle file name ;globbing. With file ;nameglobbing enabled, each local file or pathglob
name is processed for csh(1 )melacnaracters.These characters include "'?[] - ()".
H

4th Berkeley Distribution

18 july 1983

FrP (IC)

UNIX Programmer's Manual

FrP (IC)

Remote files specified in mutliple item commands, e.g. mput, are globbed by the
remote server. With globbing disabled all files and pathnames are treated literally.
help [ command]
Print an informative message about the meaning of command If no argument is given,
ftp prints a list of the known commands.
led [ directory]
Change the working directory on the local machine. If no directory is specified, the
user's home directory is used.
Is [ remote-directory] [ local-file]
Print an abbreviated listing of the contents of a directory on the remote machine. If
remote-directory is left unspecified, the current working directory is used. If no local file
is specified, the output is sent to the terminal.
mdelete remote-files
Delete the specified files on the remote machine. If globbing is enabled, the
specification of remote files will first be expanded using Is.

mdir remote-files local-file
Obtain a directory listing of multiple files on the remote machine and place the result in
local-file.
mget remote-files
Retrieve the specified files from the remote machine and place them in the current
local directory. If globbing is enabled, the specification of remote files will first be
expanding using Is.

mkdir directory-name
Make a directory on the remote machine.
mls remote-files local-file
Obtain an abbreviated listing of multiple files on the remote machine and place the
result in local-file.
mode [ mode-name]
Set the file transfer mode to mode-name. The default mode is Hstream" mode.
mput local-files
Transfer multiple local files from the current local directory to the current working
directory on the remote machine.
open host [ port]
Establish a connection to the specified host FTP server. An optional port number may
be supplied, in which case, ftp will attempt to contact an FTP server at that port. If the
auto-login option is on (default), ftpwill also attempt to automatically log the user in to
the FrP server (see below).
prompt Toggle interactive prompting. Interactive prompting occurs during multiple file
transfers to allow the user to selectively retrieve or store files. If prompting is turned
oft' (default), any mgetor mputwill transfer all files.
put local-file [ remote-file]
Store a local file on the remote machine. If remote-file is left unspecified, the local file
name is used in naming the remote file. File transfer uses the current settings for type,
format, mode, and structure.
pwd

Print the name of the current working directory on the remote machine.

quit

A synonym for bye.

4th Berkeley Distribution

18 July 1983

2

FrP (IC)

UNIX

PrQgr~mmer's

Manual

FrP (IC)

quote arg1 arg2 ...
The arguments specified are sent, verbatim, to the remote FTP server. A single FrP
reply code is expected in return.
recv remote-file [ local-file]
A synonym for get.
remotebelp [ command-name]
Request help from the remote FTP server. If a command-name is specified it is supplied to the server as well.
rename [ from] [ to]
Rename the file from on the remote machine, to the file to.
rmdir directory-name
Delete a directory on the remote machine.
send local-file [ remote-file]
A synonym for put.
sendport
Toggle the use of PORT commands. By default, ftp will attempt to use a PORT command when establishing a connection for each data transfer. If the PORT command
fails, ftpwill use the default data port. When the use pf PORT commands is disabled,
no attempt will be made to use PORT commands for each data transfer. This is useful
for certain FTP implementations which do ignore PORT commands but, incorrectly,
indicate they've been accepted.
status Show the current status of ftp.
struct [ struct-name]
Set the file transfer structure to sfruct.. name. By default "stre3rn" structure is used.
tenex

Set the file transfer type to that needed to talk to TENEX machines.

trace

Toggle packet traCing.

type [ type-name]
Set the file transfer type to type-n4me. If no type is specifieq, the current type is
printed. The default type is network ASCII.
user user-name [ password] I account]
Identify yourself to the remote FTP server. If tne password is not specified and the
server requires it, ftp will prompt the user for it (after disabling local echo). If an
account field is not specified, and theFTP server requires it, the user will be prompted
for it. Unless ftp is invoked with Hauto-login" .di~bJed, this process is done automatically on initial connection to the FTP server.
verbose
Toggle verbose mode. In v.erbosemode, all responses from the FTP server are
displayed to the user. In a(iditio,n, if 'Verbose 1$ on., wbenafile transfer completes,
statistics regarding the efficiency of the transfer ,are ;rep()'r,te4. By default, verbose is on.
? [ command]
A synonym for he~lp.

Command arguments which have e:Jllbeddedspaces may be q.pote4 with quote (,,) marks.
FILE NAMING CONVENTIONS

Files specified as arguments to /Jpcommands arepratessed ,:acCQrdillS to the foUowing rules.
1)

If the file name
used.

4th Berkeley Distribution

H

-"

is specined" the st41,11 (for readi.,g}Qrstdout (for wrH~ing) is

18 July 1983

3

FrP (IC)

UNIX Programmer's Manual

FrP (IC)

2)

If the first character of the file name is "t" the remainder of the argument is interpreted as a shell command. Ftp then forks a shell, using popen(3) with the argument
supplied, and reads (writes) from the stdout (stdin). If the shell command includes
spaces, the argument must be quoted; e.g. "i Is -It"". A particularly useful example of
this mechanism is: "dir more".

3)

Failing the above checks, if "globbing" is enabled, local file names are expanded
according to the rules used in the csh(I); c.f. the giobcommand.

FILE TRANSFER PARAMETERS

The FrP specification specifies many parameters which may affect a file transfer. The type may
be one of "ascii", "image" (binary), "ebcdic", and "local byte size" (for PDP-IO's and PDP20's mostly). Ftpsupports the ascii and image types of file transfer.
Ftp supports only the default values for the remaining file transfer parameters: mode, form, and
struct.
OPTIONS

Options may be specified at the command line, or to the command interpreter.
The -v (verbose on) option forces flpto show all responses from the remote server, as well as
report on data transfer statistics.
The - n option restrains ftp from attempting "auto-login" upon initial connection. If autologin is enabled, ftpwill check the .netrcfile in the user's home directory for an entry describing
an account on the remote machine. If no entry exists, flp will use the login name on the local
machine as the user identity on the remote machine, and prompt for a password and, optionally, an account with which to login.
The - i option turns off interactive prompting during mutliple file transfers.
The - d option enables debugging.
The - g option disables file name globbing.

BUGS
Many FrP server implementation do not support the experimental operations such as print
working directory. Aborting a file transfer does not work right; if one attempts this the local ftp
will likely have to be killed by hand.

4th Berkeley Distribution

18 July 1983

4

GCORE(l)

UNIX Prosranuner's Manual

GCORE(l)

NAME

gcore - get core images of running processes
SYNOPSIS

lcore process-id ...
DESCRIPTION
Gcore creates a core image of each specified process, suitable for use with adb(l) or dbx(1).
FILES

core. < process-id >

core images

BUGS

Paging activity that occurs while ,core is running may cause the program to become confused.
For best results, the desired processes should be stopped.

4th Berkeley Distribution

18:Janu8l':Y 1983

1

GPROF (1)

UNIX Programmer's Manual

GPROF (1)

NAME

gprof - display call graph profile data
SYNOPSIS

Iprof [ options ] [a. out [gmon.out ... ] ]
DESCRIPTION
gpro/produces an execution profile of C, Pascal, or Fortran77 programs. The effect of called
routines is incorporated in the profile of each caller. The profile data is taken from the call
graph profile file (gmon.out default) which is created by programs which are compiled with the
-PI option of cc, pc, and 177. That option also links in versions of the library routines which
are compiled for profiling. The symbol table in the named object file (a.outdefault) is read and
correlated with the call graph profile file. If more than one profile file is specified, the gproj
output shows the sum of the profile information in the given profile files.

First, a flat profile is given, similar to that provided by proj(l). This listing gives the total execution times and call counts for each of the functions in the program, sorted by decreasing
time.
Next, these times are propagated along the edges of the call graph. Cycles are discovered, and
calls into a cycle are made to share the time of the cycle. A second listing shows the functions
sorted according to the time they represent including the time of their call graph descendents.
Below each function entry is shown its (direct) call graph children, and how their times are propagated to this function. A similar display above the function shows how this function's time
and the time of its descendents is propagated to its (direct) call graph parents.
Cycles are also shown, with an entry for the cycle as a whole and a listing of the members of
the cycle and their contributions to the time and call counts of the cycle.
The following options are available:
- a

suppresses the printing of statically declared functions. If this option is given, all
relevant information about the static function (e.g., time samples, calls to other functions, calls from other functions) belongs to the function loaded just before the static
function in the a. out file.

- b

supresses the printing of a description of each field in the profile.

-c

the static call graph of the program is discovered by a heuristic which examines the text
space of the object file. Static-only parents or children are indicated with call counts of

O.
-e name
suppresses the printing of the graph profile entry for routine name and all its descendants (unless they have other ancestors that aren't suppressed). More than one - e
option may be given. Only one name may be given with each - e option.
-E name
suppresses the printing of the graph profile entry for routine name (and its descendants)
as -e, above, and also excludes the time spent in name (and its descendants) from the
total and percentage time computations. (For example, - E mcount - E mcleanup is the
default.)
-f name
prints the graph profile entry of only the specified routine name and its descendants.
More than one - f option may be given. Only one name may be given with each - f
option.

-F name
prints the graph profile entry of only the routine name and its descendants (as - f,
above) and also uses only the times of the printed routines in total time and percentage

4th Berkeley Distribution

18 January 1983

GPROF(I)

UNIX Programmer's Manual

GPROF (1)

computations. More than one - F option may be given. Only one name may be given
with each - F option. The - F option overrides the - E option.
- s

a profile file gmon.sum is produced which represents the sum of the profile information
in all the specified profile files. This summary profile file may be given to subsequent
executions of gprof (probably also with a - s) to accumulate profile data across several
runs of an a.outfile.

- z

displays routines which have zero usage (as indicated by call counts and accumulated
time). This is useful in conjunction with the -c option for discovering which routines
were never called.

FILES

a.out
gmon.out
gmon.sum

the name list and text space.
dynamic call graph and profile.
summarized dynamic call graph and profile.

SEE ALSO

monitor(3), profiH2), ccO), prof0)
"'gprof: A Call Graph Execution Profiler", by Graham, S.L., Kessler, P.B., McKusick, M.K.~
Proceedings oj the SIGPLAN '82 Symposium on Compiler Construction, SIGPLAN Notices, Vol.
17, No.6, pp. 120-126, June 1982.

BUGS
Beware of quantization errors. The granularity of the sampling is shown, but remains statistical
at best. We assume that the time for each execution ora function can be expressed by the total
time for the function divided by the number of times the function is called. Thus the time propagated along the call graph arcs to parents of that function is directly proportional to the
number of times that arc is traversed.
Parents which are not themselves profiled ·will have the time of their profiled children propagated to them, but they will appear to be spontaneously invoked in the call graph listing, and
will not have their time propagated further. Similarly, signal catchers, even though profiled,
will appear to be spontaneous (although for more obscure reasons). Any profiled children of
signal catchers should have their times propagated properly, unless the signal catcher was
invoked during the execution of the profiling routine, in which case all is lost.
The profiled program must call exit(2) or return normally for the profiling information to be
saved in the gmon.out file.

4th Berkeley Distribution

18 January 1983

2

GRAPH (lG)

UNIX Programmer's Manual

GRAPH (lG)

NAME

graph - draw a graph
SYNOPSIS

lraph [ option ] ...
DESCRIPTION
Graph with no options takes pairs of numbers from the standard input as abscissas and ordinates of a graph. Successive points are connected by straight lines. The graph is encoded on
the standard output for display by the plot(1G) filters.

If the coordinates of a point are followed by a nonnumeric string, that string is printed as a
label beginning on the point. Labels may be surrounded with quotes "...", in which case they
may be empty or contain blanks and numbers; labels never contain newlines.
The following options are recognized, each as a separate argument.
-a
Supply abscissas automatically (they are missing from the input); spacing is given by
the next argument (default 1). A second optional argument is the starting point for
automatic abscissas (default 0 or lower limit given by -x).
-b
Break (disconnect) the graph after each label in the input.
-e
Character string given by next argument is default label for each point.
-I
Next argument is grid style, 0 no grid, 1 frame with ticks, 2 full grid (default).
-1
Next argument is label for graph.
-m
Next argument is mode (style) of connecting lines: 0 disconnected, 1 connected
(default). Some devices give distinguishable line styles for other small integers.
-s
Save screen, don't erase before plotting.
-x [1]
If 1 is present, x axis is logarithmic. Next 1 (or 2) arguments are lower (and upper) x
limits. Third argument, if present, is grid spacing on x axis. Normally these quantities
are determined automatically.
-y [1]
Similarly for y.
- h
-w

Next argument is fraction of space for height.
Similarly for width.
-r
Next argument is fraction of space to move right before plotting.
-u
Similarly to move up before plotting.
-t
Transpose horizontal and vertical axes. (Option -x now applies to the vertical axis.)
A legend indicating grid range is produced with a grid unless the -s option is present.

If a specified lower limit exceeds the upper limit, the axis is reversed.
SEE ALSO

spline (1 G), plot (1 G)

BUGS
Graph stores all points internally and drops those for which there isn't room.
Segments that run out of bounds are dropped, not windowed.
Logarithmic axes may not be reversed.

7th Edition

18 January 1983

1

GREP(l)

UNIX Progiammer'sManual

GREP (1)

NAME

grep, egrep, fgrep - search a tile for a pattern
SYNOPSIS

arep [ option] ... expression [tile] ...
earep," [ option ] ... [expression] [file] ...
flrep [ option ] ... [strings] [tile]
DESCRIPTION

Commands of the grep family search the input files (standard input default) for lines matching a
pattern. Normally, each line found is copied to the standard output. Grep patterns are limited
regular expressions in the style of ex(1);it uses a compact nondeterministic algorithm. Egrep
patterns are full regular expressions; it" uses a fast deterministic algorithm that sometimes needs
exponential space. Fgrep patterns are tixed strings; it is fast and compact. The following
options are recognized.
-v
All lines but those matching are printed.
- x
(Exact) only "lines matched in their entirety are printed (fgrep only) .
-e
Only a count of matching lines is printed.
"-I
The names of tiles with matching lines are listed (once)"" separated by newlines.
-0
Each line is preceded by its relative line number in the tile.
- b
Each line is preceded by the block number on which it was found. This is sometimes
useful in locating disk block numbers by context.
-I
The case of letters is ignored in making comparisons - that is, upper and lower case
are considered identical. This applies to grep "and fgrep only.
-s
Silent mode. Nothing is printed (except error messages). This is useful for checking
the error status~
-w
The expression is searched for as a word (as if surrounded by '\ <' and '\>', see
ex(l).) (grep only)
-e expression
Same as a simple expression argument, but useful when the expreSSion begins with a -.
-f file The regular expression (egrep) or string list (fgrep) is taken from the file.
In all cases the file name is shown if there is more" than one input tile. Care should be taken
when using the characters $ • [ .. I ( ) and \ in the expression as they are also meaningful to the
Shell. It is safest to enclose the entire expression argument in single quotes ' '.
Fgrep searches for lines that contain one of the (newlin.e-separated) strings.
Egrep accepts extended regular expressions. In the" follOwing desCription 'character' excludes
newline:
A \ followed by a Single character otlier than newline matches that character.
The character .. matches th" beginning of a line.
The character S matches the end of a line.
A • (period)" matches any charaCter.
A single character n.ot otherwise endowed with special meaning matches that character.
A string enclosed in bracketS U matches any single character from the string. Ranges
of ASCII character codes may be abbreviated as in 'a;....zO-9'. A] may occur only as
the tirst character of the" string. A literal - must be placed where it can't be mistaken

4th Berkeley Distribution "

11 August 1980

1

GREP(l)

UNIX Programmer's Manual

GREP (1)

as a range indicator.
A regular expression followed by an • (asterisk) matches a sequence of 0 or more
matches of the regular expression. A regular expression followed by a + (plus)
matches a sequence of 1 or more matches of the regular expression. A regular expression followed by a ? (question mark) matches a sequence of 0 or 1 matches of the regular expression.
Two regular expressions concatenated match a match of the first followed by a match of
the second.
Two regular expressions separated by Ior newline match either a match for the first or a
match for the second.
A regular expression enclosed in parentheses matches a match for the regular expression.
The order of precedence of operators at the same parenthesis level is [] then • +? then concatenation then I and newline.
Ideally there should be only one grep, but we don't know a single algorithm that spans a wide
enough range of space-time tradeotrs.
SEE ALSO

ex(l), sed(1), shU)
DIAGNOSTICS

Exit status is 0 if any matches are found, 1 if none, 2 for syntax errors or inaccessible files.
BUGS

Lines are limited to 256 characters; longer lines are truncated.

4th Berkeley Distribution

11 August 1980

2

GRIPE( )

UNIX Programmer's Manual

GRIPE( )

NAME

gripe -- mail a local system bug repOIt
SYNOPSIS

gril)e [ address]
DESCRIPTION

Bug reports sent to 'gripes' nre intercepted by a progmnI which expects bug reports to con form to a
standard Ihrmat. Gripe is a shell script to hclp the user compose (lnd mail bug repOIts in the
correct format. Gripe works by invok ing cl11acs(J) (by deHlu1t, unless the environment variable
EDITOR. is set) on a temporary copy of the bug report format outlinc. The lIser must fill in the
appropriate fields and exit emacs. Gripe then mails the completed report to 'gripes' or the address
specified,op the cPll1mand.li~e~

. . . .

,

t.·z

.

FILES

lusr/ucb/bugformat

contains the bug report olltli ne

SEE ALSO

emacs( 1), sendbug( 1), scndmai 1(8)

7th Edition

1

GROUPS (1)

UNIX Programmer's Manual

GROUPS (1 )

NAME

groups - show group memberships
SYNOPSIS
groups luser)
DESCRIPTION
The groups command shows the groups to which you or the optionally specified user belong.
Each user belongs to a group specified in the password file letclpasswd and possibly to other
groups as specified in the file letclgroup. If you do not own a file but belong to the group which
it is owned by then you are granted group access to the file.

When a new file is created it is given the group of the containing directory.
SEE ALSO
setgroups (2)
FILES

letc/passwd, letc/group

BUGS
More groups should be allowed.

4th Berkeley Distribution

30 May 1983

HEAD (1)

UNIX Programmer's Manual

HEAD (1)

NAME

head - give first few lines
SYNOPSIS

head [ - count] [file ... ]
DESCRIPTION

This filter gives the first count lines of each of the specified files, or of the standard input. If
count is omitted it defaults to 10.
SEE ALSO

taiHO

3rd Berkeley Distribution

24 February 1979

1

1-IOS1' (1)

UNIX Programmerts Manual

HOst(l)

NAME

host - print IP host names and addresses
SYNOPSIS

host
host hostname I intel'net-address •..
DESCR IPTION

Host invoked with a host name or address prints the namc(s) of that host and the primary internet
address of the host.
.
fnvoked with no arguments, it prints the names and address of the local host.
AU]'HOR

Jeff Mogul
BUGS
This inherits lots of bugs from lhe library routi nes that look lip hosts names.

It doesn't print multiple addresses For multi-homed hosts; its concept of "primary address" is arbitrary (but it malches t.he concept uses by most programs.)

7th Edition

1 .

HOSTID(l)

UNIX Programmer's Manual

HOSTID (1)

NAME

hostid - set or print identifier of current host system
SYNOPSIS

hostid [ identifier ]
DESCRIPTION

The hostid command prints tb~ identifier of the current host. This numeric value is expected to
be unique across all hosts and is normally set to the host's Internet address. The super-user
can set the hostid by giving an. argument; this is usually done in the startup script I etc/rc.1ocal.
SEE ALSO

gethostid(2), sethostid(2)

4th Berkeley Distribution

1 Apri11983

1

HOSTNAME ( 1 )

UNIX Programmer's Manual

HOSTNAME ( 1 )

NAME

hostname - set or print name of current host system
SYNOPSIS

hostname [ nameotbost ]
DESCRIPTION

The hostname command prints the name of the current host, as given before the "login"
prompt. The super-user can set the hostname by giving an argument; this is usually done in
the startup script letc/rc.local.
SEE ALSO

gethostname(2), sethostname(2)

4th Berkeley Distribution

13 March 1982

1

lCONC( 1)

UNIX Programmer's Manual

ICONC( 1)

iconc - compile and link Icon programs
SYNOPSIS

leone [ option... ] file ...
DESCRIPl'ION

[oone is a compiler for Version 5 of the Icon programming language. Compilation consists of four phases: tra.nsla.tion, link:ing, assembling, and loading. Dur-

ing translation, each Icon source ftl.e is translated into an intermediate
language; during linking, the intermediate language tlles are combined and a
single assembly code output file is produced which is then assembled; during
loading, the assembled program is loaded with the Icon runtime system
libraries, producing an executable file. Unless the -0 option is specified, the
name of the resulting executable file is formed by deleting the sufiix of the first
tlle named on the command line.
Files whose names end in '.icn' are assumed to be Icon source programs; they
are translated, and the intermediate code is left in two files of the same name
with •.ut' and' .u2' substituted for' .icn'. The intermediate code files are normally deleted when compilation has finished. Files whose names end in '. u1' or
'. u2' are assumed to be intermediate code files from a previous translation (only
one should be named - the other is assumed); these tiles are included in the
linking phase after any '.icn' files have been translated. Files whose names end
in '.c' or '.0' are assumed to be external functions. Any '.c' file is compiled using
00(1) to produce a '.0' tile. A '.ul'. '.u2', '.c'. or '.0' file that is explicitly named
is not deleted.
The following options are recognized by icone.
-c Suppress the linking and loading phases. The intermediate code files are not
deleted.

-m
Preprocess each '.icn' source file with the m4(l) macro processor before
translation.

-oout:put
Name the executable file output.
-8 Suppress any informative messages from the translator and linker. Normally. both informative messages and error messages are sent to standard
error output.
-t Arrange for &trace to have an initial value of -1 when the program is executed. Normally. I£trace has an initial value of O.
-u Issue warning messages for undeclared identifiers in the program. The warnings are issued during the linking phase.
When an Icon program is executed. a number of environment variables are
examined to determine certain execution parameters. The values assigned to
these variables should be numbers. The variables that affect execution and the
interpretations of their values are as follows:
TRACE
Initialize the value of leU-ace. If this variable has a value, it overrides the
translation-time -t option.
NBUFS
The number of i/O buffers to use for files. When a file is opened, it is

The University of Arizona

2 March 1983

1

IeONC( 1)

UNIX Programmer's Manual

leONe ( 1)

assigned an i/o buffer if one is available and the tile is not a tty. If no buffer
is available, the tile is not buffered. &input., &:output., and &:elTOut are
buffered if butlers are available. On VAX systems, ten butlers are allocated
initially; on PDP-11 systems, five buffers are allocated initially.

NOERRBUF
If set, &errout is not buffered.

STRSIZE
The initial size of the string space. in bytes. The string space grows if necessary. but it never shrinks. On VAX systems, the string space is initially
51.200 bytes; on PDP-l1 systems. 10.240 bytes initially.

HEAPSlZE
The initial size of the heap, in bytes. The heap grows if necessary, but it
never shrinks. On VAX systems. the heap is initially 51,200 bytes; on PDP-11
systems, 10.240 bytes initially.
NSTACKS
The number of stack~ initially available for co-expressions. On VAX systems.
four stacks are initially allocated; on PDP-11 systems, two stacks are initially
allocated. More are automatically allocated if needed. It is unwise to set
NSTACKS to 1.

STKSIZE
The size of each co-expression stack, in words. On VAX systems, stacks are
normally 2000 words; on PDP-l1 systems. stacks are normally 1000 words.

PROFILE
Turn on execution profiling of the runtime system. The value of this variable
specifies the sampling resolution. in words. If the value is zero, profiling is
not done. When a protiled .program finishes, a file named 'mon.out' is
created containing the results of the profile. The program proJ{ 1) can be
used to examine the results. This produces a profile of the runtime system.
not the user program.
mon. out
v5g/ cmp/bin/utran
v5g/cmp/bin/ulink
v5g/cmp/bin/libLa

results of profiling
icon translator
icon linker
icon runtime library

SEE ALSO

The Icon Programm.ing Language, Ralph E. Griswold and Madge T. Griswold.
Prentice-Hall Inc., Englewood Cliffs. New Jersey, 1983.
Installation a.nd Ma.intenance Guid.e lor Release 59 o/lcon, Department of Computer Science, The University of Arizona, March 1983.
cc{l), icont(l), Id(l), m4(l), prof(l), monitor(3)
BUGS

Because of the way that co-expressions are implemented, there is a possibility
that programs in which they are used may malfunction mysteriously.
Integer overflow on multiplication is not detected.
If the -m option is used, line numbers reported in error messages or tracing
messages are from the file after. not before. preprocessing.

The University of Arizona

2 March 1983

2

ICONT( 1)

UNIX Programmer's Manual

ICONT( 1)

NAIIE

icont - translate leon programs for interpretive execution
SYNOPSIS

icont [ option ... ] file ... [ -x arg ... ]
DESCRIPTION

[cant is a translator for Version 5 of the Icon programming language, which pro-

duces a file suitable for interpretation by the Icon interpreter. Translation consists of two phases: tra.nsla.tion and linking. During translation. each Icon
source tile is translated into an intermediate language; during linking. the intermediate language files are combined and a single output tile is produced. The
output file from the linker is referred to as an inte'1'p1"etabZe file. Unless the - 0
option is specified, the name of the resulting interpretable file is formed by
deleting the sutIix of the first input file named on the command line. If the -x
argument is used, the file is automatically executed by the interpreter and any
arguments following the -x are passed as execution arguments to the Icon program itself.
Files whose names end in '.icn' are assumed to be Icon source programs; they
are translated, and the intermediate code is left in two files of the same name
with '.ul' and '.u2' substituted for '.icn'. The intermediate code tiles normally
are deleted when compilation has finished. Files whose names end in '.u1' or
'.u2' are assumed to be intermediate code files from a previous translation (only
one should be named - the other is assumed); these files are included in the
linking phase after any '.icn' files have been translated. A'. ul' or '. u2' file that
is explicitly named is not deleted. Icon source programs may be read from
standard input. The argument - signifies the use of standard input as a source
me. In this case, the intermediate code is placed in 'stdin.ul' and 'stdin.u2' and
the interpretable file is 'stdin'.
The following options are recognized by icont .
-c Suppress the linking phase. The intermediate code files are not deleted.

-m
-0

Preprocess each '.icn' source file with the m4(1) macro processor before
translation.

output

Name the interpretable tlle output.
-8 Suppress any informative messages from the translator and linker. Normally, both informative messages and error messages are sent to standard
error output.
-t Arrange for &trace to have an initial value of -1 when the program is, executed. Normally, letrace has an initial value of o.
-u Issue warning messages for undeclared identifiers in the program. The warnings are issued during the linking phase.
The interpretable file produced by the Icon linker is directly ezecutable. For
example, the command

icont hello.icn
produces a file named hello that. can be run by the: command

The University of Arizona

2 March 1,983

1

ICONT{ 1)

UNIX Programmer's Manual

ICONT( 1)

hello
The method used to make interpretable files appear to be directly executable is
system dependent. See the Icon installation guide for complete details. For
most intents and purposes, interpretable flies are executable programs in the
same sense that files produced by ld(l) are executable programs.
Arguments can be passed to the Icon program by following the program name
with the arguments. Any such arguments are passed to the main procedure as a
list of strings.
When an Icon program is executed. a number of environment variables are
examined to determine certain execution parameters. The values assigned to
these variables should be numbers. The variables that affect execution and the
interpretations of their values are as follows:

TRACE
Initialize the value of &trace. If this variable has a value, it overrides the
transla"l.on-time -t option.
NBUFS
The number of i/o buffers to use for files. When a file is opened, it is
assigned an i/o buffer if one is available and the tile is not a tty. If no buffer
is available. the file is not buffered. akinput, Icoutput, and lcelTOut are
buffered if buffers are available. On VAX systems. ten buffers are allocated
initially; on PDP-l1 systems, five butlers are allocated initially.
NOERRBUF
If set, Icerrout is not buffered.

STRSIZE
The initial size of the string space, in bytes. The string space grows if necessary, but it never shrinks. On VAX systems, the string space is initially
51,200 bytes; on PDP-11 systems, 10,240 bytes initially.

HEAPSIZE
The initial size of the heap. in bytes. The heap grows if necessary, but it
never shrinks. On VAX systems, the heap is initially 51,200 bytes; on PDP-i1
systems, 10,240 bytes initially.
NSTACKS
The number of stacks initially available for co-expressions. On VAX systems,
four stacks are initially allocated; on PDP-l1 systems, two stacks are initially
allocated. More are automatically allocated if needed. It is unwise to set
NSTACKS to 1.

STKSIZE
The size of each co-expression stack, in words. On VAX systems, stacks are
normally 2000 words; on PDP-l1 systems, stacks are normally 1000 words.
PROFILE
Turn on execution profiling of the runtime system. The value of this variable
specifies the sampling resolution, in words. If the value is zero, profiling is
not done. When a profiled program finishes, a file named 'mon.out' is
created containing the results of the profile. The program 1"0/(1) can be
used to examine the results. This produces a profile of the runtime system,
not the user program.

The University of Arizona

2 March 1983

2

ICONT( 1)

v5g/int/bin/utran
v5g/int/bin/ulink
vSg/int/bin/iconx
mon.out

UNIX Programmer's Manual

ICONT( 1)

icon translator
icon linker
icon interpretsr
results of ptotUing

sa ALSO
The Icon Programming Language" Ralph E. Griswold and Madge T. Griswold.
Prentice-Hall Inc., Englewood Clifts. New Jersey. 1983.
Installation and. Maintena:fu:e Guide lor Release 5g 01 loon, Department of Computer Science, The University of Arizona. March 1983.
iconc(1). m4(l). prof(1). monitor(3)
BUGS

Downward compatibility of interpretable tiles will not be maintained in subsequent releases of Icon. No checks are perform.ed to determine if the interpretable file and the interpreter- are compatible. Peculiar program behavior is the
only indication of such incompatibility.
Interpretable files do not stand alone; the Icon interpreter must be present on
the system. This implies that an interpretable' file produced on one system will
not work on another system unless the Icon interpreter is in the same place on
both systems and that the interpreter is of the same version of Icon as the
translator that produced the interpretable file.
Because of the way that co-expressions ate implemented. th~re is a possibility
that programs in which they are llsed may malfunction mysteriously.
Integer overflow on multiplication' is not detected.
If the -m option is used. line numbers teported in error messages or tracing
messages are from the tile after. ,not before. preprocessing.

1he University of Arizona

2 Matoh 1983

3

IDENT(l)

UNIX Programmer's Manual

IDENT(l)

NAME

ident - identify files
SYNOPSIS

Ideat file ...
DESCRIPTION

Ident searches the named files for all occurrences of the pattern $keyword:.•. $, where keyword is
one of
Author
Date
Header
Locker
Log
Revision
Source
State
These patterns are normally inserted automatically by the ReS command co OJ, but can also be
inserted manually.
Ident works on text files as well as object files. For example, if the C program in file f.c contains
char rcsid[] - "$Header: Header information $";
and f.c is compiled into f.o, then the command
ident f.c f.o
will print
f.c:
$Header: Header information $
f.o:
$Header: Header information $
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.0 ; Rele~e Date: 82/12/04 .
Copyright 0 1982 by Walter F. Tichy.
SEE ALSO

ci (0, co 0), res (1), rcsdiff(O, rcsintro (0, rcsmerge (0, rlog (0, rcsfile (5).
Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
Proceedings of the 6th International Coriference on Software Engineering, IEEE, Tokyo, Sept. 1982.

BUGS

Purdue University

6/29/83

1

IMPRIN'f( 1)

UNIX Progrmnrncr's Manual

IMPRINT(I)

NAME

imprint - print text files on Imprint-IO
SYNOPSIS

imprint [ pr options] [ options] [ filc ... ]
DESCRIPTION
ilnprinl calls pr Of

cat on the input files and prefixes an appropriate document hC


This is useful for keeping track of volume and source of incoming mail. Eventually, repl, /arw, cam.p, and d:ist may also produce audits to this (or another) file,
perhaps with "Message-Id:" information to keep an exact correspondence history.
Audit-file" will be in the user's MH directory unless a full path is
specitled.
Inc will incorporate even illegally formatted messages into the user's MH folder
inserting a blank line prior to the otTending component. and printing a comment
identifying the bad message.
In all cases, the mail tlle will be zeroed.
II

I

SHOME/mh..protile
SHaME/mail
/ audit-file

The user profile
The user's mail drop
Audit trace tile (optional)

PRDmE COIIPONENiS

Path:
To determine the user's MH directory'
Folder-Protect: For protection on new folders
Msg-Protect:
For protection on new messages
DEFAULTS

'+folder' defaults to "inbox"
CONTEXl"

The folder into which the message is being incorporated will become the current
folder t and the first message incorporated will be the current message. This
leaves the context ready for a show of the tirst new message.

4th Berkeley Distribution

3 August 1983

1

INCLUDE(l)

UNIX Programmer's Manual

INCLUDE(l)

NAME

include - search for and print header (include) files
SYNOPSIS

include [-acnq.] [files •..]
DESCUIPTION

Include is used to find and print the contents of header (".hH) files. There are a number of places
where a header file might be found; include has a list of several places to search.
Invoking include with no file arguments causes it to print a list of the directOlies searched; these are
searched in the order they arc printed here. Your ihome directory and its "include/" subdirectory
arc included. It is not an error if some of the listed directories do not exist (or are not searchable.)
..
The directory HI" is a special case; this tlleans that an ab Sl:>1ute pathname is expected.
Invoking include with one or more file arguments causes it to search for the specified file in the
on the search list. ln each directory. include first looks for file and, if that is not there,
fiI~.h. Jf 1<.>lll1d, the file is printed on the terminal. using lIlore(l}.

dh-(~ctories

FLAGS

-a
-c

-on
-q

Normally. include searches for a file only until it finds it. This flag causes
include to look for as many instances of the file as it can.
Tells include to usc cal(l) instead of more(l) to print the file on the tenninal.
Tells include to print only the names of the files found; the contents arc
not printed.
Tells include not to print the names of the files; only the contents arc
printed (unless the -n flag is on.)
Tells include not to search "J" {i.e.• the current working directory}· as
such; it may be searched if it is also named by another directory on the
search list.

DIA(iNOSTICS

Indicates if a file is not found anywhere.
AUTIIOR.

JeffreyM ogul
BUGS

7th Edition

1

INDENT (1)

UNIX Programmer's Manual

INDENT (1)

NAME

indent -- indent and format C program source
SYNOPSIS

indent input [ output] [flags]
DESCRIPTION

Indentis·intended primarily as a C program formatter. Specifically, indentwi1l:
•

indent code lines

•

align comments

•

insert spaces around operators where necessary

•

break up declaration lists as in "int a,b,c;".

Indent will not break up long statements to make them fit within the maximum line length, but
it will flag lines that are too long. Lines will be broken so that each statement starts a new line,
and braces will appear alone on a line. (See the - br option to inhibit this.) Also, an attempt is
made to line up identifiers in declarations.

The flags which can be specified follow. They may appear before or after the file names. If the
output file is omitted, the formatted file will be written back into input and a Hbackup" copy of
input will be written in the current directory. If input is named "/blah/blah/file", the backup
file will be named H .Bfile" . If output is specified, indent checks to make sure it is different from
input.
The following flags may be used to control the formatting style imposed by indent.
-Innn

Maximum length of an output line. The default is 75.

-cnnn

The column in which comments will start. The default is 33.

-cdnnn

The column in which comments on declarations will start. The default is for these
commenis to start in the same column as other comments.

- innn

The number of spaces for one indentation level. The default is 4.

.... dJ, -ndj -dj will cause declarations to be left justified..... ndj will cause them to be indented
the same as code. The default is .... ndj.
-v, -nV

-v turns On "verbose" mode, --nv turns it of[ When in verbose mode, indentwill
report when it splits one line of input into two or more lines of output, and it will
give some size statistics at completion. The default is .... nv.

-be, -nbc

If -be is specified, then a newline will be forced after each comma in a declaration.
- nbe will turn off this option. The defaul t is - be
-dnnn

This option controls the placement of comments which are not to the right of code.
Specifying - d2 means that such comments will be placed two indentation levels to
the left of code. The default -- dO lines up these comments with the code. See the
section on comment indentation below.

-br, .... hl Specifying - bl will cause complex statements to be lined up like this:
if L')
{
code

}
Specifying - br (the default) will make them look like this:
if t .. ) {
code

4th Berkeley Distribution

22 December 1917

INDENT (1)

UNIX Programmer's Manual

. INDENT (1)

You may set up your own Hprofile" of defaults to indent by creating the file H.indent.pro" in
your login directory and including whatever switches you like. If indent is run and a profile file
exists, then it is read to set up the program's defaults. Switches on the command line, though,
will always override profile switches. The profile file must be a single line of not more than 127
characters. The switches should be separated on the line by spaces or tabs.

Multi-line expressions
Indentwill not break up complicated expressions that extend over multiple lines, but it will usually correctly indent such expressions which have already been broken up. Such an expression
might end up looking like this:
x==
(

(Arbitrary parenthesized expression)

+
(

(Parenthesized expression)

•
(Parenthesized expression)
)

Comments
Indent recognizes four kinds of comments. They are: straight text, "box" comments, UNIXstyle comments, and comments that should be passed through unchanged. The action taken
with these various types are as follows:
"Box" comments. Indent assumes that any comment with a dash immediately after the start of
comment (j.e. H/ __ ") is a comment surrounded by a box of stars. Each line of such a comment will be left unchanged, except that the first non-blank character of each successive line
will be lined up with the beginning slash of the first line. Box comments will be indented (see
below).
"Unix-style" comments. This is the type of section header which is used extensively in the
UNIX system source. If the start of comment (H/_") appears on a line by itself, indent
assumes that it is a UNIX-style comment. These will be treated similarly to box comments,
except the first non-blank character on each line will be lined up with the '-' of the H/_".
Unchanged comments. Any comment which starts in column 1 will be left completely
unchanged. This is intended primarily for documentation header pages. The check for
unchanged comments is made before the check for UNIX-style comments.
Straight text. All other comments are treated as straight text. Indent will fit as many words
(separated by blanks, tabs, or newlines) on a line as possible. Straight text comments will be
indented.

Comment indentation
Box, UNIX-style, and straight text comments may be indented. If a comment is on a line with
code it will be started in the "comment column", which is set by the - cnnn command line
parameter. Otherwise, the comment will be started at nnn indentation levels less than where
code is currently being placed, where nnn is specified by the -dnnn command line parameter.
(Indented comments will never be ·placed in column 1.) If the code on a line extends past the
comment column, the comment will be moved to the next line.

4th Berkeley Distribution

22 December 1977

2

INDENT (1)

UNIX Programmer'ts Manual

INDENT ( 1)

DIAGNOSTICS

Diagnostic error messages, mostly to tell that a text line has been broken or is too long for the
output line.
FILES

.indent. pro

profile file

BUGS

Does not know how to format "long" declarations.

4th' Ber.keley Distribution

22· December ·1977

3

lNEWS( 1)

UNIX Programmer's Manual

INEWS( 1)

RAIlE

inews - submit news articles
SYNOPSIS

mews [ -h] -t title [ -n newsgroups ] [ -e e:r:piraiion d.ate ]
mews -p [filename ]
inews -C newsgroup
DESCRIPTION

[news submits news articles to the USENET news network. It is intended as a
raw interface, not as a human user interface. Casual users should probably use
postnews{1} instead.
The first form is for submitting user articles. The body will be read from the
standard input. A title must be specified as there is no default. Each article
belongs to a list of newsgroups. If the ~ flag is omitted, the list will. default to
something line general. (On ours. it is general.) If you wish to submit an article
in multiple newsgroups, the newsgroups must be separated by commas and/or
spaces. If not specified, the expiration date will be set to the local default. The
-f fiag specifies the article's sender. Without this nag, the sender defaults to the
user's name. If -f is specified, the real sender's name will be included as a
Sender line. The -b. flag specifies that headers are present at the beginning of
the article, and these headers should be included with the article header instead
of as text. {This mechanism can be used to edit headers and supply additional
nondefault headers, but not to specify certain information, such as the sender
and article ID. that inews itself generates.}
When posting an article, the environment is checked for information about the
sender. If NAME is found. its value is used for the full name, rather than the system value (often in / etc/passwd). This is useful if the system value cannot be
set, or when more than one person uses the same login. If ORGANIZATION is
found, the value overrides the system default organization. This is useful when a
person uses a guest login and is not primarily associated with the organization
awning the machine.
The second form is used for receiving articles from other machines. If filenam.e
is given, the article will be read from the specified file; otherwise the article will
be read from the standard input. An expiration date need not be present and a
receival date, if present, will be ignored.
After local installation, inews will transmit the article to all systems that subscribe to the newsgroups that the article belongs to.
The third form is for creating new newsgroups. On some systems, this may be
limited to specitlcusers such as the super-user or news administrator. (This
happens on ours.)
If the tile /usr/lib/news/recording is present. it is taken as a list of "recordings"
to be shown to users posting news. (This is by analogy to the recording you hear
when you dial information in some parts of the country. asking you if you really
wanted to do this.) The flle contains lines of the form:
newsgroups  fllename
for example:
net. all net.recording
fa-all fa.recording
Any user posting an article to a newsgroup ma~cbing the pattern on the left will
be shown the contents of the file on the right. The file is found in the LIB directory (often /usr/lib/news). The user is then told to hit DEL to abort or RETURN

4th Berkeley Distribution

28 July 1983

1

lNEWS( 1)

UNIX Programmer's Manual

INEWS( 1)

to proceed. The intent of this feature is to help companies keep proprietary
information from accidently leaking out.
/usr /spool/news/.sys.nnn
Temporary articles
/usr/spool/news/'newsgroups/a.rticle...:rw.
Articles
Expired articles
/usr /spool/ oldnews/
List of known newsgroups and highest local
/usr /lib/news/active
article numbers in each.
Sequence number of last article
/usr/lib/news/seq
List of all articles ever seen
/usr /lib/news/history
System subscription list
/usr /lib/news/sys
SEE ALSO

Mail(l), binmail(l), getdate(3), msgs(l), news(5), newsrc(5) , postnews(l). readnews(l), recnews(l}. sendnews(8), uucp(l). uurec(8),
AUTHORS
Matt Glickman
Mark Horton
Stephen Daniel
Tom R. Truscott

4th Berkeley Distribution

28 July 1983

2

INGROUP(l)

UNIX Programmer's ,Manual

:INGROUP(l)

NAME

ingroup - show membership in a specified group
SYNOPSIS

ingroup group •••
DESCRIPTION

The ingroup command shows the users who belong to the spccific4 group(s).

Each user belongs to a group specified in the password file / etc/passwd and possibly to other
groups as specified in the file / etc/group.
SEE ALSO

-; -,'.. -. ~- . -.g(p'1P~(P ;
FILES

/ctc/passwd, /etc/group
BUGS

Probably should be a function of grolljJs(1).

7th Edition

1

INSTALL (1)

UNIX Programmer's Manual

INSTALL (1)

NAME

install - install binaries
SYNOPSIS

install [ -c] [ -m mode] [

-0

owner] [ -g group] [ -s) binary destination

DESCRIPTION

Binary is moved (or copied if -c is specified) to destination. If destination already existS, it is
removed before binary is moved. If the destination is a directory then binary is moved into the
destination directory with its original file-name.
The mode for Destination is set to 755~ the - m mode option may be used to specify a different
mode.

Destination is changed to owner root; the

-0

owner option may be used to specify a different

owner.

Destination is changed to group

staff~

the -g group option may be used to specify a different

group.

If the - s option is specified the binary is stripped after being installed.

Install refuses to move a file onto itself.
SEE ALSO

chgrp(1), chmod(1), cp(1), mv(l), strip(1), chown(S)

4th Berkeley Distribution

22 April 1983

1

lOST AT (1)

UNIX Programmer's Manual

fOSTAT (1)

NAME

iostat - report 110 statistics
SYNOPSIS

iostat [ interval [ count] ]
DESCRIPTION

fostat iteratively reports the number of characters read and written to terminals, and, for each
disk, the number of seeks transfers per second, kilobytes transfered per second, and the milliseconds per average seek. It also gives the percentage of time the system has spent in user
mode, in user mode running low priority (niced) processes, in system mode, and idling.
To compute this information, for each disk, seeks and data transfer completions and number of
words transferred are counted~ for terminals collectively, the number of input and output characters are counted. Also, each sixtieth of a second, the state of each disk is examined and a
tally is made if the disk is active. From these numbers and given the transfer rates of the devices it is possible to determine average seek times for each device.
The optional interval argument causes iostat to report once each interval seconds. The first
report is for all time since a reboot and each subsequent report is for the last interval only.
The optional count argument restricts the number of reports.
FILES

Idev/kmem
Ivrnunix
SEE ALSO

vmstat(l)

4th Berkeley Distribution

18 January 1983

IPHOS'I'ID( 1)

UN IX Programmer's Manual

lPHOSTID( 1)

NAME

iphostid - set or print Internet Protocol (lJ» identifier of current host
SYNOPSIS
hostid [ identifier]
DEscnlPTION
The iphoslid command prints the identifier of the current host in both hcxi1owing argulllent as the name of a font file for the text. A variable-pitch font
will gcneraI1y produce ugly rcsulLIi.

- F

Use the following argumcnt as the name of a font file for the bold header line (sec description of the - B nag).

- 011

Print with a page ofrset (left margin) of 11 spaces..

-III

Take the pgmnlllWr's ManU'll

l'l'ROFF (1)

ITROFF( 1)

NAME

itrofr - trofY to t.he ImPrint printer
SYNOPSIS

itrolT [ Iroi)' options] [ flags] [file .... ]
DESCHIP'I'ION

/11'(41' funs Iroj}(1) in an environment to prociuce typeset output on the ImPrint-]O priJller. It lIses
the caldvi program to convert !n DVI format.

Besides the

ln~f.1'nags,

the f()llowing arc recognized:

- en

Print

-IVIII

Set the Imprint-IO memory parl,mct~r. to If!., where .1 :$nS5. See the ImprinFIO
Programmer's Guide for a de~criplioll of this value. This }'iararnetcr all'plies only for i)rerelease systems (RELEASE = 0).

II

copies.

SEE ALSO

imprint(l), ipq(I), ipr(l), iprm(l), trofltl)
HUGS

Not all characters arc handl\d optimally. Italic spacing tends to be a little tight. Cut marks fall
jw;t outside till..: page boundaries, thus the first set of cut marks is lost and <.III subsequent ones 11111 at
the bottom of t.he prececuing pagc. Back wards motion across page boundaries, as is sometimes
done in fbI. wi II cause errors.

7th

F~dilion

I JOCAL

1

JOIN (I)

UNIX Programmer's Manual

JOIN (I)

NAME

join - relational database operator
SYNOPSIS

Join [ options] filel file2
DESCRIPTION

Join forms, on the standard output, a join of the two relations specified by the lines of .filel and
.filel. If filel is '-', the standard input is used.
Filel and file2 must be sorted in increasing ASCII collating sequence on the fields on which
they are to be joined, normally the first in each line.
There is one line in the output for each pair of lines in filel and file2 that have identical join
fields. The output line normally consists of the common field, then the rest of the line from
filel, then the rest of the line from fi1e2.
Fields are normally separated by blank, tab or newline. In this case, multiple separators count
as one, and leading separators are discarded.
These options are recognized:

-an
-e s

In addition to the normal output, produce a line for each unpairable line in file n,
where n is I or 2.
Replace empty output fields by string s.

-J n m

Join on the mth field of file n. If n is missing, use the mth field in each file.
-0 list Each output line comprises the fields specified in list, each element of which has the
form n.m, where n is a file number and m is a field number.
-tc
Use character c as a separator (tab character). Every appearance of c in a line is
significant.
SEE ALSO

sortO), comm(l), awk(l)
BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is
that of a plain sort.
The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous.

7th Edition

18 January 1983

1

KILL (1)

UNIX

Progrf.lmm~r' s

Man'Jal

KILL (1 )

NAME

kill - terminate a process with extreme prejudice
SYNOPSIS

kill [ -sig ] processid ...
kill -I
DESCRIPTION
Kill sends the TERM 
-z
Arrange for the process to be loaded on demand from the resulting executable file (413
format) rather than preloaded. This is the default. Results in a 1024 byte header on
the output file followed by a text and data segment each of which have size a multiple
of 1024 bytes (being padded out with nulls in the file if necessary). With this format
the first few BSS segment symbols may actually appear (from the output of size(1» to
live in the data segment; this to avoid wasting the space resulting from data segment
size roundup.
FILES

llib/lib-.a
lusrllib/lib-.a
lusr/iocal/lib/lib-.a
a.out

libraries
more libraries
still more libraries
output file

SEE ALSO

as(l), ar(l), cc(l), ranlib(l)

BUGS
There is no way to force data to be page aligned. Ld pads images which are to be demand
loaded from the file system to the next page boundary to avoid a bug in the system.

4th Berkeley Distribution

18 January 1983

2

LD68 ( 1)

UN IX Programmer's Manual

NAME
ld68 - .b ~> b.otlt linker for the MC68000
SYNOPSIS

Id68 [ option] ... file ...
DESCRIPTION
l.d68 comhines several object programs into one, resolves external references, and sC(lrchcs

libraries. In the simplest C(lse several object fIles arc given, and IdoS combines them, producing an
object module which can be either execuled or become the input t()r a further 1d68 run. On the
latter case, the - r option rnllst be given· to preserve the relocation bits.) The output of Id68 is left
on b.out. This file is made executable only if no errors occurred during the load.
The argument routines are concatenated in the order specHled.
The entry point of the output is determined by the first applicable item or the following I ist: the
- c option if given, the value of the symbol _start if defined, or the text origin· (first instruction).
If any argulllent is a library, it is searched exactly once at the point it is encountered in lhe argument list. Ollly those routines defining an unresolved external reference arc loaded. I f a routine
from a library references another routine ill the library, the referenced routine must tippear after the
referencing routine in the library. Thus the order of programs within libraries may be important.
The symbols '_etext', '_edata' and '_end' ('ctext', 'edata' and 'end' in C) are reserved, andi f referred
to, are set to t.he first location ahove the program, the first location above initialized data, and the
first location above all data respectively. It is erroneous to define these symbols.
['d68 understands several options. Excepl for -I, they sholild appear bcfhre the file names.
-I)

Take the next argulllent as a decimal number and pad t.he data segment with zero bytes to
the indicated length.

-d

Force definilion of common storage even if the - r !lag is present.

-c

'l'he 1()lIowing argument is taken to be t.he name of the entry point of t.he loaded program;
location Ox 1000 is the uenltllt.

- f

Fold case on idcntH1crs. That is, upper and lower case lellers are not- distinguished. Used
to link with Pasc~ll routines, ()f example.

--Ix

This option is an abbreviation (hr the library nallle '/usrlsun/lih/libx .a', where .x is a
string. /\ library is searched when iLs name is encountered, so the placement of a -I is
significant.

-vx

This denotes board version x which may at present only be 'm' f()rMotorola Design
Module. The deflllllt board version is the Sunl prototype, vI.

- M

Create a hUl1lan~readable list of symbols in "sym.out".

- n

Arrange (by giving the output me a 0410 "magic number") that when the output me is executed, the text portion will be read-only and shared among all users executing the file.
This involves moving lhe data areas lip to the first possible 64K byle boundary Il)lIowing
the end or the text (not really useful yet).

-0

The nome argument after

-q

Quicksort symbols in b.()ut in ascending Ilumericalorder.

- r

Generate relocation bits in the output file so that it can be the subject of arlother /d68 nm.
'l'h1s nag also prevent') final definitions from being given to common symbols, and
suppresses the 'undefined symbol' diagnostics.

-S

'Strip' the output by removing all symbols except locals and globals.

-s

'Strip' the output, that is, remove tile symbol table and relocation ·bits to save space (but

7th Edilion

1

-0

is used

,18

the name of the ld68 output file, instead of h.out.

UNIX Programmer's .Manual

LD68 ( 1)

LD68(1)

impair the usefulness of the de buggers). This information can also be removed by slrip(1).
- T

The next argument is a hexadecimal number which sets the text segment origin. The
del:llIlt origin is OxlOOO. Jf you intend to use the output as input to another fun of Id68,
you must specify -'1' O.

- R

The next argument is a hexadecimal number which sets the common/bs::> scgment origin.
The default origin is immcdiately after the data segment.

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

- X

Save local symbols except for those whose names begin with '1..'. This option is used by
cc(1) to discard interilally-gcilerakdlatJc"1swhile retaining symbols tocatio routines.

- x

Do not preserve local (non-.globI) symbols in the output symbol table: only enter external
symbols. This option saves some space in the output file.

FILES

lusrlsun/lib/lib*.a
b.Ollt

libraries
output file

SEE ALSO

ar(l), cc68(1), a68( 1)
BUGS

The b.out fannat header docs not contain (lny indication of the text segment origin, so if you
specify somethillg other than the default origin -'I' 1000, you will have to remember this value and
specify it again to dl()8 when you download. The standard Sun monitor cannot netload files with
origins other than 1000, so you must either usc dl()8 or write a special loader for such programs.

7th Edition

2

LEARN (1)

UNIX Programmer's Manual

LEARN (1)

NAME

learn - computer aided instruction about UNIX
SYNOPSIS
learn [ -directory] [subject [ lesson] ]
DESCRIPTION
Learn gives Computer Aided Instruction courses and practice in the use of UNIX, the C Shell,
and the Berkeley text editors. To get started simply type learn. The program will ask questions
to find out what you want to do. Some questions may be bypassed by naming a subject, and
more yet by naming a lesson. You may enter the lesson as a number that learn gave you in a
previous session. If you do not know the lesson number, you may enter the lesson as a word,
and learn will look for the first lesson containing it. If the lesson is ' - " learn prompts for each
lesson; this is useful for debugging.

The subject's presently handled are
files
editor
vi
morefiles
macros
eqn
C
There are a few special commands. The command 'bye' terminates a learn session and ~where'
tells you of your progress, with ~where m' telling you more. The command 'again' re-displays
the text of the lesson and ·again lesson' lets you review lesson.
The - directory option allows one to exercise a script in a nonstandard place.
FILES

/usr/lib/learn
/usr/tmp/pl*

subtree for all dependent directories and files
playpen directories

SEE ALSO
csh(I), ex(I)

BUGS
The main strength of learn, that it asks the student to use the real UNIX, also makes possible
baffiing mistakes. It is helpful, especially for nonprogrammers, to have a UNIX initiate near at
hand during the first sessions.
Occasionally lessons are incorrect, sometimes because the local version ofa command operates
in anon-standard way. Such lessons may be skipped with the ~skip' command, but it takes
some sophistication to recognize the situation.
To find a lesson given as a word, learn does a simple fgrep(I) through the lessons. It is unclear
whether this sort of subject indexing is better than none.
Spawning a new shell is required for each of many user and internal functions.

7th Edition

26 April 1983

LEAVE (1)

UNIX Programmer's Manual

LEAVE(l)

NAME

leave - remind you when you have to leave
SYNOPSIS

leave [ bhmm ]
DESCRIPTION

Leave waits until the specified time, then reminds you that you have to leave. You are reminded S minutes and 1 minute before the actUJ! time, at the time, and every minute thereafter.
When you log off, leave exits just before it would have printed the next message.
The time of day is in the form hhmm where hh is a time in hours (on a 12 or 24 hour clock).
All times are converted to a 12 hour clock, and assumed to be in the next 12 hours.
If no argument is given, leave prompts with "When do you have to leave 1". A reply of newline
causes leave to exit, otherwise the reply is assumed to be a time. This form is suitable for
inclusion in a .Iogin or .projile.
Leave ignores interrupts, quits, and terminates. To get rid of it you should either log off or use
"kill - 9" giving its process ide
SEE ALSO

calendar(t)
AUTHOR

Mark Horton
BUGS

3rd Berkeley Distribution

1

LEX (1)

. UNIX Programmer's Manual

LEX (1)

NAME

lex - generator of lexical analysis programs
SYNOPSIS

lex [ -tvfn ] [file] ...
DESCRIPTION

Lex generates programs to be used in simple lexical analyis of text. The input files (standard
input default) contain regular expressions to be searched for, and actions written in C to be
executed when expressions are found.
A C source program, 'lex.yy.c' is generated, to be compiled thus:
cc lex.yy.c -11
This program, when run, copies unrecognized portions of the input to the output, and executes
the associated C action for each regular expression that is recognized.
The options have the following meanings.
-t
Place the result on the standard output instead of in file "lex.yy.c".
-v
Print a one-line summary of statistics of the generated analyzer.
-n
Opposite of -v; - 0 is default.
-f
"Faster" compilation: don't bother to pack the resulting tables; limited to small programs.
EXAMPLE

lex lexcommands
would draw lex instructions from the file lexcommands, and place the output in lex.yy.c

%%
[A -Z] putchar(yytext[O] +'a' -'A');
[ ]+$
[ ] + putchare ');
is an example of a lex program that would be put into a lex command file. This program converts upper case to lower, removes blanks at the end of lines, and replaces multiple blanks by
single blanks.
SEE ALSO

yacc(l), sed(1)
M. E. Lesk and E. Schmidt, LEX - Lexical Analyzer Generator

7th Edition

7 February 1983

1

LINELEN(l)

UNIX Programmer's Manual

LINELEN(l)

NAME

linclen - print line lengths for a text file
SYNOPSIS

Ii nelen [ -

.
nl ) [

filename )

DESCUIPTION

Lindell rcads lines from the specified file (or the standard input, if no filename is given) and copies
thcln to the standard outPllt; each linc is preccedcd by itl) length. For example. "linclen
I etc I fstab.rp07" gives

00018: Idev/hpOa:/:rw:l:1

:. ,.0q02,I:. /~cy IhpOg:/m"t~rw:l :3,

; t 1

00021: Idcv/hpOh:/usr:rw:l:2

If the - m flag is given. then instead of printing every line in the file, /iNe/cll prints only the Iinc of
maximal lenglh. For example, ulinelen -Ill !etc/fstab.rp07" gives
longest line at line #2, 21 characters:
I dev IhpOg:/mnt: rw: 1:3
AUTHOR

Jeffrey Mogul
SEE ALSO

eat(l), wc(l)
BUGS

The - III option prints the first line of m~,ximal length; it docs not indicate how many maximal.
lenglh lines lhere arc.
Lines longer than 10000 characters will break lhisprogram.

7th Edition

1

LINT (1)

UNIX Programmer's Manual

LINT(I)

NAME

lint - a C program verifier
SYNOPSIS
Unt [ -abc:hnpuvx ] file ...
DESCRIPTION

Lint attempts to detect features of the C program files which are likely to be bugs, or nonportable, or wasteful. It also checks the type usage of the program more strictly than the compilers. Among the things which are currently found are unreachable statements, loops not
entered at the top, automatic variables declared and not used, and logical expressions whose
value is constant. Moreover, the usage of functions is checked to find functions which return
values in some places and not in others, functions called with varying numbers' of arguments,
and functions whose values are not used.
By default, it is assumed that all the files are to be loaded together; they are checked for mutual
compatibility. Function definitions for certain libraries are available to lint; these libraries are
referred to by a conventional name, such as '-1m', in the style of Id(1). Arguments ending in
.In are also treated as library files. To create lint libraries, use the -C option:
lint -Cfoo files ...
where files are the C sources of library /00. The result is a file Ilib-lfoo.ln in the correct library
format suitable for linting programs using /00.
Any number of the options in the following list may be used. The - D, - U, and -I options of
cc(l) are also recognized as separate arguments.
p
Attempt to check portability tQ the IBM and GCOS dialects of C.
h
Apply a number of heuristic tests to attempt to intuit bugs, improve style, and reduce
waste.
b
Report break statements that cannot be reached. (This is not the default because,
unfortunately, most lex and many yacc outputs produce dozens of such comments.)

v

Suppress complaints about unused arguments in functions.
x
Report variables referred to by extern declarations, but never used.
a
Report assignments of long values to int variables.
e
Complain about casts which have questionable portability.
u
Do not complain about functions and variables used and not defined, or defined and
not used (this is suitable for running lint on a subset of files out of a larger program) .
n
Do not check compatibility against the standard library.
z
Do not complain about structures that are never defined (e.g. using a structure pointer
without knowing its contents.).
Exit(2) and other functions which do not return are not understood; this causes various lies.
Certain conventional comments in the C source will 'change the behavior of lint:
/-NOTREACHED-/
at appropriate points stops comments about unreachable code.

I-VARARGSn-/
suppresses the usual checking for variable numbers of arguments in the followinS function declaration. The data types of the first n arguments are checked; a missing n is
taken to be O.
/.NOSTRICT-/
shuts off strict type checking in the next expression.

4th Berkeley Distribution

7 March 1983

1

LINT (1 )

I·ARGSUSED·I
turns on the

UNIX Pro81'ammer's Manual

-Y

LINT(l)

option for the next function.

I·LINTLmRARY·1
at the beainninl of a file shuts off complaints about unused functions in this file.
AUTHOR
S.C. Johnson. Lint library construction implemented by Edward Wang.
FILES

lusr/lib/lint/lind121
lusr/lib/iintillib-Ic.ln
lusrllib/lint/llib-Ic
lusr/lib/lint/llib-port.1n
lusrllib/lintlllib-port
lIib-I•.1n

programs
declarations for standard functions
human readable version of above
declarations for portable functions
human readable ...
library created with -C

SEE ALSO

ceO)
S. C. Johnson, Lint, a C Program Checker
BUGS

There are some things you just can't let lint to shut up about.

4th Berkeley Distribution

7 March 1983

2

LISP (1)

UNIX Programmer's Manual

LISP (1)

NAME

lisp - lisp interpreter
SYNOPSIS
Hsp
DESCRIPTION
Lisp is a lisp interpreter for a dialect which closely resembles MIT's MACLISP. This lisp, known

as FRANz LISP, features an 1/0 facility which allows the user to change the input and output
syntax, add macro characters, and maintain compatibility with upper-case only lisp systems;
infinite precision integer arithmetic, and an error facility which allows the user to trap system
errors in many different ways. Interpreted functions may be mixed with code compiled by
liszt(1) and both may be debugged using the "Joseph Lister" trace package. A lisp containing
compiled and interpreted code may be dumped into a file for later use.
There are too many functions to list here; one should refer to the manuals listed below.
AUTHORS

An early version was written by Jeff Levinsky, Mike Curry, and John Breedlove. Keith
Sklower wrote and is maintaining the current version, with the assistance of John Foderaro.
The garbage collector was implemented by Bill Rowan.
FILES

lusr/lib/lisp/trace.l
lusr/lib/lisp/toplevel.1

Joseph Lister trace package
top level read-eval-print loop

SEE ALSO

liszt (1), Ixref(1)
'FRANZ LISP Manual, Version l' by John K. Foderaro
MACLISP Manual
BUGS

The error system is in a state of flux and not all error messages are as informative as they could

be.

4th Berkeley Distribution

1 October 1980

1

LISZT (1)

UNIX Programmer's Manual

LISZT (1)

NAME

liszt - compile a Franz Lisp program
SYNOPSIS

liszt [ -mpqruwxCQST] [ -e form] [ -0 objfile] [name]
DESCRIPTION

Liszt takes a file whose names ends in '.1' and compiles the FRANZ LISP code there leaving an
object program on the file whose name is that of the source with' .0' substituted for '.1'.
The following options are interpreted by Iiszt.
-e
-m
-0

Evaluate the given form before compilation begins.
Compile a MACLISP file, by changing the readtable to conform to MACLISP syntax and
including a macro-defined compatibility package.
Put the object code in the specified file, rather than the default' .0' file.

-p

places profiling code at the beginning of each non-local function. If the lisp system is
also created with profiling in it, this allows function calling frequency to be determined
(see prof{ 1) .)

-q

Only print warning and error messages. 'Compilation statistics and notes on correct but
unusual constructs will not be printed.
place bootstrap code at the beginning of the object file, which when the object file is
executed will cause a lisp system to be invoked and the object file fasl'ed in.
Compile a UCI-lispfile, by changing the readtable to conform to UCI-Lisp syntax and
including a macro-defined compatibility package.
Suppress warning diagnostics.

-r
-u
-w

-x

Create a lisp cross reference file with the same name as the source file but with '.x'
appended. The program Ixref{l) reads this file and creates a human readable cross
reference listing.

-C

put comments in the assembler output of the compiler. Useful for debugging the compiler.

-Q

Print compilation statistics and warn of strange constructs. This is the default.
Compile the named program and leave the assembler-language output on the
corresponding file suffixed '.s'. This will also prevent the assembler language file from
being assembled.

-S

-T
send the assembler output to standard output.
If no source file is specified, then the compiler will run interactively. You will find yourself
talking to the Iisp(l) top-level command interpreter. You can compile a file by using the function liszt (an nlambda) with the same arguments as you use on the command line. For example
to compile 'foo', a MACLISP file, you would use:
(Iiszt -m foo)
Note that liszt supplies the ".1" extension for you.
FILES

lusr/lib/lisp/machacks.l
lusr /lib/lispl syscall.l
lusr llib/lisp I ucifnc.l

MACLISP compatibility package
macro definitions of Unix system calls
UCI Lisp compatibility package

AUTHOR

John Foderaro

4th Berkeley Distribution

1 October 1980

1

LISZT (1)

UNIX Programmer's Manual

LISZT (1)

SEE ALSO
lisp (1 ), lxref( 1)

4th Berkeley Distribution

1 October 1980

2

LN(I)

UNIX Programmer's Manual

LN(I)

NAME

In - make links
SYNOPSIS

In [ -s ] namel [name2 ]
In name ... directory
DESCRIPTION

A link is a directory entry referring to a file; the same file (together with its size, all its protection information, etc.) may have several links to it. There are two kinds of links: hard links
and symbolic links.
By default In makes hard links. A hard link to a file is indistinguishable from the original directory entry; any changes to a file are effective independent of the name used to reference the
file. Hard links may not span file systems and may not refer to directories.
The - s option causes In to create symbolic links. A symbolic link contains the name of the file
to which it is linked. The referenced file is used when an open(2) operation is performed on
the link. A stat(2) on a symbolic link will return the linked-to file; an Istat(2) must be done to
obtain information about the link. The readlink(2) call may be used to read the contents of a
symbolic link. Symbolic links may span file systems and may refer to directories.
Given one or two arguments, In creates a link to an existing file namel. If name2 is given, the
link has that name; name2 may also be a directory in which to place the link; otherwise it is
placed in the current directory. If only the directory is specified, the link will be made to the
last component of namel.
Given more than two arguments, In makes links to all the named files in the named directory.
The links made will have the same name as the files being linked to.
SEE ALSO

rm(1), cp(1), mv(l), Iink(2), readlink(2), stat(2), symlink(2)

4th Berkeley Distribution

17 March 1982

1

LOADAVO(l)

UN IX Programmer's Manual

LOADAVG(l)

NAME

loadavg - average load log data on a weekly basis
SYNOPSIS
IO~ldavg

DESCRIPTION

Loadavg is a filter which reads binary load log data from standard input, and outputs one weeks
worth.of binary load log data that is t.he average
FILES
SEE ALSO

loadlog(l), exlog(1)
AUTI-IOR

Marc R.llannah
HUGS

The average number of users is rounded to the nearest integer.

7th .Edition

1 .

LOADI,OG( 1)

UN IX Programmer's Manual

LOADLOG(I)

NAME

loadlog - log the current time, number of llsers, and load average
SYNOPSIS

load log
DESCRIPTION

Loadlog writes a binary load log entry to standard output. An entry consists of a long integ~:~r conG:lining (time/60)*60 + l1users, where lime is the result of a call to the procedure lillle(2) and
nusers is the number of users currently logged in. This is followed by a short integer containing
the current 15 minute load average multiplied by 100.
Loadlog is intended to be nm every 15 minuteS' byc/vII(8) witb output appended to a system. iog
file. This can be done with the following entry in lusr/lib/crontab:
0,15,30.45

* * * * lusrlslanf(.>rcl/bin/loadlog »/usr/adm/loadlog

SEE ALSO

cron(8), exlog( 1), loadavg(l)
AlJTlIOR

Marc R. Hannah

7th Edition

1

LOCATE(l)

LOCATE(l)

UNIX Programmer's Manual

NAME

locate - location and owner of Pup network
SYNOPSIS

host.~

,

locate hostname I hostname ... ]

DESCRIPTION

Locate returns the "attributes" associated with the Pup Network ,Directory entry for thc specified
host(s). USlJally, these attributes arc "Location" and "Owner".
For examplc,
... -..

- .....

locate irs
'"",

..

,

...

,..

..

.,

"

~

.',

would return
Lassen (50#200#0) Location: MJlI 020, Owner: CSD

Note that the specified host name has been replaced by the "otlicial" (prcfered) name fbr the host.
SEE ALSO

miscserver(8)
DIAGNOSTICS

Will tell you if a host name is not H)Und.
AUTHOR

Jeffrey Mogul

BUGS
This is a local (Stanf(Hd-only) protocol, and is t1lirly dumb.

7th Edition

local

1

LOCK(I)

UNIX Programmer's Manual

LOCK(I)

NAME

lock - reserve a terminal
SYNOPSIS

lock
DESCRIPTION

Lock requests a password from the user, then prints "LOCKED" on the terminal and refuses to
relinquish the terminal until the password is repeated. If the user forgets the password, he has
no other recourse but to login elsewhere and kill the lock process.
AUTHOR

Kurt Shoens
BUGS

Should timeout after 1S minutes.

3rd Berkeley Distribution

24 February 1979

1

LOGIN(l)

UNIX Programmer's Manual

LOGIN (1 )

NAME
login - sign on
SYNOPSIS

100ln [ usemame ]
DESCRIPTION

The login command is used when a user initially signs on, or it may be used at any time to
change from one user to another. The latter case is the one summarized above and described
here. See "How to Get Started" for how to dial up initially.
If login is invoked without an argument, it asks for a user name, and, if appropriate, a password. Echoing is turned off Of 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 mail, and the message of the day is printed, as is the time he last logged in (unless he has a
".hushlogin" file in his home directory - this is mostly used to make life easier for nonhuman users, such as uucp).
Login initializes the user and group IDs and the working directory, then executes a command
interpreter (usually shU» according to specifications found in a password file. Argument 0 of
the command interpreter is "-sh", or more generally the name of the command interpreter
with a leading dash (56 -") prepended.
Login also initializes the environment environ(7) with information specifying home directory,
command interpreter, terminal type (if available) and user name.
If the file /etc/nologin exists login prints its contents on the user's terminal and exits. This is
used by shutdown(S) to stop users logging in when the system is about to go down.

Login is recognized by sh(1) and csh(1) and executed directly (without forking).
FILES

/etc/utmp
/usr/adm/wtmp
/usr/spool/mail/.
/etc/motd
/etc/passwd
/etc/nologin
.hushlogin
/ etc/securetty

accounting
accounting
mail
message-of-the-daY
password file
stops logins
makes login quieter
lists ttys that root may log in on

SEE ALSO

init(S), getty(S), mail (1) , passwd(I), passwd(S) , environ(7), shutdown(S)
DIAGNOSTICS

"Login incorrect," if the name or the password is bad.
"No Shell", "cannot open password file", "no directory": consult a programming. counselor.
BUGS

An undocumented option, -r is used by the remote login. server, rlogind(SC) to force login to
enter into an initial connection protocol.

4th Berkeley Distribution

1 April 1981

1

LOOK(l)

LOOK(l)

UNIX Proarammer's Manual

NAME
look - find lines in a sorted list
SYNOPSIS

look [ -dl ] string [ file ]
DESCRIPTION
Look consults a sorted file and prints all Unes that

beam with string.

It uses binary search.

The options d and f affect comparisons as in &Ort(1):
d

'Dictionary' order: only letters, digits, tabs and blanks participate in comparisons.

f
Fold. Upper case letters compare equal to lower case.
If no file is specified, lusrldictlwords is assumed with collating sequence -dl.
nLES

lusr/dict/words
SEE ALSO
sort (1), arep (1)

7th Edition

18 January 1983

1

LOOKBIB (1)

UNIX Programmer's Manual

LOOKBIB (1)

NAME

indxbib, lookbib - build inverted index for a bibliography, find references in a bibliography
SYNOPSIS

indxbib database
lookbib database
DESCRIPTION
Indxbib makes an inverted index to the named databases (or files) for use by lookbib(I) and
rejer(1). These files contain bibliographic references (or other kinds of information) separated
by blank lines.

A bibliographic reference is a set of lines, constituting fields of bibliographic information. Each
field starts on a line beginning with a HO/O", followed by a key-letter, then a blank, and finally
the contents of the field, which may continue until the next line starting with H%".
Indxbib is a shell script that calls lusr/lib/refer/mkey and lusr/lib/referlinv. The first program,
mkey, truncates words to 6 characters, and maps upper case to lower case. It also discards
words shorter than 3 characters, words among the 100 most common English words, and
numbers (dates) < 1900 or > 2000. These parameters can be changed~ see page 4 of the Refer
document by Mike Lesk. The second program, in v, creates an entry file Cia), a posting file
Cib), and a tag file Cic), all in the working directory.
Lookbib uses an inverted index made by indxbib to find sets of bibliographic references. It reads
keywords typed after the ">" prompt on the terminal, and retrieves records containing all
these keywords. If nothing matches, nothing is returned except another H>" prompt.

It is possible to search multiple databases, as long as they have a common index made by indxbib. In that case, only the first argument given to indxbib is specified to lookbib.
If lookbib does not find the index files (the .i [abc] files), it looks for a reference file with the
same name as the argument, without the suffixes. It creates a file with a '.ig' suffix, suitable for
use with fgrep. It then uses this fgrepfile to find references. This method is simpler to use, but
the .ig file is slower to use than the .Habc1 files, and does not allow the use of multiple reference files.
FILES

x.ia, x.ib, x.ic, where x is the first argument, or if these are not present, then x.ig, x
SEE ALSO
refer(1), addbib(1), sortbib(1), roftbib(1), lookbib(l)

BUGS
Probably all dates should be indexed, since many disciplines refer to literature written in the
1800s or earlier.

4th Berkeley Distribution

18 July 1983

1

LORDER(l)

UNIX Programmer's Manual

LORDER(l)

NAME

lorder - find ordering relation for an object library
SYNOPSIS

lorder file ...
DESCRIPTION

The input is one or more object or library archive (see ar(1» files. The standard output is a list
of pairs of object ftle names, meaning that the first file of the pair refers to external identifiers
defined in the second. The output may be processed by tsort(1) to find an ordering of a library
suitable for one-pass access by 1d(1).
This brash one-liner intends to build a new library from existing '.0' files.
ar cr library' lorder *.0 I tsort'
The need for lorder may be vitiated by use of ranlib(1), which converts an ordered archive into
a randomly accessed library.
FILES

*synaref, *symdef
nm(1), sedO), sortO), join(1)
SEE ALSO

tsort(1), ld(l), arO), ranlib(1)

BUGS
The names of object files, in and out of libraries, must end with '.0'; nonsense results otherwise.

4th Berkeley Distribution

18 January 1983

1

LORDER68 ( 1)

UNIX Programmer's Manual

LORDElt68 (1)

NAME
lorder68 - find ordering relation for an MCG8000 object library
SYNOPSIS

lordcr68 file ...
DESCRIPTION

The input is one or more object files. The standard output is a list of pairs of object file names,
meaning that the first file of the pair refers to external identifiers defined in the second. The output
may be processed by /sarlO) to find an ordering of a library suitable for one-pass access by Id68(l).
This brash one-liner intends to build a new library from existing '.b' files.
ar cr library ']ordcr68 *.b I tsort'
FILE...')

*symref, *symdef
nmO), sed(I), sort(1), join(1)
SEE ALSO

to;;ort( 1), Id68( 1),
RUGS

The names of object files, in and out of libraries, must end with '.b'; nonsense result\) otherwise.
Doesn't handle libraries.

4th Berkeley Distribution

1 .

LOWER(l)

UNIX Programmer's Manual

LOWER(l)

NAME
lower - lower the case of a filename
SYNOPSIS

lower files ...
DFSCRIPTION

lower renames each of it~ file arguments to contain no upper case lcttcrs. Thus lower Mr.Bill would
rename the filc Mr.Bill to mr.bill. Use lower * to rid a directory of upper case namcs.

AUTHOR
V. R. Pratt
DIAGNOSTICS

An appropriate messagc is OlHput if a filc·h(no't 'found. Ifl'cnaming would overwrite an existing filc
the renaming is not performed and a message about the already exbting file is printed.

7lh Edition

.1

LPQ (1)

UNIX Programmer's Manual

LPQ (1 )

NAME

Ipq - spool queue examination program
SYNOPSIS
Ipq [

+[n ] ]

[-I ] [ - Pprinter ] [job # ... ] [user ... ]

DESCRIPTION
Ipq examines the spooling area used by Ipd(S) for printing files on the line printer, and reports
the status of the specified jobs or all jobs associated with a user. /pq invoked without any argu-

ments reports on any jobs currently in the queue. A - P flag may be used to specify a particular printer, otherwise the default line printer is used (or the value of the PRINTER variable in
the environment). If a + argument is supplied, Ipq displays the spool queue until it empties.
Supplying a number immediately after the + sign indicates that /pq should sleep n seconds in
between scans of the queue. All other arguments supplied are interpreted as user names or job
numbers to filter out only those jobs of interest.
For each job submitted (i.e. invocation of /prO» /pq reports the user's name, current rank in
the queue, the names of files comprising the job, the job identifier (a number which may be
supplied to Iprm(I) for removing a specific job), and the total size in bytes. The -I option
causes information about each of. the files comprising the job to be printed. Normally, only as
much information as will fit on one line is displayed. Job ordering is dependent on the algorithm used to scan the spooling directory and is supposed to be FIFO (First in First Out). File
names comprising a job may be unavailable (when /prO) is used as a sink in a pipeline) in
which case the file is indicated as H(standard input)".
If Ipq warns that there is no daemon present (i.e. due to some malfunction), the /pdS) command can be used to restart the printer daemon.
FILES

/ etcl term cap
letc/printcap
lusrlspool!*
lusrlspooll */ cf*
lusrlspool!*llock

for manipulating the screen for repeated display
to determine printer characteristics
the spooling directory, as determined from printcap
control files specifying jobs
the lock file to obtain the currently active job

SEE ALSO

IprO), Iprm(I), IpC".
-g
Include the group ownership of the file in a long output.
- t
Sort by time modified Oatest first) instead of by name.
- a
List all entries; in the absence of this option, entries whose names begin with a period
(.) are not listed.
-5

-d

- L
-r
-u

Give size in kilobytes of each file.
If argument is a directory, list only its name; often used with -I to get the status of a
directory.
If argument is a symbolic link, list the file or directory the link references rather than
the link itself.
Reverse the order of sort to get reverse alphabetic or oldest first as appropriate.
Use time of last access instead of last modification for sorting (with the -t option)
and/or printing (with the -I option).

-c
-i

Use time of file creation for sorting or printing.
For each file, print the i-number in the first column of the report.
-f
Force each argument to be interpreted as a directory and list the name found in each
slot. This option turns off -I, -t, -s, and -r, and turns on -8; the order is the
order in which entries appear in the directory.
- F
cause directories to be marked with a trailing 'I', sockets with a trailing ' .. ', symbolic
links with a trailing '@', and executable files with a trailing '.'.
- R
recursively list subdirectories encountered.
-1
force one entry per line output format; this is the default when output is not to a terminal.
-c force multi-column output; this is the default when output is to a terminal.
-q
force printing of non-grapliic characters in file mimes as the character '1'; this is the
default when output is to a terminal.
The mode printed under the -I option contairts 11 characters which are interpreted as follows:
the first character is
d if the entry is a directory;
b if the entry is a block-type special file;

4th Berkeley Distribution

28 July 1983

1

UNIX Programmer's Manual

LS (1)

LS (1)

c if the entry is a character-type special file;
1 if the entry is a symbolic link;
s if the entry is a socket, or
if the entry is a plain file.
The next 9 characters are interpreted as three sets of three bits each. The first set refers to
owner permissions; the next to permissions to others in the same user-group; and the last to all
others. Within each set the three characters indicate permission respectively to read, to write,
or to execute the file as a program. For a directory, 'execute' permission is interpreted to mean
permission to search the directory. The permissions are indicated as follows:
r if the file is readable;
w if the file is writable;
x if the file is executable;
if the indicated permission is not granted.
The group-execute permission character is given as s if the file has the set-group-id bit set; likewise the user-execute permission character is given as s if the file has the set-user-id bit set.
The last character of the mode (normally 'x' or '- ') is t if the 1000 bit of the mode is on. See
chmod(I) for the meaning of this mode.
When the sizes of the files in a directory are listed, a total count of blocks, including indirect
blocks is printed.
}'ILES

letc/passwd to get user id's for 'Is -1'.
letc/group to get group id's for 'Is -g'.
BUGS
Newline and tab are considered printing characters in file names.
The output device is assumed to be 80 columns wide.
The option setting based on whether the output is a teletype is undesirable as "Is - s" is much
different than "Is -s Ilpr". On the other hand, not doing this setting would make old shell
scripts which used Is almost certain losers.

4th Berkeley Distribution

28 July 1983

2

LXREF(l)

UNIX Programmer's Manual

LXREF(l)

NAME

lxref - lisp cross reference program
SYNOPSIS

lxref [ - N ] xref-file ... [-a source-file ... ]
DESCRIPTION

Lxre/ reads cross reference file (s) written by the lisp compiler /iszt and prints a cross reference
listing on the standard output. Liszt will create a cross reference file during compilation when it
is given the -x switch. Cross reference .files usually end in '.x' and consequently lxrefwill
append a '.x' to the file names given if necessary. The first option to lxre/is a decimal integer,
N, which sets the ignore/eve/. If a function is called more than ignore/evel times, the cross reference listing will just print the number of calls instead of listing each one of them. The default
for ignore/eve/ is 50.
The -a option causes lxre/to put limited cross reference information in the sources named.
lxre/ will scan the source and when it comes across a definition of a function (that is a line
beginning with '(def it will preceed that line with a list of the functions which call this function,
written as a comment preceeded by',·.. '. All existing lines beginning with ';.. ' will be removed
from the file. If the source file contains a line beginning ';. - ' then this will disable this annotation process from this point on until a',·. +' is seen (however, lines beginning with ';.. ' will
continue to be deleted). After the annoation is done, the original file 100'/' is renamed to "
'# ,/00./" and the new file with annotation is named 100. /'
AUTHOR

John Foderaro
SEE ALSO

lisp (1), liszt (1 )
BUGS

4th Berkeley Distribution

24 September 1980

1

M4(1)

UNIX Programmer's Manual

M4(1)

NAME
~4

--

~acro

processor

SYNOPSIS

m4 [ flies 1
DESCRIPTION
M4 is a ~cro processor intended as a front end for Ratror, C, and other languages. Each of

the argu~ent files is processed in order; if there are no argu~ents, or if an argu~ent is '--',
the standard input is read. The processed text is written on the standard output.
Macro calls have the fo~
~e(argl,arg2, ... , argn)
The '(' ~ust immediately follow the ~e of the macro. If a defined ~acro n~e is not followed by a '(', it is .dee~ed to have no arg~ents. Leading unquoted blanks, tabs, and newlines are ignored while collecting argu~ents. Potential ~cro n~es consist of alphabetic
letters, digits, and underscore '_" where the first character is not a digit.
Left and right single quotes (") are used to quote strings. The value of a quoted string is the
string stripped of the quotes.
When a ~acro n~e is recognized, its argu~ents are collected by searching for a ~tching right
parenthesis. Macro evaluation proceeds no~ly during the collection of the argu~ents, and
any commas or right parentheses which happen to tum up within the value of a nested call are
as effective as those in the original input text. After argu~ent collection, the value of the
~acro is pushed back onto the input stre~ and rescanned.
M4 makes available the following built-in ~acros. They ~ay be redefined, but once this is
done the original ~eaning is lost. Their values are null unless otherwise stated.
deftne
The second argument is installed as the value of the ~acro whose n~e is the first
argu~ent. Each occurrence of $n in the replacement text, where n is a digit, is
replaced by the n-th argu~ent. Argument 0 is the n~e of the ~acro; missing
arguments are replaced by the null string.
undeftne re~oves the definition of the macro n~ed in its argu~ent.
lfdef
If the first arg~ent is defined, the value is the second argu~ent, otherwise the
third. If there is no third argu~ent, the value is null. The word unix is predefined
on UNIX versions of m4.
ehanlequote
Change quote characters to the first and second arguments. Changequote without
argu~ents restores the original values (i.e., ").
divert
M4 maintains 10 output stre~, nu~bered 0-9. The final output is the concatenation of the str~ in nu~erical order; initially stre~ 0 is the current stre~. The
divert ~acro changes the current output stre~ to its (digit-string) argu~ent. Output diverted to a str~ other than 0 through 9 is discarded.
undlvert causes immediate output of text from diversions n~ed as arguments, or all diver
sions if no arg~ent. Text ~y be undiverted into another diversion. Undiverting
discards the diverted text.
dlvnum returns the value of the current output stre~.
dol
reads and discards characters up to and including the next newline.
lfelse
has three or ~ore arguments. If the first argument is the ~e string as the second,
then the value is the third argu~ent. If not, and if there are ~ore than four arguments, the process is repeated with arguments 4, S, 6 and 7. Otherwise, the value is
u

7th Edition

18 January 1983

1

M4(1)

UNIX Programmer's Manual

M4(1)

either the fourth string, or, if it is not present, nUll.
iner

returns the value of its argument incremented by 1. The value of the argument is
calculated by interpreting an initial digit-string 8$ a decimal number.

eval

evaluates its argument as an arithmetic expression, using 32-bit arithmetic. Operators include +, -, *, I, %, .. (exponentiation); relationals; parentheses.

len

returns the number of characters in its argument.

index

returns the position in its first argument where the second argument begins (zero
origin), or -1 if the second argument does not occur.

substr

returns a substring of its first argument. The second argument is a zero origin
number selecting the first character; the third argument indicates the length of the
substring. A missing third argument is taken to be large enough to extend to the
end of the first string.

transllt

transliterates the characters in its first argument from the set given by the second
argument to the set given by the third. No abbreviations are permitted.

inelude

returns the contents of the file named in the argument.

sinclude

is identical to include, except that it says nothing if the file is inaccessible.

sysemd

executes the UNIX command given in the first argument. No value is returned.

maketemp
fills in a string of XXXXX in its argument with the current process ide
errprlnt

prints its argument on the diagnostic output file.

dumpdef prints current names and definitions, for the named items, or for all if no arguments
are given.
SEE ALSO

B. W. Kernighan and D. M. Ritchie,The M4 Macro Processor

7th Edition

1:8 January 1983

2

UNIX Programmer's Manual

MACGEI' (local)

MACGEf' (local)

NAME

mucget - rcccivc filc from macintosh via modem7/mactelminal
SYNOPSIS

.

nmeget [ - rdu ] [file]
DESCRIPTION

Macget rcceives a file from a Macintosh running MacTcrminal. Thc ]7ile 'l'ranstcr settings should
specify thc' "Modcm7" transfer method and a "MacTcrminal" remote system. 'fhis program is
designed for use with the 0.5 Beta and newer versions of :tvlacTenninal, but includes a compatibility
option f{)r the older -O.lSX Almost-Alpha version.
To use this program. Jog into the unix system using MacTerminal, start macget with thc desired
:optit>lls, -seleCt "Se'nd File .. :" froni the ·'''File~' menu. and 'olier\ the file you wish to send. If MacTerminal is properly configured, it will put up an indicator showing how much of the file has been
transfercd. Several Control-X's may be used to force macget to give up if the transfer fails.
The optional .file parameter specifics the name to usc when creating the unix files, otherwise the
Mac me name is lIsed (with spaces converted to underscores).
If none of the - rdu flags are specified, macge/ receives three files from the Mac: file.info. ftle.dat~l.
andfile.rsrc. This mode is useful for storing Mac files so they can be restored later using macpul.
The - r flag specifie's resource mode. Only file.rsrc will be created, from the Mac file's resource
fork.
The -d Ilag specifics data mode. Only f"e.d~lta will be created, containing the data fork of the
~1ac tile.
The - u flag requests Ullix mode, in which carriage returns are converted into unix newline ch~lrac­
ters,  .
Interrupt and quit cause the target to be deleted unless the target is a directory or depends on
the special name' .PRECIOUS , .
Other options:

-1

Equivalent to the special entry '.IGNORE:'.

- k

When a command returns nonzero status, abandon work on the current entry, but continue on branches that do not depend on the current entry.

-n

Trace and print, but do not execute the commands needed to update the targets.

-t

Touch, i.e. update the modified date of targets, without executing any commands.

-r
-s

Equivalent to an initial special entry '.SUFFIXES:' with no list.
Equivalent to the special entry '.SILENT:'.

nLES

makefile, Makefile
SEE ALSO
sh(I), touch(I), fi7(I) , pc(I)
S. I. Feldman Make - .A Program for Maintaining Computer Programs

BUGS
Some commands return nonzero status inappropriately. Use -1 to overcome the difficulty.
Commands that are directly executed by the shell, notably ed(n, are ineffectual across newlines
in make.

4th Berkeley Distribution

18 January 1983

2

MAKEDEP( 1)

UNIX

Programlll~r's

Manual

NAME

makedep - construct dependency lines for makefiles
SYNOPSIS

makcdcl) [ options 1[ source files]
DESCRIPTION

Afakede/J constructs a makdlle-sty1c dependency list showing which header Illes the object files conslructed from the given source files depend upon. The dependency of the object me upon the
source file is not indicaled in the outpul; lhis dependency can normal1y be inferred by the make
program.
Ala/(edep handles nested includes properly, propagating dependencies of one header file upon
anot.her back to each object me whose source me includes the dependent header file.

The following options are accepted. In options that take an argument, the space between the
.
option letter and the argument is optional.
file

Outpul file name. The denlllll is "dependencies". The name "-" indicates standard output.

-I dir

Add dir to the include file search list. Multiple -I options acculTlulate, building the
search list from left to right. with the system include directories added at the end.
Directory names are interpreted relative to the directory from which lI111kcdcp is
invoked.

-U

Use the standard Unix header direct.ories as the system search list. Equivalent to
speci fying -l/usr/inclllund. This option is lIseltll when you are not
interested in dependencies on system include files.

-e ext

Object files have extension ".ext". Denllllts to.b if-V or -xV is specified,.o otherwise.

-d

Turn on debug output. Useful only to the maintainers.

-0

If the source files depend on any header files in standard system include directories, one of the
options -U, -V, -xV, or -N should normally l}(,~ specified. These f()lIr options are Illutually exclusive.
If none of these options is given, only the directories specified in -I options are included in the
search list (as with the -N Ilag), but warning messages are still printed for any header files that cannot be found.
SEE ALSO

make(l)
DIAGNOSTICS

A warning is printed for each included
sages should be self-explanatory.

me that cannot be t~)Und.

Other errors are· fatal; the mes-

Pathnaincs that are excessively long may be silent.ly truncated or cause crashes.

7th Edition

2 Apri11984

.1

.

MAKEDEP( 1)

UN IX Programmer's Manual

MAKEDEP( 1)

Afakedep does not know that the same me can have two different names, for example "bar.h" and
"foo/..lhar.h". This means it will nlit to detect loops in the dependency graph if the pathnamcs
grow in this way while it is following lhc loop. The loop will eventually terminate due to the previews bug, and garbage output wil~ result.
AUTHORS

Marvin Theimcr and Tim Mann, Stanford.

7th Edition

2 April 1984

.

2

MAN(l)

MAN (.1)

UN IX Programlllcr's Manual

NAME

man - find manual

inf()rl1l~ltion

by keywords; print out the manual

SYNOPSIS
man - k keyword ...
man -ffile ...

man [ - ] [ - t ] [ - d ] [ - i ] [ section J title ...
DE,,"CI{IPTION
A/all is a program vvhich gives information from the programmers manual. It can be asked for one
line descriptions of commands specified by name, or fbI' all commands whose description contains
any of a set of keywords. It can also provide on-line access to the sections
the printed manual.

or

,Whcn ·given lheo'ption - k and 'a set ()f 'keywords,man p'rii'lt:~ out a one line synopsis of each
manual sections whose listing in the table of contents contains thal keyword.
\Vhen gi vcn the option - f and a lisl of file

I1mllCS,

mall attcmpts to locate manual sections related

to those fIlcs, printing out the lable of contents lines for thosc sections.

\\-'hen neither - k nor - f is specified, mall formats a specified set of manual pages. If a section
specificr is given IIIlIII looks in the that section of the manulli f()r the given lilIes. ,\'ecliol1 is an A rahie section number (3 for instance). The 11111nhcr may followed by a single letter c1assilier (lg for
instance) indicltillg a graphics program in section 1. If seclioll is omitted, IJ/Ull searches all sections
of the manual, giving preference to commands over subroutines in system libraries, and printing the
first section it finds, if any.

If the standard output is a teletype, or if the flag - is given, lIIan pipes its output through ('(11(1)
with the option _os to crush out useless bl.llIk lines, ulO) to create propcr underlines for different
tcnnin;:tls, and through IJ/ore(l) to stop atkr c<\ch page on the screcn. Ilit a space to continue, a
control-I) to scroll 11 more lines when the output stops.
The -tlbg causes 111([11 to arrange fiJI" the specified section to be tndTed to a slIitable raster output
device~ see vlmilO).
The - d and - i nags calise mall to print thc specified section using dlrt?iJ( 1) (on the Dovcr) or
ilndJ(l) (on lht: Imagen), respectively.
lusr/man/l1lan? 1*
lusr/man/cat'? 1*
SEE ALSO

111ore( I), uIO), whereisO), catman(8)
BlJ(;S

The manual is supposed to be reproducible eilher on the photolypesetter or
ever, on a typewriter some information is necessarily lost.

4t.h Berkeley Distribution

18 January 1983

011

a typewriter. I low-

MERGE(l)

UNIX Programmer's Manual

MERGE (1)

NAME

merge - three-way file merge
SYNOPSIS

melle [ -p ] file 1 file2 file3
DESCRIPTION
Merge incorporates all changes that lead form file2 to file3 into fileJ. The result goes to std. output if -p is present, into filel otherwise. Merge is useful for combining separate changes to an
original. Suppose file2 is the original, and both filel and file3 are modifications of file2. Then
merge combines both changes.

An overlap occurs if both filel and file3 have changes in a common segment of lines. Merge
prints how many overlaps occurred, and includes both alternatives in the result. The alterna.,
tives are delimited as follows:

«««< filel
lines in file 1

-------

lines in file3

»»»> file3

If there are overlaps, the user should edit the result and delete one of the alternatives.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.0 ; Release Date: 82/11/25 .
Copyright CD 1982 by Walter F. Tichy.
SEE ALSO

dUD (1), diff (1), rcsmerge (t), co (1).

Purdue University

6/29/83

1

MESO(I)

UNIX Programmer's Manual

MESO (1)

NAME

mesg - permit or deny messages
SYNOPSIS

mesa [0] [y]
DESCRIPTION

Mesg with argument D forbids messages via write and talkO) by revoking non-user write permission on the user's terminal. Mesg with argument y reinstates permission. All by itself~
mesg reports the current state without changing it.
FILES

Idev/tty*
SEE ALSO

writeO), talkO)
DIAGNOSTICS

Exit status is 0 if messages are receivable, 1 if not, 2 on error.

7th Edition

18 July 1983

1

MKSTR(l)

MKSTR(I)

UNIX PrOll'ammer's Manual

NAME

mkstr - create an error messale file by massalinl C source
SYNOPSIS

mkatr [ - ] messaaefile prefix file ...
DESClUPTION
. Mkstr is used to create flies of error messale5. Its use can make proarams with larle numbers

of error diaanostics much smaller, and reduce system overhead in runninl the proaram as the
error messales do not have to be constantly swapped in and out.
Mkstr will process each of the specified files, placinl a massaled version of the input file in a file
whose name consists of the specified pr~ and the oriainal name. A typical usale of mkstr
would be

mkstr pistrinp xx *.c
This command would cause all the error messales from the C source files in the current directory to be placed in the file pistrings and processed copies of the source for these files to be
placed in files whose names are prefixed with xx.
To process the error messales in the source to the messale file mkstr keys on the string
'errore"' in the input stream. Each time it occurs, the C string startinl at the '"' is placed in the
message file followed by a null character and a new-line character; the null character terminates
the messale so it can be easily used when retrieved, the new-line character makes it possible to
sensibly cat the error messaae file to see its contents. The massaged copy of the input file then
contains a /seek pointer into the file which can be used to retrieve the messale, Le.:

char
lnt

efilname[] efil - -I;

"/usr/lib/pCstrinIS";

error(al, a2, 83, a4)

{
char buf[256];
if (efil

< 0)

(

efil - open(efilname, 0);

11 (efll

< 0) (

oops:
perror(efilname) ;
exit(1);

}
11 (lseek(efil, (lonl) ai, 0) II read(efil, buf, 256)
loto oops;
printf(buf, a2, 83, a4);

< - 0)

The optional - causes the error messqes to be placed at the end of the specified messale file
for recompiling part of a larae mkstr ed proaram.
SEE ALSO

lseek(2), xstr(1)
AUTHORS

William Joy and Charles Haley

3rd Berkeley Distribution

24 February 1979

1

MODO}

UNIX Programmcr's Manual

MOiJ(I}

NAMI!:

mod -- Modula-2 compiler
SYNOPSIS
mod [ options] !lame ...
I)ESCr~1 PTION

Alod is a Modula-2 compilcr. It compiles olle or more Modula-2 program or· implemC'ntaliol1
modules. Definition modules arc not compiled. In the absence of options, it will compile all
spccif1cd modules and link them together into an executable rile called a.Oll/.

Elch program or implementation module must be in a separate file with a nalll(! ending with
Each definition module mllst be ill a separale me called "module.def', where "modllle"is
tlw name of the module. Object files endjng with ".0" compiled with mot! or some other compiler
may be specified.

'':.\lIod''.

File name argllm('nts ending with" .pcd" and ".s" are assumed to he pcode arId assembly language
files, rcspectively, and arc translated nning inttnnodule checking, ignore references to modules not specHied. ('Fhisis
useful when chccking modules to be placed in a library).
- M Perform intermodule checking, but do not recompile if inconsistencies are found.

7th Edition

1 February 1984

1

MOD(I)

UNIX Programmer's Manllal

MODO)

-Nname
While performing intennodlile checking, ignore references to the module "namc". (This is
u~erlll when the module "name" is not a Modula-2 module.) This option may occur multiple
times.
- 0
- P

PerroI'm code optimizations.
Stop aner generating pcodc in a file ending with ·'.ped".

-S

Slop afler generating assembly language in a file ending with ".s".

UBHARY

MO()ULl~S

By default, an import of a global module will cuuse the compiler to look for the definition module
first in the working directory and then in the standard library directory. The standard library
..'
modules arc automatically linked with the progi'C1in:
The ddhult may be overridden to spcci(y other directories of definition modules using the MODPATH environment variable. MODPATII is set to a sequence of directory narnes separated by
colons. Those directorics will be searched in the order specincd to find any definition Illouule.
The corresponding object Illes or libraries arc specified when linking. The MODPATH environment vecn relaxed in some areas. For the most part,

7th Edition

1 February 1984 .

2

UN IX Programmer's Manual

MOD(l)

tvlOD( 1)

these changes arc upward compatible.
Thc following is an incomplete list of diiferences betwecn this compiler and Wirth's compiler:
Reserved words and standard identir-iers arc recognized in any case, not just in upper C'lSC. Thus,
case variations of reserved words may not be used for identifiers. This feature is disabled by the·
sk option.
Cardinal and non··negative slibranges that do not exceed MAX I NT arc considered to be subrangcs
of integer and rn a deflnilion module arc assumed qualified whether the export stalCtllent says
qualilied or not. Unqualified exports arc pennilled if the (il)unqllalilkd keyword is used.
Multiple export statements arc permitted, but they must occur next to each other.
External variables and procedures
A procedure or variable may be (,ccessed by C and Pascal routines using its unqualified
name if the ((jJext.efl1al attribute occurs between the keyword proccdllre and the name of
the procedure or precedes t.he variable declaration, respectively. See Using Modula-2 with
Unix C and Berkeley Pascal Il)r more details.
Uncounted open arrays
Opcn array parameters appear as two parameters, the address or the array and t.he number
of element, to non-Modula-2 programs. If necessary, the counl Illay he omitted by placing
the auribute  or -r)
Assembly code (-S or -r)
Modllla~2 compiler rront-end
Modllla-2 compiler back-end
Intermodule checker
Standard definition modules
I )cf~,ult library
'I'emporary Pcode rile
Temporary assembly code file

S(t:E ALSO

N. Wirth, I'rogrl1llllJlil1g ill A/oi/u/a-2, Springer-Verlag, New York, 1982.
DIAGNOSTICS

A1I error messages suppress subsequent compilation phases. Error messages ending with a quest.ion
mark are internal errors, and probably represent compiler bugs. When pointer chec~ing is enabled
in a runnillg Modula-2 program. segmentation tllUlts tnay be generated by the pointer v41li<.iation
test These are int(~ntionill and should be considered as invalid pointer messages. The compiler
rUlls with runtime checks enabled, and may produce core dumps. Report problems to the author.

7th

'~Llition

1 l:ebruary 1984

4 .

MOD(l)

UN IX Programmer's Manual

MOD(I)

AUTllon

rVlichae1 L. Powell
Digital Equipmenl Corporation
Western Research I.aboratory
4410 EI Camino Real
I ,os 1\ I los, C A 94022
Mail: powcl1((;!dccwrl.csnet or {dccvax,lIcbvax} !decwrl!powell
Software and doctllTlentation is Copyright 1984, Digital Equipment Corporation, 1\1aynard,Massachusctts. All rights reserved. This soflware is provided under license agreement and must be
kept. confidential.
LIMITATIONS

" ,

This is an experimental compiler, and th~;s ';'0 w~ri"lilties ~i're expressed or" implicd~lbout its conformance to the ddlnition of the Modula-2 language or about its proper functioning. We will
.cll(kavor to report and fix bugs, but users should be aware that this compiler is not a supported
product.

7th

T~dilion

1 l·'cbruary ] 984'

5

MORE(I)

UNIX Programmer's Manual

MORE (1 )

NAME

more, page - file perusal filter for crt viewing
SYNOPSIS

more [ -cdftsu ] [ - n] [ + linenumber) [ + I pattern] [name ...
pale more options

DESCRIPTION

More is a filter which allows examination of a continuous text one screenful at a time on a
soft-copy terminal. It normally pauses after each screenful, printing --More-- at the bottom of
the screen. If the user then types a carriage return, one more line is displayed. If the user hits
a space, another screenful is displayed. Other possibilities are enumerated later.
The command line options are:
- n
An integer which is the size (in lines) of the window which more will use instead of the
default.
-e
More will draw each page by beginning at the top of the screen and erasing each line
just before it draws on it. This avoids scrolling the screen, making it easier to read
while more is writing. This option will be ignored if the terminal does not have the
ability to clear to the end of a line.
-d

More will prompt the user with the message "Hit space to continue, Rubout to abort" at
the end of each screenful. This is useful if more is being used as a filter in some setting, such as a class, where many users may be unsophisticated.

-f

This causes more to count logical, rather than screen lines. That is, long lines are not
folded. This option is recommended if nroff output is being piped through ul, since the
latter may generate escape sequences. These escape sequences contain characters which
would ordinarily occupy screen positions, but which do not print when they are sent to
the terminal as part of an escape sequence. Thus more may think that lines are longer
than they actually are, and fold lines erroneously.

-1

Do not treat AL (form feed) specially. If this option is not given, more will pause after
any line that contains a AL, as if the end of a screenful had been reached. Also, if a file
begins with a form feed, the screen will be cleared before the file is printed.

-s

Squeeze multiple blank lines from the output, producing only one blaitk line. Especially helpful when viewing nroff output, this option maximizes the useful information
present on the screen.

-u

Normally, more will handle underlining such as produced by nroffin a manner appropriate to the particular terminal: if the terminal can perform underlining or has a standout mode, more will output appropriate escape sequences to enable underlining or
stand-out mode for underlined information in the source file. The -u option
suppresses this processing.

+ linenumber
Start up at linen umber.

+Ipanern
Start up two lines before the line containing the regular expression panern.
If the program is invoked as page, then the screen is cleared before each screenful is printed
(but only if a full screenful is being printed), and k - 1 rather than k - 2 lines are printed in
each screenful, where k is the number of lines the terminal can display.

More looks in the file letdtermcap to determine terminal characteristics, and to determine the
default window size. On a terminal capable of displaying 24 lines, the default window size is 22
lines.

4th Berkeley Distribution

27 April 1981

1

MORE(I)

UNIX Programmer's Manual

MORE(I)

More looks in the environment variable MORE to pre-set any flags desired. For example, if
you prefer to view files using the -c mode of operation, the csh command setenv MORE -c or
the sh command sequence MORE- '-c' ,. export MORE would cause all invocations of more,
including· invocations by programs such as man and msgs , to use this mode. Normally, the
user will place the command sequence which sets up the MORE environment variable in the
.cshrc or .profile file.
If more is reading from a file, rather than a pipe, then a percentage is displayed along with the
--More-- prompt. This gives the fraction of the file (in characters, not lines) that has been read
so far.
Other sequences which may be typed when more pauses, and their effects, are as follows (i is an
optional integer argument, defaulting to 1) :
i
display i more lines, (or another screenful if no argument is given)
AD
display 11 more lines (a "scroll"). If i is given, then the scroll size is set to i.
d
same as "D (control-D)
iz

is

same as typing a space except that i, if present, becomes the new window size.
skip i lines and print a screenful of lines

skip i screenfuls and print a screenful of lines
q or Q Exit from more.
if

v
h

Display the current line number.
Start up the editor vi at the current line.
Help command; give a description of all the more commands.

ilexpr search for the i-th occurrence of the regular expression expr. If there are less than· i
occurrences of expr, and the input is a file (rather than a pipe), then the position in the
file remains unchanged. Otherwise, a screenful is displayed, starting two lines before
the place where the expression was found. The user's erase and kill characters may be
used to edit the regular expression. Erasing back past the first column cancels the
search command.
in

search for the i-th occurrence of the last regular expression entered.
(single quote) Go to the point from which the last search started. If no search has
been performed in the current file, this command goes back to the beginning of the file.

!command
invoke a shell with command. The characters '%' and 'I' in "command" are replaced
with the current file name and the previous shell command respectively. If there is no
current file name, '%' is not expanded. The sequences "\%" and "\!" are replaced by
"%" and "!" respectively.
i:n
skip to the i-th next file given in the command line (skips to last file if n doesn't make
sense)
i:p

:f

skip to the i-th previous file given in the command line. If this commandissiven in
the middle of printing out a file, then more goes back to the beginning of the file. If i
doesn't make sense, more skips back to the first file. If more is not reading from a file,
the bell is rung and nothing else happens.
display the current file name and line number.

4th Berkeley Distribution

27 April 1981

2

MORE(l)

UNIX Programmer's Manual

MORE(I)

:qor :Q
exit from more (same as q or Q).
(dot) repeat the previous command.
The commands take effect immediately, i.e., it is not necessary to type a carriage return. Up to
the time when the command character itself is given, the user may hit the line kill character to
cancel the numerical argument being formed. In addition, the user may hit the erase character
to redisplay the --~fore--(xx%) message.
At any time when output is being sent to the terminal, the user can hit the quit key (normally
control-\). More will stop sending output, and will display the usual --More-- prompt. The
user may then enter one of the above commands in the normal manner. Unfortunately, som,e
output is lost when this is done, due to the fact that any characters waiting in the terminal's
output queue are flushed when the quit signal occurs.
The terminal is set to noecho mode by this program so that the output can be continuous.
What you type will thus not show on your terminal, except for the I and! commands.
If the standard output is not a teletype, then more acts just like cat, except that a header is
printed before each file (if there is more than one).
A sample usage of more in previewing nroJ! output would be
Droft" - ms

+ 2 doc.n Imore -s

AUTHOR

Eric Shienbrood, minor revisions by John Foderaro and Geoffrey Peck
FILES

I etc/termcap
lusr/lib/more.help

Terminal data base
Help file

SEE ALSO

csh(l), man(l), msgs(l), scriptU), shU), environ(7)

4th Berkeley Distribution

27 April 1981

3

MSOS(I)

UNIX Programmer's Manual

MSGS (1)

NAME

msgs - system messages and junk mail program
SYNOPSIS
mill [ -fbIpq] [ number] [ -number]
DESCRIPTION
Msgs il used to read system messages. These messages are sent by mailing to the login 'msgs'
and should be short pieces of information which are suitable to be read once by most users of
the system.

Msgs is normally invoked each time you login, by placing it in the file .login (.projile if you use
Ibinlsh) . It will then prompt you with the source and subject of each new message. If there is
no subject line, the first few non-blank lines of the message will be displayed. If there is more
to the message, you will be told how long it is and asked whether you wish to see the rest of
the message. The possible responses are:
y

type the rest of the message

RETURN
synonym for y.
D

skip this message and go on to the next message.
redisplay the last message.

q

drops you out of msgs; the next time you run the program it will pick up where you left

off.
I

append the current message to the file "Messages" in the current directory; 's -' will
save the previously displayed message. A's' or 's-' may be followed by a space and a
filename to receive the message replacing the default "Messages".

m

or 'm - ' causes a copy of the specified message to be placed in a temporary mailbox
and mailU) to be invoked on that mailbox. Both 'm' and's' accept a numeric argument in place of the '-'.

Msgs keeps track of the next message you will see by a number in the file .msgsrc in your home
directory. In the directory lusrlmsgs it keeps a set of files whose names are the (sequential)
numbers of the messages they represent. The file lusrlmsgslbounds shows the low and high
number of the messages in the directory so that msgs can quickly determine if there are no
messages for you. If the contents of bounds is incorrect it can be fixed by removing it; msgs will
make a new bounds file the next time it is run.
Options to msgs include:

-f

which causes it not to say "No new messages.". This is useful in your .login ftle since
this is often the case here.

-q

Queries whether there are messages, printing "There are new messages." if there are.
The command "msgs -q" is often used in login scripts.

-h

causes msgs to print the first part of messages only.

-1

option causes only locally originated messages to be reported.

num

A message number can be given on the command line, causing msgs to start at .the
specified message rather than at the next message indicated by your .msgsrc file. Thus
msgs -h 1
prints the first part of all messages.

-number
will cause msgs to start number messages back from the one indicated by your .msgsrc

4th Berkeley Distribution

18 January 1983

1

MSGS(I)

UNIX Programmer's Manual

MSGS(I)

file, useful for reviews of recent messages.
-p
causes long messages to be piped through more(l).
Within msgs you can also go to any specific message by typing its number when msgs requests
input as to what to do.
FILES

lusr/msgs/*
-I.msgsrc

database

number of next message to be presented

AUTHORS

William Joy
David Wasley
SEE ALSO

mail (1), more(1)

BUGS

4th Berkeley Distribution

18 January 1983

2

MT(l)

UNIX Programmer's Manual

MT(l)

NAME

mt - magnetic tape manipulating program
SYNOPSIS

mt [ -f tapename] command [ count ]
DESCRIPTION

Mt is used to give commands to a magnetic tape drive. If a tape name is not specified, the
environment variable TAPE is used; if TAPE does not exist, mt uses the device Idevlrmt12.
Note that tapename must reference a raw (not block) tape device. By default mt performs the
requested operation once. Operations may be performed multiple times by specifying count.

The available commands are listed below. Only as many characters as are required to uniquely
identify a command need be specified.
eof, weof
Write count end-of-file marks at the current position on the tape.

fsf
fsr

Forward space count files.
Forward space count records.

bsf

Back space count files.

Back space count records.
bsr
rewind Rewind the tape (Count is ignored.)
omine, rewom
Rewind the tape and place the tape unit off-line (Count is ignored.)
status Print status information about the tape unit.
Mt returns a 0 exit status when the operation (s) were successful, 1 if the command was
unrecognized, and 2 if an operation failed.
FILES

Idev/rmt.

Raw magnetic tape interface

SEE ALSO

mtio(4), dd(1), ioctl(2), environ(7)

4th Berkeley Distribution

1 April 1983

1

MV(I)

UNIX Programmer's Manual

MV(l)

NAME

mv - move or rename files
SYNOPSIS

mv [ -I] [ -f] [ - ] fUel file2
mv [ -I] [ -f] [ - ] fUe ... directory
DESCRIPTION

Mv moves (changes the name of) Jilel to ji/e2.
If jile2 already exists, it is removed before jilel is moved. If ji/e2 has a mode which forbids
writing, mv prints the mode (see chmod(2» and reads the standard input to obtain a line; if the
line begins with ." the move takes place; if not, mv exits.
In the second form, one or more jiles (plain files or directories) are moved to the directory with
their original file-names.
Mv refuses to move a fUe onto itself.
Options:
-I
stands for interactive mode. Whenever a move is to supercede an existing fUe, the user
is prompted by the name of the file followed by a question mark. If he answers with a
line starting with 'y', the move continues. Any other reply prevents the move from
occurring.
-f
stands for force. This option overrides any mode restrictions or the -i switch.
means interpret all the following arguments to mvas file names. This allows file names
starting with minus.
SEE ALSO

cpO), InO)

BUGS
If jilel and ji/e2lie on different file systems, mv must copy the file and delete the original. In
this case the owner name becomes that of the copying process and any linking relationship with
other files is lost.

4th Berkeley Distribution

I April 1981

1

NET( 1)

UN IX Programmer's

~lanual

NET(l)

NAME

net -- print IP net names and addresses
SYNOPSIS
nt't netname

I net-number •..

DESCRIPTION
N£>/ invoked with a net name or number prints the name(s) of that net and the intcl:net network
number of the net.

AUTIIOR

Jeff Mogul
BU(;S
Thj~; inherits lots of bugs froth the library'routinCs th~it lOOK up net nmnes.

The /()('mat of a network number is stupid.

7th Edition

1

NETALIAS(1}

UN IX Programmer's Manual

NETALIAS( 1}

NAME

nctalias - keeping track of remote user names and pas.')words
SYNOPSIS

nctalias [ hoslnamc ]

o ESC IUPT ION
Nc/aJias is used to specify the uscrnamc and password that you normally lise on a remote network
host. Several programs that communicate with other computers over networks use this information
so that you do not have to type it every time you run such a program. (Some of these programs
will optionally store your user name and password, but you can also lise ne/alias to do so.) The
information is encrypted and stored in a file under your home directory with a name consisting of a
,dl~t J()nO;w~d by the host na~ne in ,lowe! .ca~e. The file is ,"sccre~" iJ~ that is read protected against
everyone but the owner, and normally is not printed in directory listings since it begins with a dot.
USAGE

The program carries on a dialog with the lIser. If you do not specify a, hos//lalJle argument when
you run lie/alias, you will be asked for one.
If you do not specify "yes" to the question:
May I encrypt and store this password? (yes or no):
then the file is still written, hut instead of your pas..<;word a special code is written indicating that
you should never be asked this question again for this host. You may change passwords by I'unning Ilctalias again, or by removing the file bcfbre running a network program again.
FILES

$HOM E/.(hostname)
SEE ALSO

.

pup ftp( 1), fetc h(1)
AUTHOR

Bill Nowicki
HUGS
****W AUNING**** Do not he fooled into thinking that jllst because t.he p,',ss\o\'ord is "encrypted"
that it will be safe. 1\ two wlly encryption scheme is lIscd instead or the one way scheme used fhr
Unix passwords, since the original text l1lust be easily obt,tinnnat"~ refer to illcl(3 N) t()\. more in((.mnation regarding this flu·mat. Unspecified.
or "wildcard", addresses and ports appear as "*".
The internlce display provides a t(lhle of cUlllulative statistics regarding packcts transferred, errors,
and collisiolls. TIll' network ~Iddress (currently Intefllcl specific) of the illlerl~lce and the maximum
transmission unit ("mtu") are also displayed.
The routing table display indicates the available routes and their status. Each route consists of a
destination host or lIetwork and a gatew" in
directory names, you wilt have to quote this argument to protect it from the shell.)

If the local-dir argument is given, the program docs an implicit cd local-dir before doing anything.
The flag

argument~

-a

-b
-d
-f
.... i

must be given as one argument; the possible arguments are:

"Ask" the user if the update should take place, for each file that would ni>rmally
be updated. To update files whose name is the null string, or a single space, this
option must be used.
Turns on BSP debuggirig infhmwtion; lISlll is
local (non-external) the type letter is in lower case. The output is sorted alphabetically.

'OptiOJ1S al~e:

".

. ", \

o

0

:

tl

1

-g

Print only global (external) symbols.

- n

Sort numerically rather than alphabetically.

-0

Prepend file or archive clemcnt name to each output line rather tllan only once.

-p

Don't sort; print in symbol-table order.

- r

Sort in rever:;e order.

-d

Print only defined symbols.

-u

Print only undefined symbols.

- h
- c

Print values in hex rather than in octal. ( - x is a synonym for - h
Print only C-style symbols (those beginning with ,-. or '_'.)

-f

Give the name of each object file as it is processed. This implies a -p flag. (If the -p
nag is not presenl, nm68 sorts symbols without regard to which object file they came from.)

S[·:E ALSO

a1'( 1), ar(5), b.out(5)

7th I ~dition

1

NROFF(l)

UNIX Programmer's Manual

NROFF( 1)

NAME

nroff - text formatting
SYNOPSIS

nroff [ option ] ... [file] ...
DESCRIPTION

Nroffformats text in the named files for typewriter-like devices. See also trojf(l). The full capabilities of nroffare described in the NrofJITroff User's Manual.
If no file argument is present, the standard input is read. An argument consisting of a single
minus (-) is taken to be a file name corresponding to the standard input.
The options, which may appear in any order so long as they appear be/ore the files, are:

-olist

Print only pages whose page numbers appear in the comma-separated list of numbers
and ranges. A range N - M means pages N through M; an initial - N means from
the beginning to page N; and a final N - means from N to the end.

-oN

Number first generated page N.

-sN

Stop every N pages. Nroffwill halt prior to every N pages (default N .. l) to allow
paper loading or changing, and will resume upon receipt of a newline.

-mname Prepend the macro file lusr/lib/tmac/tmac.name to the input files.
-raN

Set register a (one-character) to N.

-I

Read standard input after the input files are exhausted.

-q

Invoke the simultaneous input-output mode of the rd request.

-T name Prepare output for specified terminal. Known names are 37 for the (default) Teletype Corporation Model 37 terminal, tn300 for the OE TermiNet 300 (or any terminal without half-line capability), 3008 for the DASI-300S, 300 for the DASI-300, and
450 for the DASI-450 (Diablo Hyterm).

-e

Produce equally-spaced words in adjusted lines, using full terminal resolution.

- h

Use output tabs during horizontal spacing to speed output and reduce output character count. Tab settings are assumed to be every 8 nominal character widths.

FILES

Itmp/ta.
temporary file
lusr/lib/tmac/tmac .• standard macro files
lusr/lib/term/.
terminal driving tables for nro§
SEE ALSO
J. F. Ossanna, Nro.81Tro§user's manual
B. W. Kernighan, A TROFF Tutorial
troff(1), eqn(O, tbl(l), ms(7), me(7), man(7), coHO

7th Edition

26 January 1982

r

068( 1)

UNIX Programmer's Manual

NAME

068 -- .s -) .s optimizer component of ce68
SYNOPSIS

'068
DEscnlPTION

068 is a 68000 assembly language optimizer. It takes

iL~

input from stdin and sends its output to

stdOllt.
FILES

/usr/sun/e68/o0.c /usr/suu/c68/ol.c /usr/bin/o68
SEE ALSO

ee68 (1)

7th Edition

MC68000

1.

.

OD (1)

UNIX Programmer's Manual

OD (1)

NAME

od - octal, decimal, hex, ascii dump
SYNOPSIS

od [ -format] [file] [ [+ ]offset[.][b] [label] ]
DESCRIPTION
Od displays file, or it's standard input, in one or more dump formats as selected by the first

argument. If the first argument is missing,
of-file.

-0

is the default. Dumping continues until end-

The meanings of the format argument characters are:

a

Interpret bytes as characters and display them with their ACSII names. If the p character
is given also, then bytes with even parity are underlined. The P character causes bytes
with odd parity to be underlined. Otherwise the parity bit is ignored.

b

Interpret bytes as unsigned octal.

c

Interpret bytes as ASCII characters. Certain non-graphic characters appear as C escapes:
null==\O, backspace==\b, formfeed=-\f, newline==\n, return==\r, tab-\t; others appear as
3-digit octal numbers. Bytes with the parity bit set are displayed in octal.

d.

Interpret (short) words as unsigned decimal.

f

Interpret long words as floating point.

h

Interpret (short) words as unsigned hexadecimal.

i

Interpret (short) words as signed decimal.
Interpret long words as signed decimal.

o

Interpret (short) words as unsigned octal.

s[n] Look for strings of ascii graphic characters, terminated with a null byte. N specifies the
minimum length string to be recognized. By default, the minimum length is 3 characters.
v

Show all data. By default, display lines that are identical to the last line shown are not output, but are indicated with an "." in column 1.

w [n] Specifies the number of input bytes to be interpreted and displayed on each output line. If
w is not specified, 16 bytes are read for each display line. If n is not specified, it defaults
to 32.

x

Interpret (short) words as hexadecimal.

An upper case format character implies the long or double precision form of the object.
The offset argument specifies the byte offset into the file where dumping is to commence. By
default this argument is interpreted in octal. A different radix can be specified; If "." is
appended to the argument, then offset is interpreted in decimal. If offset begins with "x" or
"Ox", it is interpreted in hexadecimal. If "b" ("B") is appended, the offset is interpreted asa
block count, where a block is 512 (1024) bytes. If the file argument is omitted, an offset argument must be preceded by "+".
The radix of the displayed address will be the same as the radix of the offset, if specified; otherwise it will be octal.
Label will be interpreted as a pseudo-address for the first byte displayed. It will be shown in

"0" following the file offset. It is intended to be used with core images to indicate the real
memory address. The syntax for label is identical to that for offset.
SEE ALSO

adb(1)

4th Berkeley Distribution

16 February 83

1

OD (1)

BUGS

UNIX Programmer's Manual

OD (1)

A file name argument can't start with "+". A hexadecimal offset can't be a block count.
Only one file name argument can be given.
It is an historical botch to require specification of object, radix, and sign representation in a single character argument.

4th Berkeley Distribution

16 February 83

2

P2M2(1)

UNIX Programmer's Manual

P2M2(1)

NAME

p2m2 - Pascal to Modula-2 conversion tool
SYNOPSIS

p2m2 [ -h ] [ -s ] name
DE..';CI{IPTION

P2m2 is a tool for assisting with the conversion of programs from Berkeley Pascal to Moduln-2. It
docs not pe'rlbrm a complete translation, since there are SOllIe language features in Pascal that either
do not exist in Modula-2 (e.g., !~oto statcJl1ents) or arc too dillicult to convert (e.g., write statements). It also docs not necessarily produce a "good" Modula-2 program, since it docs not restructure a program into modules.

·In: spite of these disclaimer~, it is 'possible
Pascal software to Modula-2.

t(l"

lise p2m2 to

r~ipkHy

convert a substantial amount of

Files are cOllvert.ed one at a time. /\ file name must. end with ".p" for a Pascal program or separate
compilation unit, or wit.h ".h" for a set of definitions or external specifications for a separate compilatioll unit. A file called Hname.p" will produce a progr~lIll or implementation module called
"name" in a file called "namc.mod". ;\ program modulc will bc gencr;lted ir the file contains a
Pascal program. A file called "namc.h" will produce a definition modulc called name in a me
called ··name.def'. ,
The - h !lag is specified when a separate compilation unit is converted. The option causes p211l2 to
scan the corresponding ".h" file t()f procedure parameter delinitions and insert those in the generated ",mod" me. This Ilag is useful bcc;\use Berkeley P[lscal prohibits parameters from (lppearing
in the procedure definition ir there is an extl~rnal declaration of the procedure.
The -:s nag outputs reserved words in uppcr casc, in accordance with the Modl.lla-2 report. By
default, ,,21J12 generates rt~served words in lower case.
METHOD

As p2J112 parses the Pascal program; it copies white space (comlllenL~, spaces, new lines) to the output It olltputs tokens and idcntifiers, rearranging them as necessary. The result is a program that
is formatted approximately the same as the original.
The names or procedures, functions, variablcs, types, and constants defined in ".11" flies are
exported 1'1'0111 the definition module. The names are cxported unqualilied, to simulate the global
naming that tlkcs place in Berkeley Pascal. (Although the Modula-2 report requires global exports
to be ljualilicd, the DFC Mot\ula-2 compiler permits unqualified exports.) An include directive is
changed to a comment, but causes the named module to be imported.
UNIIANI)LED [)IFFEIU·:NCE...'i

The H)ltowing is a partial list of differcnces between Pascal and rv1odulnn (*! ... !*).
AUTHOllS

Benjamin C. Pierce
Michael I.. Powell
Digital Equipment Corporation
Western Research I ,aboratory
4410 EI Camino Real
I.os /\ I tos. C/\ 94022
tv1ail: poweUql.\lccwrl.csnet or {decvax.lIcbvax} !decwrl!powell
Software and documentation is Copyright 1984. Digital Equipment Corpora.lioll. Maynard. Massachusetts. /\ II rights reserved. This software is provided under license agreement and lTlust be
kept conftdential.
LIMITATIONS

This is an experimental tool. and thus no warranties arc expressed or implied about its conlc.wmance
to lhe definition of lhe Modula-2 language or about its proper functioning.

7th Edition

1 Fcbru~lry 1984

2 .

PAGESIZE (1)

UNIX Programmer's Manual

PAGESIZE (1)

NAME

pagesize - print system page size
SYNOPSIS
pagesize
DESCRIPTION
Pagesize prints the size of a page of memory in bytes, as returned by getpagesize(2). This pro-

gram is useful in constructing portable shell scripts.
SEE ALSO

getpagesize (2)

4th Berkeley Distribution

3 April 1983

1

PASSWD (1)

UNIX Programmer's Manual

PASSWD (1)

NAME

passwd - change login password
SYNOPSIS

passwd [ name ]
DESCRIPTION

This command changes (or installs) a password associated with the user name (your own name
by default).
The program prompts for the old password and then for the new one. The caller must supply
both. The new password must be typed twice, to forestall mistakes.
New passwords must be at least four characters long if they use a sufficiently rich alphabet and
at least six characters long if monocase. These rules are relaXed if you are insistent enough.
Only the owner of the name or the super-user may change a password; the owner must prove
he knows the old password.
FILES

/etc/passwd
SEE ALSO

10gin(1), passwd(S), crypt(3)
Robert Morris and Ken Thompson, UNIX password security
BUGS
The password file information should be kept in a different data structure allowing indexed
access; dbm(3X) would probably be suitable.

4th Berkeley Distribution

18 January 1983

1

PC (1)

UNIX Programmer's Manual

PC (1)

NAME

pc - Pascal compiler
SYNOPSIS
pc [ option] [ -i name ... ] name ...
DESCRIPTION

Pc is a Pascal compiler. If given an argument file ending with .p, it will compile the file and
load it into an executable file called, by default, a.out.
A program may be separated into more than one .p file. Pc will compile a number of argument
.p files into object files (with the extension .0 in place of .p). Object files may then be loaded
into an executable a. out file. Exactly one object file must supply a program statement to successfully create an executable a.out file. The rest of the files must consist only of declarations
which logically nest within the program. References to objects shared between separately compiled files are allowed if the objects are declared in included header files, whose names must
end with .h. Header files may only be, included at the outermost level, and thus declare only
globally available objects. To allow functions and procedures to be declared, an external directive has been added, whose use is similar to the forward directive but restricted to appear only
in .h files. Function and procedure bodies may not appear in .h files. A binding phase of the
compiler checks that declarations are used consistently, to enforce the type checking rules of
Pascal.
Object files created by other language processors may be loaded together with object files
created by pc. The functions and procedures they define must have been de.clared in .h files
included by all the .p files which call those routines. Calling conventions are as in C, with var
parameters passed by address.
See the Berkeley Pascal User's Manual for details.
The following options have the same meaning as in ccO) and 1770). See Id(I) for load-time
options.
-c

Suppress loading and produce '.0' file(s) from source file(s).

-g

Have the compiler produce additional symbol table information for dbxO).

-w

Suppress warning messages.

-p

Prepare object files for profiling, see prof{I).

-0
-S

Invoke an object-code improver.
Compile the named program, and leave the assembler-language output on the
corresponding file suffixed '.s'. (No' .0' is created.).

-0

output
Name the final output file output instead of a. out.

The following options are peculiar to pc.
-C Compile code to perform runtime checks, verifyas5ertcalls, and initialize all variables to
zero as in pi.
-b
-i

Block buffer the file output.
Produce a listing for the specified procedures, functions and include files.

-I

Make a program listing during translation.

-5

Accept standard Pascal only; non-standard constructs cause warning diagnostics.

- t directory
Use the given directory for compiler temporary files.
-z Allow execution profiling with pxp by generating statement counters, and arranging for

4th Berkeley Distribution

6 June 1983

1

PC (1)

UNIX Programmer's Manual

PC (1)

the creation of the profile data file pmon. out when the resulting object is executed.
Other arguments are taken to be loader option arguments, perhaps libraries of pc compatible
routines. Certain fiags can also be controlled in comments within the program as described in
the Berkeley Pascal User's Manual.
FILES

file.p
/usr/lib/pcO
/lib/fl
/usr /lib/pe2
/lib/c2
/usr/lib/pc3
/usr /lib/pc2. *strings
/usr/lib/how.JlC
/usr /lib/libpc.a
/usr/lib/libm.a
/lib/libc.a

pascal source files
compiler
code generator
runtime integrator Online expander)
peephole optimizer
separate compilation consistency checker
text of the error messages
basic usage explanation
intrinsic functions and I/O library
math library
standard library, see intro(3)

SEE ALSO

Berkeley Pascal User's Manual
pi(l), pxp(1), pxref(l), sdb(1)
DIAGNOSTICS

For a basic explanation do
pc

See pi(l). for an explanation of the error message format. Internal errors cause messages containing the word SNARK.
AUTHORS

Charles B. Haley, William N. Joy, and Ken Thompson
Retargetted to the second pass of the portable C compiler by Peter Kessler
Runtime library and inline optimizer by M. Kirk McKusick
Separate compilation consistency checking by Louise Madrid
BUGS

The keyword packed is recognized but has no effect.
The binder is not as strict as described here, with regard to the rules about external declarations
only in '.h' files and including '.h' files only at the outermost level. It will be made to perform
these checks in its next incarnation, so users are warned not to be sloppy.
The - z fiag doesn't work for separately compiled files.
Because the - s option is usurped by the compiler, it is not possible to pass the strip option to
the loader. Thus programs which are to be stripped, must be run through strtjJ(l) after they are
compiled.

4th Berkeley Distribution

6 June 1983

2

PC68(l)

UN TX Progralluner's Manual

PC68(l)

NAME

pc68 -- Pascal compiler fbI' the MC68000
SYNOPSIS

pc68 [ option] name ...
DFSCRIJ>TION

Pc68 is the version of the p0l1able Pascal* compiler that generates code for the MC68000. Pc68 is
a flexible program for tr(\1lslating between various types of files. The types catered for in order of

appearance during translation are '.p' (Pascal source files), ',a68' or '.s' (assembly language files), '.b'
(relocatable binary files), 'b,out' (absolute binary files), '.r' (byte-reversed files, cf. rev68(J). and
';dl' (Macsbug download format, cf. d168(1) ).
Arguments to pc68 are either flags or input files, The type of an input file is normally determined
by its suflix.When an argument to pc()8 is not a flag and has none of the above suffixes, it is
assumed to be of one of the types ',p', '.b', or 'b.out', namely the latest of these three consistent
with the type of the output (e,g, if the output type were ',s' or '.b' then the input would have to be
'.p').

Translation proceeds as follows. Each '.p' and ',s' program is translated to a '.b' rdocatablc lIsing
upas68, ugen68, and as68 as necessary. Then all .b files including those produced by translalion arc
link edited into the one lite, called 'b,out', If the only input me was a single '.p' program then the
'.b' file is deleted, otherwise all '.b' files are preserved.
The amount of processing performed by cc68 may be decreased or increased with SOlne of the
options. The -S option takes translation no further than '.s' files, i.e, only upas68 and ugen68 arc
applied. The -c option takes translation up to '.b' flIes, omitting the link-editing and not deleting
any ',b' flies, The -d option goes beyond 'b,out' to produce a ',dl' file (using d168) that may be
downloaded by the Motorola Mi\CSBUG monitor and the Sunl monitor, The -r option similarly
goes beyond 'b.out' to produce a ',r' file (using rev68) that may be loaded directly by 68000 code
based on Id68. Both -d and -I' may be tI~cd together.
The output may be named explicitly with the -() option; the output file's name· should fhllow -0.
Otherwise the name is 'h.out' in the normal case, or 'filename,dl' for t.he -d option, or 'filename.r'
f-(H the -I' option. where 'fllellame' is the first '.p', '.a()~r, '.s', or '.b' filenalllcd as an input. If the
input is not in any of those three categories, the names 'd.out' and 'r,out' are used respectively lor
-d and -r.
The version of the target machine may be given as the nag

-VIl where
-vm is "Version Macshug."
-vV means to run under the· Vkerna1.
-vx V means to run under the experimental version of the Vkerne1.

II

is the version.

A complete list of options interpreted by pcG8 follows: .
.# !lag Pass.flag to the compiler. See the SOURCE I:'-T,AGS section below.
-~

Suppress loading alld produce ',h' filc(s) frolll source filets).

-g

I-lave the compiler produce additional symbol table information
mented).

f()l'

pcdb68 (not imple-

- c cntrypoint
Entrypoint specifics where to begin execution.
-0

- s

output
Name the final output me output instead of b.oul.
Accept standard Pascal only; non-standard constructs calise warning diagnostics (n()t implc·
mellted - see internally controlled options).

- v n Use the 'n' version of the runtime support.

7th Edition

MC68000

1

PC68(1)

UNIX Programmer's Manual

PC68 ( 1)

- \V

Suppress warning messages (not implemented).

- - x Suppress passing the' - x' flag to the loader,

ret~lil1ing

local symbols.

-I·:

Run only the preprocessor (not implemented).

-L
-0

Make an assembly listing in filenamc.ls t(lr each file assembled.
Invoke an object~code improver (not implemented).

- R

Preserve relocation information in b.out.

-5

Compile the named program. and leave the as.')emhler-Ianguage output on the corresponding
file suffixed' .s·. (No' .b' is created.).

-T org
Org specifics in hexadecimal where to begin londing the program.

- V
- U

Show the various stages of the compilation by printing images of the processes t()rked o(f to
perform the actual work of the compilation.
Save th~ ucode Clssociated with filname.p in filename.u (and filename.z, depending 011 the -W
option).

- W

Invoke t.he global ucode-to-ucl)de optimizer. I f -U option active. generates fitcilame.z.

- P

Save all intermediate files. Most useful in conjul1tioll with - V (so that it is possible to find
the intermediates).

Other arguments are taken to be loader option arguments, perhaps libraries of pcoS compatible routines.
SEPAUATE COMPILATION

Object files created by other language processors may be Imlded together with object mes created
hy pc6S. Calling conventions are as in C, with "ar parameters and arrays passed by address. Don't
pass structures except hy VAR (poillter). if you call C. since here pc68 and cc()R difrer. I\s a convenience, string consumts (1re followed by a zero byte, so that you can use them as C strings when
calling C routines.
.
To refer to a subroutine de1lned in a separate module. it Illust be declared. This f()lIows the same
syntax as forward declarations. except that till..' keyword FOn\VARI) is replaced by 1·:XTI4:I~N .

1\ file or subroutines is similar to a program except that there is no main program. alld the I>rogrmn
statement at the beginning or the file is replaced by a statement:
MODUI.E modulename;
The 'end:' of the last function in the file is Il)lIowcd by a period - Ulere is no main program block.
The modulename will become significant in Pnscal*. Note that in identifiers (such as subprogram
names) upper case is changed to lower case, and the linker is asked to ignore case.
FILI~S

OPENIN(;

To open a file fhr hoth input and output, lise the standard procedure REV ISE, which is analogous
with RESEI' and REWRITE. NOT TESTED.
You can read and write files on machines which run a Leaf server. To open a file for reading do:
resel(Ale, '[hostname: username:password]fiIcnamc');
The same syntax applies to rewrite. You can of course also lise a Pascal string variable. Terminat-

ing spaces in hosln4lllle, uscrname and ptlssword are ignored. (This should make it easier
gram to construct the appropriate H1enamc string.)

7th Edilion

MC68000

f-(>r

tl

pro~

2 .

PC68 ( 1)

UN1X Programmer's Manual

PC68(.l)

You can )cave out fields (or the entire second parameter), and the program will assume you want
the same as bct()re. I f there is no "bcfbrc", it will ask yOll.

Reset, Rewrite and Revise may have an optional third parameter, which is a string of switches.
h.g.:
Reset( Input, 'datal.txt', 'Nofilter;Prompt: "'l'ry again!"');
Standard switches arc:
- Prompt: The string is lIsed as a prompt (interactive systems only). If a file name is NOT
given, this prompt is used to get the file name th)m the user. If one IS given (like in the example
above), the prompt is used to get another filc name from the user if the file can't be opened.
- Dcftlult: The string is lIsed nrc lIsed asa denJ.U1t file name, whic}tjs used if the ~Iser types a C~lr­
riage return in response to the prompt.
- Standard: If Reset, the standard input file is lIsed. If Rewrite, the standard output is used.
- Noftller: (Reset, Revise only.) Normally a text me is 'filtered' by the runtimes so that it confonns to the standard Pascal definition of (l textft1e. Most notably, any end-oHine characters
an: changed into one space.
The inclusion of Nofther causes all characters to he passed
through exactly as they appear in the text file. EOltl, Eopage and Readln still work as for standard files.
EXTENSIONS TO IlEAD AND WIHTJl:

For all field widths (if there arc two ficld-width-type parameters, the first one only), a negative
,value will mean that the value written will he left-aligned instead of right-aligned. For
string variables, if Abs(Fic1dwidth) < I,ength, then the last I,ength - Abs(Ficldwidth) characters of the string will he written.
Variables of enumerated types may be read and written. The Held width is interpreted the same as
ttH'strings. Enumerated constant names are uppercased when they are read in.
Sets of readable and writeable types may also be read and wrillen. They appear exactly as set
constant.s appear in Pascal programs. The field width is interpreted It)r cach clement the
same as it woqld be It)J° the set clement type.
Integers may be written in other bases beside base 10 by including an optional field-width-type
parameter, which may be anywhere fh>rll 1..16. The field width is the same asfbr base 10.
Integers may also be read from a nle in other than base 10. by including a Hcld-width-type
parameter in the call to Read or Readln.
Real numbers may have a capital "E" as well as the standard small "e" in the exponent part.
MOIU: AUOtlT INPUT-OUTPUT

Lazy lokahead is used for text files, so that terminal input works reasonably.
The procedure Eopagc is true iff a pnge marker has just been read, and the corresponding space in
now in the file buffer.
Random-access in files is done with the standard procedure
seek (File, N);
This positions the me so that the next read/write will apply to component no. N of the file.
'1'0

7th Edition

close a file immediately do: ctose(file);

MC68000

3

UN rx Programmer's Manual

PC68 ( 1)

PC68(1)

l:"unction Filcsize (var Filevar: Anyfile): O.. Maxint returns the current number of components in.a
file.
Function Curpos (val' Filevar: Anyfile): O•. Maxint: Returns lhe current file position.
Procedure Filcpos (val' Filcvar: 'rext; val' Pagenum, Linenutn, Charnum: O.. Maxint): Returns page,
line number, and column numbcr of the next character that will be read from the file (must be
open for input). Does not work t()r random access.
TIME ANI) DATE ROUTINFS
.

.

,

'"

.

,

Clock -returns miJli-scconds since the monitor was booted.
,

.

,

\

.

,

.

'.

.

..

.

.'

.

t

,t.

The following routines routines don't work if you want to run stand-atone. but need an operating
system (VOl' Unix).
Ptime -returns (in theory) milli-seconds since midnight.
(under V, actually returns seconds* 1000)
Pdate(day, month" year) -set day, month & year (say 1982).
Time(string) -sets string to 'UII:MM:SS'
Date(string) -sets string to 'MM/DD/YY'.
For both time and date, the string is a p(~cked array [l..nJ of char, where n>=8. (Any overllo.w is
set to spaces.)
OTIIEH EXTENSIONS AND FEATUrU:S

All "others" label inas CASE statement, indicates a denlult case.
To include a filc as part of the program source do:
INel ,U DI ~ 'flkn,ime';

This is especially useful for lkclaratiolls Ihr scperately compiled modules.
Records declared as "packed" will be packed down to individual bits; however clements of packed
arrays are at least a byte.
Function Min (X,Y: '1'): T -- returns the minimum of two arguments, which may be of any ordiOf renl type.

nnl

Function Max (X, Y: '1'): T -- returns the maximum of two arguments.
Procedure Halt (Exitcode: Integer): Causes ahnormal lermaination of a program. Passes a
system-depelldent exit code to the operating system.
The'comment pairs '{ }' and '( * *) match independently, allowing limited nesting of comments.
SOUI~CI~

FLAGS

These flags can be passed to the compiler either at the command level when invoking pc68, or as
comments within the program. A sample option line is a l:Olllment with # as its first character:
Sample option line: (* #g + ,tdpy J,tchk I,U-8 *)
WARNING: Only (* *)-stylccomments will work; {# ... } is ignored!

7th Edition

MC68000

4

PC68 ( 1)

UN IX Programmcr's Manual

PC68(1)

Sample command line: pc68 file.p #g:+ #tdpy:l ·#tchk:l #U:-8
Swilch

Meaning (Note that the deHllJlt value is shown)

B+
C+

YJ2

Bounds and nil pointer checking
Print ucode
Load with debugger
Emit source code (ror system debugging)
Write error messages only to listing file
Write full listing
Number of characters of identificrs that
are considered significant
Emit optimizer-compatible code
Keep execution profile
Put up to N local variables in (data) registers
(Register al1oc filename]
Start executing objfile, passing args as command line arguments; < or > can be uSed to
redirect input or output in the usual manner.
trace Un procedure(function] Uf condition]
trace source-line-number [If condition]
trace procedure(function Un procedure(function] [if condition)'
trace expression at source-line-number Uf condition]
trace variable Un procedure!.function} [if condition}
Have tracing information printed when the program is executed. A number is associated with the command that is used to tum the tracing off (see the delete command).
The first argument describes what is to be traced. If it is a source-line-number, then the
line is printed immediately prior to being executed. Source line numbers in a file other
than the current one must be preceded by the name of the file' and' a colon, e.g.
"mumble.p:17" .
If the argument is a procedure or function name' then every time it is· called, informa..
tion is printed telling what routine called it, from what source fine it was called, and
what parameters were passed to it. In addition, its: return fs·noted, and if itJs a function
then the value it is returning is also printed.

If the argument is an expression with' an at clause tben' the value of the expression is
printed whenever the identified source line is reached.
If the, argument is a variable then the name and value of the variable is' printed whenever it changes. Execution is substantially slower during, this form of tracing.
If no argument is specified then· all source lines are' printed before they are' executed.
Execution is substantially slower duting this, form of'tracing.
The clause "'in procedure/function~" restricts tracing information to be printed only while
executing inside the given procedure or function.

4th Berkeley Distribution

PDX (1)

UNIX Programmer's Manual

PDX (1)

Condition is a Pascal boolean expression and is evaluated prior to printing the tracing
information; if it is false then the information is not printed.
There is no restriction on the amount of information that can be traced.
stop If condition
stop at source-line-number [If condition]
stop In procedure/function [If condition]
stop variable [If condition]
Stop execution when the given line is reached, procedure or function called, variable
changed, or condition true.
delete command-number
The trace or stop corresponding to the given number is removed. The numbers associated with traces and stops are printed by the status command.
status [> filename]
Print out the currently active trace and stop commands.
cont
Continue execution from where it stopped. This can only be done when the program
was stopped by an interrupt or through use of the stop command.
step
next

Execute one source line.
Execute up to the next source line. The difference between this and step is that if the
line contains a call to a procedure or function the step command will stop at the beginning of that block, while the next command will not.
print expression [, expression .. .]
Print out the values of the Pascal expressions. Variables declared in an outer block but
having the same identifier as one in the current block may be referenced as "blockname. variable".

whatls identifier
Print the declaration of the given identifier.
which identifier
Print the full qualification of the given identifer, i.e. the outer blocks that the identifier
is associated with.
assign variable expression
Assign the value of the expression to the variable.
call procedure (parameters)
Execute the object code associated with the named procedure or function.
help
Print out a synopsis of pdx commands.
gripe Invokes a mail program to send a message to the person in charge of pdx.
where Print out a list of the active procedures and functions and the respective source line
where they are called.
source filename
Read pdx commands from the given filename. Especially useful when the filename has
been created by redirecting a status command from an earlier debugging session.
dump [> filename]
Print the names and values of all active data.
list [source-line-number [, source-line-number))
list procedure/function
List the lines in the current source file from the first line number to the second

4th Berkeley Distribution

9 February 1983

2

PDX (1)

UNIX Programmer's Manual

POX (1)

inclusive. As in the editor "$" can be used to refer to the last line. If no lines ar6
specified, the entire file is listed. If the name of a procedure or function is given lines
n-k to n+k are listed where n is the first statement in the procedure or function and k
is small.
file (filename]
Change the current source file name to filename. If none is specified then the current
source file name is printed.
edit (filename]
edit procedure/jitnction-name
Invoke an editor on filename or the current source file if none is specified. If a procedure or jUnction name is specified, the editor is invoked on the file that contains it.
Which editor is invoked by default depends on the installation. The default can be
overridden by setting the environment variable EDITOR to the name of the desired
editor.
pi
Recompile the program and read in the new symbol table information.
sh command-line
Pass the command line to the shell for execution. The SHELL environment variable
determines which shell is used.
alias new-command-name old-command-name
This command makes pdx respond to new-commond-nome the way it used to respond to
old-command-name.
quit
Exit pdx.

The following commands deal with the program at the px instruction level rather than source
level. They are not intended for general use.
tracei [address] [if condJ
tracei [variable] [at address] [if condJ
stopi [address1 lif condJ
stopi [at) (address] [If conal
Tum on tracing or set a stop using a px machine instruction addresses.
xi address [, address]
Print the instructions starting at the first address. Instructions up to the'second address
are printed.
xd address [, address]
Print in octal the specified data location(s).
FILES

obj
.pdxinit

Pascal object file
Pdx initialization file

SEE ALSO
pHI) ~ px (1)

An Introduction to Pdx

BUGS
Pdx does not understand sets, and provides no information about files.

4th Berkeley Distribution

9 February 1983,

PDX (1)

UNIX Programmer's Manual

PDX (1)

The whatis command doesn't quite work for variant records.
Bad things will happen if a procedure invoked with the call command does a non-local goto.
The commands step and next should be able to take a count that specifies how many lines to
execute.
There should be commands stepi and nexti that correspond to step and next but work at the
instruction level.
There should be a way to get an address associated with a line number, procedure or function,
and variable.
Most of the command names are too long.
The alias facility is quite weak.
A csh-like history capability would improve the situation.

4th Berkeley Distribution

9 February 1983

4

PI (1)

UNIX Programmer's Manual

PI (1)

NAME

pi - Pascal interpreter code translator
SYNOPSIS

pi [ option] [ -I name ... ] name.p
DESCRIPTION

Pi translates the program in the file name.p leaving interpreter code in the file obj in the current
directory. The interpreter code can be executed using px. Pix performs the functions of pi and
px for 'load and go' Pascal.
The following flags are interpreted by pi: the associated options can also be controlled in comments within the program as described in the Berkeley Pascal User's Manual.
- b

Block buffer the file output.

-i

Enable the listing for any specified procedures and functions and while processing any
specified Include files.

-I

Make a program listing during translation.

-n

Begin each listed include file on a new page with a banner line.

-p

Suppress the post-mortem control flow backtrace if an error occurs; suppress statement
limit counting.

-s

Accept standard Pascal only; non-standard constructs cause warning diagnostics.

-t

Suppress runtime tests of subrange variables and treat assert statements as comments.

-u

Card image mode; only the first 72 characters of input lines are used.

-w

Suppress warning diagnostics.

-z

Allow execution profiling with pxp by generating statement counters, and arranging for
the creation of the profile data file pmon. out when the resulting object is executed.

FILES

file.p
file.i
/usr/lib/pi2 .• strings
/usr/lib/howyi.
obj

input file
include file (s)
text of the error messages
basic usage explanation
interpreter code output

SEE ALSO

Berkeley Pascal User's Manual
pixel), px(1), pxp(1), pxref(1)
DIAGNOSTICS

For a basic explanation do
pi
In the diagnostic output of the translator, lines containing syntax errors are listed with a flag
indicating the point of error. Diagnostic messages indicate the action which the recovery
mechanism took in order to be able to continue parsing. Some diagnostics indicate only that
the input is 'malformed.' This occurs if the recovery can find no simple correction to make the
input syntactically valid.
Semantic error diagnostics indicate a line in the source text near the point of error. Some
errors evoke more than one diagnostic to help pinpoint the error; the follow-up messages begin
with an ellipsis ' ... '.

3rd Berkeley Distribution

8 Apri11979

1

PI (1)

UNIX Programmer's Manual

PI (1 )

The first character of each error message indicates its class:
E
Fatal error; no code will be generated.
e
Non-fatai error.
w
Warning - a potential problem.
s
Non-standard Pascal construct warning.
If a severe error occurs which inhibits further processing, the translator will give a diagnostic
and then 'QUIT'.
AUTHORS

Charles B. Haley, William N. Joy, and Ken Thompson
Ported to VAX -II by Peter Kessler
BUGS

The keyword packed is recognized but has no effect.
For clarity, semantic errors. should be flagged at an appropriate place in the source text, and
multiple instances of the 'same' semantic error should be summarized at the end of a procedure
or function rather than evoking many diagnostics.
When include files are present, diagnostics relating to the last procedure in one file may appear
after the beginning of the listing of the next.

3rd Berkeley Distribution

8 April 1979

2

PICK ( 1)

UNIX Programmer's Manual

PICK( 1)

NAIIE

pick - select messages by content
SYNOPSIS

pick -cc
-date
-from
-search
-subject
-to
--component

[-src +folder] [msgs] [-help] [-scan] [-noscan]
[ -show] [-noshow] [-nofile] [-nokeep]
pattern
[-file [-preserve] [-link] +folder ... [-nopreserve] [-nolint
[-keep [-stay] [-nostay] [ +folder ... ] ]

typically:
pick -from jones -scan
pick -to holloway
pick -subject ned -scan -keep
DESCRIPtION

Pick searches messages within a fo!der for the specified contents, then performs
several operations on the selected messages.
A modified grep(I) is used to perform the searching, so the full regular expression (see ed(I» facility is available within 'pattern'. With '-search', pattern is
used directly, and with the others. the grep pattern constructed is:

,..... component:pattern··
This means that the pattern specified for a '-search' will be found everywhere in
the message. including the header and the body, while the other search requests
are limited to the single specified component. The expression '--component
pattern' is a shorthand for specifying '-search "component:pattern" '; it is used
to pick a component not in the set [cc date from subject to]. An example is
"pick --reply-to pooh -show".
Searching is performed on a per-line basis. Within the header of the message.
each component is treated as one long line. but in the body, each line is
separate. Lower-case letters in the search pattern will match either lower or
upper case in the message. while upper case will match only upper case.
Once the search has been performed, the selected messages are scanned (see
serm.) if the '-scan' switch is given, and then they are shown (see show) if the
'-show' switch is given. After these two operations. the tlle operations (if
requested) are performed.
The '-tile' switch operates exactly like the file command. with the same meaning
for the '-preserve' and '-link' switches.
The '-keep' switch is similar to I-file', but it produces a folder that is a subfolder of the folder being searched and defines it as the current folder (unless
the '-stay' flag is used). This subfolder contains the messages which matched
the search criteria. All of the MH commands may be used with the sub-folder as
the current folder. This gives the user considerable power in dealing with subsets of messages in a folder.
The messages in a folder produced by '-keep' will always have the same
numbers as they have in the source folder (Le.• the '-preserve' switch is
automatic). This way. the message numbers are consistent with the folder from

4th Berkeley Distribution

3 August 1983

1

UNIX Programmer's Manual

PICK ( 1)

PICK( 1)

which the messages were selected. Messages are not removed from the source
folder (i.e., the '-link' switch is assumed). If a '+folder' is not specified, the
standard name "select" will be used. (This is the meaning of "(select)" when it
appears in the output of the fold.er command.) If '+folder' arguments are given
to '-keep', they will be used rather than "select" for the names of the subfolders. This allows for several subfolders to be maintained concurrently.
When a '-keep' is performed, the subfolder becomes, the current folder. This
can be overridden by use of the' -stay' switch.
Here's an example:
1
2
3
4
5
6

7

a

9

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

"folder +inbox
inbox+ has 16 messages ( 3- 22); cur= 3.
"pick -from dcrocker
6 hits.
[+inbox/select now current]
"folder
inbox/select+ has 6 messages ( 3- 16); cur= 3.
"scan
3+ 8/20 Dcrocker
Re: ned tile update issue .. .
6 8/23 Dcrocker
removal of tiles from /tm.. .
8 6/27 Dcrocker
Problems with the new ned .. .
13 6/28 dcrocker
newest nned I would ap...
15 7/ 5 Dcrocker
nned Last week I asked ..
16 7/ 5 dcrocker
message id format Ire ...
"show aU I print
[produce a full listing of this set of messages on the line printer.]
"folder -up
inbox+ has 16 messages ( 3- 22); cur= 3; (select).
"folder -down
inbox/select+ has 6 messages ( 3- 16): cur= 3.
"rmf
[+inbox now current]
"folder
inbox+ has 16 messages ( 3- 22); cur= 3.

This is a rather lengthy example, but it shows the power of the MH package. In
item 1, the current folder is set to inbox. In 3, all of the messages from
dcrocker are found in inbox and linked into the folder "inbox/select". (Since no
action switch is specified, '-keep' is assumed) Items 6 and 7 show that this subfolder is now the current folder. Items 8 through 14 are a scan of the selected
messages (note that they are all from dcrocker and are all in upper and lower
case). Item 15 lists all of the messages to the high-speed printer. Item 17
directs folder to set the current folder to the parent of the selection-list folder,
which is now current. Item 18 shows that this has been done. Item 19 resets the
current folder to the selection list, and 21 removes the selection-list folder and
resets the current folder to the parent folder, as shown in 22 and 23.
SHOME/mh-proflle

The user protlle

PROmE COIIPONENTS

Path:
To determine the user's ME directory
Folder-Protect: For protection on new folders

4th Berkeley Distribution

3 August 1983

2

PICK ( 1)

Current-Folder:

UNIX Programmer's Manual

PICK( 1)

To find the default current folder

DEFAULTS

'-src +folder' defaults to current
'msgs' defaults to all
'-keep +select' is the default if no '-scan', '-show', or ·-tile' is specitled
CONTElrr

If a '-src +folder' is specified, it will become the current folder, unless a'-keep'
with 0 or 1 folder arguments malees the selection-list subfolder the current
folder. Each selection-list folder will have its current message set to the first of
the messages linked into it unless the selection list already existed, in which
case the current message won't be changed.

4th Berkeley Distribution

3

PING(l)

UN IX Programmer's Manual

PING(l)

NAME

ping - IP/ICMP echo user program
SYNOPSIS

,

ping [ -cn11n ) [ - snnn ] hostname [ ]
DE..45CRIPTION

Ping is used to send an rCM» (Internet Control Message Protocol) "Echo Me" packet to a host; it
wa.its for a 'reply to see if the host responds. Since every IP host is required to respond to lCMP
packels, this is a simple way to determine if a host is up.
If more than one host name argument is given, the hosts are pinged in order.
OPTIONS

- , .' -:': : TI~e' 1{)II()~j~lg': or)timis'are" rcc()g·nii.c~.t . N(lte' that illllTICric tal~gurhents follow the option flags
immediately, without intervening spaces.
_. cnnn
For each host specified, send the echo Will times.
- snnn
Make the packets Ill/II bytes long.
)JUGS

By changing the deHlUlt length you may create a situation where Unix may send the echo packet
but will drop the response, thus confusing the is.l)ue.
Since the Unix hostname software is abysmally slow, it often takes longer to look lip the hostname
than it does to exchange packct~.

7th Edition

1

PIX ( 1)

UNiX Programmer's l"y1anual

PIX ( 1 )

NAME

pix - Pascal interpreter and executor
SYNOPSIS

pix [ -blnpstuwz] [ -i name ... ] name.p [argument ...
DESCRIPTION
Pix is a 'load and go' version of Pascal which combines the functions of the interpreter code
translator pi and the executor px. It uses pi to translate the program in the file name.p and, if

there were no fatal errors during translation, causes the resulting interpreter code to be executed by px with the specified arguments. A temporary file is used for the object code~ the file
obj is neither created nor destroyed.
FILES

lusr/ucb/pi
lusr lucb/px
Itmp/pix*
lusr llib/how-pix

Pascal translator
Pascal executor
temporary
basic explanation

SEE ALSO

Berkeley Pascal User's Manual
pHI), px(I)
DIAGNOSTICS

For a basic explanation do
pix
AUTHORS

Susan L. Graham and William N. Joy

4th Berkeley Distribution

10 February 1983

1

UN IX Programmer's Manual

PL01'(lG}

PLO'I'(IG)

NAME:

plot - graphics filters
SYNOPSIS

plot [ - Tterminal [ raster] ]
DESCRIPTION

These commands rcad plotting instmctiolls (see p/ot(5» from the standard input. and in general
produce plotting instructions suitable tl)}" a particular tenllillal on the standard output.
I r no terminal type is specified,. the environment parameLer $TERM (sec cllviron(5» is used.
Known terminals are:
4014 Tektronix 4014 storage scope.
450
DASI Hytenn 450 terminal (Diablo mechanism).
300
DASI 300 or aSl terminal (Diablo mechanism).
300S D"SI 300S terminal (Diablo mechanism).
ver
Versatec D1200" printer-plotter. This version of plot places a scan-converted image in
"/usr/t.mp/raster' and sends the result. directly to the plotter device rather than to the standard output. The optiotl(tl argument causes a previously scan-converted file raster to be
sent to the plotter.
var
Varian plotter; similar to versatec except that data is buffered internally. lusr/tmp/raster is
not written, and it cannot dump a scan-converted lite. However, it's a "lot faster.
tek4025.4025
Tektronix 4025 terminal
hp2648,2648
Hewlett-Packard 2648 terminal
cl 00. c 1OOrv, ClOt), C I OOrv
Conc~pl 100 (fHr light duty low accuracy work only)
press Sends a plot to tl PI;CSS(ilC printer.
dover synonym for "pres.')"
;;

sungr

Per Bolhner's Sun Graphics Terminal (probably obsolete)

FILES

lusr/bin/tek
IlIsr/bin/t450
IlIsr/bin/t300
IlIsr/bin/t300s
11Isr/bi III vplot
IlIsr/bin/varplot
11Isr/bi nl prcssplut
lusr/bin/tck4025
lusr/bin/hp2648
I lIsrIbi IIIconcept
lusrIbin/sll nplot
lusr/tmp/raster
SEE AI.SO

plot(3), plot(5)
BUGS
There is no lockout protection for lusr/tmp/raster.

7th Edition

1 .

PMERGE(l)

UNIX Programmer's Manual

PMERGE (1)

NAME

pmerge - pascal file merger
SYNOPSIS

pmel'le name.p ...
DESCRIPTION

Pmerge assembles the named Pascal files into a single standard Pascal program. The resulting
program is listed on the standard output. It is intended to be used to merge a collection of
separately compiled modules so that they can be run through pi , or exported to other sites.
FILES

/usr/tmp/MG.

default temporary files

SEE ALSO

pc(I), pHI),
Auxiliary documentation Berkeley Pascal User's Manual.
AUTHOR

M. Kirk McKusick
BUGS

Very minimal error checking is done, so incorrect programs will produce unpredictable results.
Block comments should be placed after the keyword to which they refer or they are likely to
end up in bizarre places.

4th Berkeley Distribution

18 January 1983

1

POSTNEWS ( 1 )

UNIX Programmer's Manual

POSTNEWS ( 1 )

postnews - submit news articles
SYNOPSIS

postnews [ a.rticle ]
msauPTION

Postnews is a shell script that calls inews(l) to submit news articles to USENET.
It will prompt the user for the title of the article (which should be a phrase suggesting the subject. so that persons reading the news can tell if they are
interested in the article) for the newsgroup. and for the distribution.
An omitted newsgroup {from hitting return} will default to general.
general is read by everyone on the local machine. Other possible newsgroups
include, but are not limited to, btl.general. which is read by all users at all Bell
labs sites on USENET, net. general. which is read by all users at all sites on
USENET. and net. news, which is read by users interested in the network news on
all sites. There is often a local set of newsgroups, such as 'Ucb. all, that circuiate
within a local set of machines. {In this case, ucb newsgroups circulate among
machines at the University of California at Berkeley.}
The distribution can be any valid newsgroup name list, and defaults to the same
as the newsgroup. {If they are the same, the distribution will be omitted from
the headers put into the editor bufter.} A distribution header will, if given, be
included in the headers of the article, affecting where the article is distributed
to.
After entering the title. newsgroup. and distribution, the user will be placed in
an editor. If $EDITOR is set in the environment, that editor will be used. Otherwise, postnews defaults to vi( 1).
An initial set of headers containing the subject and newsgroups will be placed in
the editor, followed by a blank line. The article should be appended to the
butler, after the blank line. These headers can be changed, or additional
headers added. while in the editor, if desired.
Optionally, the article will be read from the specifted filena.me .
For more sophisticated uses, such as posting news from a program, see
inews( 1).
SlZALSO

Mail(1). checknews(l), inews(1), mail(1), readnews{l).

4th Berkeley Distribution

28 July 1983

1

PR( 1)

UNIX Programmer's Manual

PR (1)

NAME

pr - print file
SYNOPSIS

pr [ option ] ... [file] ...
DESCRIPTION

Pr produces a printed listing of one or more jiles. The output is separated into pages headed by
a date, the name of the file or a specified header, and the page number. If there are no file
arguments, pr prints its standard input.
Options apply to all following files but may be reset between files:

- n
+n
-h

Produce n-column output.
Begin printing with page n.
Take the next argument as a page header.

-w n

For purposes of multi-column output, take the width of the page to be n characters
instead of the default 72.
Use formfeeds instead of newlines to separate pages. A formfeed is assumed to use up
two blank lines at the top of a page. (Thus this option does not affect the effective
page length.)

-f

-in
-t

Take the length of the page to be n lines instead of the default 66.
Do not print the 5-line header or the 5-line trailer normally supplied for each page.

-sc

Separate columns by the single character c instead of by the appropriate amount of
white space. A missing c is taken to be a tab.
\
-m
Print all files simultaneously, each in one column,
Inter-terminal messages via write(l) are forbidden during apr.
FILES

Idev/tty? to suspend messages.
SEE ALSO

catn)
DIAGNOSTICS

There are no diagnostics when pr is printi'ng on a terminat

4th Berkeley Distribution

1

PR68 ( 1)

UN IX Programmer's Manual

PR68(l)

NAME

pr68 - print extended statistics on .h file
SYNOPSIS
pr68 file

DE...'iCRI PTION
Pr68 print<; the header information, symbol table, and relocation commands of a .b
Verifies that the text and data segments arc multiples of 4.

Of

.68 file.

AUTHOR

C.J. Terman

7th Edition .

1

PRESS1MP( 1)

UNIX Programmer's Manual

PRESStMP( 1)

NAME

pressimp - convert press files to ImPress format and print them on the ImPrint printer.
SYNOPSIS

I)rcssimp [ options] [ files]
DESCI~II'TION

Press imp reads in Xerox press files, converts t.hem to ImPress format and queues them to be pdnted
on the ImPrint printer. If no input files are specified, standard input is used (although pipes cannot
be used).
The environment variable IMPRESS may he used to specify defaults. The value of IMPRESS is
a, string of argumel:lts before the argumentc; thatappenllalion to be printed uut as font nics are being read.

-I)

Causes very Illuch debugging inf{)rmation to be printed out as font filcs nrc being
read, as well as the position of every character.

-iname

Causes the press me to be written to the named file rather than being shipped to
the ImJ>rinl printer.

ENVIRONMENT

IMPRESS

string of options to be used by pressimp.

TFM

the path namc of a me to
(hut width inf(:>rmatioll.

RAS

the path name of a directory to usc in prefercnce to lusr/locallfc))1ts/rastcr to
find the character rasters.

u~c

in preference to /ustr/locallfontl)/tfuT to find the

FILES

lusr/tmp/lmPressXXXXXX
lusr/locallfont')/tfm

default imPress fife output.

lusr/local/fonts/rastcr

describes aU the available fonls· milgnificaHoJ)s.

lusr/local/l ib/ipr

ImPrint prhltcl' Printer qucuer.

7th Edition

describes aU the available font fatuities.

1

UNIX Programmer's Manual

PRESSIMP(l)

SEE

PRESSIMP( 1 }

ALf~O

ipq(1), ipr(l), iprm(l),

itrofT(l)~

imprint(l}, scribe(l)

AUTHon
Bill Nowicki, Stanford Univcristy.
DIAGNOSTICS

Lot'), but they should be self explanatory.
HUGS

Inherits lot~ of bugs from other programs. It docs not implement the entire Press specification,
only those produced by common utilities like Scribe.

7th

l~dition

2 .

PREV (1)

UNIX Programmer's Manual

PREV( 1)

prey - show the previous message
SYNOPSIS

prev [ +folder ] [ -switches for 1 ] [ -help]
DESCRIPTION
Prev performs a show on the previous message in the specified (or current)
folder. Like show. it passes any switches on to the program 1. which is called to
list the message. This command is exactly equivalent to "show prey" .

$HOME/mh.protlle

The user protlle

PBOm..E COIlPONENTS

Path:
Current-Folder:

To determine the user's MH directory
To find the default current folder

aJNTEXT

If a folder is specified. it will become current, and the message that is shown
(Le., the previous message in sequence) will become the current message.

4th Berkeley Distribution

3 August 1983

1

UNIX Programmer's Manual

PRINT (1 )

PRINT (1)

NAME

print - pr to the line printer
SYNOPSIS

print file ...
DESCRIPTION

Print pr's a copy of each named file on the line printer. It is a one line shell script:
lpr -p $...
SEE ALSO

IprO), prO)

3rd Berkeley Distribution

24 February 1979

1

PRINTENV ( 1 )

UNIX Programmer's Manual

PRINTENV ( 1 )

NAME

printenv - print out the environment
SYNOPSIS

printenv [ name]
DESCRIPTION

Printenv prints out the values of the variables in the environment. If a name is specified, only
its value is printed.
If a name is specified and it is not defined in the environment, printenv returns exit status 1,
else it returns status O.
SEE ALSO

shU), environ(7), csh(l)

3rd Berkeley Distribution

24

Febr~ary

1979

1

PRMAIL (1)

UNIX Programmer's Manual

PRMAIL (1)

NAME

pintail - print out mail in the post office
SYNOPSIS

prmall [ user ... ]
DESCRIPTION

Prmail prints the mail which waits for you, or the specified user, in the post office. The mail is
not disturbed.
riLES

lusrlspoollmaill-

post office

SEE ALSO

bitr(l), mail(1), from(D, binmail(1)

4th Berkeley Distribution

24 February 1979

1

PROF(l)

UNIX Programmer's Manual

PROF(l)

NAME

prof - display profile data
SYNOPSIS

prof [ -a] [-1] [ -0] [ -I] [ -8 J [ -y [ -low [ -high] ) 1(a.out (mon.out ... ] ]

DESCRIPTION

Prof interprets the file produced by the monitOr subroutine., Under default modes, the symbol
table in the named object file (a. out default) is read and correlated with the profile file (mon.out
default) . For each external symbol, the percentlge of time spent executing between titat symbol and the next is printed (in decreasing order), together with the number of times that routine was called and the number of milliseconds per caU. If mOre thail one profile fiie is
specified, the output represents the sum of the profiles.
In order for the number of calls to a routine to be tallied, the -p option of ee, j71 or pc must
have been given when the fHe containing the routine was compiled. This opdon als6 arranges
for the profile file to be produced automatically
Options are:
-a
all symbols are reported rather than just external symbols.
-I
the output is sorted by symbol value.
-0
the output is sorted by number of calls
-s'
a summary profile file is produced in mon.sum. This is really only useful when more
than one profile file is specified.
-y
all printing is suppressed: and a graphic version of the profile is produced on the standard output for display by the plot (1 ) fitters. When plotting, the numbers low arid high~
by default 0 and 100, may be giventa' cause a selected percentage of the profile'to be
plotted with acc'oretingly higher resolution.
-z
routines which have zero usage (as indicated by call counts and accumulated time)' are
nevertheless printed in the output.
 will cause the whole component to be left out. A 1.\" preceding a
 will continue the response on the next line, allowing for multiline
component.s.
Any component that is non-blank will be copied and echoed to the terminal.
The start of the message body is prompted by a line of dashes. If the body is
non-blank, the prompt is "-Enter additional text". Message-body typing is
terminated with a  (or  during message-body typing is equivalent to  for compatibility with NED. A  during component typing will abort the command that
invoked prompter.
II

PROm.E COIlPONENTS

prompter-next:

editor to be used on eXit from prompter

4th Berkeley Distribution

3 August 1983

1

PS (1)

UNIX Programmer's Manual

PS (I)

NAME

ps - process status
SYNOPSIS

ps [ aeegklstuvwx# ]
DESCRIPTION

Ps prints information about processes. Normally, only your processes are candidates to be
printed by ps; specifying a causes other users processes to be candidates to be printed; specifying x includes processes without control terminals in the candidate pool.
All output formats include, for each process, the process id PID, control terminal of the process TT, cpu time used by the process TIME (this includes both user and system time), the
state STAT of the process, and an indication of the COMMAND which is running. The state is
given by a sequence of four letters, e.g. "RWNA". The first letter indicates the runnability of
the process: R for runnable processes, T for stopped processes, P for processes in page wait, D
for those in disk (or other short term) waits, S for those sleeping for less than about 20
seconds, and I for idle (sleeping longer than about 20 seconds) processes. The second letter
indicates whether a process is swapped out, showing W if it is, or a blank if it is loaded (incore); a process which has specified a soft limit on memory requirements and which is exceeding that limit shows >; such a process is (necessarily) not swapped. The third letter indicates
whether a process is running with altered CPU scheduling priority (nice); if the process priority
is reduced, an N is shown, if the process priority has been artificially raised then a '<' is
shown; processes running without special treatment have just a blank. The final letter indicates
any special treatment of the process for virtual memory replacement; the letters correspond to
options to the vadvise(2) call; currently the possibilities are A standing for VA_ANOM, S for
VA_SEQL and blank for VA_NORM; an A typically represents a Iisp(D in garbage collection, S
is typical of large image processing programs which are using virtual memory to sequentially
address voluminous data.
Here are the options:
a
asks for information about all processes with terminals (ordinarily only one's own
processes are displayed).
c

e
g

k
I
s

tx

u

prints the command name, as stored internally in the system for purposes of accounting.
rather than the command arguments, which are kept in the process' address space. This
is more reliable, if less informative, since the process is free to destroy the latter information.
Asks for the environment to be printed as well as the arguments to the command.
Asks for all processes. Without this option, ps only prints "interesting" processes.
Processes are deemed to be uninteresting if they are process group leaders. This normally
eliminates top-level command interpreters and processes waiting for users to login on free
terminals.
causes the file Ivmcore is used in place of Idevlkmem and Idevlmem. This is used for postmortem system debugging.
asks for a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS and WCHAN as
described below.
Adds the size SSIZ of the kernel stack of each process (for use by system maintainers) to
the basic output format.
restricts output to processes whose controlling tty is x (which should be specified as
printed by PSt e.g. 13 for tty3, teo for console, IdO for ttydO, I? for processes with no tty, I
for processes at the current tty, etc). This option must be the last one given.
A user oriented output is produced. This includes fields USER, %CPU, NICE, SIZE, and

4th Berkeley Distribution

13 April 1983

1

PS (1)

UNIX Programmer's Manual

v

w

x
#

PS (1)

RSS as described below.
A version of the output containing virtual memory statistics is output. This includes
fieldsRE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU and %MEM, described
below.
Use a wide output format (I32 columns rather than 80); if repeated, e.g. ww, use arbitrarily wide output. This information is used to decide how much of long commands to
print.
asks even about processes with no terminal.
A process number may be given, (indicated here by #), in which case the output is restricted to that process. This option must also be last.

A second argument tells ps where to look for core if the k option is given, instead of Ivmcore.
A third argument is the name of a swap file to use instead of the default Idev/drum. If a
fourth argument is given, it is taken to be the file containing the system's name list. Otherwise,
Ivmunix is used.
Fields which are not common to all output formats:
USER
name of the owner of the process
cpu utilization of the process; this is a decaying average over up to a minute of preOfoCPU
vious (real) time. Since the time base over which this is computed varies (since
processes may be very young) it is possible for the sum of all %CPU fields to exceed
100%.
(or NO process scheduling increment (see setpriority (2) )
NICE
virtual size of the process (in 1024 byte units)
SIZE
RSS
real memory (resident set) size of the process (in 1024 byte units)
soft limit on memory used, specified via a call to setrlimit(2); if no limit has been
LIM
specified then shown as xx
TSIZ
size of text (shared program) image
TRS
size of resident (real memory) set of text
%MEM
percentage of real memory used by this process.
RE
residency time of the process (seconds in core)
SL
sleep time of the process (seconds blocked)
PAGEIN number of disk i/o's resulting from references by the process to pages not loaded in
core.
UID
numerical user-id of process owner
PPID
numerical id of parent of process
CP
short-term cpu utilization factor (used in scheduling)
PRI
process priority (non-positive when in non-interruptible wait)
ADDR
swap address of the process
WCHAN event on which process is waiting (an address in the system), with the initial part of
the address trimmed off e.g. 80004000 prints as 4000.
F

flags associated with process· as in < sys/proc. h > :
SLOAD
000001 in core
SSYS
000002 swapper or pager process
SLOCK
000004 process being swapped out
SSWAP
000008 save area flag
STRC
000010 process is being traced
SWTED
000020 another tracing flag
SULOCK
000040 user settable lock in core
SPAGE
000080 process in page wait state
SKEEP
000100 another flag to prevent swap out

4th Berkeley Distribution

13 April 1983

2

PS (1)

tJNiX Programmer's Manuai

SOL YU
SWEXIT
SPHYSIO
SVFORK
SVFOONE
SNOVM
SPAGI
SANOM
SUANOM
STIMO
SOET ACH
SOUSIG

000200
000400
000800
001000
002000
004000
008000
010000
020000
040000
080000
100000

r., \ 1 J
ftlt" ,

,

"

delayed unlock of pages
working on exiting
doing physical i/o (bio.c)
process resulted from vforkO
another vfork flag
no vm, parent in a vforkO
init data space on demand from inode
system detected anomalous vm behavior
user warned of anomalous vm behavior
timing out during sleep
detached inherited by init
using old signal mechanism

A process that has exited and has a parent, but has not yet been waited for by the patent is
marked < defunct>; a process which is blocked trying to exit is marked < exiting>; Ps makes
an educated guess as to the file name and arguments giyen when the process was created by
examining memory or the swap area. The method is inherently somewhat unreliable and in any
event a process is entitled to destroy this information, so the names cannot be counted on too
much.
FILES

Ivmunix
Idev/kmem
Idev/drum
Ivmcore
Idev

system namelist
kernel memory
swap device
core file
searched to find swap device and tty names

SEE ALSO

kilHl), w(I)

BUGS
Things can change while ps is running; the picture it gives is only a close approximation to reality.

4th Berkeley Distribution

13 April 1983

3

PTI(I)

UNIX Programmer's Manual

PTI(I)

NAME
pti - phototypesetter interpreter
SYNOPSIS
ptl [ file ... ]
DESClUPTION
Pti shows the commands in a stream from the standard output of lf01l0) using tro./rs - t
option, interpreting them as they would act on the typesetter. Horizontal motions shows as
counts in internal units and are marked with '<' and '>' indicating left and right motion.
Vertical space is called lead and is also indicated.
SEE ALSO
trotr(l)

BUGS
Too cryptic for normal users, who should use "trotr -a ... ".

3rd Berkeley Distribution

24 February 1979

1

-..14'\

riA \ 1 J

tJr..'lX Piogiammei's Manual

PTX(!)

NAME

ptx - permuted index
SYNOPSIS

ptx [ option] ... [input [ output] ]
DESCRIPTION
Ptx generates a permuted index to file input on file output (standard input and output default).

It has three phases: the first does the permutation, generating one line for each keyword in an
input line. The keyword is rotated to the front. The permuted file is then sorted. Finally, the
sorted lines are rotated so the keyword comes at the middle of the page. Ptx prodllces output
in the form:
.xx "tail" "before keyword" "keyword and after" "head"
where .xx may be an nroff or tro.DtO macro for user-defined formatting. The be/ore keyword
and keyword and after fields incorporate as much of the line as will fit around the keyword when
it is printed at the middle of the page. Tail and head, at. least one of which is an empty string
"", are wrapped-around pieces small enough to fit in the unused space at the opposite end of the
line. When original text must be discarded, 'I' marks the spot.
The following options can be applied:
-f
Fold upper and lower case letters for sorting.
-t
Prepare the output for the phototypesetter; the default line length is 100 characters.
-w n Use the next argument, n, as the width oC the output line. The deCault line length is 72
characters.
.- I n Use the next argument, n, as the number of characters to allow for each gap among the
four parts oC the line as finally printed. The deCault gap is 3 characters.
-0 only
Use as keywords only the words given in the only file.
-I ignore
Do not use as keywords any words given in the ignore file. If the -I and -0 options
are missing, use lusrllibleign as the ignore file.
-b break
Use the characters in the break file to separate words. In any case, tab, newline, and
space characters are always used as break characters.
-r
Take any leading nonblank characters oC each input line to be a reCerence identifier (as
to a page or chapter) separate from the text of the line. Attach that identifier as a 5th
field on each output line.
The index for this manual was generated using ptx.
FILES

lusr Ibinl sort
lusr/lib/eign
BUGS

Line length counts do not account for overstriking or proportional spacing.

7th Edition

18 January 1983

1

PUPECHO(l)

UN IX Programmer's Manual

PUPECHO(l)

NAME

pupccho, cchoservc - Pup Echo protocol llser and server
SYNOPSIS

pupccho [-v] host [string]
cchoscrvc [-c] [-v]
DESCRIPTION

The Pup Echo Protocol is a simple protocol used for determining that Pup packets can be
exchanged bet.ween two hosts. The USCI' sends a packet with PupType ECHOM E to the
ECHOSER VER socket, and the server responds with an lAM ECHO packet, containing the same
PupData as the received pac~et.
...... . ,/ .~.:. '...
The server can respond with an IAMBADECHO if the received packet appeared damaged, an
ERRORPUP if it doesn't like to echo, or simply not respond at all.
.
To usc pupC'c/to. invoke it wit.h the name of a host (th,lt you believe will echo packeL~) and a string
to send as data (this is fairly arbitrary.) The program will send packets at short intervals. until it
receives an interrupt signal (normally CtrI/C), at which point it will print out statistics showing how
sllccessful it was. The -v option will print oul lhe status of every packet.
To usc echosen'e. invoke with -c, if you want it to check the checksums on incoming packets, or
without -c, if you want it to ignore bad checksums. [t will echo to any host sending it an
ECHOME.
SEE ALSO

Xerox document, Pup Hcllo Protocol
DIA(iNOSTtCS

cryptic
AUTIIOR

JclTrey Mogul, Slight mods by Bill Nowicki

7th Edition

1

PUPFTP(l)

UNIX Programmer's Manual

PUPF1P(l)

NAME

pupftp - Pup File Transfer Program
SYNOPSIS

pupftl> [host]
DESCIUPTION

Pupfip is a program used to transfer files to and from another host on a PUP network. It is quite
similar to lhe FTP program used on the XEROX Altos. It can only be used to transfer to or from
a host which is running a pupfip server program, such as t.he IFS, a Dolphin or Dandelioll, or
another Vax.

If you do not specify a host, it prompts you for t.he name of the server: you may give either a host
·nitnic or·an «)cta}) ·host number: .
.. , i. -1
~ENEnAL

NOTES

In general, you mllst be Jogged in (see the command descriptions below and lIelalia.(J) } befbrc
doing anything at the rcmote host. Commands arc read from standard input, which may be a terminal or a command file.
Files on the remote host are named according to that host's Iilc-nmning rules. Each operating system has a different concept of a "directory" and "name body", for example.

r·. .

The interactive cOlTIlnand parser of the pup[tp program is similar to that of Alto rp, the IFS, or
TOPS-20: your 'erase' character deletes characters that you have typed~ if you type the unambiguous prefix of a command, the program completes the command for you alter you type a punctuation, space, or control character.
COMMANDS

assume

change

ct~mparc

The cOInpnrc cOIlTlrrand allows you to cOlnpare remote files t(') local ones. The
remote file is. piped into the dijJ(1) program' (or the cmp(1) program for binary
fUes)
and compared with the specified local: file. The default local file is the remote
file's name body.

delete

'rile dclctc cummand. allows you to specify HIes to be ddeted at the rclnote
host: after you type the filename; you arc shown some infortn;ltiOlY abnut the
Hie, and t.hen IHusl answer 'y' or 'n~ to either delete it, or not.
'I;hc directory comnmnd.changcs your dcHHllt directory .at the I'emote host. The·
directory name typed becomes the default directory until a new 'directory' or
'login' is executed. If a carriage return is hit the deflll:1lt of the remote uscl"s
directory is used. Entering "." (a. single d()t) sets, the remote direcuuy to' the
current working directory.
'rile list command' a1fows you to fil1d: out ablllit a' mc~ or group of filcs~, at the;
remote host. Since this may generate a Ibt of inforl11ation, wIR~n· th'c pl"()gram
has printed a page. of data, it prompts you with thc line .. ~ . . Spacc fbr 1110."C;'-";
unftwtunatcly there is not a simple way to interrupt this listing:

directory

list .

logih

7th~

The assume cOIlHnand invok.es a mode i'n which the files names arc assumed to
be identical on both the local and remote machines. I':"or example, if you are
doing a copy (or comparison) of alt t.he files in a given directory, this mode can
save you much typing. Subsequent Hssumc coo11l1ands invert lhe state of this
luude (just nke the verhose and ! commands~ sec below).
The· ch·augc commal)d changes t.he current work ng directory 011 the local
machine. The corresponding cOlllmand for changing the rcmote directory is
dircctory.

EdWoll

This command must: be executed before doing: anything. else; unless your'

'I

UN IX Programmer's Manual

PUPFl'P ( 1)

PUPFti>(l}

password had been saved by the nelalin.c(J) feature. The login command
requires a username for the remote system, and then a password (which is not
echoed.)
.
quit
.

The quit command is llsed to te]minate a connection with the remote host; the
connc~cti{)n is also telnlinated (although not as c1eanly) if the process is killed.

retrieve

The retrieve command allow remote files to be retrieved. It prompts you fhr a'
local filellam~ to put each retrieved fi1e under. ]f you do not specify one, the
default Hlellame is the the remote hase filename. If you specify - (a hyphen)
as the file name, it will be sent to standard output.

shell

The shell command accepts a standard Unix shell command and executes it.
For example, the Is command will list your local files. and plVd will print your
current working directory.

store

The store command tnnation removed, placed in the directory of the remote account
under which you are logged in. It then risks you whether the file should be
stored as a Binary f1Ie if you have not set a default mode; the dcflllllt is 'n' (Le.
Text).

type

This command allows you to specify the defllllit file type to usc. There are four
possibilities. Tcxt type tmnsfers perform the proper conversions to and (-i"om
Unix end of line conventions. Bin&lfY type transfers arc done with 8 hit bytes,
swapping the bytes in every word. This means that Press liles, ftH" example. caJl
be sent between Vaxes and Altos wit.h no problems. Guess type transfers (ini~
tially the dcf~lult) will lise the mode sped Iyed by the server. On store com~
mands, the first 512 bytes of the file are examined. If any 'of these bytes are not
7 bit ASCII characters. the HIe is cOllsidered binary. otherwise it is considered as
text. QlIl'fY type translers will usc the type specified by the server on retrieves.
bufask the lIser to specify the type of each me stored.
The n'.'bose command turns on and on~ very long-winded debugging inf()rm(\~
tion. Used Ibr mai ntcnence only.

verbose

Turns on and 011' the printing of exclamation points on each buller sucessru1ty
translcred. Ijnitially this leature is enabled. to allow a small amollnt of
confidence that some progress is being made.
SEE ALSO

eftp(l), puptclnel(l), nelalias(1), ftpser(8)
AUTIIOI{S

Bill Nowicki. based on an earlier version by Dan Kolkowitl'. & Erik Hedberg
1)1 A(; NOSTICS

Should be sdF·explanatory
HUGS

There should be a way or inlcrruptitlg a list command. and aborting a retrieve request. Should
expand wildcards on storc commands.

7th Edition

2

PUPROUTE{l)

UN IX Programmer's Manual

PUPROUTE(l)

NAME

puproute - print Pup network rOllting table information
SYNOPSIS

puproutc [ -a] [ -e] [

-8 [

intcrval ]]

DESCRIPTION

Puproute is used to print the Pup routing table; this is mostly a debugging tool.
OPTIONS

-a
-c

Normally, networks and gateways are listed by name, but giving this
option list.s them by address.
Lists only directly-coll.Heeted· networks.
.' .
If this option is given, puproule· will rcpc,it c'ontinualfy,'sleeping interval
seconds between repetitions. If interval is omitted. the period defaults to
30 seconds: this is the normal update interval on a quiescent network.
~,;~

- f;

[interval]

AUTHOR

Jem'cy Mogul
BUGS

Using puproute without the - a option can be slow, at least on the first time around, because
translating the addresses to names takes a while. I f the - s option is used, subsequent iterations arc
much faster, since a cache is kept of address-to-name translations.

7th Edition

1

PUPTELNET(l)

pUIyrELNET ( 1 )

UNIX Programmer's Manual

NAME
puptelnet - connect your terminal to a remote computer via Pup network
SYNOPSIS

lluptclnct [options] [host] [typescript-file]
DESCfUPTION

Puplelnel connect') your telminal to a remote computer in sllch a way that you can more or less
pretend you arc connected to it directly. The remote computer must be connected to this Unix system by means of an appropriate Pup network or combination of networks. Puptelnet initially checks
to see if the requested host is connected on the local Pup internet, If it is unable to find the
requcsted host there, it then invokes the te!IlCl(l) program to connect through IP/TCP protocols.
...

•

•

......

"

,.

t

"..

"

'I

'\

'.

.~

".

~

•

.,

I '

..

';

t. 1

".

The hos/ name that you type can be eithcr a symbolic name or an octal ethernet port number.
Octal port numbers are lIseful only in the emergency situation of the name server being broken.

If no host is specified as an argument, you will be prompted for one. Ifa typescript file is specified,
all output is sent to that file in addition to being printed on the terminal.
The puplelllel program exits with the message [Connection Closed] when either the remote host or
the user closes the connection.
'rhe recognized options are:
-7

- open the connection in 7-bit character mode. This means that regardless of how many
bits per character your terminal sends, only the rightmost seven will be transmitted to the
distant host. This mode is necessary if you are using a terminal that does not generate
proper parily bits (such as a CIOQ) t.o connect to a host that insists on them (such as <;MU
or MIT).

-8

- open the connl:ction in ·g-bit character mode. This mode will be necessary if you arc
connecting to a machine wit.h 8-bit characters (like a VAX or IFS) and you want to control the parity bits sent in the connection. I f you arc using a terminal with an EDIT or
META key, for example, you will want to usc 8-bit connections.

-d
- wizards .only. Run in BSP diagnostic modc.
Commands can be entered to pup/clnel by typing the escape character, control up-arrow, which is
the same character that the TOPS-20 PIIJ)/e/llet program uses, and a command character. The
escape commands arc:
(control up-arrow) send the escape character

1'1'

-

c

- close the connection

Note that to send 11 escape characters, 2 to the power Il escape characters must be typed. The control up-arrow character is generated on t.he Tektronix 4025 and Alto keyboards by typing control
shift 6, and on the hazclline 1510 by control shill N.
AUTllon

Bitt Nowicki, also hacked by Jen' Mogul and (bcwarc!!!) by Brian Reid.
SEE ALSO·

The PUP protocol specifications (an internal Xerox memo), and the manual section describing the
Unix PUP package.
J)IA(jNOSTICS

All plIpLclnet messages llre enclosed in square brackets. Any abort messages sent by the remote
host are simply printed and the connection closed. If pup/dllet is unahle to open the required two
ethcrnet POItS:
[Sorry, no ethernct P()lts available]

7th I~dition

l,oeAL

·1

PUPfELNET(l)

UN IX Programmer's Manual

PUPTELNEt ( 1 )

If the connection times out, i.e. the remote host does not respond to timing packets in about 30-40
seconds, the message
[Connection closed - Tim~(}ut]
is printed.

BUGS

'rimeouts are very hard to implement correctly

one must compromise between impatient users

and slow systems.

7th Edttiotl

,LOCAl.

2-

PWD(l)

UNIX Programmer's Manual

PWD(l)

NAME
pwd - working directory name
SYNOPSIS
pwd
DESCRIPTION
Pwd prints the pathname of the working (current) directory.
SEE ALSO
cd(I), csh(I), getwd(3)

BUGS
In csh(1) the command dirs is always faster (although it can give a different answer in the rare
case that the current directory or a containing directory was moved after the shell descended
into it).

4th Berkeley Distribution

18 January 1983

1

PX(l)

UNIX Programmer's Manual

PX (I)

NAME
px - Pascal interpreter
SYNOPSIS

px [ obj [ argument ... ] ]
DESCRIPTION

Px interprets the abstract machine code generated by pi. The first argument is the file to be
interpreted, and defaults to obj; remaining arguments are available to the Pascal program using
the built-ins argv and argc. Px is also invoked by pix when running 'load and go'.
If the program terminates abnormally an error message and a control flow backtrace are printed.
The number of statements executed and total execution time are printed after normal termination. The p option of pi suppresses all of this except the message indicating the cause of abnormal termination.
FILES

obj
pmon.out

default object file
profile data file

SEE ALSO

Berkeley Pascal User's Manual
pi(I), pix(t)
DIAGNOSTICS

Most run-time error messages are self-explanatory. Some of the more unusual ones are:
Reference to an inactive file
A file other than input or output was used before a' call to reset or rewrite.
Statement count limit exceeded
The limit of 500,000 executed statements (which prevents excessive looping or recursion) has been exceeded.
Bad data found on integer read
Bad data found on real read
Usually, non-numeric input was found for a number. For reals, Pascal requires digits
before and after the decimal point so that numbers like '.1' or '21.' evoke the second
diagnostic.
panic: Some message
Indicates a internal inconsistency detected in px probably due to a Pascal system bug.
AUTHORS

Charles B. Haley, William Joy, and Ken Thompson
VAX-II version by Kirk McKusick
BUGS

Post-mortem traceback is not limited; infinite recursion leads to almost infinite traceback.

3rd Berkeley Distribution

8 April 1979

1

PXP(l)

UNIX Programmer's Manual

PXP (1)

NAME

pxp - Pascal execution profiler
SYNOPSIS

pxp [ - aedeQnstuw_] [ - 13456789 ] [ -

1 [

name ... ] ] name.p

DESCRIPTION

Pxp can be used to obtain execution profiles of Pascal programs or as a pretty-printer. To produce an execution profile all that is necessary is to translate the program specifying the 1 option
to pi or pix, to execute the program, and to then issue the command

name.p
A reformatted listing is output if none of the c, t, or 1 options are specified; thus
PXP

-I

pxp old.p > new.p
places a pretty-printed version of the program in 'old.p' in the file 'new.p'.
The use of the following options of pxp is discussed in sections 2.6, 5.4, 5.5 and 5.10 of the

Berkeley Pascal User's ManUtlI.

-a
-c
-d

Print the bodies of all procedures and functions in the profile; even those which were
never executed.
Extract profile data from the file core.
Include declaration parts in a profile.

-e

Eliminate Include directives when reformatting a file; the Include is replaced by the
reformatted contents of the specified file.

- f

Fully parenthesize expressions.
Left justify all procedures and functions.
Eject a new page as each file is included; in profiles, print a blank line at the top of the
page.

-J
-n
-5

Strip comments from the input text.

-t
-u
- w

Print a table summarizing procedure and function call counts.
Card image mode; only the first 72 characters of input lines are used.
Suppress warning diagnostics.
Generate an execution profile. If no name s, are given the profile is of the entire program. If a list of names is given, then only any specified procedures or functions and the
contents of any specified include files will appear in the profile.
Underline keywords.

- 1

- d

With d a digit, 2
default is 4.

~

d ~ 9, causes pxp to use d spaces as the basic indenting unit. The

FILES

name.p
input file
include file(s)
name.i
pmon.out
profile data
core
profile data source with -c
lusr/lib/how"pxp
information on basic usage

3rd Berkeley Distribution

8 April 1979

1

PXP (1)

UNIX Programmer's Manual

PXP( 1)

SEE ALSO

Berkeley Pascal User's Manual
pi(1), px(1)
DIAGNOSTICS

For a basic explanation do
psp

Error diagnostics include 'No profile data in file' with the e option if the J option was not
enabled to pi: 'Not a Pascal system core file' if the core is not from a px execution; 'Program
and count data do not correspond' if the program was changed after compilation, before
profiling; or if the wrong program is specified.
AUTHOR

William Joy
BUGS

Does not place multiple statements per line.

3rd Berkeley Distribution

8 April 1979

2

PXREP(l)

UNIX Programmer's Manual

PXREP(l)

NAME

pxref - Pascal cross-reference program
SYNOPSIS

pxref [ - ] name
DESCRIPTION

Pxrefmakes a line numbered listing and a cross-reference of identifier usage for the program in
name. The optional '-' argument suppresses the listing. The keywords loto and label are
treated as identifiers for the purpose of the cross-reference. Include directives are not processed, but cause the placement of an entry indexed by '#include' in the cross-reference.
SEE ALSO

Berkeley Pascal User's Manual
AUTHOR

Niklaus Wirth
BUGS

Identifiers are trimmed to 10 characters.

3rd Berkeley Distribution

8 April 1979

1

UNIX Programmer's tv1anual

I'U Tn.,.... "
\
'lVVA n , 1 I

NAME

quota - display disc usage and limits
SYNOPSIS
quota [ -qv ] [user]
DESCRIPTION

Quota displays users' disc usage and limits. Only the super-user may use the optional user argument to view the limits of users other than himself.
The -q flag prints a more terse message, containing only information on file systems where
usage is over quota.
If a -v flag is supplied, quota will also display user's quotas on file systems where no storage is
allocated.

Quota reports only on file systems which have disc quotas. If quota exits with a non-zero status,
one or more file systems are over quota.
SEE ALSO

quota(2), quotaon(8)

4th Berkeley Distribution

28 July 1983

1

RANLm(l)

UNIX Programmer's Manual

RANLIB(l)

NAME
ranlib - convert archives to random libraries
SYNOPSIS

ranllb archive ...
DESCRIPTION
Ranlib converts each archive to a form which the loader can load more rapidly. Ranlib does this
by adding a table of contents called _oSYMDEF to the beginning of the archive. Ranlib uses
arO)' to reconstruct the archive, so that sufficient temporary file space must be available in the

file system which contains the current directory.
SEE ALSO

Id(l), arO), 10rderO)

BUGS
Because generation of a library by ar and randomization of the library by ran lib are separate
processes, phase errors are possible. The loader, Id, warns when the modification date of a
library is more recent than the creation date of its dictionary; but this means that you get the
warning even if you only copy the library.

7th Edition

8 February 1983

1

RATFOR(I)

UNIX Programmer's Manual

RATFOR(I)

NAME
ratfor - rational Fortran dialect
SYNOPSIS

ratfor [ option ... ] [filename ... ]
DESCRIPTION

Raffor converts a rational dialect of Fortran into ordinary irrational Fortran. Raffor provides
control flow constructs essentially identical to those in C:
statement grouping:
{ statement; statement; statement }
decision-making:
if (condition) statement [ else statement ]
switch (integer value) {
case integer:
statement
[ default: ]

statement

loops: while (condition) statement
for (expression; condition; expression) statement
do limits statement
repeat statement [ until (condition) ]
break
next
and some syntactic sugar to make programs easier to read and write:
free form input:
multiple statements/line; automatic continuation
comments:
# this is a comment
translation of relationals:
>, > -, etc., become .OT., .OE., etc.
return (expression)
returns expression to caller from function
define: define name replacement
include:
include filename

Rat/or is best used with .177(1).
SEE ALSO

fi7(1)
B. W. Kernighan and P. J. Plauger, Software Tools, Addison-Wesley, 1976.

7th Edition

18 January 1983

1

Rep (Ie)

UNIX Programmer's Manual

Rep (Ie)

NAME

rcp - remote file copy
SYNOPSIS

rcp file 1 file2
rcp [ - r ] file ... directory
DESCRIPTION
Rep copies files between machines. Each file or directory argument is either a remote file name

of the form "rhost:path", or a local file name (containing no ':' characters, or a '/' before any
':'s.)
If the -r is specified and any of the source files are directories, rep copies each subtree rooted
at that name; in this case the destination must be a directory.
If path is not a full path name, it is interpreted relative to your login directory on rhost. A path
on a remote host may be quoted (using \, ", or ') so that the metacharacters are interpreted
remotely.
Rep does not prompt for passwords; your current local user name must exist on rhost and allow
remote command execution via rsh(lC).
Rep handles third party copies, where neither source nor target files are on the current machine.
Hostnames may also take the form "rhost.rname" to use rname rather than the current user

name on the remote host.
SEE ALSO

ftp(IC), rsh(IC), rlogin(IC)

BUGS
Doesn't detect all cases where the target of a copy might be a file in cases where only a directory should be legal.
Is confused by any output generated by commands in a .login, .profile , or .cshrc file on the
remote host.

4th Berkeley Distribution

17 March 1982

1

RCSINTRO ( 1 )

UNIX Programmer's Manual

RCSINTRO ( 1 )

NAME

rcsintro - introduction to ReS commands
DESCRIPTION

The Revision Control System (ReS) manages multiple revisions of text files. Res automates
the storing, retrieval, logging, identification, and merging of revisions. ReS is useful for text
that is revised frequently, for example programs, documentation, graphics, papers, form letters,
etc.
The basic user interface is extremely simple. The novice only needs to learn two commands: ci
and co. Ci, short for "checkin", deposits the contents of a text file into an archival file called an
ReS file. An ReS file contains all revisions of a particular text file. Co, short for "checkout",
retrieves revisions from an RCS file.
Functions of ReS
•
Storage and retrieval of multiple revisions of text. ReS saves all old revisions in a space
efficient way. Changes no longer destroy the original, because the previous revisions
remain accessible. Revisions can be retrieved according to· ranges of revision numbers,
symbolic names, dates, authors, and states.
•
Maintenance of a complete history of changes. Res logs all changes automatically.
Besides the text of each revision, ReS stores the author, the date and time of checkin,
and a log message summarizing the change. The logging makes it easy to find out what
happened to a module, without having to compare source listings or having to track
down colleagues.
•
Resolution of access conflicts. When two or more programmers wish to modify the
same revision, ReS alerts the programmers and prevents one modification from corrupting the other.
•
Maintenance of a tree of Revisions. ReS can maintain separate lines of development
for each module. It stores a tree structure that represents the ancestral relationships
among revisions.
•
Merging of revisions and resolution of contlicts. Two separate lines of development of
a module can be coalesced by merging. If the revisions to be merged affect the same
sections of code, Res alerts the user about the overlapping changes.
•

•

•

Release and configuration control. Revisions can be assigned symbolic names and
marked as released, stable, experimental, etc. With these facilities, configurations of
modules can be described simply and directly.
Automatic identification of each revision with name, revision number, creation time,
author, etc. The identification is like a stamp that can be embedded at an appropriate
place in the text of a revision. The identification makes it simple to determine which
revisions of which modules make up a given configuration.
Minimization of secondary storage. ReS needs little extra space for the revisions (only
the differences). If intermediate revisions are deleted, the corresponding deltas are
compressed accordingly.

Gettinl Started with ReS
Suppose you have a file f.c that you wish to put under control of ReS. Invoke the checkin command
ci f.c

Purdue University

6/29/83

1

RCSINTRO ( 1 )

UNIX Programmer's Manual

RCSINTRO ( 1 )

This command creates the RCS file f.c, v, stores f.c into it as revision 1.1, and deletes f.c. It
also asks you for a description. The description should be a synopsis of the contents of the file.
All later checkin commands will ask you for a log entry, which should summarize the changes
that you made.
Files ending in ,v are called RCS files ('v' stands for 'versions'), the others are called working
files. To get back the working file f.c in the previous example, use the checkout command
co f.c
This command extracts the latest revision from f.c, v and writes it into f.c. You can now edit f.c
and check it back in by invoking
ci f.c
Ci increments the revision number properly. If ci complains with the message
ci error: no lock set by 
then your system administrator has decided to create all RCS files with the locking attribute set
to 'strict'. In this case, you should have locked the revision during the previous checkout. Your
last checkout should have been
co -1 f.c
Of course, it is too late now to do the checkout with locking, because you probably modified f.c
already, and a second checkout would overwrite your modifications. Instead, invoke
res -1 f.c
This command will lock the latest revision for you, unless somebody else got ahead of you
already. In this case, you'll have to negotiate with that person.
Locking assures that you, and only you, can check in the next update, and avoids nasty problems if several people work on the same file. Even if a revision is locked, it can still be
checked out for reading, compiling, etc. All that locking prevents is a CHECKIN by anybody
but the locker.
If your RCS file is private, i.e., if you are the only person who is going to deposit revisions into
it, strict locking is not needed and you can tum it off. If strict locking is turned off, the owner
off the RCS file need not have a lock for checkin; all others still do. Turning strict locking off
and on is done with the commands
res -u f.c
and
res -L f.c
If you don't want to clutter your working directory with RCS files, create a subdirectory called
RCS in your working directory, and move all your RCS files there. RCS commands will look
first into that directory to find needed files. All the commands discussed above will still work,
without any modification. (Actually, pairs of RCS and working files can be specified in 3 ways:
(a) both are given, (b) only the working file is given, (c) only the RCS file is given. Both RCS
and working files may have arbitrary path prefixes; RCS commands pair them up intelligently).
To avoid the deletion of the working file during checkin (in case you want to continue editing),
invoke
ci -I f.c
or
ci -u f.c
These commands check in f.c as usual, but perform an implicit checkout. The first form also
locks the checked in revision, the second one doesn't. Thus, these options save you one
checkout operation. The first form is useful if locking is strict, the second one if not strict.
Both update the identification markers in your working file (see below).

Purdue University

6/29/83

2

RCSINTRO ( 1 )

UNIX Programmer's Manual

RCSINTRO ( 1 )

You can give ci the number you want assigned to a checked in revision. Assume all your revisions were numbered 1.1, 1.2, 1.3, etc., and you would like to start release 2. The command
ci -r2 f.c
or
ci -r2.1 f.c
assigns the number 2.1 to the new revision. From then on, ci will number the subsequent revisions with 2.2, 2.3, etc. The corresponding co commands
co -r2 f.c
and
co -r2.1 f.c
retrieve the latest revision numbered 2.x and the revision 2.1, respectively. Co without a revision number selects the latest revision on the "trunk", i.e., the highest revision with a number
consisting of 2 fields. Numbers with more than 2 fields are needed for branches. For example,
to start a branch at revision 1.3, invoke
ci -rl.3.1 f.c
This command starts a branch numbered 1 at revision 1.3, and assigns the number 1.3.1.1 to
the new revision. For more information about branches, see rcWle(S).
Automatic Identification
RCS can put special strings for identification into your source and object code. To obtain such
identification, place the marker
SHeaderS
into your text, for instance inside a comment. RCS will replace this marker with a string of the
form
SHeader: filename revision_number date time author state S
With such a marker on the first page of each module, you can always see with which revision
you are working. RCS keeps the markers up to date automatically. To propagate the markers
into your object code, simply put them into literal character strings. In C, this is done as follows:
static char rcsid[] - "SHeaderS";
The command ident extracts such markers from any file, even object code and dumps. Thus,
ident lets you find out which revisions of which modules were used in a given program.
You may also find it useful to put the marker SLogS into your text, inside a comment. This
marker accumulates the log messages that are requested during checkin. Thus, you can maintain the complete history of your file directly inside it. There are several additional
identification markers; see coU) for details.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.0 ; Release Date: 83/05/11 .
Copyright 0 1982 by Walter F. Tichy.
SEE ALSO

/

ci(l), coU), ident(l), merge(l), rcs(l), rcsdiffU), rcsmerge(l), rlog(l), rcsfile(S).
Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
Proceedings 0/ the 6th International Cotiference on Software Engineering, IEEE, Tokyo, Sept. 1982.

Purdue University

6/29/83

3

Res (1)

UNIX Programmer's Manual

Res (1)

NAME

res - change ReS file attributes
SYNOPSIS

res [ options ] file ...
DESCRIPTION
Res creates new ReS files or changes attributes of existing ones. An ReS file contains multiple

revisions of text, an access list, a change log, descriptive text, and some control attributes. For
res to work, the caller's login name must be on the access list, except if the access list is empty,
the caller is the owner of the file or the superuser, or the -I option is present.
Files ending in ',v' are ReS files, all others are working files. If a working file is given, res tries
to find the corresponding ReS file first in directory .IReS and then in the current directory, as
explained in eo (1).
-1
creates and initializes a new ReS file, but does not deposit any revision. If the
ReS file has no path prefix, res tries to place it first into the subdirectory .IReS,
and then into the current directory. If the ReS file already exists, an err.or message
is printed.
.
appends the login names appearing in the comma-separated list logins to the access
list of the ReS file.
- Ao/tUile appends the access list of olc(file to the access list of the ReS file.
-e[logins] erases the login names appearing in the comma-separated list logins from the access
list of the ReS file. If logins is omitted, the entire access list is erased.
-estring
sets the comment leader to string. The comment leader is printed before every log
message line generated by the keyword SLogS during checkout (see co). This is
useful for programming languages without multi-line comments. During res -i or
initial ci, the comment leader is guessed from the suffix of the working file.
-I [rev]
locks the revision with number rev. If a branch is given, the latest revision on that
branch is locked. If rev is omitted, the latest revision on the trunk is locked.
Locking prevents overlapping changes. A lock is removed with ei or res -u (see
below).
-u [rev]
unlocks the revision with number rev. If a branch is given, the latest revision on
that branch is unlocked. If rev is omitted, the latest lock held by the caller is
removed. Normally, only the locker of a revision may unlock it. Somebody else
unlocking a revision breaks the lock. This causes a mail message to be sent to the
original locker. The message contains a commentary solicited from the breaker.
The commentary is terminated with a line containing a single'.' or control-D.
- L
sets locking to strict. Strict locking means that the owner of an Res file is not
exempt from locking for checkin. This option should be used for files that are
shared.
sets locking to non-strict. Non-strict locking means that the owner of a file need
- U
not lock a revision for checkin. This option should NOT be used for files that are
shared. The default (-L or -U) is determined by your system administrator.
-a/ogins

-n name[: rev]

associates the symbolic name name with the branch or revision rev. Res prints an
error message if name is already associated with another number. If rev is omitted,
the symbolic name is deleted.
- N name[:rev]
same as

Purdue University

-D,

except that it overrides a previous assignment of name.

6/29/83

1

RCS(I)

UNIX Programmer's Manual

RCS (1)

-orange

deletes ("outdates") the revisions given by range. A range consisting of a single
revision number means that revision. A range consisting of a branch number
means the latest revision on that branch. A range of the form revl-rev2 means
revisions rev} to rev2 on the same branch, -rev means from the beginning of the
branch containing rev up to and including rev, and rev- means from revision rev to
the end of the branch containing rev. None of the outdated revisions may have
branches or locks.
-q
quiet mode; diagnostics are not printed.
-sstate(:rev]
sets the state attribute of the revision rev to state. If rev is omitted, the latest revision on the trunk is assumed; If rev is a branch number, the latest revision on that
branch is assumed. Any identifier is acceptable for state. A useful set of states is
Exp (for experimental), Stab (for stable), and Rei (for released). By default, ci sets
the state of a revision to Exp.
-t(adile] writes descriptive text into the RCS file (deletes the existing text). If rxf/ile is
omitted, res prompts the user for text supplied from the std. input, terminated with
a line containing a single'.' or control-D. Otherwise, the descriptive text is copied
from the file af/ile. If the -I option is present, descriptive text is requested even if
-t is not given. The prompt is suppressed if the std. input is not a terminal.

DIAGNOSTICS

The ReS file name and the revisions outdated are written to the diagnostic output. The exit
status always refers to the last RCS file operated upon, and is 0 if the operation was successful,
1 otherwise.
FILES

The caller of the command must have read/write permission for the directory containing the
RCS file and read permission for the RCS file itself. Res creates a semaphore file in the same
directory as the RCS file to prevent simultaneous update. For changes, res always creates a new
file. On successful completion, res deletes the old one and renames the new one. This strategy
makes links to RCS files useless.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.1 ; Release Date: 83/04/04 .
Copyright 0 1982 by Walter F. Tichy.
SEE ALSO

co (1), ci (1), ident(1), rcsdiff (1), rcsintro (1), rcsmerge (1), rIog (1), rcsfile (5), sccstorcs
(8).

Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
Proceedings of the 6th International Conference on Software Engineering, IEEE, Tokyo, Sept. 1982.
BUGS

Purdue University

6/29/83

2

RCSDIFF(1 )

UNIX Programmer's Manual

RCSDIFF (1)

NAME

rcsdiff - compare RCS revisions
SYNOPSIS

rcsdltr [ -b ] [ -eefho ] [ -rrevl] [ -rrev2 ] file ...
DESCRIPTION

RcsdIU runs dIU (1) to compare two revisions of each RCS file given. A file name ending in ',v'
is an RCS file name, otherwise a working file name. Rcsdiff derives the working file name from
the RCS file name and vice versa, as explained in co (1). Pairs consisting of both an RCS and a
working file name may also be specified.
The options -b, -e, -e, -f, and -b have the same effect as described in diU (1); option -0 generates an edit script of the format used by RCS.

If both rev} and rev2 are omitted, rcsdiffcompares the latest revision on the trunk with the contents of the corresponding working file. This is useful for determining what you changed since
the last checkin.
If rev} is given, but rev2 is omitted, rcsdiffcompares revision rev} of the RCS file with the contents of the corresponding working file.
If both rev} and rev2 are given, rcsdiffcompares revisions revl and rev2 of the ReS file.
Both rev} and rev2 may be given numerically or symbolically.
EXAMPLES

The command
rcsdiff f.c
runs diff on the latest trunk revision of RCS file f.c, v and the contents of working file f.c.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.0 ; Release Date: 83/01/15 .
Copyright 0 1982 by Walter F. Tichy.
SEE ALSO
ci (1), co (1), diff (1), ident (1), rcs (1), rcsintro (1), rcsmerge (1), rlog (1), rcsfile (5).

Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
Proceedings 0/ the 6th International Coriference on Software Engineering, IEEE, Tokyo, Sept. 1982.

BUGS

Purdue University

6/29/83

1

RCSMERGE ( 1 )

UNIX Programmer's Manual

RCSMERGE ( 1 )

NAME

rcsmerge - merge ReS revisions
SYNOPSIS

rcsmelle -rrevl [ -rrev2] [ -p ] file
DESCRIPTION

Rcsmerge incorporates the changes between revl and rev2 of an RCS file into the corresponding
working file. If -p is given, the result is printed on the std. output, otherwise the result
overwrites the working file.
A file name ending in ',v' is an RCS file name, otherwise a working file name. Merge derives
the working file name from the RCS file name and vice versa, as explained in co (1). A pair
consisting of both an RCS and a working file name may also be specified.
Revl may not be omitted. If rev2 is omitted, the latest revision on the trunk is assumed. Both
revl and rev2 may be given numerically or symbolically.
Rcsmerge prints a warning if there are overlaps, and delimits the overlapping regions as
explained in co -j. The command is useful for incorporating changes into a checked-out revi
sion.
e

EXAMPLES

Suppose you have released revision 2.8 of f.c. Assume furthermore that you just completed
revision 3.4, when you receive updates to release 2.8 from someone else. To combine the
updates to 2.8 and your changes between 2.8 and 3.4, put the updates to 2.8 into file f.c and
execute
resmerge -p -r2.8 -r3.4 f.c > f.merged.c
Then examine f.merged.c. Alternatively, if you want to save the updates to 2.8 in the ReS file,
check them in as revision 2.8.1.1 and execute co -J.
ci -r2.8.l.1 f.c
co -r3.4 -j2.8:2.8.1.1 f.c
As another example, the following command undoes the changes between revision 2.4 and 2.8
in your currently checked out revision in f.c.
rcsmerge -r2.8 -r2.4 f.c
Note the order of the arguments, and that f.c will be overwritten.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.0 ; Release Date: 83/01/15 .
Copyright CD 1982 by Walter F. Tichy.
SEE ALSO
ci (I), co (I), merge (1), ident

(0, res (1), rcsditf (I), rlog (I), rcsfile (5).
Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
. Proceedings of the 6th International Conference on Software Engineering, IEEE, Tokyo, Sept. 1982.

BUGS
Rcsmerge does not work for files that contain lines with a single '.'.

Purdue University

6/29/83

1

UNIX Programmcr's Manual

RDIST( 1)

RDIST( 1)

NAME

rdist - remote tIle distribution progrrun
SYNOPSIS

rdist [ -nqbIRvwy] [ -fdistmc] [ -d vnr=value] [name ... ]
r •=' '   

4th Berkeley Distribution

22 November 1983

1

RDIST( 1)

UNIX Programmer's Manual

RDIS'l'( 1)

The first format is used for defining variables. The second format is lIsed for distributing files to
other hosts. The third format is lIsed je)r mak ing lists of files that have been changed since SOlllC
given date. The source lisI specifles a list of files and/or directories on the local host whkh arc to
be lIsed as the master copy I<-H' distribut.ioll. The de.s'Iillalioll lisI is the list of hosts these files are to
be copied to. Each me in the source list is added to a list of changes if the file is out. or date on thc
host being updated (second /()nnat) or the file is newer than the time st
or
'('  ')'
The shell Illeul-characters T. T, 't', '}', '*', and'?' are recognized (md expanded (on the local host
only) in the same way ,IS csh(I). The ,-, character is also expanded iII the s ';'
 string ';'

The ills/all commanu is used to copy oUl of date files al1d/or directories. Each source file is copied
to each host in the "destinatioll list. I )ircctories are recursively copied in the same way.
OpcdesCllal11c is all oplional parameter to rell'IITlC flies. If no ills/all command appears in the
cOl1l1n;IIHI list or the destill,·'lion name is not specified, the source lile name is" used. I)irectories in
the path name will be created if they do not exist 011 the remote host. The optiol1s arc' - R', •- v',
• - w', '- y', anu '_." b' and have t.he sallie semantics as opt.iolls on t.he command line except they
only  dl selects
the revisions ,that were deposited betweendl and d2, (inclusive). A range of the
form  selects all revisions dated d or earlier. A range of the form d< or
>d selects all revisions dated d or later. A range of the form d selects the single,
latest revision dated d or earlier. The date/time strings d, dl, and d2 are in the free
format explained in co (1). Quoting is normally necessary, especially for < and >.
Note that the separator is a semicolon.
-I [lockers]
prints information about locked revisions. If the comma-separated list lockers of
login names is given, only the revisions locked by the given login names are printed.
If the list is omitted, all locked revisions are printed.
-rrevisions
prints information about revisions given in the comma-separated list revisions of
revisions and ranges. A range revl-rev2 means revisions revl to rev2 on the same
branch, -rev means revisions from the beginning of the branch up to and including
rev, and rev- means revisions starting with rev to the end of the branch containing
rev. An argument that is a branch means all revisions on that branch. A range of
branches means all revisions on the branches in that range.
-sstates prints information about revisions whose state attributes match one of the states
given in the comma-separated list states.
-",[Iogins]
prints information about revisions checked in by users with login names appearing in
the comma-separated list logins. If logins is omitted, the user's login is assumed.

Purdue University

6/29/83

1

READNEWS ( 1 )

UNIX Programmer's Manual

READNEWS ( 1)

RAIlE

readnews - read news articles
SYNOPSIS

readnews [ -a d.a.te ] [ -n newsgroups ] [ -t titles ] [ -lprxbfuJI ] [ -c [ mailer ]

]
readnews-s
There are several interfaces
Interface
A m.sgs{l) like interface.
An interface to Mail(l).
-K
A Ibin/m.a:il{ 1)-like interface.
-c
-c "mailer"
All selected articles written to a temporary file. Then the mailer is
invoked. The name of the temporary me is referenced with a U%".
Thus, "mail -f %" will invoke mail on a temporary file consisting of all
selected messages.
-p
All selected articles are sent to the standard output. No questions
asked.
-l
Only the titles output. The .newsrc file will not be updated.
The -I" nag causes the articles to be printed in reverse order. The -f flag
prevents any followup articles from being printed. The -h flag causes articles to
be printed in a less verbose format, and is intended for terminals running at 300
baud the -u. flag causes the .newsrc tile to be updated every 5 minutes, in case
of an unreliable system. (Note that if the newsrc flle is updated, the ][ command
will not restore it to its original contents.)
The following flags determine the selection of articles.
-n newsgroups
Select all articles that belong to newsgroups.
-t titles Select all articles whose titles contain one of the strings specified by
titles.
-a [d.ate ]
Select all articles that were posted past the given d.ate (in getda.te(3)
format).
-1[
Ignore .ne'-IJSTC file. That is, select articles that have already been read
as well as new ones.
readne1LS maintains a .ne'UBrC file in the user's home directory that specifies all
news articles already read. It is updated at the end of each reading session in
which the ~ or -l options weren't specified. If the environment variable
NEWSRC is present, it should be the path name of a file to be used in place of
.newsrc.
If the user wishes, an options line may be placed in the .newsrc file. This line
starts with the word options (left justified) followed by the list of standard
options just as they would be typed on the command line. Such a list may
include: the -n tlag along with a newsgroup list; a favorite interfac e; and/or the
Flag
default

4th Berkeley Distribution

28 July 1983

1

READ NEWS ( 1)

UNIX Programmer's Manual

READNEWS ( 1 )

-r or --t flag. Continuation lines are specified by following lines beginning with a
space or tab character. Similarly, options can be specified in the NEWSOPl'S
environment parameter. Where conflicts exist, option on the command line take
precedence, followed by the .'11.SWSTC options line, and lastly the NEWSOPl'S
parameter.
readnews -s will print the newsgroup subs~ription list.
When the user uses the reply command of the msgs(l) or /bin/mail(l} interfaces, the environment parameter :MAILER will be used to determine which
mailer to use. The default is usually /bin/mail.
If the user so desires, he may specify a specific paging progam for articles. The
environment parameter PAGER should be set to the paging program. The name
of the article is referenced with a '%', as in the -c option. If no '%' is present.
the article will be piped to the program. Paging may be disabled by setting
PAGER to a null value.
mIDlANDS
This section lists the commands you can type to the msgs and /bin/mail interface prompts. The msgs interface will suggest some common commands in
brackets. Just hitting return is the same as typing the first command. For
example, "[ynq]" means that the commands lIy" (yes). lin" {no}. and IIq" (quit)
are
common
responses.
and
that
"y"
is
the
default.
Command
Meaning
y
Yes. Prints current article and goes on to next.
n
No. Goes on to next article without printing current one. In the
/bin/mail interface, this means "go on to the next article". which will
have the sarne effect as "y" or just hitting return.
q
Quit. The .newsrc tlle will be updated if -lor -x were not on the command line.
c
Cancel the article. Only the author or the super user can do this.
r
Reply. Reply to article's author via mail. You are placed in your EDITOR
with a header specifying To, Subject, and References lines taken from the
message. You may change or add headers, as appropriate. You add the
text of the reply after the blank line, and then exit the editor. The resulting message is mailed to the author of the article.
rd
Reply directly. You are placed in $MAlLER ("mail" by default) in reply to
the author. Type the text of the reply and then control-D.
f

[title]

fd

Submit a follow up article. Normally you should leave off the title, since
the system will generate one for you. You will be placed in your EDITOR to
compose the text of the followup.
Followup directly. without edited headers. This is like f. but the headers
of the article are not included in the editor buffer.

N [newsgro'Up]
Go to the next newsgroup or named newsgroup.

s [file]
Save. The article is appended to the named me. The default is "Articles".
If the first character of the file name is '1', the rest of the tile name is
taken as the name of a program. which is executed with the text of the

4th Berkeley Distribution

28 July 1983

2

READNEWS ( 1 )

UNIX Programmer's Manual

READ NEWS ( 1 )

article as standard input. If the first character of the file name is '1', it is
taken as a full path name of a tile. If SNEWSBOX (in the environment) is
set to a full path name, and the file contains no '1', the tile is saved in
$NEWSBOX. Otherwise, it is saved relative to SHOME.
I
Report the name and size of the newsgroup.
e
Erase. Forget that this article was read.
h
Print a more verbose header.
H
Print a very verbose header, containing all known information about the
article.
U
Unsubscribe from this newsgroup. Also goes on to the next newsgroup.
d
Read a digest. Breaks up a digest into separate articles and permits you
to read and reply to each piece.
D
Decrypt. Invokes a Caesar decoding program on the body of the message.
This is used to decrypt rotated jokes posted to net.jokes. Such jokes 'are
usually obscene or otherwise offensive to some groups of people, and so
are rotated to avoid accidental decryption by people who would be
offended. The title of the joke should indicate the nature of the problem.
enabling people to decide whether to decrypt it or not.
Normally the Caesar program does a character frequency count on each line of
the article separately, so that lines which are not rotated will be shown in plain
text. This works well unless the line is short, in which case it sometimes gets the
wrong rotation. An explicit number rotation (usually 13) may be given to force a
particular shift.
v
Print the current version of the news software.
Shell escape.

'number
Go to number.

+[n]

Skip n articles. The articles skipped are recorded as "unread~' and will
be offered to you again the next time you read news.
Go back to last article. This is a toggle, typing it twice returns you to the
original article.
Exit. Like quit except that .newsrc is not updated

x
X system
Transmit article to the named system.
The commands c, f. fd. r, rd, e, h, H, and s can be followed by -'s to refer to the
previous article. Thus. when replying to an article using the msgs interface, you
should normally type "r-" (or lire-") since by the time you enter a command,
you are being otferred the next article~
EDYPIES

readnews
Read all unread articles using the msgs(l) interface. The .newsrc file
is updated at the end of the session.
readnews -c Iled X" -I.
· Invoke the ed{ 1) text editor on a file containing the titles of all unread
articles. The .neusrc file is not updated at the end of the session.

4th Berkeley Distribution

28,July 1983

3

R,E.A.DNEWS ( 1 )

UNIX Programmer's Manual

READNEWS ( 1)

readnews -n all !fa.all -II --r
Read all unread articles except articles whose newsgroups begin with
"fa." via Mail(l) in reverse order. The .ne'WS1"C tile is updated at tbe
end of the session.
readnews -p -n all-e.last thursday
Print every unread article since last Thursday. The .newsrc tile is
updated at the end of the session.
readnews -p > I devI null Be
Discard all unread news. This is. useful after returning from a long trip.
_, /usr /spool/news/newsgroup /number
News articles
Active newsgroups and numbers of articles
/usr/lib/news/active
Help file for m.sgs(l) interface
lusr /lib/news/help
Options and list of previously read articles
-/.newsrc

sa ALSO
checknews(l). inews(l). sendnews{B). recnews{B). uurec{B). msgs(l). Mail{l).
mail(l). news(5). newsrc(5)
AUTHORS

Matt Glickman
Mark Horton
Stephen Daniel
Tom R. Truscott

4th Berkeley Distribution

28 July 1983

(.

REFER (1)

REFER (1)

UNIX Programmer's Manual

NAME

refer - find and insert literature references in documents
SYNOPSIS
refer [ -a ] [ -b ] [ -c ] [ -e ] [ -fn] [ -kx] [ -Im,n] [
- B/.m] [ - p ] [
[file ... ]

-s ]

-0 ] [

-p bib] [ -skeys] [

DESCRIPTION

Refer is a preprocessor for nroff or troff(l} that finds and formats references for footnotes or
endnotes. It is also the base for a series of programs designed to index, search, sort, and print
stand-alone bibliographies, or other data entered in the appropriate form.
Given an incomplete citation with sufficiently precise keywords, refer will search a bibliographic
database for references containing these keywords anywhere in the title, author, journal, etc.
The input file (or standard input) is copied to standard output, except for lines between . [ and
.1 delimiters, which are assumed to contain keywords, and are replaced by information from the
bibliographic database. The user may also search different databases, override particular fields,
or add new fields. The reference data, from whatever source, are assigned to a set of (roff
strings. Macro packages such as ms(7) print the finished reference text from these strings. By
default references are flagged by footnote numbers.
The following options are available:

-ar Reverse the first n author names (Jones, J. A. instead of J. A. Jones). If n is omitted all
author names are reversed.
-b Bare mode: do not put any flags in text (neither numbers nor labels).
-ckeys
Capitalize (with CAPS SMALL CAPS) the fields whose key-letters are in keys.

-e

Instead of leaving the references where encountered, accumulate them until a sequence
of the form

.[

SLISTS

.]

is encountered, and then write out all references collected so far. Collapse references to
same source.
-fn

Set the footnote number to n instead of the default of 1 (one). With labels rather than
numbers, this flag is a no-op.

- kx Instead of numbering references, use labels as specified in a reference data line beginning %x; by default x is L.

-Im,n
Instead of numbering references, use labels made from the senior author's last name and
the year of publication. Only the first m letters of the last name and the last n digits of
the date are used. If either m or n is omitted the entire name or date respectively is
used.
-0
Do not search the default file lusr/dict/papers/lnd. If there is a REFER environment
variable, the specified file will be searched instead of the default file; in this case the - 0
flag has no effect.
-p bib
Take the next argument bib as a file of references to be searched. The default file is
searched last.
-skeys
Sort references by fields whose key-letters are in the keys string; permute reference

4th Berkeley Distribution

18 July 1983

1

REFER (I)

UNIX Programmer's Manual

REFER (1)

numbers in text accordingly. Implies -e. The key-letters in keys may be followed by a
number to indicate how many such fields are used, with + taken as a very large number.
The default is AD which sorts on the senior author and then date; to sort, for example,
on all authors and then title use -sA +T.

-B/.m
Bibliography mode. Take a file composed of records separated by blank lines, and turn
them into troffinput. Label I will be turned into the macro .m with I defaulting to %X
and .m defaulting to .AP (annotation paragraph).
- P

Place punctuation marks .,:;?! after the reference signal, rather than before. (Periods
and commas used to be done with strings.)

-5

Produce references in the Natural or Social Science format.

To use your own references, put them in the format described below. They can be searched
more rapidly by running indxbib(I) on them before using refer; failure to index results in a
linear search. When refer is used with the eqn, neqn or tbl preprocessors refer should be first, to
minimize the volume of data passed through pipes.
The refer preprocessor and associated programs expect input from a file of references composed
of records separated by blank lines. A record is a set of lines (fields), each containing one kind
of information. Fields start on a line beginning with a HOlo", followed by a key-letter, then a
blank, and finally the contents of the field, and continue until the next line starting with H%".
The output ordering and formatting of fields is controlled by the macros specified for nro./lltroff
(for footnotes and endnotes) or rojJbib (for stand-alone bibliographies). For a list of the most
common key-letters and their corresponding fields, see addbib(I). An example of a refer entry
is given below.
EXAMPLE

%A
%T

%B
%V
%1
%C

%D

M. E. Lesk
Some Applications of Inverted Indexes on the UNIX System·
UNIX Programmer's Manual
2b
Bell Laboratories
Murray Hill, NJ
1978

FILES

/usr/diet/papers
/usr/lib/refer

directory of default publication lists
directory of companion programs

SEE ALSO

addbib(1), sortbib(I), roftbib(1), indxbib(I), lookbib(l)
AUTHOR

Mike Lesk
BUGS

Blank spaces at the end of lines in bibliography fields will cause the records to sort and reverse
incorrectly. Sorting large numbers of references causes a core dump.

4th Berkeley Distribution

18 July 1983

2

RE1;lLE(1)

UNIX

Programmer~s

REFILE(l)

Manual

NAME

refile -.- file message(s) in (an)othcr folder(s)
SYNOPSIS

refile [ - src + folder] [ msgs ] [ -·link ] [ - preserve]
- file file ] [ -. nofile ] [ - help]

+ folder

... [ - nolink] [ - nopreserve ] [

DESCRIPTION

Rejile moves (mv(1» or links (lnO» messages from a source folder into one or more destination
folders. 1f you think of a message as a sheet of paper, this operation is not unlike filing the sheet of
paper (or copies) in file cabinet JDlders. When a message is refiled, it is linked into t.he destination
folder(s) if possible, and is copied otherwise. As long as the destination folders are all on the same
file system, multiple f11ing causes little storage overhead. 111is fltcility provides a good way to
cross-file or mUltiply-index messages. For example, if a message is received from Jones about the
ARPA Map Project, the command
.
refile cllr

+ jones

-I- Map

would allow the message to be found in either of Lhe two folders 'jones' or 'Map'.
The option' - file fi1e' directs refill' to use the specified file as the source message to be filed, rather
than a message from a folder.

If a destination foldcr doesn't exist, refile wilt ask if you want to create one ..' A negative response
will abort the reme operation.
•-link' preserves the sollrce f()lder copy of the message (i.e., it does a 11I(l) rather than a 1IIl'( 1),
whereas, '-nolink' deletes the "ref1\cd" Illcssages fi'o11l the source folder. Normally, when a message is refiled, it is assigned the next highest number available in each or the destination n)\ders.
Usc of the' - preserve' switch will override this message "renaming", but name conflicts may occur,
so use this switch cautiollsly. (Sec pick ()t' more details on message numbering.)
rf '-link' is not specHled (or '- nolink' is specif1cd), the refiled messages

will

be removed (

ulllink(2» lI'om the source folder.

If' - src + folder' is given,' it will become the current folder for future Mil c·ornmallds. I f neither
'-link' nor 'all' arc specified, the current message in the source (llde!' will be set to the last message specified; oU1erwise, the current Illl'ssage won't be changed.
FILI~

$HOM H/mlLprofile
pnOFILE

The user pronte

COMPONI~NTS

Path:
Current-I :older:
Folder-- Protect:

To determine the user's M II directory
To find Lhe delimit current folder

To set Illode when creating a new folder

DEFAULTS

•- src + (()Ider' del1tults to the current Iblder
'msgs' dcf~llIlts to cur
'- nolink'
•- nopreserve'
'- nofi1e'
CONTI~XT

If '~src +. «)Ider' is given, it wi11 hecolne the cllrrent folder for future Mil cOlT1llwnds. If neither
•-link' nor 'all' arc specified, the current mess4Ig<.' in the source 1()lder will be set to the last message specified; otherwise, the current message WO\l't be changed.

4th Berkeley Distribution

3 August 1983

1 .

REMOTE(l)

UNIX Programmer's Manual

REMOTE( 1)

NAME

remote - Remote command execution
SYNOPSIS

hosl [-d] command [args.. .]
DESCRIPTION
Remote is a program used to execute commands on another host in a PUP inter-network. It uses
the PUP rtp protocol, so the commands can only be clone on a host which is running all flp server

program, slIch as the Unix time-sharing systems. A special escape mechanism is used, so not even
all flp servers are guanll1teed to work. You must have a valid user name and password stored in
your home directory with the Ilcla/ia.s(l) feature or the fJupJip{ I) program.
The· hOSI is specified as the "zcr()th" ai·gllllicnt, which' li1e~lI1s·t\'alid hosts will be linked to the
remote program. If t.he "zeroth" argument is remote, then the first argument is the host name, and
the remote command is the second through the last. I"or example, to finger the user named smith
on the machine named Shasta, use the comllland
shasta finger smith
The standard output of the command is sent to the currently open standard output rile, which may
be redirected or piped in the lIsual manner. The -d option will print out some debugging infbrmalion, like the ftp property lists being sent and recieved.
SEE ALSO

pupftp( 1), tclnet(l), netalias( 1), ftpser(8)
AUTUOR

Bi1l Nowicki
BUGS

There should be a way of supplying input to a COllllllCllld, and executing a subset or commands
(1ike "finger") 011 hosts on which the user docs not have an accollnt. This should be invoked
automagically by a command of the rorlll "finger lIser(i{lllOst".

7th Edition

1

REPL(1)

UNIX Programmer's Manual

REPL(t)

repl - reply to a message
SYNOPSIS

repl [ +folder ] [ msg ] [ -editor editor] [ -inplace ] [ -annotate] [ -help] [
-noinplace] [ -noannotate ]
DESCRIPTION

Repl aids a user in producing a reply to an existing message. In its simplest
form (with no arguments), it will set up a message-form skeleton in reply to the
current message in the current folder, invoke the editor, and send the composed message if so directed. The composed message is constructed as follows:
To:  or 
cc: , 
Subject: Re: 
In-reply-to: Your message of 

where field names enclosed in angle brackets « » indicate the contents of the
named field from the message to which the reply is being made. Once the skeleton is constructed, an editor is invoked (as in camp, d.ist, andJorw). While in the
editor, the message being replied to is available through a link named "@". In
NED, this means the replied-to message may be "used" with "use @", or put in a
window by "window @" •
As in camp, d.ist, and /orw, the user will be queried before the message is sent.
If I-annotate' is specified, the replied-to message will be annotated with the single line
Replied: Date.
The command "comp -use" may be used to pick up interrupted editing, as in
cJist and /orw; the '-inplace' switch annotates the message in place, so that all
folders with links to it will see the annotation.
$HOME/mh~roflle

 / draft
/usr/bin/send

The user profile
The constructed message file
To send the composed message

PROFILE COMPONENTS

Path:
Editor:
Current-Folder:

To determine the user's MH directory
To override the use of /bin/ned as the default editor
To find the default current folder

IEP'AOLTS

'+folder' defaults to current
'msgs' defaults to cur
'-editor' defaults to /bin/ned
'-no annotate ,
'-noinplace'

mNTEXr

If a '+folder' is specified, it will become the current folder, and the current m·es~
sage will be set to the replied-to message.

4th Berkeley Distribution

3 August 1983

1

I

RESET (1)

UNIX Programmer's Manual

RESET (1)

NAME

reset - reset the teletype bits to a sensible state
SYNOPSIS

reset
DESCRIPTION

Reset sets the terminal to cooked mode, turns off cbreak and raw modes, turns on nl, and
restores special characters that are undefined to their default values.
This is most useful after a program dies leaving a terminal in a funny state; you have to type
"reset" to get it to work then to the shell, as  often doesn't work; often
none of this will echo.
It is a good idea to follow reset with tset(I)
SEE ALSO

stty(1), tset(I)

BUGS
Doesn't set tabs properly; it can't intuit personal choices for interrupt and line kill characters,
so it leaves these set to the local system standards.

4th Berkeley Distribution

18 July 1983

1

REV(I)

UNIX Programmer's Manual

REV ( 1)

NAME

rev - reverse lines of a file
SYNOPSIS
rev [ file] ...
DESCRIPTION

Rev copies the named files to the standard output, reversing the order of characters in every
line. If no file is specified, the standard input is copied.

7th Edition

18 January 1983

1

REV68(l)

UNIX Programmer's Manual

REV68(1)

NAME

rev68 - reverse byte order in 68000 .h and .68 (b.out) tiles
SYNOPSIS

rcv68 infilc [ outfilc ... ]
[)ESCr~IPTION

/?ev68 translates .b and .68 (b.Ollt) files into a form readable hy the 68000. This entails reversing
the byte urder within short and long words. and rearranging structs to agree with the c68 interprcta*
lion of stlucts.

The transform(ltions that take place are: the 8 longs in the header (including the magic number)
are each byte reversed; the text. and data segments are lInclwngl'd~ the symbol segment is nlOdificd
so that t.he strllct defining the type and value of the symbol !its in 6 bytes instead of 8 (to agree with
the c68 interpretation of strllct sym in lusr/sun/td68/b.olll.h): each symbol is. padded with all extra
o if necessary to force word alignment; and the relocation commands arc repacked to agree with
the e68 interpretation of strllet reloc in lusr/sun/ld68/b.out.h.
The output is written to olltfile, which if not specified dct~llIlts to r.out. The outPllt wil'l be slIwller
than the input unless there nre no symbols or relocation commands.
The intent is that ('.out Hies not be the input to any Unix program, but that they be sent directly to
the 68000 as a byte stream.
AUTIIOI{

v.ll. Pratt

7t.h Edition

t .

UN IX Programmer's Manual

RL68(1)

RL68(1)

NAME

rI68 - print relocation commands in a .b file for the 68000
SYNOPSIS

rl68 infilc
OESCIUPTION

RI68 print') the relocation commands in a 68000 .h file. The format for each command is:
AREA SEGMENT SIZE

Displacement Symbol

The AREA is one of T or D according to whether the command acts on Text or Data. The SEGM ENT is one of T, D, n, or E, according to whethcr the object linked to is in Text, Data, Of Bss,
oris External. The SIZE is one of B, W. or L, according to whether the object linked to is of size
Byte, Word. Of Long. The' Displacemcht' iJiditale~ whci;c in thc· t\ REA the --command is to be
applied. The Symbol is lhe symboJic name of the object linked to if any.
The correspondence with struct rc10c (defined in /usr/sun/ld68/b.OiILh) is as follows. SEGM ENT
is rscgmcnt and SIZE is fsize. Displacemcnt is rdisp. Symbol is determincd thnll rsymbol, a short
which is the symbol id. AREA is determined by the area in which the relocation command is
found, there being two stich areas.

RELATED
nm68, sizc68, pr68, lorder68

AUTHOR
C..J. Tcrman

7th Edition

1

RLOO(l)

UNIX Programmer's Manual

Rlog prints the intersection of the revisions selected with the options -tI, -I,

RLOO(l)

-5,

-w, intersected

with the union of the revisions selected by -b and -r.
EXAMPLES

rlol
rlol
rlol
rlol

-L -R ReS/-,v
-L -h ReS/-,v
-L -I ReS/-, v
RCS/-, v

The first command prints the names of all RCS files in the subdirectory 'RCS' which have
locks. The second command prints the headers of those files, and the third prints the headers
plus the 101 messales of the locked revisions. The last command prints complete information.
DIAGNOSTICS

The exit status always refers to the last RCS file operated upon, and is 0 if the operation was
successful, 1 otherwise.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.2 ; Release Date: 83/05/11 .
Copyright CD 1982 by Walter F. Tichy.
SEE ALSO
ci (1), co (1), ident(1), rcs (1), rcsdiff (1), rcsintro (1), rcsmerge (1), rcsfile (5), sccstorcs (8).

Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
Proceedings of the 6th International Cotiference on Software Engineering, IEEE, Tokyo, Sept. 1982.
BUGS

Purdue University

6/29/83

2

RLOG(l)

UNIX Programmer's Manual

RLOG (1)

NAME

rlog - print log messages and other information about ReS files
SYNOPSIS

rlOl [ options ] file ...
DESCRIPTION
Rlog prints information about ReS files. Files ending in ',v' are ReS files, all others are working files. If a working file is given, rlog tries to find the corresponding ReS file first in directory
.IReS and then in the current directory, as explained in co (0.

Rlog prints the following information for each ReS file: ReS file name, working file name,
head (i.e., the number of the latest revision on the trunk), access list, locks, symbolic names,
suffix, total number of revisions, number of revisions selected for printing, and descriptive text.
This is followed by entries for the selected revisions in reverse chronological order for each
branch. For each revision, rlog prints revision number, author, date/time, state, number of
lines added/deleted (with respect to the previous revision), locker of the revision (if any), and
log message. Without options, rlog prints complete information. The options below restrict
this output.
- L
ignores ReS files that have no locks set; convenient in combination with -R, -h, or
-I.
- R
only prints the name of the ReS file; convenient for translating a working file name
into an ReS file name.
- h
prints only ReS file name, working file name, head, access list, locks, symbolic
names, and suffix.
-t
prints the same as -h, plus the descriptive text.
-ddates prints information about revisions with a checkin date/time in the ranges given by
the semicolon-separated list of dates. A range of the form dl < d2 or d2> dl selects
the revisions .that were deposited between dl and d2, (inclusive). A range of the
form  selects all revisions dated d or earlier. A range of the form d< or
> d selects all revisions dated d or later. A range of the form d selects the single,
latest revision dated d or earlier. The date/time strings d, dl, and d2 are in the free
format explained in co (1). Quoting is normally necessary, especially for < and >.
Note that the separator is a semicolon.
-I [lockers]
prints information about locked revisions. If the comma-separated list lockers of
login names is given, only the revisions locked by the given login names are printed.
If the list is omitted, all locked revisions are printed.
-rrevisions
prints information about revisions given in the comma-separated list revisions of
revisions and ranges. A range revl-rev2 means revisions revl to rev2 on the same
branch, -rev means revisions from the beginning of the branch up to and including
rev, and rev- means revisions starting with rev to the end of the branch containing
rev. An argument that is a branch means all revisions on that branch. A range of
branches means all revisions on the branches in that range.
-sstales prints information about revisions whose state attributes match one of the states
given in the comma-separated list states.
-w[logins]
prints information about revisions checked in by users with login names appearing in
the comma-separated list logins. If logins is omitted, the user's login is assumed.

Purdue University

6/29/83

1

RLOG(I)

UNIX Programmer's Manual

nOG (1)

Rlog prints the intersection of the revisions selected with the options -tI, -I, -5, -w, intersected
with the union of the revisions selected by -It and -r.
EXAMPLES

rlol
rlol
rlol
rlol

-L -R RCS/-, v
-L -h RCS/-, v
-L -I RCS/-,v
RCS/-, v

The first command prints the names of all RCS files in the subdirectory 'RCS' which have
locks. The second command prints the headers of those files, and the third prints the headers
plus the 101 messales of the locked revisions. The last command prints complete information.
DIAGNOSTICS

The exit status always refers to the last RCS file operated upon, and is 0 if the operation was
successful, 1 otherwise.
IDENTIFICATION

Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
Revision Number: 3.2 ; Release Date: 83/05/11 .
Copyrilht 0 1982 by Walter F. Tichy.
SEE ALSO
ci (1), co (1), ident(1), res (1), rcsdiff (1), rcsintro (1), rcsmerle (1), resfile (5), sccstorcs (8).

Walter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control System," in
Proceedings 0/ the 6th International Cotiference on Software Engineering, IEEE, Tokyo, Sept. 1982.
BUGS

Purdue University

6129/83

2

RLOGIN (IC)

UNIX Programmer's Manual

RLOGIN (Ie)

NAME

rlogin - remote login
SYNOPSIS

rlogin rhost [ - e c 1 [ -I username
rhost [ -ec] [ -I username ]

1

DESCRIPTION

Rlogin connects your terminal on the current local host system Ihost to the remote host system
rhost.
Each host has a file letclhosls.equiv which contains a list of rhosts with which it shares account
names. (The host names must be the standard names as described in rshOC).) When you rio ..
gin as the same user on an equivalent host, you don't need to give a password. Each user may
also have a private equivalence list in a file .rhosts in his login directory. Each line in this file
should contain a rhost and a username separated by a space, giving additional cases where logins
without passwords are to be permitted. If the originating user is not equivalent to the remote
user, then a login and password will be prompted for on the remote machine as in 10ginO). To
avoid some security problems, the .rhosts file must be owned by either the remote user or root
and may not be a symbolic link.
Your remote terminal type is the same as your local terminal type (as given in your environ ..
ment TERM variable). All echoing takes place at the remote site, so that (except for delays)
the rlogin is transparent. Flow control via AS and AQ and flushing of input and output on interrupts are handled properly. A line of the form "-." disconnects from the remote host, where
H·U is the escape character.
A different escape character may be specified by the -e option.
There is no space separating this option flag and the argument character.
SEE ALSO

rshOe)
FILES

lusr Ihosts/.

for rhost version of the command

BUGS
More terminal characteristics should be propagated.

4th Berkeley Distribution

10 February 1983

1

u~1X

RM(l)

ProgratTuuer'S ~fanual

RM(l)

NAME

nn, rmdir - remove (unlink) files or directories
SYNOPSIS

rm [ -f) [ -r] [ -I ] [ - ] file ...
rmdlr dir ...
DESCRIPTION

Rm removes the entries for one or more files from a directory. If an entry was the last link to
the file, the file is destroyed. Removal of a file requires write permission in its directory, but
neither read nor write permission on the file itself.
If a file has no write permission and the standard input is a terminal, its permissions are printed
and a line is read from the standard input. If that line begins with 'y' the file is deleted, otherwise the file remains. No questions are asked and no errors are reported when the -f (force)
option is given.
If a designated file is a directory, an error comment is printed unless the optional argument - r
has been used. In that case, rm recursively deletes the entire contents of the specified directory, and the directory itself.

If the -I (interactive) option is in effect, rm asks whether to delete each file, and, under -r,
whether to examine each directory.
The null option - indicates that all the arguments following it are to be treated as file names.
This allows the specification of file names starting with a minus.
Rmdir removes entries for the named directories, which must be empty.
SEE ALSO

rmU), unlink(2), nndir(2)

4th Berkeley Distribution

1 April 1981

1

RMAIL (I)

UNIX Programmer's Manual

RMAIL (1)

NAME

rmail - handle remote mail received via uucp
SYNOPSIS

rman user ...
DESCRIPTION

Rmail interprets incoming mail received via uucpUC) , collapsing "From" lines in the form
generated by binmail(l) into a single line of the form "return-path!sender", and passing the
processed mail on to sendmail(8).
Rmail is explicitly designed for use with uucp and sendmail.
SEE ALSO

binmaiI(l), uucp(1C), sendmail(8)

BUGS
Rmail should not reside in Ibin.

4th Berkeley Distribution

2 April 1983

1

RMDIR (1)

UNIX Programmer's Manual

RMDIR(I)

NAME

rmdir, rm - remove (unlink) directories or files
SYNOPSIS

rmdlr dir ...
rm [ -f] [ -r] [ -I] [ - ] file ...
DESCRIPTION

Rmdir removes entries for the named directories, which must be empty.
Rm removes the entries for one or more files from a directory. If an entry was the last link to
the file, the file is destroyed. Removal of a file requires write permission in its directory, but
neither read nor write permission on the file itself.
If a file has no write permission and the standard input is a terminal, its permissions are printed
and a line is read from the standard input. If that line begins with 'y' the file is deleted, otherwise the file remains. No questions are asked and no errors are reported when the -f (force)
option is given.
If a designated file is a directory, an error comment is printed unless the optional argument - r
has been used. In that case, rm recursively deletes the entire contents of the specified directory, and the directory itself.
If the -1 (interactive) option is in effect, rm asks whether to delete each file, and, under -r,
whether to examine each directory.
The null option - indicates that all the arguments following it are to be treated as file names.
This allows the specification of file names starting with a minus.
SEE ALSO

rm(1), unlink(2), rmdir(2)

7th Edition

1 April 1981

1

RMF{ 1}

UNIX Programmer's Manual

RMF{ 1}

rmf - remove folder
SYNOPSlS

rmf [ +folder ] [ -help ]
DGDdPIION

Rm/ removes all of the files (messages) within the specified (or default) folder,
and then removes the directory (folder). If there are any tiles within the folder
which are not a part of MH, they will not be removed, and an error will be produced. If the folder is given explicitly or the current folder is a subfolder (i.e., a
selection list from pick), it will be removed without confirmation. If no argument is specified and the current folder is not a selection-list folder, the user
will be asked for confirmation.
Rm/ irreversibly deletes messages that don't have other links, so use it with
caution.
If the folder being removed is a subfolder. the parent folder will become the new
current folder, and rm/ will produce a message telling the user this has happened. This provides an easy mechanism for selecting a set of messages,
operating on the list, then removing the list and returning to the current folder
from which the list was extracted. (See the example under pick.)
The tiles that rml will delete are cur, any file beginning with a comma, and tiles
with purely numeric names. All others will produce error messages.
Rml of a read-only folder will delete the .. cur-" entry from the profile without
atfecting the folder itself.
I1I..ES
PROftLE COIlPONENTS

$HOME/rnh..profile
Path;
Current-Folder:

The user profile
To determine the user's MH directory
To find the default current folder

DEFAULTS

'+folder' defaults to current, usually with confirmation
OONTEXT

Rml will set the current folder to the parent folder if a subfolder is removed; or
if the current folder is removed, it will make lIinbox" current. Otherwise, it
doesn't change the current folder or message.

4th Berkeley Distribution

3

~ugust

1983

1

RMM(l)

UNIX Programmer's Manual

RMM( 1)

rmm - remove messages
SYNOPSIS

rmm [ +folder ] [ msgs ] [ -help]
DESCRIPl'ION

Rmm removes the specified messages by renaming the message files with
preceding commas. (this is the Rand-UNIX backup tile convention.)
The current message is not changed by rmm, so a nezt will advance to the next
message in the folder as expected.

SHOME/mh-profile

The user profile

PROm.E COMPONENTS

Path:
Current-Folder:

To determine the user's MH directory
To find the default current folder

DEFAULTS

'+folder' defaults to current
'msgs' defaults to cur
CONTEXT

If a folder is given, it will become current.

4th Berkeley Distribution

3 August 1983

1

ROFFBIB (1)

UNIX Programmer's Manual

ROFFBIB (1)

NAME

roftbib - run off bibliographic database
SYNOPSIS
roflbib [ -e ] [ -h ] [ - 0 ] [ -0 ] [ -r] [ -s ] [ -Tterm] [ -x ] [ -m mac] [ -V ] [

-Q ] [file ... ]
DESCRIPTION

RoJlbib prints out all records in a bibliographic database, in bibliography format rather than as
footnotes or endnotes. Generally it is used in conjunction with sortbib:
sortbib database Iroftbib

RoJlbib accepts most of the options understood by nroff(l), most importantly the -T flag to
specify terminal type.

If abstracts or comments are entered following the %X field key, roJlbib will format them into
paragraphs for an annotated bibliography. Several %X fields may be given if several annotation
paragraphs are desired. The -x flag will suppress the printing of these abstracts.
A user-defined set of macros may be specified after the - m option. There should be a space
between the -m and the macro filename. This set of macros will replace the ones defined in
/usr/lib/tmac/tmac.bib. The -V flag will send output to the Versatec; the -Q flag will queue
output for the phototypesetter.
Four command-line registers control formatting style of the bibliography, much like the
number registers of ms(7). The command-line argument -rNl will number the references
starting at one (1). The flag -rV2 will double space the bibliography, while -rVl will double
space references but single space annotation paragraphs. The line length can be changed from
the default 6.5 inches to 6 inches with the -rL6i argument, and the page offset can be set from
the default of 0 to one inch by specifying -rOli (capital 0, not zero). Note: with the - V and
-Q flags the default page offset is already one inch.
FILES

lusr/lib/tmac/tmac.bib

file of macros used by nro./fltroff

SEE ALSO

refer(1), addbib(I), sortbib(I), indxbib(1), lookbib(l)
AUTHORS

Greg Shenaut, Bill Tuthill
BUGS

Users have to rewrite macros to create customized formats.

4th Berkeley Distribution

18 July 1983

1

RSH(IC)

UNIX Programmer's Manual

RSH(IC)

NAME

rsh - remote shell
SYNOPSIS

rsh host [ -1 usemame ] [ - 0 ] command
host [ -1 username ] [ - 0 ] command
DESCRIPTION

Rsh connects to the specified host, and executes the specified command. Rsh copies its standard
input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit and
terminate signals are propagated to the remote command; rsh normally terminates when the
remote command does.
The remote username used is the same as your local username, unless you specify a different
remote name with the -I option. This remote name must be equivalent (in the sense of
rlogin(1C» to the originating account; no provision is made for specifying a password with a
command.
If you omit command, then instead of executing a single command, you will be logged in on the
remote host using rlogin (1 C) .
Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote machine. Thus the command
rsh otherhost cat remotefile > > localfile
appends the remote file remotefile to the localfile localfile, while
rsh otherhost cat remotefile "> >" otherremotefile
appends remote./ile to otherremote./ile.
Host names are given in the file letc/hosts. Each host has one standard name (the first name
given in the file), which is rather long and unambiguous, and optionally one or more nicknames. The host names for local machines are also commands in the directory lusr/hosts; if
you put this directory in your search path then the rsh can be omitted.
FILES

letc/hosts

lusr/hosts/·
SEE ALSO

rlogin(IC)

BUGS
If you are using csh(l) and put a TshOC) in the background without redirecting its input away
from the terminal, it win block even if no reads are posted by the remote command. If no
input is desired you should redirect the input of rsh to Idev/null using the - 0 option.
You cannot run an interactive command (like rogue(6) or vi(1»; use rlogin(1C).
Stop signals stop the local rsh process only; this is arguably wrong, but currently hard to fix for
reasons too complicated to explain here.

4th Berkeley Distribution

17 March 1982

1

RTAR(l)

UNIX Programmer's Manual

RTAR(l)

NAME

rL.'1r, rdd, rmt - remote tape manipulation programs
SYNOPSIS

rtar .. J... llOsl:device [ files] ...

nld ... [ if= hosl:device ] ... [ of:= host:device 1...
nnt [ - f hoSI:device] ...
DESCRIPTION
Rlar, rdd and rml arc ven;ions of lar(1.), dd(l) and ml(l) which work on remote tapes in much the
same way as rdump(8) and rresfore(8). These programs cause another program I eLcl nnt (rml(8» to

be executed on the remote host, which in turn manipulates the specified device according to com·
mands issLled by the local ptbgram, passitig' data" b,ick and forth- as' necessary. An "keys and options
for thc rcmote flavor programs arc the samc as for the local flavor progn:uns; thconly differcnce is
that if a tape device of the form Iwst:device is spccified, the tape operations are performed on the
named device on the named host.
DIAGNOSTICS

Diagnostics are the same as for the local flavor programs, wilh the exception of a few possible
socket errors. Remote errors arc reported to the local program.
SEE ALSO

dd( 1), mt( I), tar(l), mtio(4), rdump(8), rmt(8), rrcstore(8)
BUGS

is clearly a bad name t()1' 'remotc ml', since it clashes with I etcl nl1l. It is suggested that one
simply install fIlll as lilt, since the overhead of using the remote routines is low for this program.
/? far, rdd and nlll must all be setllid to root, since they lise a privileged socket. The programs
know enough to setuid back to the real uscr id after opening the sockct, but there are undoubtedly
security iwoblems herc.
The program I etc/ nlll has bugs in it. Most of lhese bugs appear to be handled by rlar and fricnds,
but beware.

RIlII

4th Berkeley Distribution

16 Mm'Ch 1984 .

1

RUPTIME(IC)

RUPTIME ( 1C)

UNIX Programmer's Manual

NAME

ruptime - show host status of local machines
SYNOPSIS

ruptlme [ - a] [ -)] [ - t] [ -

8 ]

DESCRIPTION

Ruptime gives a status line like uptime for each machine on the local network; these are formed
from packets broadcast by each host on the network once a minute.
Machines for which no status report has been received for S minutes are shown as being down.
Users idle an hour or more are not counted unless the -a flag is given.
Normally, the listing is sorted by host name. The -1 t -t
load average, uptime, and number of users, respectively.

t

and

-8

flags specify sorting by

FILES

lusrlspoollrwho/whod.•

data files

SEE ALSO

rwho(1C)

4th Berkeley Distribution

8 March 1982

1

RWHO(lC)

UNIX Programmer's Manual

RWHO(lC)

NAME

rwho - who's logged in on local machines
SYNOPSIS

rwho [ -a]
DESCRIPTION
The rwho command produces output similar to who, but for all machines on the local network.
If no report has been received from a machine for S minutes then rwho assumes the machine is

down, and does not report users last known to be logged into that machine.
If a users hasn't typed to the system for a minute or more, then rwho reports this idle time. If
a user hasn't typed to the system for an hour or more, then the user will be omitted from the
output of rwho unless the - a flag is given.
FILES

lusrlspoollrwho/whod.*

information about other machines

SEE ALSO

ruptime(1C), rwhod(8C)

BUGS
This is unwieldy when the number of machines on the local net is large.

4th Berkeley Distribution

23 March 1982

1

UNIX Programmer's Manual

SCAN ( 1)

SCAN ( 1)

scan - produce a one-line-per-message scan listing
SYNOPSIS

scan [ +folder ] [ msgs ] [ -ff ] [ -header] [ -help] [ -notI ] [ -noheader ]
DESCRIPl"ION

Scan produces a one-line-per-message listing of the specified messages. Each
sca.n line contains the message number (name), the date, the "From" field, the
"Subject" field, and, if room allows, some of the body of the message. For example:

. . . #""' .........Date"'........ From""' ..... Subject [Body]
..... 15+""'........7/ 5""'.........Dcrocker""' ..... nned Last week I asked some of
.... 16 -""' .......... 7/ 5""' ......... dcrocker""' .... message id format I recommend
.... 18""'.......... 7/ 6""'''''''' Obrien""'''''' Re: Exit status from mkdir
.... 19-..........7/ 7""' ........ Obrien""' ....... scan" listing format in MH
The '+' on message 15 indicates that it is the current m~ssage. The I_' on message 16 indicates that it has been replied to, as indicated by a "Replied:" component produced by an I-annotate' switch to the repl command.
If there is sufficient room left on the scan line after the subject, the line will be
tilled with text from the body, preceded by. Sca.n actually reads each of the
specified messages and parses them to extract the desired fields. During parsing, appropriate error messages will be produced if there are format errors in
any of the messages.
The I-header' switch produces a header line prior to the scan listing, and the
I-ff switch will cause a form feed to be output at the end of the scan listing .
.... SHOME/mh.protlle""' .....Tbe user profile
PROm.E COIlPONEN'TS

Path:
Current-Folder:

To determine the user's MH directory
To find the default current folder

DEFAULTS

'+folder' defaults to current
'msgs' defaults to all
'-noff'
'-noheader'
OONTEXl"
If a folder is given, it will become current. The current message is unaffected.

4th Berkeley Distribution

3 August 1983

1

SCREEN ( I)

UNIX Programmer's Manual

SCREEN(I)

NAME

screen - repeatedly display output of command on terminal screen
SYNOPSIS

screen [-8 (seconds)] [-h]  [ ...]
DESCHIPTION
k~'creel1 takes its command line (not including any leading flags) a~d executes it in a subshcll. The
first screenful of the standard output of thc slIbshcll is then displayed on thc terminal screen.
The command is repeated aftcr a delay of a few seconds, and the tcnninal screen is refreshed.

Options are:

-h

The delay between, the end of one command execution and the start of the
next nwy be givcn~ the defilUlt is 15.
The first line of the screen is a header, including the command given, the
delay between command executions. and the date and time. Ir possible.
this is in "standout" mode.

AUTJ-IOR

Jeffrey Mogul
DIAGNOSTICS

Few.
BUGS

Many.

7th Edition

1

SCRIPT ( 1)

UNIX Programmer's Manual

SCRIPT (1 )

NAME

script - make typescript of terminal session
SYNOPSIS

script [ -a] [file]
DESCRIPTION

Script makes a typescript of everything printed on your terminal. The typescript is written to
file, or appended to file if the -a option is given. It can be sent to the line printer later with

/pre If no file name is given, the typescript is saved in the file typescript.

The script ends when the forked shell exits.
This program is useful when using a crt and a hard-copy record of the dialog is desired, as for a
student handing in a program that was developed on a crt when hard-copy terminals are in short
supply.

BUGS
Script places everything in the log file. This is not what the naive user expects.

4th Berkeley Distribution

26 March 1982

1

SED (1)

UNIX Programmer's Manual

SED (1)

NAME

sed - stream editor
SYNOPSIS

sed [

-0 ] [

-e script ][ -f sfile ] [file] ...

DESCR.IPTION
Sed copies the named files (standard input default) to the standard output, edited according to a

script of commands. The -f option causes the script to be taken from file ~/e; these options
accumulate. If there is just one -e option and no -rs, the flag -e may be omitted. The - 0
option suppresses the default output.
A script consists of editing commands, one per line, of the following form:
[address [, address] ] function [arguments]
In normal operation sed cyclically copies a line of input into a pattern space (unless there is
something left after a 'D' command), applies in sequence all commands whose addresses select
that pattern space, and at the end of the script copies the pattern space to the standard output
(except under -0) and deletes the pattern space.
An address is either a decimal number that counts input lines cumulatively across files, a '$'
that addresses the last line of input, or a context address, '/regular expression/', in the style of
ed(1) modified thus:
The escape sequence '\n' matches a newline embedded in the pattern space.
A command line with no addresses selects every pattern space.
A command line with one address selects each pattern space that matches the address.
A command line with two addresses selects the. inclusive range from the first pattern space that
matches the first address through the next pattern space that matches the second. (If the
second address is a number less than or equal to the line number first selected, only one line is
selected.) Thereafter the process is repeated, looking again for the first address.
Editing commands can be applied only to non-selected pattern spaces by use of the negation
function '! ' (below).
In the following list of functions the maximum number of permissible addresses for each function is indicated in parentheses.
An argument denoted text consists of one or more lines, all but the last of which end with '\' to

hide the newline. Backslashes in text are treated like backslashes in the replacement string of
an's' command, and may be used to protect initial blanks and tabs against the stripping that is
done on every script line.
An argument denoted rfile or wfile must terminate the command line and must be preceded by
exactly one blank. Each wfile is created before processing begins. There can be at most 10 distinct wfile arguments.
(1) a\
text

Append. Place text on the output before reading the next input line.
(2) b label

Branch to the ':' command bearing the label. If labelis empty, branch to the end of the
script.
(2) c\
text

Change. Delete the pattern space. With 0 or 1 address or at the end of a 2-address
range, place text on the output. Start the next cycle.

7th Edition

18 January 1983

1

SED (1)

(2) d
(2) D
(2) g
(2) G
(2) h
(2) H

UNIX Programmer's Manual

SED (1)

Delete the pattern space. Start the next cycle.
Delete the initial segment of the pattern space through the first newline. Start the next
cycle.
Replace the contents of the pattern space by the contents of the hold space.
Append the contents of the hold space to the pattern space.
Replace the contents of the hold space by the contents of the pattern space.
Append the contents· of the pattern space to the hold space.

(1) i\

text
Insert. Place text on the standard output.
(2) n Copy the pattern space to the standard output. Replace the pattern space with the next
line of input.
(2) N Append the next line of input to the pattern space with an embedded newline. (The
current line number changes.)
(2) p Print. Copy the pattern space to the standard output.
(2) P Copy the initial segment of the pattern space through the first newline to the standard
output.
(1) q Quit. Branch to the end of the script. Do not start a new cycle.
(2) r rfile
,
Read the contents of rjile. Place them on the output before reading the next input line.
(2) s/regular expressionlreplacement/jlags
Substitute the replacement string for instances of the regular expression in the pattern
space. Any character may be used instead of 'I'. For a fuller description see ed( 1) .
Flags is zero or more of
g
Global. Substitute for all nonoverlapping instances of the regular expression
rather than just the first one.
p
Print the pattern space if a replacement was made.
w wfile Write. Append the pattern space to wfile if a replacement was made.
(2) t label
Test. Branch to the ':' command bearing the label if any substitutions have been made
since the most recent reading of an input line or execution of a 't'. If label is empty,
branch to the end of the script.
(2) w wfile
Write. Append the pattern space to w./ile.
(2) x Exchange the contents of the pattern and hold spaces.
(2) ylstringllstring21
Transform. Replace all occurrences of characters in string] with the corresponding
character in string2. The lengths of stringl and string2 must be equal.
(2) ! /unction
Don't. Apply the /unction (or group, if /unction is '(') only to lines not selected by the
address (es) .
(0): label
This command does nothing; it bears a label for 'b' and 't' commands to branch to.
(1) Place the current line number on the standard output as a line.

7th Edition

18 January 1983

2

SED (1)

(2) {
(0)

UNIX Programmer's Manual

SED (1)

Execute the following commands through a matching '}' only when the pattern space is
selected.
An empty command is ignored.

SEE ALSO

ed(1), grep(l), awk(t), lex(l)

7th Edition

18 January 1983

3

SEND{l)

UNIX Programmer's Manual

SEND ( 1)

send - send a message
SYNOPSIS

send [ file ] [ -draft] [ -verbose] [ -format] [ -msgid ] [ -help] [-noverbose
] [ -noformat ] [ -nomsgid ]
DESCRIPTION

Send will cause the specified file (default  / draft) to be delivered to
each of the addresses in the "To:", "cc:", and "Bee:" fields of the message. If
I-verbose' is specified, send; will monitor the delivery of local and net mail.
Send. with no argument will query whether the draft is the intended tile. whereas
I-draft' will suppress this question. Once the message has been mailed (or
queued) successfully. the file will be renamed with a leading comma. which
allows it to be relreived until the next draft message is sent. If there are errors
in the formatting of the message, send; will abort with a (hopefully) helpful error
message.
If a "Bcc:" field is encountered, its addresses will be used for delivery. but the
"Bcc:" field itself will be deleted from all copies of the outgoing message.
Prior to sending the message, the fields "From: user". and "Date: now" will be
prepended to the message. If I-msgid' is specified. then a "Message-Id:" field
will also be added to the message. If the message already contains a "From:"
field. then a "Sender: user" field will be added instead. (An already existing
"Sender:" field will be deleted from the message.)
If the user doesn't specify '-noformat', each of the entries in the "To:" and
"cc:" fields will be replaced with "standard" format entries. This standard format is designed to be usable by all of the message handlers on the various systems around the ARPANET.
If an "Fcc: folder" is encountered, the message will be copied to the specified
folder in the format in which it will appear to any receivers of the message. That
is, it will have the prepended fields and field reformatting.
If a "Distribute-To:" field is encountered, the message is handled as a redistribution message (see dist for details), with "Distribution-Date: now' and
"Distribution-From: user" added
SHOME/mh.profile

The user profile

PROmE COMPONENTS

Path:

To determine the user's llH directory

DEFAULTS
ltile' defaults to draft
I-noverbose'
I-format'
I-nomsgid'

·OONTEXT

Send. has no effect on the current message or folder.

4th Berkeley Distribution

3 August 1983

1

SENDBUG (1)

UNIX Programmer's Manual

SENDBUG (1)

NAME

sendbug - mail a system bug r.eport to 4bsd-bugs
SYNOPSIS
sendbug

I address )

DESCRIPTION

Bug reports sent to '4bsd-bugs@BERKELEY' are intercepted by a program which expects bug
reports to conform to a standard format. Sendbug is a shell script to help the user compose and
mail bug reports in the correct format. Sendbug works by invoking vi(I) on a temporary copy
of the bug report format outline. The user must fill in the appropriate fields and exit vi. Sendbug then mails the completed report to '4bsd-bugs@BERKELEY' or the address specified on
the command line.
FILES

lusr lucblbugformat

contains the bug report outline

SEE ALSO

vi(I), sendmail(8)

4th Berkeley Distribution

11 May 1983

1

~u

~&&

11 ,
\

UNIX Programmer's Manua!

.I. ,

SH (1)

NAME'

sh, fOf, case, if, while, :, ., break, continue, cd, eval, exec, exit, export, login, read, readonly,
set, shift, times, trap, umask, wait - command language
SYNOPSIS

sh [ -ceiknrstuvx ] [arg] ...
DESCRIPTION

Sh is a command programming language that executes commands read from a terminal or a file.
See invocation for the meaning of arguments to the shell.
Commands.
A simple-command is a sequence of non blank words separated by blanks (a blank is a tab or a
space). The first word specifies the name of the command to be executed. Except as specified
below the remaining words are passed as arguments to the invoked command. The command
name is passed as argument 0 (see execve(2». The value of a simple-command is its exit status
if it terminates normally or 200+ status if it terminates abnormally (see sigvec(2) for a list of
status values).
A pipeline is a sequence of one or more commands separated by I. The standard output of each
command but the last is connected by a pipe(2) to the standard input of the next command.
Each command is run as a separate process; the shell waits for the last command to terminate.
A list is a sequence of one or more pipelines separated by;, &, && or II and optionally terminated by ; or &. ; and & have equal precedence which is lower than that of && and II, &&
and II also have equal precedence. A semicolon causes sequential execution~ an ampersand
causes the preceding pipeline to be executed without waiting for it to finish. The symbol &&
(II) causes the list following to be executed only if the preceding pipeline returns a zero (non
zero) value. Newlines may appear in a list, instead of semicolons, to delimit commands.
A command is either a simple-command or one of the following. The value returned by a command is that of the last simple-command executed in the command.
for name lin word ... ] do list done
Each time a for command is executed name is set to the next word in the for word list
If in word ... is omitted, in "$@" is assumed. Execution ends when there are no more
words in the list.
case word in [pattern [ I pattern] ... ) list;;] ... esac
A case command executes the list associated with the first pattern that matches word.
The form of the patterns is the same as that used for file name generation.
if list then list [elif list then list] ... [else list] fi
The list following if is executed and if it returns zero the list following then is executed.
Otherwise, the list following elif is executed and if its value is zero the list following
then is executed. Failing that the else list is executed.
while list [do list] done
A while command repeatedly executes the while list and if its value is zero executes
the do list; otherwise the loop terminates. The value returned by a while command is
that of the last executed command in the do list. until may be used in place of while to
negate the loop termination test.

( list) Execute list in a subshell.
( list) list is simply executed.
The following words are only recognized as the first word of a command and when not quoted.
if then else elif fi case in esac for while until do done ( )

7th Edition

7 February 1983

1

UNIX Programmer's Manual

SH (1)

SH (1)

Command substitution.
The standard output from a command enclosed in a pair of back quotes (' ') may be used as
part or all of a word; trailing newlines are removed.
Parameter substitution.
The character $ is used to introduce substitutable parameters. Positional parameters may be
assigned values by set. Variables may be set by writing

name = value [ name-value] ...
S (parameter)
A parameter is a sequence of letters, digits or underscores (a name), a digit, or any of
the characters • @ # ? - $ !. The value, if any, of the parameter is substituted. The
braces are required only when parameter is followed by a letter, digit, or underscore that
is not to be interpreted as part of its name. If parameter is a digit, it is a positional
parameter. If parameter is • or @ then all the positional parameters, starting with $1,
are substituted separated by spaces. $0 is set from argument zero when the shell is
invoked.
S (parameter - word)
If parameter is set, substitute its value; otherwise substitute word.
S (parameter- word)
If parameter is not set, set it to word; the value of the parameter is then substituted.
Positional parameters may not be assigned to in this way.
S {parameter? word}
If parameter is set, substitute its value; otherwise, print word and exit from the shell. If
word is omitted, a standard message is printed.
S (parameter+word)
If parameter is set, substitute word; otherwise substitute nothing.
In the above word is not evaluated unless it is to be used as the substituted string. (So that, for
example, echo $(d -'pwd'} will only execute pwd if d is unset.)
The following parameters are automatically set by the shell.
#
The number of positional parameters in decimal.
Options supplied to the shell on invocation or by set.
?
The value returned by the last executed command in decimal.
$
The process number of this shell.
The process number of the last background command invoked.
The following parameters are used but not set by the shell.
HOME The default argument (home directory) for the cd command.
PATH The search path for commands (see execution).
MAIL If this variable is set to the name of a mail file, the shell informs the user of
the arrival of mail in the specified file.
PSI
Primary prompt string, by default '$ '.
PS2
Secondary prompt string, by default '> '.
IFS
Internal field separators, normally space, tab, and newline.
Blank interpretation.
After parameter and command substitution, any results of substitution are scanned for internal
field separator characters (those found in $IFS) and split into distinct arguments where such
characters are found. Explicit null arguments ("" or ") are retained. Implicit null arguments
(those resulting from parameters that have no values) are removed.

7th Edition

7 February 1983

2

SH (1)

SH (1)

UNIX Programmer's Manual

File name generation.
Following substitution, each command word is scanned for the characters -, ? and I. If one of
these characters appears, the word is regarded as a pattern. The word is replaced with alphabetically sorted file names that match the pattern. If no file name is found that matches the pattern, the word is left unchanged. The character • at the start of a file name or immediately following aI, and the character I, must be matched explicitly.
?

I ... ]

Matches any string, including the null string.
Matches any single character.
Matches anyone of the characters enclosed. A pair of characters separated by matches any character lexically between the pair.

Quoting.
The following characters have a special meaning to the shell and cause termination of a word
unless quoted.
; &

( )

I <

>

newline space tab

A character may be quoted by preceding it with a \. \newline is ignored. All characters
enclosed between a pair of quote marks ("), except a single quote, are quoted. Inside double
quotes (" ") parameter and command substitution occurs and \ quotes the characters \ ' " and $.

"$-" is equivalent to "SI S2 ••• " whereas
"$@" is equivalent to "SI" ·S2" .•••
Prompting.
When used interactively, the shell prompts with the value of PSI before reading a· command. If
at any time a newline is typed and further input is needed to complete a command, the secondary prompt (SPS2) is issued.
Input output.
Before a command is executed its input and output may be redirected using a' special notation
interpreted by the shell. The following may appear anywhere in a simple-command or may precede or follow a command and are not passed on to the invoked command. SUbstitution occurs
before word or digit is used.
< word Use file word as standard input (file descriptor 0).

> word Use file word as standard output (file descriptor 1). If the file does not exist, it is
created; otherwise it is truncated to zero length.

»

word
Use file word as standard output. If the tile exists, output is appended (by seeking to
the end); otherwise the file is created.

« word
The shell input is read up- to a line the same as word,. or end of file. The resulting
document becomes the standard; input. If any character of word is quoted, no interpretation is placed upon the characters of the document; otherwise, parameter and com~
mand substitution occurs, \newline is ignored, and \ is used to quote the characters \ S
, and the first character of word.
< & digit
The standard input is duplicated from file descriptor
standard output using> .
<& -

digit,~

se-e dup(2}. Similarly for the

The standard input is closed. Similarly for the standard output using> .

If one of the above is preceded by a digit, the' file descriptor created is that specified; by the digit
(instead of the default 0- or 1). For example"

7th- Edition

7 February 1983

3

SH (1)

UNIX Programmer's Manual

SH (1)

... 2>&1
creates file descriptor 2 to be a duplicate of file descriptor 1.

If a command is followed by &: then the default standard input for the command is the empty
file (/dev/null). Otherwise, the environment for the execution of a command contains the file
descriptors of the invoking shell as modified by input output specifications.
Environment.
The environment is a list of name-value pairs that is passed to an executed program in the
same way as a normal argument list~ see execve(2) and environ (7) . The shell interacts with the
environment in several ways. On invocation, the shell scans the environment and creates a
parameter for each name found, giving it the corresponding value. Executed commands inherit
the same environment. If the user modifies the values of these parameters or creates new ones,
none of these affects the environment unless the export command is used to bind the shell's
parameter to the environment. The environment seen by any executed command is thus composed of any unmodified name-value pairs originally inherited by the shell, plus any
modifications or additions, all of which must be noted in export commands.
The environment for any Simple-command may be augmented by prefixing it with one or more
assignments to parameters. Thus these two lines are equivalent
TERM==450 cmd args
(export TERM~ TERM"450~ cmd args)
If the - k flag is set, all keyword arguments are placed in the environment, even if the occur
after the command name. The following prints 'a=-b c' and 'c':
echo a-b c
set -k
echo a==b c
Signals.
The INTERRUPT and QUIT signals for an invoked command are ignored if the command is
followed by &:; otherwise signals have the values inherited by the shell from its parent. (But
see also trap.)
Execution.
Each time a command is executed the above substitutions are carried out. Except for the 'special commands' listed below a new process is created and an attempt is made to execute the
command via an execve (2) .
The shell parameter SPATH defines the search path for the directory containing the command.
Each alternative directory name is separated by a colon (:). The default path is :/bin:/usr/bin.
If the command name contains a /, the search path is not used. Otherwise, each directory in
the path is searched for an executable file. If the file has execute permission but is not an a.out
file, it is assumed to be a file containing shell commands. A subshell (Le., a separate process)
is spawned to read it. A parenthesized command is also executed in a subshell.
Special commands.
The following commands are executed in the shell process and except where specified no input
output redirection is permitted for such commands.
No effect; the command does nothing .
• file Read and execute commands from file and return. The search path SPATH is used to
find the directory containing file.
break [n]
Exit from the enclosing for or while loop, if any. If n is specified, break n levels.
continue [n]
Resume the next iteration of the enclosing for or while loop. If n is specified, resume

7th Edition

7 February 1983

4

SH (1)

UNIX Programmer's Manual

SH (1)

at the n-th enclosing loop.
cd [arg]
Change the current directory to arg. The shell parameter $HOME is the default arg.
eval [arg ... ]
The arguments are read as input to the shell and the resulting command (s) executed.
exec [arg ... ]
The command specified by the arguments is executed in place of this shell without
creating a new process. Input output arguments may appear and if no other arguments
are given cause the shell input output to be modified.
exit [n]
Causes a non interactive shell to exit with the exit status specified by n. If n is omitted,
the exit status is that of the last command executed. (An end of file will also exit from
the shell.)
export [name ... ]
The given names are marked for automatic export to the environment of subsequentlyexecuted commands. If no arguments are given, a list of exportable names is printed.
login [arg ... ]
Equivalent to 'exec login arg ... '.
read name ...
One line is read from the standard inpUt; successive words of the input are assigned to
the variables name in order, with leftover words to the last variable. The return code is
o unless the end-of-file is encountered.
readonly [name ... ]
The given names are marked readonly and the values of the these names may not be
changed by subsequent assignment. If no arguments are given, a list of all readonly
names is printed.
set [-eknptuyx [arg ... ]]
-e If non interactive, exit immediately if a command fails.
- k All keyword arguments are placed in the environment for a command, not just
those that precede the command name.
-0
Read commands but do not execute them.
-t
Exit after reading and executing one command.
-u Treat unset variables as an error when substituting.
-y
Print shell input lines as they are read.
- x Print commands and their arguments as they are executed.
Turn off the -x and -y options.
These flags can also be used upon invocation ·of the shell. The current set of flags may
be found in $-.
Remaining arguments are positional parameters ana are assigned, in order, to $1, $2,
etc. If no arguments are given, the values of all names are printed.
shift The positional parameters from $2... are renamed $1 ...
times Print the accumulated user and system times for processes run from the shell.
trap [arg] [n] ...
Arg is a command to be read and executed when the shell receives signal (s) n. (Note
that arg is scanned once when the trap is set and once when the trap is taken.) Trap
commands are executed in order of signal number. If arg is absent, all trap(s) n are
reset to their original values. If arg is the null string, this signal is ignored by the shell
and by invoked commands. If n is 0, thecommandarg is executed .onexit from the
shell, otherwise upon receipt of signal n as numbered in sigvec(2). Trap with no arguments prints a list of commands associated with each signal number.

7th Edition

7 ,February 1983

5

SH (1)

UNIX Programmer's Manual

SH (1)

umask [ nnn]
The user file creation mask is set to the octal value nnn (see umask(2». If nnn is omitted, the current value of the mask is printed.
wait [n]
Wait for the specified process and report its termination status. If n is not given, all
currently active child processes are waited for. The return code from this command is
that of the process waited for.
Invocation.
If the first character of argument zero is -, commands are read from SHOMI/. profile, if such a
file exists. Commands are then read as described below. The following flags are interpreted by
the shell when it is invoked.
-c string If the -c flag is present, commands are read from string.
-s
If the -s flag is present or if no arguments remain then commands are read from
the standard input. Shell output is written to file descriptor 2.
-i
If the -i flag is present or if the shell input and output are attached to a terminal
(as told by gtty) then this shell is interactive. In this case the terminate signal
SIGTERM (see sigvec(2» is ignored (so that 'kill 0' does not kill an interactive
shell) and the interrupt signal SIGINT is caught and ignored (so that wait is interruptible). In all cases SIGQUIT is ignored by the shell.
The remaining flags and arguments are described under the set command.
FILES

SHaMEl. profile
/tmp/sh.
/dev/null
SEE ALSO

csh(1), test(1), execve(2), environ(7)
DIAGNOSTICS

Errors detected by the shell, such as syntax errors cause the shell to return a non zero exit
status. If the shell is being used non interactively then execution of the shell file is abandoned.
Otherwise, the shell returns the exit status of the last command executed (see also exit).
BUGS

If < < is used to provide standard input to an asynchronous process invoked by &, the shell gets
mixed up about naming the input document. A garbage file Itmp/sh* is created, and the shell
complains about not being able to find the file by another name.

7th Edition

7 February 1983

6

SHt\R(l)

UN IX Programmer's Manual

SHAR (1)

NAME

shnr -- produce shell-script archives
SYNOPSIS

slwr riles [ 1>archive
DESCRIPTION

,\'/1([" is used to collect a \lumber of tex t
"cxtracts" itself to recreate the files.

7lh Edition

ftIe~

into a single archive, that, whcn run as a shell script,

1 .

SHOW{l)

UNIX Programmer's Manual

SHOW ( 1)

HAIlE

show - show {list} messages
SYNOPSIS

show [ +folder ] [ msgs ] [ -pr ] [ -nopr ] [ -draft] [ -help] [ 1 or pr switches]
DESCRIPTION

Shnw lists each of the specified messages to the standard output (typically, the
terminal). The messages are listed exactly as they are, with no reformatting. A
program called 1 is invoked to do the listing. and any switches not recognized by
show are passed along to 1.
If no "msgs" are specified. the current message is used If more than one message is specified, 1 will prompt for a  prior to listing each message.
1 will list each message, a page at a time. When the end of page is reached, 1 will
ring the bell and wait for a  or . If a  is entered, 1
will clear the screen before listing the next page. whereas  will not.
·The switches to 1 are '-pH' to indicate the page length in lines, and '-wH' to indicate the width of the pag~ in characters.
If the standard output is not a terminal, no queries are made, and each tile is
listed with a one-line header and two lines of separation.
If '-pr' is specified, then pr(I) will be invoked rather than 1, and the switches
(other than '-draft') will be passed along. "Show :...draft" will list the file  / draft if it exists.
$HOME/mh.profile
/bin/l
/bin/pr

The user profile
Screen-at-a-time list program

pr{l)

PROPlLE COMPONENTS

Path:
Current-Folder:

To determine the user's MH directory
To find the default current folder

DEFAULTS

'+folder' defaults to current
'msgs' defaults to cur
'-nopr'
OONTEXl'

If a folder is given, it will become the current message. The last message listed
will become the current message.

4th Berkeley Distribution

3 August 1983

1

SIZE (1)

UNIX Programmer's Manual

SIZE (1)

NAME

size - size of an object file
SYNOPSIS

size [ object ... ]
DESCRIPTION

Size prints the (decimal) number of bytes required by the text, data, and bss portions, and their
sum in hex and decimal, of each object-file argument. If no file is specified, a.out is used.
SEE ALSO

a.out(5)

7th Edition

18 January 1983

1

S]ZE68 (1 )

UNIX Programmer's Manual

SIZE68( 1)

NAM[~

size68 - prints sizes of segments in a .h or .68 file
SYNOPSIS

sizc68 [ -hi) file
DII:SCRIPTION
Siz('o8 prints the sizes of the text, (bta, and bss segments of a .b or .68 file, in decimal: the total

size is also given in both dccinlal and octal. The -h flag causes the sizes to be given in hexadecimal. The -I flag causes a complete printout in decimal (hex if -h is given) or Lhe values of the 8
header words, namely the magic number, l.he sizes of the three segnlenls, the si/.e of lhe symbol
table, and the sizes of the relocation commands.
AUTllon

C..J. Terman

7th

r~uit.ion

1

SLEEP (1)

UNIX Programmer's Manual

SLEEP (1)

NAME

sleep - suspend execution for an interval
SYNOPSIS

sleep time
DESCRIPTION

Sleep suspends execution for time seconds. It is used to execute a command after a certain
amount of time as in:
(sleep 105; command) &
or to execute a command every so often, as in:
while true
do
command
sleep 37
done
SEE ALSO

setitimer(2), alarm(3C), sleep(3)

BUGS

Time must be less than 2,147,483,647 seconds.

7th Edition

10 February 1983

1

UNIX Programmer's Manual

SOELIM(l)

SOELIM (1)

NAME

soelim - eliminate .so's from nroff input
SYNOPSIS

soellm [ file ... ]
DESCRIPTION
Soe!im reads the specified files or the standard input and performs the textual inclusion implied

by the nroffdirectives of the form
.so somefile
when they appear at the beginning of input lines. This is useful since programs such as thl do
not normally do this; it allows the placement of individual tables in separate files to be run as a
part of a large document.
An argument consisting of a single minus (-) is taken to be a file name corresponding to the
standard input.
Note that inclusion can be suppressed by using ", instead of '.', i.e.
'so /usr/lib/tmac.s
A sample usage of soe!im would be
soelim exum?n I tbll nroff - ms I colilpr
SEE ALSO

colcrt(l), moreO)
AUTHOR

William Joy
BUGS

The format of the source commands must involve no strangeness - exactly one blank must
precede and no blanks follow the file name.

7th Edition

16 September 1982

1

SORT ( 1)

UNIX Programmer's Manual

SORT (1)

NAME

sort - sort or merge files
SYNOPSIS

sort [ -mubdfinrtx] [ + pos} [ -pos2] ] •.. [-0 name] [ -T directory] [ name] ...

DESCRIPTION

Sort sorts lines of all the named files together and writes the result on the standard output. The
name '-' means the standard input. If no input files are named, the standard input is sorted.
The default sort key is an entire line. Default ordering is lexicographic by bytes in machine
collating sequence. The ordering is affected globally by the following options, one or more of
which may appear.
b
Ignore leading blanks (spaces and tabs) in field comparisons.
d
'Dictionary' order: only letters, digits and blanks are significant in comparisons.
f
Fold upper case letters onto lower case.
I
Ignore characters outside the ASCII range 040-0176 in nonnumeric comparisons.
n
An initial numeric string, consisting of optional blanks, optional minus sign, and zero or
more digits with optional decimal point, is sorted by arithmetic value. Option n implies
option b.
r
Reverse the sense of comparisons.
tx 'Tab character' separating fields is x.
The notation +pos} - pos2 restricts a sort key to a field beginning at pos} and ending just
before pos2. Pos} and pos2 each have the form m.n, optionally followed by one or more of the
flags bdfinr, where m tells a number of fields to skip from the beginning of the line and n tells
a number of characters to skip further. If any flags are present they override all the global ordering options for this key. If the b option is in effect n is counted from the first nonblank in
the field; b is attached independently to pos2. A missing .n means .0; a missing - pos2 means
the end of the line. Under the -tx option, fields are strings separated by x; otherwise fields
are nonempty non blank strings separated by blanks.
When there are multiple sort keys, later keys are compared only after all earlier keys compare
equal. Lines that otherwise compare equal are ordered with all bytes significant.
These option arguments are also understood:
c
Check that the input file is sorted according to the ordering rules; give no output unless
the file is out of sort.
m
Merge only, the input files are already sorted.
o
The next argument is the name of an output file to use instead of the standard output.
This file may be the same as one of the inputs.
T
The next argument is the name of a directory in· which temporary files should be made.
u
Suppress all but one in each set of equal lines. Ignored bytes and bytes outside keys do
not participate in this comparison.
EXAMPLES

Print in alphabetical order all the unique spellings in a list of words. Capitalized words differ
from uncapitalized.
sort -u +Of +0 list
Print the password file (passwd(S» sorted by user id number (the 3rd colo~-separatedfield).

7th Edition

10 February 1983

1

SORT(l)

UNIX Programmer's Manual

SORT ( 1)

sort -t: +2n letc/passwd
Print the first instance of each month in an already sorted file of (month day) entries. The
options - um with just one input file make the choice of a unique representative from a set of
equal lines predictable.
sort -um +0 -1 dates
FILES

lusr/tmp/stm., Itmp/. first and second tries for temporary files
SEE ALSO

uniq(1), comm(1), rev(n, join (1)
DIAGNOSTICS

Comments and exits with nonzero status for various trouble conditions and for disorder
discovered under option -c.
BUGS

Very long lines are silently truncated.

7th Edition

10 February 1983

2

SORTBIB (1)

UNIX Programmer's Manual

SORtBIB (1)

NAME

sortbib - sort bibliographic database
SYNOPSIS

sortbib [ - sKEYS ] database ...
DESCRIPTION

Sortbib sorts files of records containing refer key"letters by user-specified keys. Records may be
separated by blank lines, or by . [ and .] delimiters, but the two styles may not be mixed
together. This program reads through each database and pulls out key fields, which are sorted
separately. The sorted key fields contain the file pointer, byte offset, and length of corresponding records. These records are delivered using disk seeks and reads, so sortbib may not be used
in a pipeline to read standard input.
By default, sortbib alphabetizes by the first %A and the %0 fields, which contain the senior
author and date. The -5 option is used to specify new KEYS. For instance,. -sATD will sort
by author, title, and date, while - sA + D will sort by aU authors, and date. Sort keys past the
fourth are not meaningful. No more than 16 databases may be sorted together at one time.
Records longer than 4096 characters will be truncated.
Sortbib sorts on the last word on the %A line, which is assu~med to be the author's last name.
A word in the final position, such as "jr." or Bed.", will be ignored if the name beforehand
ends with a comma. Authors with two-word last names or unusual constructions cart be sorted
correctly by using the nroff convention '$\0" in place of a blank. A %Q field is considered to be
the same as %A, except sorting begins with the first, not the last, word. Sottbib sorts on the
last word of the %D line, usually the year. It also ignores leading articles (like "A" or "The")
when sorting by titles in the %T or %J fields; it will ignore articles of any modern European
language. If a sort-significant field is absent from a record,. sortbib places that record before
other records containing that field.
SEE ALSO

refer(I), addbib(1), roftbib(I), indxbib(l), lookbib(I)
AUTHORS

Greg Shenaut, Bill Tuthill
BUGS

Records with missing author fields should probably be sorted by tille:.

4th Berkeley Distribution

1

SPELL (1)

UNIX Programmer's Manual

SPELL (1)

NAME

spell, spellin, spellout - find spelling errors
SYNOPSIS

spell [ -v ] [ -b] [ -x ] [ -d hlist ] [ -s hstop ] [ -h spellhist ] [file] ...
spellin [ list ]
spellout [ -d ] list
DESCRIPTION

Spell collects words from the named documents, and looks them up in a spelling list. Words
that neither occur among nor are derivable (by applying certain inflections, prefixes or suffixes)
from words in the spelling list are printed on the standard output. If no files are named, words
are collected from the standard input.
Spell ignores most troff, tbl and eqn(1) constructions.
Under the -v option, all words not literally in the spelling list are printed, and plausible derivations from spelling list words are indicated.
Under the -b option, British spelling is checked. Besides preferring centre, colour, speciality,
travelled, etc., this option insists upon -ise in words like standardise, Fowler and the OED to the
contrary notwithstanding.
Under the -x option, every plausible stem is printed with '-' for each word.
The spelling list is based on many sources. While it is more haphazard than an ordinary dictionary, it is also more etrective with proper names and popular technical words. Coverage of
the specialized vocabularies of biology, medicine and chemistry is light.
The auxiliary files used for the spelling list, stop list, and history file may be specified by arguments following the -d, -s, and -h options. The default files are indicated below. Copies of
all output may be accumulated in the history file. The stop list filters out misspellings (e.g.
thier - thy - Y+ier) that would otherwise pass.
Two routines help maintain the hash lists used by spell. Both expect a set of words, one per
line, from the standard input. Spellin combines the words from the standard input and the
preexisting list file and places a new list on the standard output. If no list file is specified, the
new list is created from scratch. Spellout looks up each word from the standard input and prints
on the standard output those that are missing from (or present on, with option -d) the hashed
list file. For example, to verify that hookey is not on the default spelling list, add it to your own
private list, and then use it with spell,

I

echo hookey spellout /usr/dict/hlista
echo hookey spellin lusr/ dict/hlista > myhlist
spell - d myhlist huckftnn
FILES

/usr/dict/hlist[ab]
lusr/ dict/hstop
/dev/null
Itmp/spell.$$.
lusrllibl spell

hashed spelling lists, American &. British, default for -d
hashed stop list, default for -s
history file, default for - h
temporary files

SEE ALSO

derotr(1), sort(1), tee(1), sed(t)
BUGS
The spelling list's coverage is uneven; new installations will probably wish to monitor the output for several months to gather local additions.
British spelling was done by an American.

7th Edition

, 12 September 1983

1

SPLINE (lG)

UNIX Programmer's Manual

SPLINE (IG)

NAME

spline - interpolate smooth curve
SYNOPSIS

spline [ option ] ...
DESCRIPTION

Spline takes pairs of numbers from the standard input as abcissas and ordinates of a function. It
produces a similar set, which is approximately equally spaced and includes the input set, on the
standard output. The cubic spline output (R. W. Hamming, Numerical Methods for Scientists and
Engineers, 2nd ed., 349ff) has two continuous derivatives, and sufficiently many points to look
smooth when plotted, for example by graph(IG).
The following options are recognized, each as a separate argument.

-a Supply abscissas automatically (they are missing from the input); spacing is given by the
next argument, or is assumed to be 1 if next argument is not a number.
- k The constant k used in the boundary value computation

is set by the next argument. By default k ==

o.

-n Space output points so that approximately n intervals occur between the lower and
limits. (Default n == 100.)

~pper

x

-p Make output periodic, i.e. match derivatives at ends.. First and last input values should
normally agree.

-x Next 1 (or 2) arguments are lower (and upper) x limits. Normally these limits are calculated from the data. Automatic abcissas start at lower limit (default 0).
SEE ALSO

graph(IG), plot(1G)
DIAGNOSTICS

When data is not strictly monotone in x, spline reproduces the input without interpolating ,extra
points.
BUGS

A limit of 1000 input points is enforced silently.

7th Edition

18

Janu~ry

198,3

1

SPLIT (1)

UNIX Proarammer's Manual

SPLIT (1)

NAME

split - split a file into pieces
SYNOPSIS

spHt [ - n] [me [ name ] ]
DESCRIPTION

Split reads file and writes it in n-Iine pieces (default 1000), as many as necessary, onto a set of
output fUes. The name of the first output me is name with •• appended, and so on lexicographically. If no output name is liven, s is default.
If no input file is liven, or if - is liven in its stead, then the standard input file is used.

7th Edition

18 January 1983

1

STR.'NGS ( 1 )

UNIX Progra.!n..rner's Manual

STRINGS (1)

NAME
strings - find the printable strings in a object, or other binary, file
SYNOPSIS

strings [ - ] [ -0] [ - number] file ...
DESCRIPTION

Strings looks for ascii strings in a binary file. A string is any sequence of 4 or more printing
characters ending with a newline or a null. Unless the - flag is· given, strings only looks in the
initialized data space of object files. If the -0 flag is given, then each string is preceded by its
offset in the file (in octal). If the - number flag is· given then number is used as the minimum
string length rather than 4.
Strings is useful for identifying random object files and many other things.
SEE ALSO

adO)

BUGS
The algorithm for identifying strings is extremely primitive

3rd Berkeley Distribution

24 February 1979

1

STRIP (1)

UNIX Programmer's Manual

STRIP (1)

NAME

strip - remove symbols and relocation bits
SYNOPSIS

strip name ...
DESCRIPTION
Strip removes the symbol table and relocation bits ordinarily attached to the output of the

assembler and loader. This is useful to save space after a program has been debugged.
The effect of strip is the same as use of the -s option of Id.
FILES

Itmp/stm?

temporary file

SEE ALSO
ld(l)

7th Edition

18 January 1983

1

STRUCT(l)

UNIX Programmer's Manual

STRUCT(l)

NAME

struct - structure Fortran programs
SYNOPSIS

struct [ option ] ... file
DESCRIPTION

Struct translates the Fortran program specified by file (standard input default) into a Ratfor pro-

gram. Wherever possible, Ratfor control constructs replace the original Fortran. Statement
numbers appear only where still necessary. Cosmetic changes are made, including changing
Hollerith strings into quoted strings and relational operators into symbols (.e.g. ";G1." into
"> "). The output is appropriately indented.
The following options may occur in any order.
-s

-1

-a

Input is accepted in standard format, i.e. comments are specified by a c, C, or - in
column 1, and continuation lines are specified by a nonzero, non blank character in
column 6. Normally input is in the form accepted by .177(1)
Do not turn computed goto statements into switches. (Ratfor doeS not turn switches
back into computed go to statements.)
Turn sequences of else ifs into a non-Ratfor switch of the form
switch
case predl: code
case pred2: code
case pred3: code
default: code
The case predicates are tested in order; the code appropriate to only one case is executed. This generalized form of switch statement does not occur in Ratfor.

-b
-n

Generate goto's instead of multilevel break statements.
Generate goto's instead of multilevel next statements.

-tn
-en
-en

Make the nonzero integer n the lowest valued label in the output program (default 10).
Increment successive labels in the output program by the nonzero integer n (default 1).
If n is 0 (default), place code within a loop only if it can lead to an iteration of the loop.
If n is nonzero, admit a small code segments to a loop if otherwise the loop would have
exits to several places including the segment, and the segment can be reached only
from the loop. 'Small' is close to, but not equal to, the number of statements in the
code segment. Values of n under 10 are suggested.

FILES

/tmp/struct*
/usr/lib/struct/SEE ALSO
ti7(1)

BUGS
Struct knows Fortran 66 syntax, but not full Fortran. 77.
If an input Fortran program contains identifiers which are reserved words in Ratfor, the' structured version of the program will not be a valid Ratfor program.
The labels generated cannot go above 32767.
If you get a goto without a target, try -e .

7th Edition

It January 1983

1

STTY (1)

UNIX Programmer's Manual

STTY (1)

NAME

stty - set terminal options
SYNOPSIS

stty [ option ... ]
DESCRIPTION
Stt)' sets certain 110 options on the current output terminal, placing its output on the diagnostic
output. With no argument, it reports the speed of the terminal and the settings of the options
which are different from their defaults. With the argument "all", all normally used option settings are reported. With the argument "everything", everything stty knows about is printed.
The option strings are selected from the following set:

allow even parity input
disallow even parity input
allow odd parity input
disallow odd parity input
raw mode input {no input processing (erase, kill, interrupt, .. .); parity bit passed
back)
-raw
negate raw mode
same as '-raw'
eooked
ebreak
make each character available to read(2) as received; no erase and kill processing,
but all other processing (interrupt, suspend, ... ) is performed
-ebreak make characters available to read only when newline is received
-nl
allow carriage return for new-line, and output CR-LF for carriage return or new-line
nl
accept only new-line to end lines
echo back every character typed
eeho
-eeho
do not echo characters
map upper case to lower case
lease
do not map case
-lease
tandem
enable flow control, so that the system sends out the stop character when its internal
queue is in danger of overflowing on input, and sends the start character when it is
ready to accept further input
- tandem disable flow control
-tabs
replace tabs by spaces when printing
tabs
preserve tabs
ek
set erase and kill characters to # and @
For the following commands which take a character argument c, you may also specify c as the
"u" or "under', to set the value to be undefined. A value of "AX", a 2 character sequence, is
also interpreted as a control character, with ".01" representing delete.
even
-even
odd
-odd
raw

set erase character to c (default '#', but often reset to AH.)
set kill character to c (default '@', but often reset to AU.)
set interrupt character to c (default DEL or "1 (delete), but often reset to AC.)
set quit character to c (default control \.)
set start character to c (default control Q.)
set stop character to c (default control S.)
set end of file character to c (default control 0.)
set break character to c (default undefined.) This character is an extra wakeup causing character.
erO erl er2 er3
select style of delay for carriage return (see ioctl(2»
nl0 nil nl2 nl3
select style of delay for linefeed
tabO tabl tab2 tab3

erase c
kill c
lntr c
quit c
start c
stop c
eof c
brk c

4th Berkeley Distribution

11 May 1981

1

STTY (1)

ft'OfIl
bsO bsl
tty33
tty37
vt05
dec

UNIX Programmer's Manual

STTY (1)

select style of delay for tab
select style of delay for form feed
select style of delay for backspace
set all modes suitable for the Teletype Corporation Model 33 terminal.
set all modes suitable for the Teletype Corporation Model 37 terminal.
set all modes suitable for Digital Equipment Corp. VT05 terminal
set all modes suitable for Digital Equipment Corp. operating systems users; (erase,
kill, and interrupt characters to A?, AU, and AC, decctlq and "newcrt".)

tn300
ti700
tek

set all modes suitable for a General Electric TermiNet 300
set all modes suitable for Texas Instruments 700 series terminal
set all modes suitable for Tektronix 4014 terminal
o
hang up phone line immediately
50 75 110 134 150 200300 600 1200 1800 2400 4800 9600 exta extb
Set terminal baud rate to the number given, if possible. (These are the speeds supported by the DH-ll interface).
A teletype driver which supports the job control processing of csh(I) and more functionality
than the basic driver is fully described in tty(4). The following options apply only to it.

new
crt
crtbs
prterase
crterase
-crterase
crtkill
-crtkill
ctlecho

Use new driver (switching flushes typeahead).
Set options for a CRT (crtbs, ctlecho and, if > == 1200 baud, crterase and crtkill.)
Echo backspaces on erase characters.
For printing terminal echo .erased characters backwards within "\" and "/".
Wipe out erased characters with "backspace-space-backspace."
Leave erased characters visible~ just backspace.
Wipe out input on like kill ala crterase.
Just echo line kill character and a newline on line kill.
Echo control characters as W' x" (and delete as "'''?''.) Print two backspaces following the EOT character (control D).
-ctlecho Control characters echo as themselves; in cooked mode EOT (control-D) is not
echoed.
After output is suspended (normally by "S), only a start character (normally "Q) will
decctlq
restart it. This is compatible with DEC's vendor supplied systems.
-decctlq After output is suspended, any character typed will restart it; the start character will
restart output without providing any input. (This is the default.)
tostop
Background jobs stop if they attempt terminal output.
-tostop Output from background jobs to the terminal is allowed.
Convert "-,, to u·" on output (for Hazeltine terminals).
tilde
Leave poor "-,, alone.
-tilde
Output is being discarded usually because user hit control 0 (internal state bit).
flusho
-flusho Output is not being discarded.
Input is pending after a switch from cbreak to cooked and will be re-input when a
pendin
read becomes pending or more input arrives (internal state bit).
- pendin Input is not pending.
intrup
Send a signal (SIGTINT) to the terminal control process group whenever an input
record (line in cooked mode, character in cbreak or raw mode) is available for reading.
-intrup Don't send input available interrupts.
mdmbuf Start/stop output on carrier transitions (not implemented).
-mdmbuf
Return error if write attempted after carrier drops.
Send output characters without any processing.
litout

4th Berkeley Distribution

11 May 1981

2

STTY (I)

UNIX Programmer's Manual

STTY (I)

-litout Do normal output processing, inserting delays, etc.
Don't send hangup signal if carrier drops.
Dohang
-nohang Send hangup signal to control process group when carrier drops.
etxack
Diablo style etx/ack handshaking (not implemented).
The following special characters are applicable only to the new teletype driver and are not normally changed.
susp c
dsusp c

set
set
rprnt c
set
set
flush c
werase c set
Inext c
set

suspend process character to c (default control Z).
delayed suspend process character to c (default control Y).
reprint line character to c (default control R).
flush output character to c (default control 0).
word erase character to c (default control W).
literal next character to c (default control V).

SEE ALSO

ioctI(2), tabs(l), tset(l), tty(4)

4th Berkeley Distribution

11 May 1981

3

STYLE (1)

UNIX Programmer's Manual

STYLE (1)

NAME

style -

analyze surface characteristics of a document

SYNOPSIS

style [ -ml ] [ -mm] [ -a] [ -e) [ -I num] [ -r num ] [ -p] [ -P ] file ...
DESCRIPTION
Style analyzes the surface characteristics of the writing style of a document. It reports on reada-

bility, sentence length and structure, word length and usage, verb type, and sentence openers.
Because style runs deroffbefore looking at the text, formatting header files should be included
as part of the input. The default macro package -ms may be overridden with the flag -mm.
The flag -ml, which causes deroff to skip lists, should be used if the document contains many
lists of non-sentences. The other options are used to locate sentences with certain characteristics.
- a
print all sentences with their length and readability index.

-e

print all sentences that begin with an expletive.
-p
print all sentences that contain a passive verb.
-Inum print all sentences longer than num.

-rnum print all sentences whose readability index is greater than num.
- P
print parts of speech of the words in the document.
SEE ALSO

deroff( 1), diction (1)

BUGS
Use of non-standard formatting macros may cause incorrect sentence breaks.

7th Edition

18 January 1983

1

SU (1)

UNIX Programmer's Manual

SU(1 )

NAME

su - substitute user id temporarily
SYNOPSIS

su [ userid ]
DESCRIPTION

Su demands the password of the specified userid, and if it is given, changes to that userid and
invokes the Shell shU) without changing the current directory. The user environment is
unchanged except for HOME and SHELL, which are taken from the password file for the user
being substituted (see environ (7» . The new user ID stays in force until the Shell exits.
If no userid is specified, 'root' is assumed. To remind the super-user of his responsibilities, the
Shell substitutes '#' for its usual prompt.
SEE ALSO

shU)

BUGS
Local administrative rules cause restrictions to be placed on who can su to 'root', even with the
root password. These rules vary from site to site.

3rd Berkeley Distribution

16 November 1979

1

SUM(I)

UNIX Programmer's Manual

SUM (1)

NAME

sum - sum and count blocks in a file
SYNOPSIS
sum file
DESCRIPTION

Sum calculates and prints. a 16-bit checksum for the named file, and also prints the number of
blocks in the file. It is typically used to look for bad spots, or to validate a file communicated
over some transmission line.
SEE ALSO
wc(1)
DIAGNOSTICS

'Read error' is indistinguishable from end of file on most devices; check the block count.

7th Edition

18 January 1983

1

UNIX Programmer's M,1I1ual

SYMI ,CHK(.l.)

SYMLCHK( 1)

NAMI~

symlchk - check fur bad symbolic links
SYNOPSIS

symlchk

I

-p ] mes [ ... ]

DESCHIPTION

Symbolic links, unlike hard links, Celli point to files that do not exist. The symlchk program takes a
list or files (possibly directories) and rccursively desccllds through t.hem, checking for symholic links
that cannot be followcd.
Normally, bad links are printcd. 1f thc - p Ilag is given, all symbolic links are printed.
DIAGNOSTICS

, "": E~il' SI~ltlls'is
links.

< 0' if thcpn~gral~l

'f~Ii'ls. '0' ii"l~o bad links ~,rd fhl~nd; otherwise the number of bad

AUTllon
.Jcn~rey

Mogul

SEE ALSO

IsO), I nO), symlink(2), readlink(2), stat(2)
BUGS

Even good links that point to directorics are not followed in the recursive descent. This may not
be a bug, since it would complicate the task of chccking the enUrc me system, t()r example.
;\ symbolic link may appcar bad becausc the user is denied access, evcn though the link is actually
good. Running lhis progr'1Il1 as rool will avoid this.

7th Edition

Stanford

SYMORDER ( 1 )

UN1X Programmer's Manual

SYMORDER ( 1 )

NAME

symorder - rearrange name list
SYNOPSIS

symorder orderlist symbolfile
DESCRIPTION

Order/ist is a file containing symbols to be foUnd in symbolfile, 1 symbol per line;
Symbo/file is updated in place to put the requested symbols first in the symbol table, in the
order specified. This is done by swapping the old symbols in the required spots with the new
ones. If all of the order symbols are not found, an error is generated.
This program was specifically designed to cut down on the overhead of getting symbols from
Ivmunix.
SEE ALSO

nlist(3)

3rd Berkeley Distribution

10, October 1979'

1

SYSLINE( 1)

UNIX Programmer's Manual

SYSLINE( 1)

NAME

sysline - display system status on status line of a terminal
SYNOPSIS

1)'lllne [ - bedehDllmpqrlJ ] [

+N ]

DESCRIPTION

sysline runs in the background and periodically displays system status information on the status
line of the terminal. Not all terminals contain a status line. Those that do include the h19,
concept 108, Ann Arbor Ambassador, vt100, Televideo 9251950 and Freedom 100. If no flags
are given, sysline displays the time of day, the current load average, the change in load average
in the last 5 minutes, the number of users (followed by a 'u'), the number of runnable process
(followed by a 'r')[VAX only], the number of suspended processes (followed by a 's')[VAX
only], and the users who have logged on and off since the last status report. Finally, if new
mail has arrived, a summary of it is printed. If there is unread mail in your mailbox, an aster~
isk will appear after the display of the number of users. The display is normally in reverse
video (if your terminal supports this in the status line) and is right justified to reduce distraction. Every fifth display is done in normal video to give the screen a chance to rest.
If you have a file named .who in your home directory, then the contents of that file is printed
first. One common use of this feature is to alias chdir, pushd, and popd to place the current
directory stack in -I. who after it changes the new directory.
The following flags may be given on the command line.
- b

Beep once every half hour and twice every hour, just like those obnoxious watches you
keep hearing.

-c:

Clear the status line for 5 seconds before each redisplay.
Debug mode -- print status line data in human readable format
Print out only the information. Do not print out the control commands necessary to
put the information on the bottom line. This option is useful for putting the output of
sysline onto the mode line of an emacs window.
Print out the current dayldate before the time.
Print out the host machine's name after the time [V AX only].

-d

-e

-D
-h
-1
-m
-p

-r

+N
-q

-1

-I

-J

Don't print the names of people who log in and out.
Don't check for mail.
Don't report the number of process which are runnable and suspended.
Don't display in reverse video.
Update the status line every N seconds. The default is 60 seconds.
Don't print out diagnostic messages if something goes wrong when starting up.
Print out the process id of the sysline process onto standard output upon startup. With
this information you can send the alarm signal to the sysline process to cause it to
update immediately. sysline writes to the standard error, so you can redirect the standard output into a file to catch the process ide
Print "short" form of line by left-justifying iffescapes are not allowed in the status line.
Some terminals (the Televideos and Freedom 100 for example) do not allow cursor
movement (or other "intelligent" operations) in the status line. For these terminals,
sysline normally uses blanks to cause right-justification. This flag will disable the adding
of the blanks.
Force the sysline output to be left justified even on terminals capable of cursor

4th Berkeley Distribution

23 March 1981

1

SYSLINE (1)

UNIX Programmer's Manual

SYSLINE (1)

movement on the status line.
If you have a file .syslinelock in your home directory, then sysiine will not update its statistics
and write on your screen, it will just go to sleep for a minute. This is useful if you want to
momentarily disable sysiine. Note that it may take a few seconds from the time the lock file is
created until you are guaranteed that sysiine will not write on the screen.

nLES

letc/utmp
Idev/kmem
S{HOME}/.who
S{HOME}/.syslinelock

names of people who are logged in
contains process table [VAX only]
information to print on bottom line
when it exists, sysline will not print

AUTHORS
John Foderaro
Tom Ferrin converted it to use termcap.
Mark Horton added terminfo capability.
BUGS
If you interrupt the display then you may find your cursor missing or stuck on the status line.
The best thing to do is reset the terminal.
If there is too much for one line, the excess is thrown away.

4th Berkeley Distribution

23 March 1981

2

TABS (1)

UNIX Programmer's Manual

TABS(l)

NAME

tabs - set terminal tabs
SYNOPSIS

tabs [ -

8

1 [terminal 1

DESCRIPTION
Tabs sets the tabs on a variety of terminals. Various terminal names given in term(7) are

recognized; the default is, however, suitable for most 300 baud terminals. If the
present then the left margin is not indented as is normal.

-8

flag is

SEE ALSO

stty(l), term(7)

BUGS
It's much better to use tset(1).

7th Edition

18 January 1983

1

TAIL(I)

UNIX Programmer's Manual

TAIL (1)

NAME
tail - deliver the last part of a file
SYNOPSIS
tall [ ± number [Ibc] [fr] ] [file ]
DESCRIPTION

Tail copies the named file to the standard output beginning at a designated place. If no file is
named, the standard input is used.
Copying begins at distance +number from the beginning, or - number from the end of the
input. Number is counted in units of lines, blocks or characters, according to the appended
option 1, b or c. When no units are specified, counting is by lines.
Specifying r causes tail to print lines from the end of the file in reverse order. The default for r
is to print the entire file this way. Specifying f causes tail to not quit at end of file, but rather
wait and try to read repeatedly in hopes that the file will grow.
SEE ALSO

dd(l)

BUGS
Tails relative to the end of the file are treasured up in a buffer, and thus are limited in length.
Various kinds of anomalous behavior may happen with character special files.

4th Berkeley Distribution

18 January 1983

1

UNIX Programmer's Manual

TALK(1 )

TALK (1)

NAME

talk - talk to another user
SYNOPSIS

talk person [ ttyname ]
DESCRIPTION
Talk is a visual communication program which copies lines from your terminal to that of

another user.
If you wish to talk to someone on you own machine, then person is just the person's login
name. If you wish to talk to a user on another host, then person is of the form:

host fuser or
host. user or
host:user or
user@host
though host@ user is perhaps preferred.
If you want to talk to a user who is logged in more than once, the ttyname argument may be
used to indicate the appropriate terminal name.
When first called, it sends the message
Message from TalkDaemon@his_machine ...
talk: connection requested by your_name@your_machine.
talk: respond with: talk your_name@your_machine
to the user you wish to talk to. At this point, the recipient of the message should reply by typing
talk your_name@your_machine
It doesn't matter from which machine the recipient replies, as long as his login-name is the
same. Once communication is established, the two parties may type simultaneously, with their
output appearing in separate windows. Typing control L will cause the screen to be reprinted,
while your erase, kill, and word kill characters will work in talk as normal. To exit, just type
your interrupt character; talk then moves the cursor to the bottom of the screen and restores
the terminal.

Permission to talk may be denied or granted by use of the mesg command. At the outset talking is allowed. Certain commands, in particular nroff and prO) disallow messages in order to
prevent messy output.
FILES

letc/hosts
letc/utmp

to find the recipient's machine
to find the recipient's tty

SEE ALSO

mesg (I ), who (1), mail( 1), write 0)

4th Berkeley Distribution

27 June 1983

1

TANGLE(lL)

UN IX Programmer's Manual

TANGI J'~( 1.1.)

NAME

tangle, weave - convert web file into pascal file, texfile
SYNOPSIS

tangle webfile[. web] [changefite[.ch]]
WCal'C [ - X ] wchf!le[.web] [challgel11e[.ch]]
l)"~SCnJPTION

The tangle program converts a WI'J~ source doclIment into a Pascal program that may be compiled
in t.he usual WCJy with the on-line' Pascal compiler (e.g., pcO». The output me is all in lowcr case
and packed int.o lines of 72 characters or less, with the only concession to rcadability being the ter~
minatation of lincs at scmicolons when t.his can be done conveniently.
WEB is a ncw languagc that Don Knut.h has crcated, primarily for his own use in rewrit.ing TeX.
The WEB language allows one to preparc a single document that contains all the infrJlled by using .tex as the extension of the WEB nIe name.
There are several macros in webhdr.tcx that probahly should be redefined by the lIser at the bcgin~
ning of the WEB file. It is a good idea to set \Lillc to the name of the program. And,. to cause output of only changed modules, one can say \)et\maybe \iffillsc.

=

WEB and the November 1981 versions of tangle and weave are described in a hard-copy document
av,litable from Phyllis Winkler in MJH 326. This document wag~ of course, written in WEB and it
speaks well for the new language. Get a copy if YOli think that you might like to lise WEB.
FILES

/usrlstanford/lib/lexR2/macros/webhdr.tex 'reX macros used by weave output.
SEE ALSO

tex(1)
pe(1)

pxp( 1) (fhr formatting tangle output when debugging)
BUGS

'111cre probably should be some way to put the output on a different directory from the WEB file.
AUTI-IOUS
WEB was designed by Donald E. Knuth, who iml>lcmcntcd it using itself: lnstalled at Stanford by

Howard Trickey, November 30, 1982.

7th Edition

1

TAR (1)

UN IX Programmer's Manual

TAR( 1)

NAME

tar -_. tape archiver
SYNOPSIS
htr

I key] [ filename

H1ename ... ] .[-J

DESCIUPTI0N
Ttlr saves multiple mes into a single archive file, or else unpacks a single archive file into a set of
destination 11Ies. It was written ()r lise in copying disk files to tape, and restoring them to disk from
tape (hence its name), hut in fact it works just fine with Lhc archiv~ a disk me or even a pipe.

The behavior of Tar is determined by th~ key argulllent. 'rhe key is a string of characters containing a function letter (tdling far whether to read or write the archive Ale), and possibly one or more
function modifiers that tell it Stich things ~,s whether or not it is supposed to priut a list of files that
it is processing, and whether it is supposed to honor the file owner and protection information
when files are being restored from an archive. The remaining arguments aller the key are file or
directory names specifying the files to dump or restore. If the key cont~,ills the letter "T', then the
first argument after the key is the name of a file to use as the archive.
In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of
that directory.
V\'hcn tar is dumping files, a filename arglllllent of" -" (a single dash) causes lar to read and process a list of filenames from its standard illPut, then rcsullle takillg filenames from the command
line after the end of standard input is reached. Thus
tar c Apples rr* cherries
means t.he sallle thing as
Is -d fr* I tar c Apples - cherries
Th(~

function portion of the key is one of the t()ltowing letters:

r

'Create an archive. II' the archive is a magnetic tape, then skip to the end of the existing
files 011 the tape bel" >. In
this mode, it accepts and executes the commands listed below. If it is invoked with arguments.
it performs an open command (see below) with those arguments.

Once a connection has been opened. te/net enters input mode. In this mode, text typed is sent
to the remote host. To issue te/net commands when in input mode. precede them with the te/net uescape character" (initially u .. ["). When in command mode. the normal terminal editing
conventions are available.
The following commands are available. Only enough of each command to uniquely identify it
need be typed.
open host [ port]
Open a connection to the named host. If the no port number is specified, te/net will
attempt to contact a TELNET server at the default port. The host specification may be
either a host name (see hosts(S» or an Internet address specified in the "dot notation" .
close

Close a TELNET session and return to command mode.

quit

Close any open TELNET session and exit te/net.

l

Suspend Ie/net. This command only works when the user is using the csh( 1).

escape [ escape-char]
Set the Ie/net "escape character". Control characters may be specified as " .... followed
by a single letter~ e.g. "control·X" is ""X".
status Show the current status of fe/net. This includes the peer one is connected to. as well as
the state of debugging.
options
Toggle viewing of TELNET options processing. When options viewing is enabled. all
TELNET option negotiations will be displayed. Options sent by Ie/net are displayed as
HSENT", while options received from the TELNET server are displayed as "RCVD".
crmod Toggle carriage return mode. When this mode is enabled any carriage return characters
received from the remote host will be mapped into a carriage return and a line feed.
This mode does not affect those characters typed by the user, only those received. This
mode is not very useful, but is required for some hosts that like to ask the user to do
local echoing.

? [ command]
Get help. With no arguments, fe/net prints a help summary. If a command is specified.
te/nerwill print the help information available about the comnland only.

BUGS
This implementation is very simple because r/ogin(I C) is the standard mechanism used to communicate locally with hosts.

4th Berkeley Distribution

18 July 1983

UNIX Programmer's Manual

TEST(l)

TEST (1)

NAME

test - condition command
SYNOPSIS

test expr
DESCRIPTION

test evaluates the expression expr, and if its value is true then returns zero exit status; otherwise, a non zero exit status is returned. test returns a non zero exit if there are no arguments.
The following primitives are used to construct expr.
-r file true if the file exists and is readable.
-w file true if the file exists and is writable.
-f file true if the file exists and is not a directory.
- d file true if the file exists exists and is a directory.
-5 file
true if the file exists and has a size greater than zero.
-t [ fildes ]
true if the open file whose file descriptor number is fildes (1 by default) is associated
with a terminal device.
-z sl
true if the length of string sl is zero.
-n sl
true if the length of the string sl is nonzero.

sl - s2 true
sl != s2 true
sl
true
nl -eq n2
true

if the strings sl and s2 are equal.
if the strings sl and s2 are not equal.
if sl is not the null string.

if the integers nl and n2 are algebraically equal. Any of the comparisons -ne,

-gt, -ge, -It, or -Ie may be used in place of -eq.
These primaries may be combined with the following operators:
unary negation operator

- a

binary and operator

- 0

binary or operator

(expr)
parentheses for grouping.
-a has higher precedence than -0. Notice that all the operators and flags are separate arguments to test. Notice also that parentheses are meaningful to tbe Shell and must be escaped.
SEE ALSO

shU), find(l)

7th Edition

18 January 1983

1

UN lX Programmer's Manual

TEX ( 11.)

'fEX(lL)

NAME

tex, latex, initex, virtex -- text fhrmatting and typesetting
SYNOPSIS
tt~X [

first line :I

latex [ first line 1
initcx [ first line .J
vi rh~x [ first line]
DESCIUPTION

TeX formals interspersed text and comman(isan.d outputs .~l typeset~~~ indcpcnd~,nt. file (called I?VI
which is short for DeVice Independent). The TcX language is described in the publication The
TeXbook by Donald E. KnUl\). Old manuals (TeX alld AI HTAFONT: New Directions in TypesettiNg) should bc put away where they will never bc seen, since there are literally hundereds of
di1Tercnces from the old TeX78 systcm that it describes.
/\ny argumcnts given on the command line to the 'rex programs are passed to them as t.he first
input line. /\s descrihed in the TeXbook. that line should begin with a file name or a \contro]sequcnce. The normal usage is to say '"tcx paper" to start processing l)(lIH!I:/CX. The name "paper"
will be the "jobn£lmc", and is lIsed in forming output file names. Directory paths are stripped from
"paper" before forming the jobnamc, so all Olltput will he in the current directory. If TeX docsn't
gd. a file name in the first line, thc jobname is "texput". The default '.tex' extension can be overridden by specifying an extcnsion explicitly.

(f there is no p(lpcr.tex in thc current directory, TcX will look through a search path of directories
to try to find it. The slanl.iyslem~

AUTHORS.

LaTeX was designed and implemented by l"esH'CLamport. ''reX was designed by Dbnald E.
Knuth, who implemented it using his \VE.B system for i"ascal progranls. I'nstallcd at Stanthrd by
Howard Trickey'.

7th Edition

1

TEX(lL)

UNIX Programmer's Manual

TEX(lL)

NAME
tcx, latex, initcx, virtex

text formatting and typesetting

SYNOPSIS

tcx [ first line 1

I

I

Intcx [ first line]
initex [ first. tine]
virtex [ first line]
DESCIUPTION

ty~e~cttcr indc-pcndent file (callcd DV!
which is short tllr Dc Vice Indcpcndcnt). The TeX languagc is described in the publication The
TeXbook by Donald E. Knut.h. Old manuals (TeX and Al HT Al'nNT: New Directions ill Typesetlill0 should he put away where they wi1l never be secn, since t.here are literally hundereds of
dillcrences (hml thc old TeX7~ system that it dcscribes.
-

___ . TeX formats i-nterspersed tcxt-and-comt}},\11{}s- and outputs-a

Any argulllents given on the command line to thc TcX programs are passcd to thcm as the first
input line. As described in the TeXbook, that line should bcgin with a file name or a \controlsequcncc. The normal usage is to say "tex paper" to start processing paper.lf.x. The name "paper"
will be the "jobnamc", and is lIsed in f()rming output file names. Directory paths are stripped from
"paper" before fl)tlning the jobname, so all output will be in the current directory. If TeX doesn't
gel a file name in the first line, the jobname is '"texput". The dcflmlt '.tex' extension can be over·
ridden by specifying an extension explicitly.

If t.here is no paper.tex in the current direclory, TeX will look through a search path of directories
to try to find it. The standard library 011 the deHllIlt search path has the basic ((.lrmal package,
plain.tex, described in the TeXbook,as well as several others. Note that it is hardly ever necessary
to \input plain, since the Ie_x program has preloaded it This means that all of the control
sequences discussed in the TeXbook arc known to TeX. Another TeX processor in cOlllmon use is
lalfx. It is like tex in all ways except that it has thc thrmat p~Ickage 11I1('}CI('X preloaded instead of
plain.lex. This is a Scribe-inspired doclllllent preparation system being developed by I,eslie I ,amport. See the m:tlllt.il page /(fIl'X( I) for more infhrmation.
The Olltput I .lVI file is written on IUlIIIl'.dl'i where lIall1(, is lhe jobname. A log of error messages
goes into name. log.
,~ ,
I>VI mes should be printed on the Dover with dl'ip (1). Note that there have been inc()mpatiblochanges in the I)VI I-{)rmat between TeX7g and TeX, so programs used to print TeX78 output will
not work l-tH' TeX.
A note about (t>llts: the TeXbook says that Plain TeX llses t.he basic fonts cmrlO, cmbxlO. etc. InHlct it lIses amrlO, amhxlO, etc., and whcnever the TeXbook implics that you should use a font
name beginning with Clll, you should suhstitllt(~ olle heginning with am. (CIlI stands f()r "Computer
Modern", which hasn't becn designcd y(~t. Alii stands li)r "Almost COIll)llltl'r Model'll". the interim
liml Hmlily. A further source of confusion is that there actually are some CIIl ()ilL') installed, but
these are ItH' lise by the ohsolete TeX7~ and are slightly incompatible with TeX.)
There are some environment variables that can be used to set up directory paths to search when
TeX opens a file for input. For example, the csh command
setenv THX I N PUTS .:/usr/me/mytib:/usr/local/lib/tex82
or the sit command sequence
'I'EX I N PUI'S .:/lIsr/me/mylib:/usrlstanford/lib/tex82/macros
export TI~XINPUTS
would cause alt invocations of te,x and it.;; derivatives to look for \input files first in the current
directory, then in a hypothetical user's "myIib", and finally in the system library. Normally, the

=

7th Edition

1

TEX(lL)

UNIX Programmer's Manual

TEX(lL)

user will place the command sequcnce which scle; up the TEXINPUTS environment variable in the
.cshrc or .profile filc. The Environment section below lists the relevant environment variables, and
their defaults.
"
The e response to TeX's error prompt causes the vi editor to start up at tlle current line of the·
current file. The environment variable, TEXEDIT, that can be used to change the editor used. It
should contain a string with "%s" indicating where the filename goes and "%d" indicating where
the decimal linenumber (if any) goes. For example, a TEXEDIT string for emacs might bc set by:
setenv TEXEDIT "/usrlstanford/bin/emacs -Itex-start -estartlinc %d %s"
(where lex-slarl is installed in the ·cmacs loadpath, as it is hcrc).

A convenient file in the library is llllll.tex, containing nothing. When tex can't find a file it thinks
you want to input, it keeps asking you for another file name; responding 'nutr gets you out of the
loop if you don't want to input anything,
Two other TeX programs, illi/ex and vir/cx, can be used to create filst-loadillg customized versions
or TeX. The illilcx program is lIsed to create a [orlllal (.fiJi!) me that permits HlSl loading of fonts
,md macro packages. After processing the fbnts and definitions desired, a \dump command will
create the tf seeing what default settings arc.
rcxmt rctrallsmis,\'wn-timcoul
Set t.he per-packet retransmission timeout,hl secoJlds.
timcout lo/a/-lrallsl1I iss;oll-lilllcoul
Set the total lrmlsluissklll limeoutin seconds.
? I COIlIIlIlIIU1-lIa1l1l' ••• 1
Gives olle-·line summaries of the specified commands. With no arguments. lists thepossi·
ble cornmands.
COMMAND LINli: OPTIONS

The remote host with which tjip is tocommuuicatc Hlay he spccificdotl the command linc.lf this
is done, tftp will do an implicit cOl1l1eclcommand for this host name.
BUGS

Lots.

4th Berkeley Dislribution

16 .January -1984 .

1

TFTP( IC)

UNIX Programmer's Manual

TFTP(lC)

This manual page was created by reading the code. It is probably wrong.
'fhc "verbose" flag apparcntly has no effect.

4th Berkeley Distribution

16 January 1984

2

TIME(I)

UNIX Programmer's Manual

TIME(l)

NAME

time - time a command
SYNOPSIS

time command
DESCRIPTION

The given command is executed; after it is complete, time prints the elapsed time during the
command, the time spent in the system, and the time spent in execution of the command.
Times are reported in seconds.
On a PDP-II, the execution time can depend on what kind of memory the program happens to
land in; the user time in MOS is often haif what it is in core.
The times are printed on the diagnostic output stream.
Time is built in to csh(l), using a different output format.

BUGS
Elapsed time is accurate to the se.cond, while the CPU times are measured to the lOOth second.
Thus the sum of the CPU times can be up to a second larger than the elapsed time.
Time is a built-in command to csh(t), with a much different syntax. This command is available
as "/bin/time" to csh users.

4th Berkeley Distribution

18 ,January 1983

1

'l'IMECHECK( 1)

UNIX Programmer's Manual

T1MJ·:CHECK( 1)

NAME

timcchcck - checks and seL') Pup network time
SYNOPSIS

timcchc('k [(reset I confirm) [threshold in seconds] 1

DESCIUPTION

Timec/teck is a general purpose utility program that is used to maintain and report upon the local
and network-wide idea of what time it is. Invoked without any arguments, it report" the time of
day as indicated by the local clock, and by a network time server. It indicates which host on the
network responded first as a timeserver.
fr a keyword argument is given (actually, only the first letter is significant), the action taken varies
quite a bit:

rcset -- means that if the local time is not within threshold seconds of the network lime, the local
time should be rcset to the network timc. If the local lime is within bOllnds, no message is given;
otherwise, both clocks arc repOlted, and a message is r,iven to inuicatc lhat the Limc has been
changed. Note that only the super-liser can reset the local lime-of-day.
confirlll - has the same action as reset, except that it pauses hef()re reseting the time to get
confirmation from st(lndard input. The confirmation should he a slI'ing beginning with the letter 'y',
or any other string to indic
Copy file from local to remote. Tip prompts for the name of a local file to transmit.
-<
Copy file from remote to local. Tip prompts first for the name of the file to be sent.
then for a command to be executed on the remote machine.
-p from [ to]

Send a file to a remote UNIX host. The put command causes the remote UNIX system to run the command string "cat > 'to''', while lip sends it the "from" file. If
the "to" file isn't specified the "from" file name is used. This command is actually
a UNIX specific version of the u->" command.
-t from [ to]

Take a file from a remote UNIX host. As in the put command the "to" file defaults
to the "from" file name if it isn't specified. The remote host executes the command
string "cat 'from'~echo "A" to send the file to tip.
Pipe the output from a remote command to a local UNIX process. The command
string sent to the local UNIX system is processed by the shell.
Send a BREAK to the remote system. For systems which don't support the necessary ioctl call the break is simulated by a sequence of line speed changes and DEL
characters.
Set a variable (see the discussion below).
Stop tip (only available with job control>.
Get a summary of the tilde escapes
Tip uses the file fetcfremote to find how to reach a particular system and to find out how it
should operate while talking to the system~ refer to remote(S) for a full description. Each system has a default baud rate with which to establish a connection. If this value is not suitable.
the baud rate to be used may be specified on the command line. e.g. "tip-300 mds".
When tip establishes a connection it sends out a connection message to the remote system~ the
default value, if any, is defined in fetc/remote.

4th Berkeley Distribution

18 July 1983

TIP ( IC)

UNIX Programmer's Manual

TIP ( IC )

When tip prompts for an argument (e.g. during setup of a file transfer) the line typed may be
edited with the standard erase and kill characters. A null line in response to a prompt. or an
interrupt, will abort the dialogue and return you to the remote machine.
Tip guards against multiple users connecting to a remote system by opening modems and terminal lines with exclusive access, and by honoring the locking protocol used by uucp( I C).
During file transfers tip provides a running count of the number of lines transferred. When
using the -> and - < commands, the Heofread" and Heofwrite" variables are used to recognize
end-of-file when reading. and specify end-of-file when writing (see below). File transfers normally depend on tandem mode for flow control. If the remote system does not support tandem
mode, Hechocheck" may be set to indicate tip should synchronize with the remote system on
the echo of each transmitted character.
When tip must dial a phone number to connect to a system it will print various messages indicating its actions. Tip supports the DEC DN-II and Racal-Vadic 831 auto-call-units~ the DEC
DF02 and DF03, Ventel 212+, Racal-Vadic 3451, and Bizcomp 1031 and 1032 integral call
unit/modems.
VARIABLES
Tip maintains a set of variables which control its operation. Some of these variable are readonly to normal users (root is allowed to change anything of interest). Variables may be
displayed and set through the "s" escape. The syntax for variables is patterned after v;( I) and
Mai/O). Supplying "'all" as an argument to the set command displays all variables readable by
tqe user. Alternatively, the user may request display of a particular variable by attaching a"?'
to the end. For example ""escape?" displays the current escape character.

Variables are numeric, string, character, or boolean values. Boolean variables are set merely by
specifying their name~ they may be reset by prepending a "!' to the name. Other variable types
are set by concatenating an "==' and the value. The entire assignment must not have any
blanks in it. A single set command may be used to interrogate as well as set a number of variables. Variables may be initialized at run time by placing set commands (without the "-s"
prefix in a file .tiprc in one's home directory). The -v option causes tip to display the sets as
they are made. Certain common variables have abbreviations. The following is a list of common variables, their abbreviations, and their default values.
beautify
(bool) Discard unprintable characters when a session is being scripted~ abbreviated be.
baudrate
(num) The baud rate at which the connection was established~ abbreviated ba.
dialtimeout
(num) When dialing a phone number. the time (in seconds) to wait for a connection to
be established~ abbreviated dial.
echocheck
(boo)) Synchronize with the remote host during file transfer by waiting for the echo of
the last character transmitted; default is off.
eofread
(str) The set of characters which signify and end-of-tranmission during a - < file
transfer command~ abbreviated eofr.
eofwrite
(str) The string sent to indicate end-of-transmission during a - > file transfer command~
abbreviated eo/we
eo)
(str) The set of characters which indicate an end-of-line. Tip will recognize escape

4th Berkeley Distribution

18 July 1983

2

TIP (Ie)

tIP ( Ie J

UNIX Programmer's Manual

characters only after an end-of-Iine.
escape
(char) The command prefix (escape) character~ abbreviated es:. default valoe is ......
exceptions
(str) The set of characters which should not be discarded due to the beautification
H
switch~ abbreviated ex. default value is H\t\n\f\b •
force
(char) The character used to force literal data transmissjon~ abbreviated fo~ default
value is ·"P'.
framesize
(num) The amount of data (in bytes) to buffer between file system writes when receiving files~ abbreviated fro
host
(str) The name of the host to which you are connected~ abbreviated ho.
prompt
(char) The character which indicates and end-or-line on the remote host~ abbreviated
"\n·. This value is used to synchronize during data transfers. The
count of lines transferred during a file transfer command is based on recipt of this character.
pr, default value is

raise
(booH Upper case mapping mode'; abbreviated ra~ default value is 0.0: When this mode
is enabled, all lower case letters will be mapped to upper case by tip for' transmission to
the remote machine.
raisechar
(char). The input character used to toggle upper ca,se mapping mode~ abbreviated r('~
default value is "" A'.
record
(str) The name of the file in which
value is ""tip. record"".

3i

session: sCri'pi{ is recofded~ abbreviated rec~ default

script
(bool) Session scripting, mode;. abbreviated ~. defauf{ jig all \Vnen script is true. tip will
record everything transmitted by' the' remote macbine' in' the script record file specified
in record~ If the bea;utify switch is; on;" only pri:ntable ASCn characters wiH be included
in the script file (those characters betwee 04() and OT1'7>. The variable exceptions is
used to indicate characters which are an exception: to the normal beautification' ru'les~
tabexpand
(b00l) Expand tabs to spaces du,ring, file transfers~ abbreviated tab~ defatI'll value is
false. Each tab is expanded' to 8' spa~es~>
verbose
(boof) Verbose' mode:~ abbre'via:tedl l1eF/1, default is true: When verh0se rn:o'de is
enabled" tip .,.·tintS message~ whil~; dialing. shows the GGrrent< num;be'r of Ii nes
transferred during a' fire: transfer operatiQ,ns., anfiIe2
SEE ALSO
ed (1), ascii (7), expand (1)

BUGS
Won't handle ASCII NUL in string1 or string2; always deletes NUL from input.

7th Edition

18 January 1983

I

TRMAN(I)

UNIX Proarammer's Manual

TRMAN (1)

NAME

trman - translate version 6 manual macros to version 7 macros
SYNOPSIS

tnnan [file ]
DESCRIPTION

Trman reads the input file, which should be nroff/troff input and attempts to translate the version 6 manual sections therein to version 7 format. It is largely successful, but seems to have
trouble with indented paragraphs and complicated font control. You should expect to have to
fix up long sections by hand somewhat.
SEE ALSO

man (7)

BUGS

3rd Berkeley Distribution

24 February 1979

1

TROFF(1 )

UNIX Programmer's Manual

TROFF(l)

NAME

troff, nroff - text formatting and typesetting
SYNOPSIS

trofl' [ option ] ... [file] .. .
Droft [ option ] ... [file] .. .
DESCRIPTION

Troffformats text in the named files for printing on a Graphic Systems CI AIT phototypesetter;
nroff is used for for typewriter-like devices. Their capabilities are described in the NroJIITroff
user's manual.
If no file argument is present, the standard input is read. An argument consisting of a single
minus (-) is taken to be a file name corresponding to the standard input. The options, which
may appear in any order so long as they appear before the files, are:
-olist
Print only pages whose page numbers appear in the comma-separated list of numbers
and ranges. A range N - M means pages N through M; an initial - N means from
the beginning to page N; and a final N - means from N to the end.
-oN
Number first generated page N.
-sN
Stop every N pages. Nroffwill halt prior to every N pages (default N-l) to allow
paper loading or changing, and will resume upon receipt of a newline. Troffwill stop
the phototypesetter every N pages, produce a trailer to allow changing cassettes, and
resume when the typesetter's start button is pressed.
-mname Prepend the macro file lusrlllbltmacltmac.name to the input/lles.
-raN
Set register a (one-character) to N.
-1
Read standard input after the input ftlesare exhausted.
-q
Invoke the simultaneous input-output mode of the rd request.

Troffonly
-t
-f
-w
- b
- a
-pN

Direct output to the standard output instead of the phototypesetter.
Refrain from feeding out paper and stopping phototypesetter at the end of the run.
Wait until phototypesetter is available, if currently busy.
Report whether the phototypesetter is busy or available. No text processing is done.
Send a printable ASCII approximation of the results to the standard output.
Print all characters in point sizeN while retaining all prescribed spacings and
motions, to reduce phototypesetter elapsed time.
If the file lusrladm/tracet is writable, troff keeps phototypesetter accounting records there. The
integrity of that file may be secured by making troffa 'set user-id' program.
FILES

Itmplta.
temporary file
lusrllibltmac/tmac.• standard macro files
lusr/liblterm/ ...
terminal driving tables for nroff
lusr/lib/fontl·
font width tables for trolf
Idev/cat
phototypesetter
lusrI adm/tracct
accounting statistics for Idev/cat
SEE ALSO

J. F. Ossanna, NroJIITroffuser'smanual
B. W. Kernighan, A TROFF Tutorial
eqn(1), tbl(l), ms(7), me(7), man(7), colO)

7th Edition

7 February ·1983

1

TRUE(I)

UNIX Programmer's Manual

TRUE(l)

NAME

true, false - provide truth values
SYNOPSIS

true
false
DESCRIPTION

True and false are usually used in a Bourne shell script. They test for the appropriate status
"true" or "false" before running (or failing to run) a list of commands.
EXAMPLE

while true
do
command list
done
SEE ALSO

csh(1), shU), false(l)
DIAGNOSTICS

True has exit status zero.

7th Edition

11 January 1982

1

TSET (1)

UNIX Programmer's Manual

TSET ( I)

NAME

tset - terminal dependent initialization
SYNOPSIS
tset [ options] [ - m fident] hest baudrate] :type ] ... [ type]

reset ...
DESCRIPTION
Tset sets up your terminal when you first log in to a UNIX system. It does terminal dependent
processing such as setting erase and kill characters, setting or resetting delays, sending any
sequences needed to properly initialized the terminal. and the like. It first determines the type
of terminal involved. and then does necessary initializations and mode settings. The type of
terminal attached to each UNIX port is specified in the lerclttytype database. Type names for terminals may be found in the termcap(S) database. If a port is not wired permanently to a
specific terminal (not hardwired) it will be given an appropriate generic identifier such as dialup.

In the case where no arguments are specified, tset simply reads the terminal type out of the
environment variable TERM and re-initializes the terminal. The rest of this manual concerns
itself with mode and environment initialization, typically done once at login, and options used
at initialization time to determine the terminal type and set up terminal modes.
When used in a startup script (.prQlile for shO) users or . login for csh(1) users) it is desirable to
give information about the type of terminal you will usually use on ports which are not
hardwired. These ports are identified in letclttytype as dialup or plugboard or arpanet, etc. To
specify what terminal type you usually use on these ports. the - m (map) option flag is followed by the appropriate port type identifier, an optional baud rate specification, and the terminal type. (The effect is to ~~map" from some conditions to a terminal type, that is, to tell tset
Hlf I'm on this kind of port, guess that I'm on that kind of terminal"') If more than one mapping is specified, the first applicable mapping prevails. A missing port type identifier matches
all identifiers. Any of the alternate generic names given in termcap may be used for the
identifier.
A baudrate is specified as with stty(I), and is compared with the speed of the diagnostic output
(which should be the control termina)}. The baud rate test may be any com bination of: >, @.
<, and !~ @ means Hat" and! inverts the sense of the test. To avoid problems with metacharacters, it is best to place the entire argument to - m within .H·" characters~ users of csh( 1 )
must also put a H\" before any H!" used here.
Thus
tset -m 'dialup>300:adm3a' -m dialup:dw2 -m 'plugboard:?adm3a'
causes the terminal type to be set to an adm3a if the port in use is a dialup at a speed greater
than 300 baud~ to a dw2 if the port is (otherwise) a dialup (i.e. at 300 baud or less). (NOTE:
the examples given here appear to take up more than one line, for text processing reasons.
When you type in real tset commands, you must enter them entirely on one line.) If the type
finally determined by tset begins with a question mark, the user is asked if slhe really wants
that type. A null response means to use that type~ otherwise, another type can be entered
which will be used instead. Thus, in the above case, the user will be queried on a plugboard
port as to whether they are actually using an adm3a.

If no mapping applies and a final type option, not preceded by a - m, is given on the command
line then that type is used~ otherwise the identifier found in the letclttytype database will be
taken to be the terminal type. This should always be the case for hardwired ports.

It is usually desirable to return the terminal type, as finally determined by tset, and information
about the terminal's capabilities to a shell's environment. This can be done using the option~ using the Bourne shell, sh( 1):

4th Berkeley Distribution

16 October 1982

TSET (1)

UNIX Programmer's Manual

TSET ( I )

export TERM~ TERM == "tset - options.. :
or using the C shell, csh(I):
setenv TERM 'tset - options.. :
With csh it is convenient to make an alias in your .cshrc:
alias tset 'setenv TERM "tset - \! •.
Either of these aliases allow the command
tset 2621
to be invoked at any time from your login csh. Note to Bourne Shell users: It is not possible
to get this aliasing effect with a shell script, because shell scripts cannot set the environment of
their parent. (If a process could set its parent's environment. none of this nonsense would be
necessary in the first place.)
These commands cause tset to place the name of your terminal in the variable TERM in the
environment~ see environ(7).
Once the terminal type is known, tset engages in terminal driver mode setting. This normally
involves sending an initialization sequence to the terminal, setting the single character erase
{and optionally the line-kill (full Iin"e erase» characters, and setting special character delays.
Tab and newline expansion are turned off during transmission of the terminal initialization
sequence.
On terminals that can backspace but not overstrike (such as a CRT), and when the erase chanlCter is the default erase character (~#' on standard systems), the erase character is changed to
BACKSPACE (Control-H).
The options are:

-ec

set the erase character to be the named character c on all terminals. the default being
the backspace character on the terminal, usually AH. The character c can either be
typed directly, or entered using the hat notation used here.

- kc

is similar to -e but for the line kill character rather than the erase character~ c defaults
to AX (for purely historical reasons). The kill characters is left alone if - k is not
specified. The hat notation can also be used for this option.
The name of the terminal finally decided upon is output on the standard output. This
is intended to be captured by the shell and placed in the environment variable TERM.

- n

On systems with the Berkeley 4BSD tty driver, specifies that the new tty driver modes
should be initialized for this terminal. For a CRT, the CRTERASE and CRTKILL
modes are set only if the baud rate is 1200 or greater. See tty(4) for more detail.

-)

suppresses transmitting terminal initialization strings.

-Q

suppresses printing the "Erase set to

H

and "Kill set to" messages.

If tset is invoked as reset. it will set cooked and echo modes, turn off cbreak and raw modes.
turn on newline translation, and restore special characters to a sensible state before any terminal dependent processing is done. Any special character that is found to be NULL or .. -1" is
reset to its default value.
This is most useful after a program dies leaving a terminal in a funny state. You may have to
type" reset" to get it to work since  may not work in this state. Often none of
this will echo.
EXAMPLES

These examples all assume the Bourne shell and use the - option. If you use csh, use one of
the variations described above. Note that a typical use of tset in a .profile or .login will also use"
the -e and - k options, and often the - n or -Q options as well. These options have not

4th Berkeley Distribution

16 October 1982

2

TSET (1)

UNIX Programmer's Manual

TSET ( 1 )

been included here to keep the examples small. (NOTE: some of the examples given here
appear to take up more than one line, for text processing reasons. When you type in real Isel
commands, you must enter them entirely on one line.)
At the moment, you are on a 2621. This is suitable for typing by hand but not for a .profile.
unless you are a/ways on a 2621.
export

TERM~

TERM == 'tset - 2621'

You have an h19 at home which you dial up on, but your office terminal is hardwired and
known in letc/ttytype.
export

TERM~

TERM:III 'tset - - m dialup:h 19'

You have a switch which connects everything to everything, making it nearly impossible to key
on what port you are coming in on. You use a vt100 in your office at 9600 baud, and dial up to
switch ports at 1200 baud from home on a 2621. Sometimes you use someone elses terminal at
work, so you want it to ask you to make sure what terminal type you have at high speeds, but
at 1200 baud you are always on a 2621. Note the placement of the question mark, and the
quotes to protect the greater than and question mark from interpretation by the shell.
export

TERM~

TERM=='tset - -m 'switch>1200:?vtlOO' -m 'switch < ==1200:2621'

All of the above entries will fall back on the terminal type specified in letclltytype if none of the
conditions hold. The following entry is appropriate if you always dial up, always at the same
baud rate, on many different kinds of terminals. Your most common terminal is an adm3a. It
always asks you what kind of terminal you are on, defaulting to adm3a.
export

TERM~

TERM == 'tset - ?adm3a'

If the file letclttytype is not properly installed and you want to key entirely on the baud rate, the
following can be used:
export

TERM~

TERM == 'tset - - m > 1200:vt 100' 2621'
1

Here is a fancy example to illustrate the power of tset and to hopelessly confuse anyone who
has made it this far. You dial up at 1200 baud or less on a co.nceptl00, sometimes over switch
ports and sometimes over regular dialups. You use various terminals at speeds higher than
1200 over switch ports, most often the terminal in your office, which is a vt 100. However.
sometimes you log in from the university you used to go to, over the ARPANET~ in this case
you are on an ALTO emulating a dm2500. You also ofle,n log .in on various hardwired ports.
such as the console, all of which are properly entered in letc/ttytype. You want your erase character set to control H, your kill character set to control U,and don't want (sel to print the
HErase set to Backspace, Kill set to Control U'" message.
.
export TERM~ TERM=='tset -e -kAU -Q - -m 'switch< ==1200:conceptl00' -m
'switch:'!vtlOO' -m dialup:conceptlOO -m arpanet:dm2500'
FILES

I etcl Uytype
letc/termcap

port name to terminal type mapping database
terminal capability database

SEE ALSO

csh(t), sh(t), stty(I), ttytype(S), termcap(S), environ(7)
AUTHORS

Eric Allman
David Wasley
Mark Horton
BUGS

4th Berkeley Distribution

16 October 1982

3

TSET (1)

UNIX Programmer's Manual

TSET ( 1 )

The tset command is one of the first commands a user must master when getting started on a
UNIX system. Unfortunately, it is one of the most complex. largely because of the extra effort
the user must go through to get the environment of the login shell set. Something needs to be
done to make all this simpler, either the login(I) program should do this stuff. or a default shell
alias should be made, or a way to set the environment of the parent should exist.

4th Berkeley Distribution

16 October 1982

4

TSORT(l)

UNIX Prosrammer's Manual

TSORT (1)

NAME

tsort - topological sort
SYNOPSIS

tsort [ file ]
DESCRIPTION

Tsort produces on the standard output a totally ordered list of items consistent with a partial
ordering of items mentioned in the input file. If no file is specified, the standard input is
understood.
The input consists of pairs of items (nonempty strings) separated by blanks. Pairs of different
items indicate ordering. Pairs of identical items indicate presence, but not ordering.
SEE ALSO

lorder(1)
DIAGNOSTICS
Odd data: there is an odd number of fields in the input file.
BUGS

Uses a quadratic algorithm; not worth fixing for the typical use of ordering a library archive file.

7th Edition

18 January 1983

1

TTIME(l)

UNIX Programmer's Manual

TTIME(l)

NAME

ttimc -- measure terminal output rate
SYNOPSIS

ttime [ - ] 

UNIX Programmer's Manual

UUCP(lC)

NAME

uucp, uulog - unix to unix copy
SYNOPSIS

uuep [ option ] ... source-file ... destination-file
u810a [ option ] .. .
DESCRIPTION

Uucp copies files named by the source.file arguments to the destination-file argument. A file
name may be a path name on your machine, or may have the form
system-name !pathname
where 'system-name' is taken from a list of system names which uucp knows about. Shell
metacharacters ? [] appearing in the pathname part will be expanded on the appropriate system.
Pathnames may be one of
(l)
a full pathname;
(2)
a pathname preceded by -user; where user is a userid on the specified system and is
replaced by that user's login directory;
(3)
anything else is prefixed by the current directory.
If the result is an erroneous pathname for the remote system the copy will fail. If the
destination-file is a directory, the last part of the source-file name is used.
Uucp preserves execute permissions across the transmission and gives 0666 read and write permissions (see chmod(2».
The following options are interpreted by uucp.

Make all necessary directories for the file copy.
-e
Use the source file when copying out rather than copying the file to the spool directory.
-m
Send mail to the requester when the copy is complete.
Uulog maintains a summary log ofuucp and uuxU C) transactions in the file
'/usrlspoolluucp/LOOFILE' by gathering information from partial log files named
'/usrlspoolluucp/LOO.•. 1'. It removes the partiailog files.
The options cause uul()g to print logging information:
-d

-ssys Print information about work involving system sys.
-auser
Print information about work done for the specified .user.
FILES

lusrlspoolluucp - spool directory
lusr/lib/uucp/. - other data and program files
SEE ALSO

uux (t C), mail (1)

D. A. Nowitz, Uucp Implementation Description
WARNING

The domain of remotely accessible files can (and for obvious security reasons, .usuallyshould)
be severely restricted. You will very likely not be able to fetch files by pathname; ask a responsible person on the remote system to se'ndthemto you. For the same reasons you will probably not be able to send files to arbitrarypathnames.

4th Berkeley Distribution

18 ,January 1983

1

UUCP(IC)

UNIX Programmer's Manual

UUCP (IC)

BUGS
All files received by uucp will be owned by uucp.
The - m option will only work sending files or receiving a single file. (Receiving multiple files
specified by special shell characters ? [] will not activate the - m option.)

4th Berkeley Distribution

18 January 1983

2

UUENCODE ( 1C)

UNIX Programmer's Manual

UUENCODE ( 1C)

NAME
uuencode,uudecode - encode/decode a binary file for transmission via mail
SYNOPSIS

uueneode [ source] remotedest Imall sysl!sys2!"!decode
uudeeode [ file ]

DESCRIPTION

Uuencode and uudecode are used to send a binary file via uucp (or other) mail. This combination can be used over indirect mail links even when uusend(lC) is not available.
Uuencode takes the named source file (default standard input) and produces an encoded version
on the standard output. The encoding uses only printing ASCII characters, and includes the
mode of the file and the remotedest for recreation on the remote system.
Uudecode reads an encoded file, strips off any leading and trailing lines added by mailers, and
recreates the original file with the specified mode and name.
The intent is that all mail to the user "decode" should be filtered through the uudecode program. This way the file is created automatically without human intervention. This is possible
on the uucp network by either using 'sendmail or by making rmail be a link to Mail instead of
mail. In each case, an alias must be created in a master file to get the automatic invocation of
uudecode.
If these facilities are not available, the file can be sent to a user on the remote machine who
can uudecode it manually.
The encode file has an ordinary text form and can be edited by any text editor to change the
mode or remote name.
SEE ALSO

uuencode(S), uusend(1C), uucp(1C), uux(1C) , mail(l)
AUTHOR

Mark Horton
BUGS

The file is expanded by 35% (3 bytes become 4 plus control information) causing it to take
longer to transmit.
The user on the remote system who is invokinguudecode (often uucp) must have writepermission on the specified file.

4th Berkeley Distribution

1 June 19·80

1

UUSEND (IC)

UNIX Programmer's Manual

UUSEND (Ie)

NAME

uusend - send a file to a remote host
SYNOPSIS

uusend [ - m mode ] sourcefile sys 1!sys2!.. !remotefile
DESCRIPTION
Uusend sends a file to a given location on a remote system. The system need not be directly
connected to the local system, but a chain of uucp

!fi.dift'"

will get the fl files from the usg and pwba machines, execute a diD' command and put the
results in fl.diff in the local directory.
Any special shell characters such as < > ~ should be quoted either by quoting the entire
command-string, or quoting the special characters as individual arguments.
FILES

lusrlspoolluucp
spool directory
lusr/lib/uucp/- other data and programs
SEE ALSO
uucp(1C)
D. A. Nowitz, Uucp Implementation Description

WARNING
An installation may ,and for security reasons generally will, limit the list of commands executable on behalf of an incoming request from uux. Typically, a restricted site will permit little
. other than the receipt of mail via uux.

BUGS
Only the first command of a shell pipeline may have a system-name I. All other commands are
executed on the system of the first command.
The use of the shell metacharacter • will probably not do what you want it to do.
The shell tokens < < and > > are not implemented.
There is no notification of denial of execution on the remote machine.

4th Berkeley Distribution

18 January 1983

1

UN IX Programmer's IV[anllal

VERCH (1)

VERCI-1 ( 1)

NAME

verch - version changing program Ibr Pascal sources
SYNOPSIS

verch Infilc [Outfile] [-\lagl +] [-nag2-] ...
vcrdl I ntile [Oulnt~] l·strip]
DESCRIPTION

k'h'RCII is a program that can be used to change back and forth bct.ween different vcrsions of a
Pascal program. To convcrt from onc version to another, you rlln the program through VERCH,
and it commcnts out blocks or code that arc not relcvent to thc current version, and ul1comments
blocks that arc, according to commands which arc contained in spccial-format cornmcnts in the
codc iL~clt: Thus both t.he input and output to VERCH ~lrc compiJablc Pascal programs.
In lhe Pascal source code, version command linc hegins with thc characters "( *%" followed by one
following commands: SETT, SETF, SET?, lVI', IFF, ELSE, EN DC, fhl10wcd by a nag
name. Spaces and tabs can bc uscd frcely, and comments can be addcd after thc last. part of lhc
command.

or the

(*%
(*%
(*%
(*%
(*%
(*%
(*%
(*%

Sctt SI *)
Setf S I *)
Set? SI *)
1ft SI *)
111' SI *)
Elsc *)
Endc *)
Delcte *)

(*% Nopagc *)
(*% Kchars *)

set flag "SI" to "truc"
sct nag "SI" to "falsc"
gct vallie of nag "SI" from uscr
if flag "s I" truc thcn don't comll1cnt out this block
if Ilag "s I" Illlse then don't comment out this block
bcgin reversc hlock
cnd of block
Delete blocks instead of commenting them out
(Also delctes all commancllincs.)
Uncommcnl everything, no maHer what the valuc of thc
fJags
I )elete page marks
TO'providc for Dcc··IO compikr kludge. usc "%"and ."
as the cOllllncnling-olll characters instead or" {" and"}"

If "'1''', "F", or "?" appear allcr a SEIT, SETF, or SET? cOllllnand, then the version changcr will
replacc it with the current valuc of the nag. Thus you can lell when you look at a program what
version is currently activc. For instancc, we can tell by the following line t.hat the progranl hasn't
been run through thc version changer yct. and thus the vcrsion "81" is still inactive:
(*% SETT Sl F *)

The nags may also he set directly from t.he cOIllIll,md line, as shown above. The nags are set as
switches. wilh .110,1:/- indic(lling that l1ag I should h. .~ SI..,t to Fals~' and .l11I!.!! -/- illdicating thal flag2
should be set to True. Thc cOlllmand slrip (see below) Inay also he set from the command line. I r
VERC1-1 encounters the use of a \lag which has not been set, it will qucry the lIser fbr the valuc to
insert.
A full·blown example: supposc wc wanted to change t.he Vax version of a program to thc S-l version of the program. Herc is the program before and nne]' running it through VERCH:

BEI"ORE: ************************************************************

7t.h Editiou

I .

VERCH(l)

UN IX Programmer's Manual

VERCH( 1)

(*%IFT Vax *)
program PTRANS (iNPUT,OUTPUT);
(*%EI,SE*)

{}
{ program PTRANS:}

{}
(*%ENDC*)
begin
end.

AF'rER: *************************************************************
:.:-

.

(*%SETF Vax F *)
(*%\1,"(' Vax *)
{ program PTRANS (lNPUT,OUTPUT);}
(*%HI_SE*)
program P'I'RANS;

(*%ENDC*)

begin
end.
**********************************************************************

Note t.hat if we had lIsed "SET?" instcHd of "SE!'F", the version l:hanger would have asked us
what we wanted the flag set to.
Other details:
"AND" lind "OR" can be lIsed to conC',ltenatc IFF and 1FT commands. For installce, aller read-

ing the following command, the version ch,angef would not comment out the block lhat fl)l\owed if
eilher nag were true:
(*% 1FT Sl OR 1FT VAX *)
Blocks may he nested. The AN I) function is performed

()nll~sted

blocks. In other words, if any

or the blocks containing (1 statcmcnt are "CrIse" hlocks, the slalcHlentis COil IIII ell ted Ol.lt.
Only the first 16 characters or a nag arc significant.
The original idea f()r the version~changef came fhun O.ick Si,te~.

This progranl depends on having at least twokindsofcotnments characters which are distinguished, e.g. (* *), and { }, so that comments may be nested atlcaSl one level deep. This is contnlry to the Pascal Standard, which mandates lhal a right cvrly bracket be treated identically with a
"*)", hut most. compilers support it.
Verch has a limit on the IHII1lher ofswitdlCS ~,llowcdon the C01111l.1and lille (currently scttH ten).
011 thc Humber ofllags thatmaybcsct from the comnwndlinc.

Thlls, there is a 1I1~IX illlum

If no output file name is given, Verch will
®to thc input me name.

Jl~lmC

the outpllt f:ile by appending the exte.nsiQIl

~lCW

SEE ALSO

unpcnt(1)
DIA(;NOSTICS

Verch now writes diagnostics to the standard Pascal output, so they nre user'·vi:rible.

7th Edition

2

VFONTINFO ( 1 )

UNIX Programmer's Manual

VFONTINFO ( 1 )

NAME

vfontinfo - inspect and print out information about UNIX fonts
SYNOPSIS

vfontlnfo [ -v ] fontname [ characters]
DESCRIPTION

Vfontirifo allows you to examine a font in the UNIX format. It prints out all the information in
the font header and information about every non-null (width> 0) glyph. This can be used to
make sure the font is consistent with the format.
The fontname argument is the name of the font you wish to inspect. It writes to standard output. If it can't find the file in your working directory, it looks in lusrllib/vlont (the place most of
the fonts are ·kept).
The characters, if given, specify certain characters to show. If omitted, the entire font is
shown.
If the -v (verbose) flag is used, the bits of the glyph itself are shown as an array of X's and
spaces, in addition to the header information.
SEE ALSO

vpr(1), vfont(S)
The Berkeley Font Catalog
AUTHORS

Mark Horton
Andy Hertzfeld

4th Berkeley Distribution

11 April 1980

1

VGRIND (1)

VGRIND (1)

UNIX Programmer's Manual

NAME

vgrind - grind nice listings of programs
SYNOPSIS

vgriod [ - f ] [ - ] [ -t ] [
-Ilanguage] name ...

-0 ] [

-x ] [

-w ] [

-so] [ -h header] [ -d file] [

DESCRIPTION
Vgrind formats the program sources which are arguments in a nice style using troff(l) Com-

ments are placed in italics, keywords in bold face, and the name of the current function is listed
down the margin of each page as it is encountered.
Vgrind runs in two basic modes, filter mode or regular mode. In filter mode vgrind acts as a
filter in a manner similar to tbl(I). The standard input is passed directly to the standard output
except for lines bracketed by the troff-like macros:

.vS

- starts processing

.vE

- ends processing

These lines are formatted as described above. The output from this filter can be passed to trojJ
for output. There need be no particular ordering with eqn (I) or tbl(I).
In regular mode vgrind accepts input files, processes them, and passes them to troff(l) for output.
In both modes vgrind passes any lines beginning with a decimal point without conversion.
The options are:
-f

forces filter mode
forces input to be taken from standard input (default if -f is specified)

-t

similar to the same option in trojJcausing formatted text to go to the standard output

-0

forces no keyword bolding

-x

outputs the index file in a "pretty" format. The index file itself is produced whenever
vgrind is run with a file called index in the current directory. The index of function
definitions can then be run off by giving vgrind the -x option and the file index as argument.

-w

forces output to the (wide) Versatec printer rather than the (narrow) Varian

-s

specifies a point size to use on output (exactly the same as the argument of a .ps)

- h

specifies a particular header to put on every output page (default is the file name)

-d

specifies an alternate language definitions file (default is /usr/Jib/vgrindefs)

-I

specifies the language to use. Currently known are PASCAL (-Ip), MODEL (-Im),C
(-Ie or the default), CSH (-lesh), SHELL (-Ish), RATFOR (-Ir), and ICON
( -II).

FILES

index
/usr /lib/ tmac/tmac. vgrind
/usr/lib/vfontedpr
/usr /lib/vgrindefs

file where source for index is created
macro package
preprocessor
language descriptions

AUTHOR

Dave Presotto & William Joy

4th Berkeley Distribution

3 August 1983

1

VGRIND (1)

UNIX Programmer's Manual

VGRIND (1)

SEE ALSO

vip (I), vtroff(I), vgrindefs (5)

BUGS
Vfontedpr assumes that a certain programming style is followed:
For C - function names can be preceded on a line only by spaces, tabs, or an asterisk. The
parenthesized arguments must also be on the same line.
For PASCAL - function names need to appear on the same line as the keywords junction or
procedure.

For MODEL - function names need to appear on the same line as the keywords is beginproc.
If these conventions are not followed, the indexing and marginal function name comment
mechanisms will fail.
More generally, arbitrary formatting styles for programs mostly look bad. The use of spaces to
align source code fails miserably; if you plan to vgrind your program you should use tabs. This
is somewhat inevitable since the font used by vgrind is variable width.
The mechanism of ctags in recognizing functions should be used here.

4th Berkeley Distribution

3 August 1983

2

VI (1)

UNIX Programmer's Manual

VI(I)

NAME

vi - screen oriented (visual) display editor based on ex
SYNOPSIS
~l

[ -t tag] [ -r] [ +command] [ -I] [ -wn] name ...

DESCRIPTION

Vi (visual) is a display oriented text editor based on exO). Ex and vi run the same code; it is
possible to get to the command mode of ex from within vi and vice-versa.
The Vi Quick Reference card and the Introduction to Display Editing with Vi provide full details on
using vi.
FILES

See exO).
SEE ALSO

ex 0), edit (1), "Vi Quick Reference" card, "An Introduction to Display Editing with Vi".
AUTHOR
William Joy

Mark Horton added macros to visual mode and is maintaining version 3
BUGS

Software tabs using AT work only immediately after the autoindent.
Left and right shifts on intelligent terminals don't make use of insert and delete character
operations in the terminal.
The wrapmargin option can be fooled since it looks at output columns when blanks are typed.
If a long word passes through the margin and onto the next line without a break, then the line
won't be broken.
Insert/delete within a line can be slow if tabs are present on intelligent terminals, since the terminals need help in doing this correctly.
Saving text on deletes in the named buffers is somewhat inefficient.
The source command does not work when executed as :source; there is no way to use the
:append , :change, and :lnsert commands, since it is not possible to give more than one line of
input to a : escape. To use these on a :global you must Q to ex command mode, execute
them, and then reenter the screen editor with vi or open.

3rd Berkeley Distribution

2 December 1979

1

UNIX Programmer's Manual

VLP (1)

VLP (1)

NAME

vip - Format Lisp programs to be printed with nroff, vtroff, or troff
SYNOPSIS

vip [ -p pointsize] [ -d ] [ -f) [ -I ] [ -y ] [ -T litle1] filel [ -T title2] file2 ...
DESCRIPTION

Vip formats the named files so that they can be run through nroff, vtroff, or troff to produce
listings that line-up and are attractive. The first non-blank character of each line is lined-up
vertically, as in the source file. Comments (text beginning with a semicolon) are printed in
italics. Each function·s name is printed in bold face next to the function. This format makes
Lisp code look attractive when it is printed with a variable width font.
Normally, vip works as a filter and sends its output to the standard output. However, the - y
switch pipes the output directly to vtroff. If no files are specified, then vip reads from the standard input.
The following options are available:
-p

The ""p switch changes the size of the text from its default value of 8 points to one of
6, 8, 10, or 12 points. Once set, the point size is used for all subsequent files. This
point size does not apply to embedded text (see - fbelow) .

-d

The -d switch puts vip into debugging mode.

- f

Vip has a filtered mode in which all lines are passed unmodified, except those lines
between the directives .Ls and .Le. This mode can be used to format Lisp code that is
embedded in a document. The directive .Ls takes an optional argument that gives the
point size for the embedded code. If not size is specified, the size of the surrounding
text is used.

-I

The -I switch prevents vip from placing labels next to functions. This switch is useful
for embedded Lisp code, where the labels would be distracting.

-y

This switch cause vip to send its output to vtroff rather than the standard output.

-T

A title to be printed on each page may be specified by using the -T switch. The -T
switch applies only to the next file name given. Titles are not printed for embedded
text (see -f, above). This switch may not be used if vip is reading from the standard
input.

FILES

/usr/lib/vlpmacs

troff/nroff macros

AUTHOR

Originally written by John K. Foderaro, with additional changes by Kevin Layer and James
Larus.
SEE ALSO

. vgrind (1), lisp (1 )
BUGS

vip transforms \ into \ \ so that it will be printed out. Hence, troff commands cannot be embedded in Lisp code.

4th Berkeley Distribution

14 July 1983

1

VMSTAT(l)

UNIX Programmer's Manual

VMSTAT(l)

NAME
vmstat - report virtual memory statistics
SYNOPSIS
vmstat [ -fs ] [interval [ count] ]
DESCRIPTION

Vmstat delves into the system and normally reports certain statistics kept about process, virtual
memory, disk, trap and cpu activity. If given a -f argument, it instead reports on the number
of forks and v/orks since system startup and the number of pages of virtual memory involved in
each kind of fork. If given a -s argument, it instead prints the contents of the sum structure,
giving the total number of several kinds of paging related events which have occurred since
boot.
If none of these options are given, vmstat will report in the first line a summary of the virtual
memory activity since the system has been booted. If interval is specified, then successive lines
are summaries over the last interval seconds. "vmstat 5" will print what the system is doing
every five seconds; this is a good choice of printing interval since this is how often some of the
statistics are sampled in the system; others vary every second, running the output for a while
will make it apparent which are recomputed every second. If a count is given, the statistics are
repeated count times. The format fields are:
Procs: information about numbers of processes in various states.
r
b

w

in run queue
blocked for resources (i/o, paging, etc.)
runnable or short sleeper « 20 sees) but swapped

Memory: information about the usage of virtual and real memory. Virtual pages are considered
active if they belong to processes which are running or have run in the last 20 seconds. A
"page" here is 1024 bytes.
avm
fre

active virtual pages
size of the free list

Page: information about page faults and paging activity. These are averaged each five seconds,
and given in units per second.
re
pi
po
fr
de
sr

page reclaims (simulating reference bits)
pages paged in
pages paged out
pages freed per second
anticipated short term memory shortfall
pages scanned by clock algorithm, per-second

up/hp/rk: Disk operations per second (this field is system dependent). Typically paging will be
split across several of the available drives. The number under each of these is the unit number.
Faults: trap/interrupt rate averages per second over last 5 seconds.
in
sy
cs

(non clock) device interrupts per second
system calls per second
cpu context switch rate (switches/sec)

Cpu: breakdown of percentage usage of CPU time
us
sy
id

user time for normal and low priority processes
system time
cpu idle

4th Berkeley Distribution

26 April 1981

1

VMSTAT(l)

UNIX Programmer's Manual

VMSTAT(l)

FILES

Idev/kmem, Ivmunix
SEE ALSO

The sections starting with "Interpreting system activity" in Installing and Operating 4.2bsd.
AUTHORS

William Joy and Ozalp Babaoglu
BUGS

There should be a screen oriented program which combines vmstat and ps(1) in real time as
well as reporting on other system activity.

4th Berkeley Distribution

26 April 1981

2

VNEWS( 1)

UN IX Programmer's Manual

VNEWS( 1)

NAME

vnews - read news articles
SYNOPSIS
VIlCWS [ -

a date

J[ -

n Ilcwsgrollps ] [ - t lilIes 'I [ - rxu ]

vnews -s
DESCnlPTJON
J/IlCIVS is a program for reading USENET news. It is based on readnews but has a CRT oriented
intcrfilce. The list of available commands is quite similar, although since vncws is a "visual" intcrniCe, most vnews commanus do not have to be terminated by a newline;

Vnews lIses the first 22 lines of UlC scre~n_ tq display the ,CUJT~Il!t article. Line 23 is the secondary
'PI:Olllp't line, and' is lIsed lo inpul strini~ (lll~uments to commatlcfs. I -ine 24 contains several fields.
The first fie1d is the prompt fielu. If vnews is at lhe end of an article, the prompt is "next?": otherwise the prompt is "more?,'. The second field is the llewsgrollp freId, which displays the current
ncwsgrollp, the number of the current article, and' the number or till' last article ill the newsgroup.
The third field cOlltlins the currenl t.ime, and the last field contains the word ttm~liltl if you have
mail. When you receive new mail, the bell 011 the terminal is rung and the word mail appears in
capital letters tl)r 30 seconds.
The -I' without any arguments prints unread articles. tlag causes the articles to be printed in
reverse order. The - l i flag causes the .Iwwsre file to be updated every 5 minutes. in case of an
unreliable system. (Note that if the newsrc file is updated, the x command will not restore it to its
original contents.)
The /l)lIowing !lags determine the selection of articles.
- n newsgroups
Select all artic1es t.hat. belong to lie wsgroups.
- t lilIes Select all articles whose titles contain one of the strings specified by litlc.t
-a [ dale]
Select all artides t.lwt were posted past the given £laIc (in gfldalcO) f(mnat).

- x

Ignore .IIClVsrc file. ' That is, select arlicles that have already been read as well as new
ones.

maintains a .lIcwsrc file in the your home directory that specifles all news articles already
It is updated at t.he end or each reading session ill which t.he --x option wasn't specified. If
the environment variable NEWSRC is present, it should be the path name of a file to be lIsed in
place of .newsrc.
[f you wish, an options line may be placed in your .l1etvsrc me. This line start.s with the word
options (left justified) fl)lIowed by t.he list of standard options just as they would he typed on the
command line. Such a list may include: the - II flag along with (I llewsgroup list: andlor the - r or
- t Hag. Continuation lines arc spccHk'd by f(}lIowing lines beginning with ~I space or tab character.
VI1CWS

re~ld.

vncws - s will print the newsgroup subscription list.
ENVIUONMENT

Options can be specified in the NI·:WSOP'fS environment parameter. Where conflicts exist.
options on the command line take precedence, followed by the .IICH'src options Jine, and lastly the
NE\VSOPTS parameter.
Whl~'n the user uses the reply command, the environment parmileterMAILEU will be used to
detenninc which mailer to usc. The dcnlllit is usually Ibin/mail.

If the user so desires, he may specify a specific paging program for articles. The environment
parameter PAGEn should be set tt) the paging program. The name of the article is reference~1 with

4th Ikrkc1cy Distribution

1 October 1984

1

UNIX Programmer's Manual

VNEWS(l)

VNEWS( 1)

a '%', as in the - c option. If no '%' is present, the article will be piped to the program. Paging
may be disabled by setting PAGER to a null value.
. If EDITOR is set, it will be used in place of the dcllmlt editor on your system to edit replies and
{bilow-ups.

If NAIVIE is set, it'wil1 be used as your full name whcn posting news or submitting a follow-up. If it
is not set, th(.~ name will be taken from the file .munc in your home directory. If this file is not
present, the name will be taken from letc/passwd.
]f NE\VSAHCJ-IIVE is set, a copy of any articles you post or follow-up to, will be save in the
specified file. I f it is the null string, they will be copied in author_copy in your home directory.

If N E\VSBOX is set, when you save or write a file, if the filename you specify does not begin with
a HI", it will be prepenc\ed with NEWSBOX.
If NEWSnC is set, it will be lIsed in place of the .newsrc file in your home directory.

If ORGANIZATION is set, it witl be used as thc natllc of your organization whenever you post an
article. Thc dcfilUll is compiled ill and is usually corrcct. Typically, you would only use this if you
were reading news at a site other than normal. (Or if you are trying to be cute.)
COMIV1ANDS

I ~ach vllews command may be preceded by a count. Some commands lISC the count: others ignore
it. 1f count is omitted, it uel:llllts to one. Smile commands prompt n>r an argument on the second
line t)·om thc bottom of the screen. Standard UN IX erase and kill processing is done· on this argumcnt. The argument is tenninated by a return. An interrupt (delete or break) gets you out or any
partially clltercd command.

In the following table.

l' B

is

w;,-~d

as a shorthand for Control-B.

Command

CR
t B

. Meaning
A. carriage return prints more or the current article, or goes on to thc next article if you are
at the end of tllc current article. A. SPACE is equivalent to CR.
Goes backwards COllllt pages.
Goes Ihrward COllnt IXlges.

1'1'
tD

Go I(wwards hal r a page.

tU

Go backwards hall" a page.

tZ
tE

Go forwards count Hnes.
Go backwards cOllnt lines.

t I.

Rcdmws the screen. 1'1. may be typed at any time.

h

B~ICk lip one article

c

C'\Ilcc\ the article. Only the author or the artide or the super user can do this.

d

Read a digest. Brcaks liP a digest into separate articlcs and permits you to read and reply
to each piece.

e

Erase. Forget that this article was rea(t.

f

Submit a f~)lIow-up arlicle. You will be placed in your EDITOR to compose the text of
the (()l1ow-up.

h

Go back to the lop of the article and JispJay only the header.

I

Rcdisplays the article after you have sent a follow-up or reply.

11

No. Goes on to next article without. printing current one. "." is eqitivalcnt to "n".· This is

4th Ikrkc1cy Dislribution

in thc currcnt group.

1 October 1984

2

VNEWS(l)

VNEWS( 1)

UN IX Programmer's Manual

cOllvenient if your terminal has a keypad.
p

Gets you the parent. article (the article that the current article is a tl)1I0W-UP to). This
doesn't work if the current article was posted by A-news or Ilotesfilcs. To get back to from
the parent article, lise the - command. Unfortunately, if you lise several p commands to
lrace the discllssion back further, there is no command to get you back.

q

Quit. The .newsrc liIe will he updMed if - x was not on the command line.

r

Reply. Reply to anicle's author via mail. You are placed in your .EDITOR vritll a header
specifying To, Subject, alld Refcrcnceg lines taken from the message. You may change or
add headers, as appropriate. You add the text of the reply aller the blank JilH.\ and then
exit the editor. The resulting message is mailed to the author of the article.

s [tHe!

v

Save. The article is' appended toihe ..famed file', The del:mlt is "Articles". If the first
character of t.he flIe nallle is T, the rest of the file name is taken as the name of a program,
which is executed with tlK' text of the ~II'tide as standard input. If the first chamcter of the
file name is 'f', it is taken as a full path IWllle of a liIe. If $NEWSBOX (in the ellvironment) is set to a filII path n~llne, alld the IIIe contains no 'f', the me is saved in $N EWSBOX. OtherwiSl" it is sav~d relative lo $IIOME.
Unsubscribe to the current. group. This is a two character command to ensure that it is not
typed accidentally alld to leave room fbr other types of unsubscribes (e. g. unsubscribe to
discussion).
Print the current vergion of the news software.

w

Is the same as "s", expect that the !lenders are not written out.

x

Exit. I .ike quit except that ,newsrc is not updated.

y

Yes. Prints the current article and goes on to the next.

[11];\
()

Go to article number II ill the current newsgroup.

H

Print a very verbose he~H.ler. containing alt known inf(mnation ab()llt the article.

K

Kill (mark as read) the rest of the articles ill the current group. This is useful if you can't
keep up wilh the vol lime ill the newsgroup, but don't W<)Ilt to unsubscribe.

ug

Decrypts it joke. It only handles rot 13 jokes. The
() re- ('ncrypts t.he joke.

I)

command is a togr,lc: typing another

N [1Il'lvsgroup]
Go to the next newsgroup or named newsgrOllp.

[1/] +

Skip n articles. The articles skipped arc recorded as "unread" and will be olfered to you
again the next time you read news.
Go back to last article. This is a toggle, typing it twice returns you to the original article.

<

Prompts Ihr an article

1/

Report th<.' ,name and size of lh(~ newsgroup.

?

Print an short help messnge.

In or t.he rest or a

11l<.'ssage .ID. It will display the article if il exists.

Passes the rest of the command line to the shell. The environment variable $/\ is set to the
name of the file containing the current article. Jf the 1astcharacter of the command is a
"&". then the "&" is deleted and tJle command is run in the background with stdin, stdout
and stderr redirected to /devfnul1. If the command is missing, the shell is invoked. Use the
1 cOJllmand (or essentially any other cOlumand) to turn on the display ailer the program
terminates. '

4th Berkeley Dist.ribution

1 October -1984 .

3

UNIX Progl'ammcr's Manual

VNEWS( l}

EXAMPLES

vncws

VNEWS( 1)

Read an unread articles using thc visual interface. The .Ilcwsrc file is updated at the
end or the session.

vncws - n all !f...all - r
Read all unread articles except articles whose newsgroups begin with "fa." in reverse
ordcr. The .Ilewsrc file is updated at the end of the session.
vncws - n ,ill -~ ~l last thllrsd~lY
Print every unread article since kIst Thursday. The .Ilewsrr me is updaLed at the end of
the session.
VIlCWS -I) } Idcv/null &
. .
,Discard 4111 unrc.ld "news. "Thi~ is, lis~~n.ll after rctll1~nihg rrom a long trip.
FILE'S

lusrlspool/ncwsl IIcwsgroupl Ilumber
lusr/lib/ncws/active
lusr/lib/news/vllews.hc1p
- I.newsrc
SE:t~

News a rticJes
Active ncwsgroups and numbers of a1tic1es
Help file for visual interfacc
Options and list of previously read articles

AL...'iO

checknews(l), rcadnews(l), recnews(8), ncws(S), newsrc(S)

4th Ikrkclcy Distribution

1 October 1984

4

VPR.( 1)

UNIX Programmer's Manual

VPR( 1 )

NAME

vpr, vprm, vpq, vprint - raster printer/plotter spooler
SYNOPSIS
vpr [ -W] [ -I] [ -v] [ -t [ -1234 font] ] [ -w] [ -wwidth] [ -m] ( name ... ]
vprm [ id ... 1 [ filename ... ] [owner ... ]
vpq
vprint [ - W ] file ...
DESCRIPTION
Vpr causes the named files to be queued for printihg or typeset simulation on one of the available raster printer/plotters. If no files are named, the standard input is read. By default the
input is assumed to be line printer-like text. For very wide plotters, the input is run through
the filter /usrllib/sidebyside giving it an argument of - wI 06 which arranges it four pages adjacent
with 90 column lines  are printed (many
control characters print special graphics not in the ASCII character set.) Tab
and underline processing is still done. If this option is not given, control characters which are not format effectors are ignored, and page breaks are inserted
after an appropriate number of lines have been printed on a page.

-W

Queues files for printing on a wide output device, if available. Normally, files
are queued for printing on a narrow output device.

-1234

Specifies a font to be mounted on font position i The daemon will construct a
.rai/mag file referencing /usrllib/vJontlname.size

-m
-w

Report by mai/O) when printing is complete.
(Applicable only to wide output devices.> Do not run the input through side byside. Such processing has been done already, or full (440 character) printer
width is desired.

-wwidth

Use width width rather than 90 for sidebyside.

-v

Use the filter lusrllib/vrast to convert the vectors to raster. The named files
must be a parameter and vector file (in that order) created by plot 0 X ) routines.

-t

Use the filter /usr/lib/veat to typeset the input on the printer/plotter. The input
must have been generated by trofj( 1) run with the - t option. This is not normally run directly to wide output devices, since it is wasteful to run only one
page across. The program vtrofj(l) is normally used and arranges, using vsort
for printing to occur four pages across, conserving paper.
.

Vprm removes entries from the raster device queues. The id, filename or owner should be that
reported by.vpq. All appropriate files will be removed. Both queues are always searched. The
id of each file removed from the queue will be printed.

Vpq prints the queues. Each entry in the queue is printed showing the owner of the Queue
entry, an identification number, the size of the entry in characters, and the file which is to be
printed. The id is useful for removing a specific entry from the printer Queue using vprm

4th Berkeley Distribution

27 July 1983

VPR (1)

UNIX Programmer's Manual

VPR ( 1 )

Vprint is a shell script which pr's a copy of each named file on one of the electrostatic
printer/plotters. The files are normally printed on a narrow device~ - W option causes them to
be printed on a wide device.
FILES

/usr/spool/v?d/ *
/usr/lib/v?d
/usr/lib/vpd
/usr/lib/vpf
/ usr/lib/ *vcat
/usr/lib/vrast
/usr/lib/sidebyside

device spool areas
daemons
Versatec daemon
filter for printer simulation
filter for typeset simulation
filter for plot
filter for wide output

SEE ALSO

troffO), vfont(S), vp(4), pti{l), vtroff(t), plot(3X)

BUGS
The l's (one's) and I's (tower-case el's) in a Benson-Varian's standard character set look very
similar~ caution is advised.
A versatec's hardware character set is rather ugly.
fonts to produce prettier listings.

4th Berkeley Distribution

27 July 1983

Vprint should use one of the constant width

2

VTROFF( 1)

UNIX Programmer's Manual

VTROFF (1)

NAME

vtrotT - trotT to a raster plotter
SYNOPSIS

vtroft' [ - w] [ - F majorfont ] [ -123 minorfont ] [ -llength] [ - x ] trotT arguments
DESCRIPTION
Vtroffruns tro.ff{l) sending its output through various programs to produce typeset output on a

raster plotter such as a Benson-Varian or or a Versatec. The -W option specifies that a wide
output device be used~ the default is to use a narrow device. The -I (lower case J) option
causes the output to be split onto successive pages every length inches rather than the default
11 ".

The default font is a Hershey font. If some other font is desired you can give a - F argument
and then the font name. This will place normal, italic and bold versions of the font on positions 1, 2, and 3. To place a font only on a single position, you can give an argument of the
form - n and the minor font name. A .r will be added to the minor font name if needed.
Thus ~~vtrotT -ms paper" will set a paper in the Hershey font, while Hvtroff - F nonie -ms
paper" will set the paper in the (sans serif) nonie font. The - x option asks for exact simulation of photo-typesetter output. (I.e.· using the width tables for the C.A.T. photo-typesetter)
FILES

lusr/libltmacltmac. vcat
lusr/lib/fontinfol *

lusr/lib/vfont

default font mounts and bug fixes
fixes for other fonts
directory containing fonts

SEE ALSO

troffO), vfont(S), vpr(I)
BUGS

Since some macro packages work correctly only if the fonts named R, I, 8, and S are mounted,
and since the Versatec fonts have different widths for individual characters than the fonts found
on the typesetter, the following dodge was necessary: If you don't use the H.fp" troff directive
then you get the widths of the standard typesetter fonts suitable for shipping the output of troff
over the network to the computer center A machine for phototypesetting. If, however, you
remount the R, I, Band S fonts, then you get the width tables for the Versatec.

4th Berkeley Distribution

28 August 1980

VWIDTH (1)

UNIX Programmer's Manual

VWIDTH (1)

NAME

vwidth - make troff width table for a font
SYNOPSIS
vwldth fondUe pointsize > ftxx.c
cc -c ftxx.c mv ftxx.o lusr/lib/font/ftxx
DESCRIPTION
Vwidth translates from the width information stored in the vfont style format to the format
expected by troff. Troff wants an object file in a.out(S) format. (This fact does not seem to be
documented anywhere.) Troff should look directly in the font file but it doesn't.

Vwidth should be used after editing a font with led(J). It is not necessary to use vwidth unless
you have made a change that would affect the width tables. Such changes include numerically
editing the width field, adding a new character, and moving or copying a character to a new
position. It is not always necessary to use vwidth if the physical width of the glyph (e.g. the
number of columns in the bit matrix) has changed, but if it has changed much the logical width
should probably be changed and vwidth run.
Vwidth produces a C program on its standard output. This program should be run through the
C compiler and the object (that is, t.he .0 file) saved. The resulting file should be placed in
lusr/lib/font in the file ftxx where is a one or two letter code that is the logical (internal to
troff) font name. This name can be found by looking in the file lusr/tib/fontinfollname*
where Iname is the external name of the font.
SEE ALSO
fedO), vfont(S), trofrO), vtroffO)

BUGS
Produces the C file using obsolete syntax that the portable C compiler complains about.

3rd Berkeley Distribution

4 March 1980

W(I)

UNIX Programmer's Manual

W (1)

NAME

w - who is on and what they are doing
SYNOPSIS

w [ - h ] [ - s ] [ user ]
DESCRIPTION
W prints a summary of the current activity on the system, including what each user is doing.

The heading line shows the current time of day, how long the system has been up, the number
of users logged into the system, and the load averages. The load average numbers give the
number of jobs in the run queue averaged over I, 5 and 15 minutes.
The fields output are: the users login name, the name of the tty the user is on, the time of day
the user logged on, the number of minutes since the user last typed anything, the CPU time
used by all processes and their children on that terminal, the CPU time used by the currently
active processes, the name and arguments of the current process.
The -h flag suppresses the heading. The -s flag asks for a short form of output. In the short
form, the tty is abbreviated, the login time and cpu times are left off, as are the arguments to
commands. -I gives the long output, which is the default.
If a user name is included, the output will be restricted to that user.
FILES

/etc/utmp
/dev/kmem
/dev/drum
SEE ALSO

who(1) ,fingerO), ps(1)
AUTHOR

Mark Horton
BUGS

The notion of the "current process" is muddy. The current algorithm is "the highest numbered process on the terminal that is not ignoring interrupts, or, if there is none, the highest
numbered process on the terminal". This fails, for example, in critical sections of programs
like the shell and editor, or when faulty programs running in the background fork and fail to
ignore interrupts. (In cases where no process can be found, w prints" - ".)
The CPU time is only an estimate, in particular, if someone leaves a background process running after logging out, the person currently on that terminal is ~~charged" with the time.
Background processes are not shown, even though they account for much of the load on the
system.
Sometimes processes, typically those in the background, are printed with null or garbagedarguments. In these cases, the name of the command is printed in parentheses.
W does not know about the new conventions for detection of background jobs. It will sometimes find a background job instead of the right one.

4th Berkeley Distribution

15 August 1980

WAIT(I)

UNIX Programmer's Manual

WAIT (1)

NAME

wait - await completion of process
SYNOPSIS

wait
DESCRIPTION

Wait until all processes started with & have completed, and report on abnormal terminations.
Because the wait(2) system call must be executed in the parent process, the Shell itself executes wait, without creating a new process.
SEE ALSO

sh(l)

BUGS
Not all the processes of a 3- or more-stage pipeline are children of the Shell, and thus can't be
waited for. (This bug does not apply to csh(I).)

7th Edition

18 January

19~3

WALL (1)

UNIX Programmer's Manual

WALL (1)

NAME

wall - write to all users
SYNOPSIS
wall
DESCRIPTION
Wall reads its standard input until an end-of-file. It then sends this message, preceded by
'Broadcast Message ... ', to all logged in users.

The sender should be super-user to override any protections the users may have invoked.
FILES

/dev/tty?
/etc/utmp
SEE ALSO
mesg(I), write(l)
DIAGNOSTICS
'Cannot send to ... ' when the open on a user's tty file fails.

4th Berkeley Distribution

18 January 1983

we (1)

UNIX Programmer·s Manual

. we (I

)

NAME

wc - word count
SYNOPSIS

we [ -lwe] [name ... ]
DESCRIPTION
We counts lines, words and characters in the named files, or in the standard input if no name

appears. A word is a maximal string of characters delimited by spaces, tabs or newlines.
If an argument beginning with one of Hlwc" is present, the specified counts (Jines, words, or
characters) are selected by the letters I, w, or e. The default is -Iwe.

BUGS

4th Berkeley Distribution

1 June 1983

WHAT ( 1)

UNIX Programmer's Manual

WHAT(l)

NAME

what - show what versions of object modules were used to construct a file
SYNOPSIS

what name ...
DESCRIPTION
What reads each file and searches for sequences of the form H@(#)" as inserted by the source

code control system. It then prints the remainder of the string after this marker, up to a null
character, newline, double quote, or ">" character.

BUGS

As sees is not licensed with UNIX/32V, this is a rewrite of the what command which is part
of sees, and may not behave exactly the same as that command does.

4th Berkeley Distribution

18 January 1983

WHATIS (1)

UNIX Programmer's Manual

WHATIS (1)

NAME

whatis - describe what a command is
SYNOPSIS

whatls command ...
DESCRIPTION

Whatis looks up a given command and gives the header line from the manual section. You can
then run the monO) command to get more information. If the line starts 'name(section)
you can do 'man section name' to get the documentation for it. Try 'whatis ed' and then you
should do 'man 1 ed' to get the manual.
00"

Whatis is actually just the -f option to the manU) command.
FILES

/usr/lib/whatis Data base
SEE ALSO

manU), catman(S)
AUTHOR

William Joy

4th Berkeley Distribution

IS January 19S3

\VHEREAMI

«(1»

UNIX Programmer's Manual

WI lEREAMI «(1»

NAME

whereami - repOlt name of terminal
SYNOPSIS
whcrc.~4:lmi

[•]

DESCUIPTION
H'/l('rcami

reports on the standard output the name of your tenninal, and whether it is a local or
network terminal. This is especially lIseful for network users, since there is no fixed assignment
between physical terminals and terminal names.
If any argument is given, the program print<; nothing unless the terminal is a network terminal.
Thus, wliereami is meant to be used in a .profile or .cshrcfllc, with an argument, so that if you log
in over a network, you will be told where you arc.

AUTIIOR

Jeffrey Mogul
HUGS

The program actua1Jy tries to rind the name or the termi nat associ'ltcd with stelerr, so if stderr is not
a tty, a nlcetiolls message is printed. This could he smarter, but why waste the ctrort'!
The mapping n'om terminal name to "nctworkness" is wired into the code, and must be changed
when the pty assignments arc.

7th Edition

1 .

WHEREIS (1)

UNIX Programmer's Manual

WHEREIS (1)

NAME

whereis - locate source, binary, and or manual for program
SYNOPSIS

whereis [ -sbm ] [ -u ] [ -SBM dir ... -f] name ...
DESCRIPTION
Whereis locates source/binary and manuals sections for specified files. The supplied names are

first stripped of leading pathname components and any (single) trailing extension of the form
".ext", e.g. ".c". Prefixes of "s." resulting from use of source code control are also dealt
with. Whereis then attempts to locate the desired program in a list of standard places. If any of
the -b, -s or -m flags are given then whereis searches only for binaries, sources or manual
sections respectively (or any two thereoO. The -u flag may be used to search for unusual
entries. A file is said to be unusual if it does not have one entry of each requested type. Thus
"whereis -m -u • "asks for those files in the current directory which have no documentation.
Finally, the -B -M and -S flags may be used to change or otherwise limit the places where
whereis searches. The -f file flags is used to terminate the last such directory list and signal the
start of file names.
EXAMPLE

The following finds all the files in lusr/bin which are not documented in lusr/man/manl with
source in lusrlsrc/cmd:
cd lusr/ucb
whereis -u - M lusr/man/man! -5 lusrlsrc/cmd -f.
FILES

lusrlsrc/·
lusrI {doc,man) I.
llib, letc, lusr/{lib,bin,ucb,old,new,local}
AUTHOR

William Joy
BUGS

Since the program uses chdir(2) to run faster. pathnames given with the - M - Sand - B
must be full; i.e. they must begin with a "I".

3rd Berkeley Distribution

24 February 1979

UNIX·. Programmer's Manual

WHICH (1 )

WHICH (1)

NAME

which - locate a program file including aliases and paths (csh only)
SYNOPSIS

which [ name ] ...
DESCRIPTION
Which takes a list of names and looks for the files which would be executed had these names

been given as commands. Each argument is expanded if it is aliased~ and searched for along
the user's path. Both aliases and path are taken from the user's .cshrc file.
FILES

-I.cshrc

source of aliases and path values

DIAGNOSTICS

A diagnostic is given for names which are aliased to more than a single word, or if an executable file with the argument name was not found in the path.
BUGS

Must be executed by a csh, since only csh's know about aliases.

3rd Berkeley Distribution

10 October 1979

WHO (1)

UNIX Programmer's Manual

WHO( 1)

NAME

who - who is on the system
SYNOPSIS
who [ who-file ] [ am I ]
DESCRIPTION
Who, without an argument, lists the login name, terminal name, and login time for each
current UNIX user.

Without an argument, who examines the letc!utmp file to obtain its information. If a file is
given, that file is examined. Typically the given file will be lusr/adm/wtmp, which contains ~
record of all the logins since it was created. Then who lists logins, logouts, and crashes since
the creation of the wtmp file. Each login is listed with user name, terminal name (with ~/dev/'
suppressed), and date and time. When an argument is given, logouts 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.
With two arguments, as in
in as.

~who

am I' (and also

~who

FILES

letc/utmp
SEE ALSO
getuid(2), utmp(S)

7th Edition

18 January 1983

are you '), who tells who you are logged

UNIX Programmer's Manual

WHOAMI(l)

WHOAMI (1)

NAME

whoami -print effective current user id
SYNOPSIS
whoami
DESCRIPTION
Whoami prints who you are. It works even if you are su'd, while 'who am i' does not since it

uses letc/utmp.
FILES

letc/passwd

Name data base

SEE ALSO

who 0)

3rd Berkeley Distribution

24 February 1919

1

UN IX Programmer's Manual

WI10IS( Ie)

WHOIS(.lC)

NAM~~

whois - ask the A RPA Internet NIC about a user
SYNOPSIS

whois [- s host] [- p ponll- v]

[~-

h] ident ...

DESCIUPTION

The who;s program implements the user end of the ARPA Internet NICNAME/WHOIS protocol,
as described in RFC812. To quote from that document:
"The NICNAME/WHOIS Server is an Nep/Tel> transaction based query/response
server, running on the SRI-N IC machine, Ihat provides netwide directory service to
ARPANET users. II is one of a series of t\RPt\NFr/lnternet name services maintained
by the Network Ini(;nnation Cel'lie'i' (Ntc') at SI(i Intej'nali6nal on bdYillf of the Defense
COlllmunications Agency (DCA). Th~ server is accessible across the ARPANET from user
programs runlling on local hosts, (lnd it delivers the full name, U.S. mailing address, telephone !'lumber, and network mailbox for ARPA NET lIsers."
Invoked with a user's name as an arglllllent (embedded spaces arc allowed), whois asks the NICNAME server about the liSeI', and prints the response. I"or example,
% whois dyer, mary
Connecting to server on sri -- nic for "dyer, mary" ... open.
Dyer, r\:1ary K. (MARY)
SR I Internat.ional
Network Information Center
Telecomlllunications Sciences Center
333 R;.Ivenswood Avellue
Menlo P;lrk, C"liI()/'llia 94025
Phone: (415) 859-4775 '

I)YER(jl'SRI-N Ie

If you use the '-h' s\vitch, w//Ois will ask the NICNAME server to prillt a help text. The '-v'
switch tells w/lOis to disclose the precise IranS
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                     : 2014:11:10 11:41:12-08:00
Modify Date                     : 2014:11:10 11:12:38-08:00
Metadata Date                   : 2014:11:10 11:12:38-08:00
Producer                        : Adobe Acrobat 9.55 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:429e9a82-b591-5d4d-b66b-6e4081f134d9
Instance ID                     : uuid:21bce4c7-8842-3e45-a5e3-85699a6bc23a
Page Layout                     : SinglePage
Page Mode                       : UseNone
Page Count                      : 540
EXIF Metadata provided by EXIF.tools

Navigation menu