V4/man/nroff-all



AR(I)			     3/15/72			    AR(I)



NAME
     ar - archive and library maintainer

SYNOPSIS
     ar__ key afile name ...

DESCRIPTION
     Ar__  maintains groups of files combined into a single archive
     file.  Its main use is to create and update library files as
     used by the loader.  It can be used, though, for any similar
     purpose.

     Key___  is  one character from the set drtux_____, optionally conca-
     tenated with v_.  Afile_____ is the archive file.  The  names_____  are
     constituent  files in the archive file.  The meanings of the
     key___ characters are:

     d_ means delete the named files from the archive file.

     r_ means replace the named files in the archive file.  If the
     archive file does not exist, r_ will create it.  If the named
     files are not in the archive file, they are appended.

     t_	prints	a  table  of contents of the archive file.  If no
     names are given, all files in the archive	are  tabled.   If
     names are given, only those files are tabled.

     u_ is similar to r_ except that only  those	files  that  have
     been  modified  are  replaced.   If  no names are given, all
     files in the archive that have been  modified  will  be  re-
     placed by the modified version.

     x_ will extract the named files.  If no names are given,  all
     files  in the archive are extracted.  In neither case does x_
     alter the archive file.

     v_	means  verbose.   Under  the  verbose  option, ar__ gives a
     file-by-file description of the making of a new archive file
     from the old archive and the constituent files.  The follow-
     ing abbreviations are used:

	c_ copy
	a_ append
	d_ delete
	r_ replace
	x_ extract

FILES
     /tmp/vtm?	     temporary

SEE ALSO
     ld(I), archive(V)






			      - 1 -



AR(I)			     3/15/72			    AR(I)


BUGS
     Option  tv__ should be implemented as a table with more infor-
     mation.

     There should be a way to specify the placement of a new file
     in an archive.  Currently, it is placed at the end.

     Since  ar__	has  not been rewritten to deal properly with the
     new file system modes, extracted files have mode 666.


















































			      - 2 -



AS(I)			     1/15/73			    AS(I)



NAME
     as - assembler

SYNOPSIS
     as__ [ - ] name ...

DESCRIPTION
     As__  assembles  the concatenation of the named files.  If the
     optional first argument - is used, all undefined symbols  in
     the assembly are treated as global.

     The output of the assembly is left on the file a_.out___.  It is
     executable if no errors occurred during the assembly, and if
     there were no unresolved external references.

FILES
     /etc/as2	     pass 2 of the assembler
     /tmp/atm[1-4]?  temporary
     a.out	     object

SEE ALSO
     ld(I), nm(I), db(I), a.out(V), `UNIX Assembler Manual'.

DIAGNOSTICS
     When an input file cannot be read, its name  followed  by	a
     question  mark is typed and assembly ceases.  When syntactic
     or semantic errors occur, a single-character  diagnostic  is
     typed out together with the line number and the file name in
     which it occurred.  Errors in pass 1 cause  cancellation  of
     pass 2.  The possible errors are:

     ) Parentheses error
     ] Parentheses error
     < String not terminated properly
     * Indirection used illegally
     . Illegal assignment to `.'
     A Error in address
     B Branch instruction is odd or too remote
     E Error in expression
     F Error in local (`f' or `b') type symbol
     G Garbage (unknown) character
     I End of file inside an if
     M Multiply defined symbol as label
     O Word quantity assembled at odd address
     P `.' different in pass 1 and 2
     R Relocation error
     U Undefined symbol
     X Syntax error

BUGS
     Symbol table overflow is not checked.  x  errors  can  cause
     incorrect line numbers in following diagnostics.






			      - 1 -



BAS(I)			     1/15/73			   BAS(I)



NAME
     bas - basic

SYNOPSIS
     bas___ [ file ]

DESCRIPTION
     Bas___  is a dialect of Basic.  If a file argument is provided,
     the file is used for input before the console is read.   Bas___
     accepts lines of the form:

	statement
	integer statement

     Integer numbered statements (known as  internal  statements)
     are  stored  for later execution.	They are stored in sorted
     ascending order.  Non-numbered  statements  are  immediately
     executed.	 The  result of an immediate expression statement
     (that does not have `=' as its highest operator) is printed.

     Statements have the following syntax:

     expression
	  The  expression  is  executed for its side effects (as-
	  signment or function call) or for printing as described
	  above.

     done____
	  Return to system level.

     draw____ expression expression expression
	  A line is drawn on the Tektronix 611 display `/dev/vt0'
	  from	the  current  display  position  to  the  XY  co-
	  ordinates  specified by the first two expressions.  The
	  scale is zero to one in both X and  Y  directions.   If
	  the  third  expression  is zero, the line is invisible.
	  The current display position is set to the end point.

     display_______ list
	  The list of expressions and strings is concatenated and
	  displayed  (i.e.  printed)  on  the 611 starting at the
	  current display position.  The current display position
	  is not changed.

     erase_____
	  The 611 screen is erased.

     for___ name = expression expression statement
     for___ name = expression expression
	  ...
     next____
	  The for___ statement  repetitively  executes  a	statement
	  (first  form)  or  a	group of statements (second form)
	  under control of a named variable.  The variable  takes
	  on  the  value  of the first expression, then is incre-
	  mented by one on each loop, not to exceed the value  of


			      - 1 -



BAS(I)			     1/15/73			   BAS(I)


	  the second expression.

     goto____ expression
	  The  expression  is  evaluated, truncated to an integer
	  and execution goes to the  corresponding  integer  num-
	  bered  statment.   If executed from immediate mode, the
	  internal statements are compiled first.

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

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

     print_____ list
	  The list of expressions and  strings	are  concatenated
	  and printed.	(A string is delimited by " characters.)

     return______ [expression]
	  The  expression  is  evaluated and the result is passed
	  back as the value of a function call.  If no expression
	  is given, zero is returned.

     run___
	  The internal statements are compiled.  The symbol table
	  is re-initialized.   The  random  number  generator  is
	  reset.  Control is passed to the lowest numbered inter-
	  nal statement.

     Expressions have the following syntax:

     name
	  A  name  is used to specify a variable.  Names are com-
	  posed of a letter followed by letters and digits.   The
	  first four characters of a name are significant.

     number
	  A  number  is  used  to  represent a constant value.	A
	  number is written in Fortran style,  and  contains  di-
	  gits,  an  optional decimal point, and possibly a scale
	  factor consisting of an e followed by a possibly signed
	  exponent.

     ( expression )
	  Parentheses  are  used to alter normal order of evalua-
	  tion.

     expression operator expression
	  Common functions of two arguments  are  abbreviated  by
	  the two arguments separated by an operator denoting the
	  function.  A complete list of operators is given below.


			      - 2 -



BAS(I)			     1/15/73			   BAS(I)


     expression ( [expression [ , expression] ... ] )
	  Functions of an arbitrary number of  arguments  can  be
	  called  by  an  expression followed by the arguments in
	  parentheses separated by commas.  The expression evalu-
	  ates to the line number of the entry of the function in
	  the internally  stored  statements.	This  causes  the
	  internal  statements to be compiled.	If the expression
	  evaluates negative, a builtin function is called.   The
	  list of builtin functions appears below.

     name [ expression [ , expression ] ...  ]
	  Each	expression is truncated to an integer and used as
	  a specifier for the name.  The result is  syntactically
	  identical  to  a  name.  a_[1_,2_] is the same as a_[1_][2_].
	  The truncated  expressions  are  restricted  to  values
	  between 0 and 32767.

     The following is the list of operators:

     =
	  = is the assignment operator.  The left operand must be
	  a  name  or  an array element.  The result is the right
	  operand.  Assignment binds right  to	left,  all  other
	  operators bind left to right.

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

     <	<=  >  >=  ==  <>
	  The  relational operators (< less than, <= less than or
	  equal, > greater than, >= greater  than  or  equal,  ==
	  equal  to,  <>  not equal to) return one if their argu-
	  ments are in the specified relation.	They return  zero
	  otherwise.   Relational  operators  at  the  same level
	  extend as follows: a>b>c is the same as a>b&b>c.

     + -
	  Add and subtract.

     * /
	  Multiply and divide.

     ^
	  Exponentiation.

     The following is a list of builtin functions:

     arg___(i_)
	  is  the  value  of  the  i -th  actual parameter on the
	  current level of function call.

     exp___(x_)
	  is the exponential function of x.


			      - 3 -



BAS(I)			     1/15/73			   BAS(I)


     log___(x_)
	  is the natural logarithm of x.

     sin___(x_)
	  is the sine of x (radians).

     cos___(x_)
	  is the cosine of x (radians).

     atn___(x_)
	  is the arctangent of x . its value  is  between  -(*p/2
	  and (*p/2.

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

     expr____( )
	  is the only form of program input.  A line is read from
	  the  input  and evaluated as an expression.  The resul-
	  tant value is returned.

     int___(x_)
	  returns x truncated to an integer.

FILES
     /tmp/btm?	    temporary

DIAGNOSTICS
     Syntax errors cause the incorrect line to be typed  with  an
     underscore  where	the  parse failed.  All other diagnostics
     are self explanatory.

BUGS
     Has been known to give core images.  Needs a way to  list____	a
     program onto a file.























			      - 4 -



CAT(I)			     1/15/73			   CAT(I)



NAME
     cat - concatenate and print

SYNOPSIS
     cat___ file ...

DESCRIPTION
     Cat___  reads  each file in sequence and writes it on the stan-
     dard output.  Thus:

	cat___ file____

     is about the easiest way to print a file.	Also:

	cat___ file1_____ file2_____ >file3_____

     is about the easiest way to concatenate files.

     If  no input file is given cat___ reads from the standard input
     file.

     If  the  argument - is encountered, cat___ reads from the stan-
     dard input file.


SEE ALSO
     pr(I), cp(I)

DIAGNOSTICS
     none; if a file cannot be found it is ignored.

BUGS
     cat___ x_ y_ >x_ and cat___ x_ y_ >y_ cause strange results.

























			      - 1 -



CATSIM(I)		     11/1/73			CATSIM(I)



NAME
     catsim - phototypesetter simulator

SYNOPSIS
     catsim______

DESCRIPTION
     Catsim______  will  interpret  its standard input as codes for the
     phototypesetter (cat).  The output of catsim______  is  output  to
     the display (vt).

     About the only use of catsim______ is to save time  and	paper  on
     the phototypesetter by the following command:

	     troff -t files | catsim

FILES
     /dev/vt0

SEE ALSO
     troff(I), cat(IV), vt(IV)

BUGS
     Point sizes are not correct.  The vt character set  is  res-
     tricted to one font of ASCII.

































			      - 1 -



CC(I)			     3/15/72			    CC(I)



NAME
     cc - C compiler

SYNOPSIS
     cc__ [ -c_ ] [ -p_ ] file ...

DESCRIPTION
     Cc__  is  the  UNIX	C  compiler.   It  accepts three types of
     arguments:

     Arguments	whose  names  end  with  `.c' are assumed to be C
     source programs; they are compiled, and the  object  program
     is  left  on  the file whose name is that of the source with
     `.o' substituted for `.c'.

     Other  arguments  (except	for  -c) are assumed to be either
     loader flag arguments, or C-compatible object programs, typ-
     ically  produced  by an earlier cc__ run, or perhaps libraries
     of C-compatible routines.	These programs, together with the
     results  of  any  compilations specified, are loaded (in the
     order given) to produce  an  executable  program  with  name
     a_.out___.

     The -c_ argument suppresses the loading phase,  as	does  any
     syntax error in any of the routines being compiled.

     If the -p_ flag is used, only the macro prepass is run on all
     files whose name ends in .c.  The expanded source is left on
     the file whose name is that of the source with .i substitut-
     ed for .c.

FILES
     file.c	     input file
     file.o	     object file
     a.out	     loaded output
     /tmp/ctm?	     temporary
     /lib/c[01]      compiler
     /lib/crt0.o     runtime startoff
     /lib/libc.a     builtin functions, etc.
     /lib/liba.a     system library

SEE ALSO
     `C reference manual', cdb(I), ld(I)  for  other  flag  argu-
     ments.

BUGS












			      - 1 -



CDB(I)			     8/15/73			   CDB(I)



NAME
     cdb - C debugger

SYNOPSIS
     cdb___ [ core [ a.out ]]

DESCRIPTION
     Cdb___  is  a debugging program for use with C programs.  It is
     by no means completed, and this section is essentially  only
     a placeholder for the actual description.

     Even the present cdb___ has one useful feature: the command

	$

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

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

BUGS
     It has to be fixed to work with the new system.


































			      - 1 -



CHDIR(I)		     3/15/72			 CHDIR(I)



NAME
     chdir - change working directory

SYNOPSIS
     chdir_____ directory

DESCRIPTION
     Directory_________	becomes  the  new working directory.  The process
     must have execute permission on the directory.  The  process
     must have execute (search) permission in directory_________.

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

SEE ALSO
     sh(I)

BUGS






































			      - 1 -



CHMOD(I)		     8/20/73			 CHMOD(I)



NAME
     chmod - change mode

SYNOPSIS
     chmod_____ octal file ...

DESCRIPTION
     The  octal mode replaces the mode of each of the files.  The
     mode is constructed from the OR of the following modes:

	 4000 set user ID on execution
	 2000 set group ID on execution
	 0400 read by owner
	 0200 write by owner
	 0100 execute by owner
	 0070 read, write, execute by group
	 0007 read, write, execute by others

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


SEE ALSO
     ls(I)


BUGS































			      - 1 -



CHOWN(I)		     3/15/72			 CHOWN(I)



NAME
     chown - change owner

SYNOPSIS
     chown_____ owner file ...

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

     Only the owner of a file (or the super-user) is  allowed  to
     change  the  owner.   Unless it is done by the super-user or
     the real user ID of the new owner, the  set-user-ID  permis-
     sion bit is turned off as the owner of a file is changed.

FILES
     /etc/passwd

BUGS






































			      - 1 -



CMP(I)			     1/15/73			   CMP(I)



NAME
     cmp - compare two files

SYNOPSIS
     cmp___ file1 file2

DESCRIPTION
     The   two	 files	 are  compared	for  identical	contents.
     Discrepancies are noted by giving the offset and the differ-
     ing words, all in octal.

SEE ALSO
     proof (I), comm (I)

BUGS
     If  the  shorter of the two files is of odd length, cmp___ acts
     as if a null byte had been appended to it.   The  offset______  is
     only a single-precision number.








































			      - 1 -



COMM(I) 		     8/21/73			  COMM(I)



NAME
     comm - print lines common to two files

SYNOPSIS
     comm____ [ - [ 123___ ] ] file1 file2 [ file3 ]

DESCRIPTION
     Comm____  reads  file1_____  and  file2_____, which should be in sort, and
     produces a three column output: lines only in  file1_____;  lines
     only in file2_____; and lines in both files.

     If file3_____ is given, the output will be placed  there;  other-
     wise it will be written on the standard output.

     Flags 1, 2, or 3  suppress  printing  of  the  corresponding
     column.   Thus  comm____ -12__ prints only the lines common to the
     two files; comm____ -23__ prints only lines in the first file  but
     not in the second; comm____ -123___ is a no-op.


SEE ALSO
     uniq(|I|), proof(|I|), cmp(|I|)

BUGS


































			      - 1 -



CP(I)			     1/24/73			    CP(I)



NAME
     cp - copy

SYNOPSIS
     cp__ file1 file2

DESCRIPTION
     The first file is copied onto the second.	The mode and own-
     er of the target file are preserved if it	already  existed;
     the mode of the source file is used otherwise.

     If file2_____ is a directory, then the target file is a  file  in
     that directory with the file-name of file1_____.

SEE ALSO
     cat(I), pr(I), mv(I)

BUGS
     Copying a file onto itself destroy