BSD 4_3_Reno release
[unix-history] / usr / src / bin / csh / csh.1
index 8e32f16..5f56b3c 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)csh.1       6.6 (Berkeley) %G%
+.\" Redistribution and use in source and binary forms are permitted provided
+.\" that: (1) source distributions retain this entire copyright notice and
+.\" comment, and (2) distributions including binaries display the following
+.\" acknowledgement:  ``This product includes software developed by the
+.\" University of California, Berkeley and its contributors'' in the
+.\" documentation or other materials provided with the distribution and in
+.\" all advertising materials mentioning features or use of this software.
+.\" Neither the name of the University nor the names of its contributors may
+.\" be used to endorse or promote products derived from this software without
+.\" specific prior written permission.
+.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
 .\"
-.TH CSH 1 ""
-.UC 4
-.de sh
-.br
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
-.if n .ds ua ^
-.if t .ds ua \(ua
-.if n .ds aa '
-.if t .ds aa \(aa
-.if n .ds ga `
-.if t .ds ga \(ga
-.if t .tr *\(**
-.SH NAME
-csh \- a shell (command interpreter) with C-like syntax
-.SH SYNOPSIS
-.B csh
-[
-.B \-cef\^instvVxX
-] [
-arg ...
-]
-.SH DESCRIPTION
-.I Csh
-is a first implementation of a command language interpreter
-incorporating a history mechanism (see \fBHistory Substitutions\fP),
-job control facilities (see \fBJobs\fP), interactive file name
-and user name completion (see \fBFile Name Completion\fP),
-and a C-like syntax.
-So as to be able to use its job control facilities, users of
-.I csh
-must (and automatically) use the new tty driver fully described in
-.IR tty (4).
-This new tty driver allows generation of interrupt characters
-from the keyboard to tell jobs to stop.  See
-.IR stty (1)
-for details on setting options in the new tty driver.
-.PP
+.\"     @(#)csh.1      6.14 (Berkeley) 7/24/90
+.\"
+.Dd July 24, 1990
+.Dt CSH 1
+.Os BSD 4
+.Sh NAME
+.Nm csh
+.Nd a shell (command interpreter) with C-like syntax
+.Sh SYNOPSIS
+.Nm csh
+.Op Fl cef\*(uainstvVxX
+.Op arg ...
+.Sh DESCRIPTION
+The
+.Nm Csh
+is a command language interpreter
+incorporating a history mechanism (see
+.Nm History Substitutions ) ,
+job control facilities (see
+.Nm Jobs ) ,
+interactive file name
+and user name completion (see
+.Nm File Name Completion ) ,
+and a C-like syntax. It is used both as an interactive
+login shell and a shell script command processor.
+.Ss Argument list processing
+If the first argument (argument 0) to the shell is
+.Sq Fl
+then this
+is a login shell.
+The flag arguments are interpreted as follows:
+.Tw 5n
+.Tp Fl b
+This flag forces a ``break'' from option processing, causing any further
+shell arguments to be treated as non-option arguments.
+The remaining arguments will not be interpreted as shell options.
+This may be used to pass options to a shell script without confusion
+or possible subterfuge.
+The shell will not run a set-user ID script without this option.
+.Tp Fl c
+Commands are read from the (single) following argument which must
+be present.
+Any remaining arguments are placed in
+.Ar argv .
+.Tp Fl e
+The shell exits if any invoked command terminates abnormally
+or yields a non-zero exit status.
+.Tp Fl f
+The shell will start faster, because it will neither search for nor
+execute commands from the file
+.Pa \&.cshrc
+in the invoker's home directory.
+.Tp Fl 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.
+.Tp Fl n
+Commands are parsed, but not executed.
+This aids in syntactic checking of shell scripts.
+.Tp Fl s
+Command input is taken from the standard input.
+.Tp Fl t
+A single line of input is read and executed.
+A `\e' may be used to escape the newline at the end of this
+line and continue onto another line.
+.Tp Fl v
+Causes the
+.Ar verbose
+variable to be set, with the effect
+that command input is echoed after history substitution.
+.Tp Fl x
+Causes the
+.Ar echo
+variable to be set, so that commands are echoed immediately before execution.
+.Tp Fl V
+Causes the
+.Ar verbose
+variable to be set even before
+.Pa \&.cshrc is executed.
+.Tp Fl X
+Is to
+.Fl x
+as
+.Fl V
+is to
+.Fl v .
+.Tp
+.Pp
+After processing of flag arguments, if arguments remain but none of the
+.Fl c ,
+.Fl i ,
+.Fl s ,
+or
+.Fl t
+options were 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 comment.
+Remaining arguments initialize the variable
+.Ar argv .
+.Pp
 An instance of
 An instance of
-.I csh
-begins by executing commands from the file `.cshrc' in the
-.I home
-directory of the invoker.
-If this is a login shell then it also executes commands from the file
-`.login' there.
-It is typical for users on crt's to put the command ``stty crt'' in their
-.I \&.login
+.Nm csh
+begins by executing commands from the file
+.Pa /etc/csh.cshrc
+and,
+if this is a login shell,
+.Pa \&/etc/csh.login .
+It then executes
+commands from
+.Pa \&.cshrc
+in the
+.Ar home
+directory of the invoker, and, if this is a login shell, the file
+.Pa \&.login
+in the same location.
+It is typical for users on crt's to put the command ``stty crt''
+in their
+.Pa \&.login
 file, and to also invoke
 file, and to also invoke
-.IR tset (1)
+.Xr tset  1
 there.
 there.
-.PP
+.Pp
 In the normal case, the shell will then begin reading commands from the
 terminal, prompting with `% '.
 Processing of arguments and the use of the shell to process files
 containing command scripts will be described later.
 In the normal case, the shell will then begin reading commands from the
 terminal, prompting with `% '.
 Processing of arguments and the use of the shell to process files
 containing command scripts will be described later.
-.PP
+.Pp
 The shell then repeatedly performs the following actions:
 a line of command input is read and broken into
 The shell then repeatedly performs the following actions:
 a line of command input is read and broken into
-.IR words .
+.Ar words  .
 This sequence of words is placed on the command history list and then parsed.
 Finally each command in the current line is executed.
 This sequence of words is placed on the command history list and then parsed.
 Finally each command in the current line is executed.
-.PP
-When a login shell terminates it executes commands from the file `.logout'
-in the users home directory.
-.sh "Lexical structure"
+.Pp
+When a login shell terminates it executes commands from the files
+.Pa .logout
+in the user's
+.Ar home
+directory and
+.Pa /etc/csh.logout .
+.Ss Lexical structure
 The shell splits input lines into words at blanks and tabs with the
 following exceptions.
 The characters
 The shell splits input lines into words at blanks and tabs with the
 following exceptions.
 The characters
-`&' `|' `;' `<' `>' `(' `)'
+`&' `\&|' `;' `<' `>' `(' `)'
 form separate words.
 form separate words.
-If doubled in `&&', `|\|\||', `<<' or `>>' these pairs form single words.
+If doubled in `&&', `\&|\&|', `<<' 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 `\e'.
 A newline preceded by a `\e' is equivalent to a blank.
 These parser metacharacters may be made part of other words, or prevented their
 special meaning, by preceding them with `\e'.
 A newline preceded by a `\e' is equivalent to a blank.
-.PP
+.Pp
 In addition strings enclosed in matched pairs of quotations,
 `\*(aa', `\*(ga' or `"',
 form parts of a word; metacharacters in these strings, including blanks
 In addition strings enclosed in matched pairs of quotations,
 `\*(aa', `\*(ga' or `"',
 form parts of a word; metacharacters in these strings, including blanks
@@ -89,66 +178,80 @@ and tabs, do not form separate words.
 These quotations have semantics to be described subsequently.
 Within pairs of `\'' or `"' characters a newline preceded by a `\e' gives
 a true newline character.
 These quotations have semantics to be described subsequently.
 Within pairs of `\'' or `"' characters a newline preceded by a `\e' gives
 a true newline character.
-.PP
+.Pp
 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 `\e'
 and in quotations using `\`', `\'', and `"'.
 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 `\e'
 and in quotations using `\`', `\'', and `"'.
-.sh "Commands"
+.Ss Commands
 A simple command is a sequence of words, the first of which
 specifies the command to be executed.
 A simple command or
 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
+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 separated by `;', and are then executed
 sequentially.
 forms a pipeline.
 The output of each command in a pipeline is connected to the input of the next.
 Sequences of pipelines may be separated by `;', and are then executed
 sequentially.
-A sequence of pipelines may be executed without immediately 
+A sequence of pipelines may be executed without immediately
 waiting for it to terminate by following it with an `&'.
 waiting for it to terminate by following it with an `&'.
-.PP
+.Pp
 Any of the above may be placed in `(' `)' to form a simple command (which
 may be a component of a pipeline, etc.)
 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 `|\|\||' or `&&' indicating,
+It is also possible to separate pipelines with `\&|\&|' or `&&' indicating,
 as in the C language,
 that the second is to be executed only if the first fails or succeeds
 respectively. (See
 as in the C language,
 that the second is to be executed only if the first fails or succeeds
 respectively. (See
-.I Expressions.)
-.sh "Jobs"
-The shell associates a \fIjob\fR with each pipeline.  It keeps
+.Em Expressions . )
+.Ss Jobs
+The shell associates a
+.Ar job
+with each pipeline.  It keeps
 a table of current jobs, printed by the
 a table of current jobs, printed by the
-\fIjobs\fR command, and assigns them small integer numbers.  When
+.Ar jobs
+command, and assigns them small integer numbers.  When
 a job is started asynchronously with `&', the shell prints a line which looks
 like:
 a job is started asynchronously with `&', the shell prints a line which looks
 like:
-.PP
-.DT
-       [1] 1234
-.PP
-indicating that the jobs which was started asynchronously was job number
+.Pp
+.Df I
+.Op 1
+1234
+.De
+.Pp
+indicating that the job which was started asynchronously was job number
 1 and had one (top-level) process, whose process id was 1234.
 1 and had one (top-level) process, whose process id was 1234.
-.PP
+.Pp
 If you are running a job and wish to do something else you may hit the key
 If you are running a job and wish to do something else you may hit the key
-\fB^Z\fR (control-Z) which sends a STOP signal to the current job.
+.Nm ^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,
 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 \fIbg\fR command, or run some other
+putting it in the background with the
+.Ar bg
+command, or run some other
 commands and then eventually bring the job back into the foreground with
 commands and then eventually bring the job back into the foreground with
-the foreground command \fIfg\fR.  A \fB^Z\fR takes effect immediately and
+the foreground command
+.Ar fg  .
+A
+.Nm ^Z
+takes effect immediately and
 is like an interrupt in that pending output and unread input are discarded
 is like an interrupt in that pending output and unread input are discarded
-when it is typed.  There is another special key \fB^Y\fR which does 
+when it is typed.  There is another special key
+.Nm ^Y
+which does
 not generate a STOP signal until a program attempts to
 not generate a STOP signal until a program attempts to
-.IR read (2)
+.Xr 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.
 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.
-.PP
+.Pp
 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.
 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.
-.PP
+.Pp
 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
 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
@@ -157,137 +260,167 @@ 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
 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
-.IR ex (1)
+.Xr 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
 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
-.I string,
+.Ar string ,
 if there is only one such job.
 if there is only one such job.
-.PP
+.Pp
 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
 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
-.I history
+.Ar history
 mechanism (described below),
 `%%' is also a synonym for the current job.
 mechanism (described below),
 `%%' is also a synonym for the current job.
-.sh "Status reporting"
+.Pp
+The job control mechanism requires that the
+.Xr stty 1
+option
+.Ic new
+be set. It is an artifact from a
+.Em new
+implementation
+of the
+tty driver which allows generation of interrupt characters from
+the keyboard to tell jobs to stop.  See stty(1) for details
+on setting options in the new tty driver.
+.Ss 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
 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
-.I notify,
+.Ar notify ,
 the shell will notify you immediately of changes of status in background
 jobs.
 There is also a shell command
 the shell will notify you immediately of changes of status in background
 jobs.
 There is also a shell command
-.I notify
+.Ar notify
 which marks a single process so that its status changes will be immediately
 which marks a single process so that its status changes will be immediately
-reported.  By default 
-.I notify
+reported.  By default
+.Ar notify
 marks the current process;
 simply say `notify' after starting a background job to mark it.
 marks the current process;
 simply say `notify' after starting a background job to mark it.
-.PP
+.Pp
 When you try to leave the shell while jobs are stopped, you will
 When you try to leave the shell while jobs are stopped, you will
-be warned that `You have stopped jobs.'  You may use the \fIjobs\fR
+be warned that `You have stopped jobs.'  You may use the
+.Ar 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.
 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.
-.sh "File Name Completion"
+.Ss File Name Completion
 When the file name completion feature is enabled by setting
 When the file name completion feature is enabled by setting
-the shell variable \fIfilec\fP (see \fBset\fP), \fIcsh\fP will
+the shell variable
+.Ar filec
+(see
+.Ic set ) ,
+.Nm csh
+will
 interactively complete file names and user names from unique
 prefixes, when they are input from the terminal followed by
 interactively complete file names and user names from unique
 prefixes, when they are input from the terminal followed by
-the escape character (the escape key, or control-[).  For example,
+the escape character (the escape key, or control-[)
+For example,
 if the current directory looks like
 if the current directory looks like
-.ta 1i 2i 3i 4i 5i 6i
-.nf
-       DSC.OLD bin     cmd     lib     xmpl.c
-       DSC.NEW chaosnet        cmtest  mail    xmpl.o
-       bench   class   dev     mbox    xmpl.out
-.fi
+.Ds I
+.Cw DSC.NEW chaosnet cmtest mbox
+.Cl DSC.OLD    bin     cmd     lib     xmpl.c
+.Cl DSC.NEW    chaosnet        cmtest  mail    xmpl.o
+.Cl bench      class   dev     mbox    xmpl.out
+.Cw
+.De
+.Pp
 and the input is
 and the input is
-.br
-       % vi ch<escape>
-.br
-\fIcsh\fP will complete the prefix ``ch''
+.Pp
+.Dl \&% vi ch<escape>
+.Pp
+.Nm csh
+will complete the prefix ``ch''
 to the only matching file name ``chaosnet'', changing the input
 line to
 to the only matching file name ``chaosnet'', changing the input
 line to
-.br
-       % vi chaosnet
-.br
+.Pp
+.Dl \&% vi chaosnet
+.Pp
 However, given
 However, given
-.br
-       % vi D<escape>
-.br
-\fIcsh\fP will only expand the input to
-.br
-       % vi DSC.
-.br
-and will sound the terminal bell to indicate the expansion is
+.Pp
+.Dl % vi D<escape>
+.Pp
+.Nm csh
+will only expand the input to
+.Pp
+.Dl \&% vi DSC.
+.Pp
+and will sound the terminal bell to indicate that the expansion is
 incomplete, since there are two file names matching the prefix ``D''.
 incomplete, since there are two file names matching the prefix ``D''.
-.PP
+.Pp
 If a partial file name is followed by the end-of-file character
 If a partial file name is followed by the end-of-file character
-(usually control-D), then, instead of completing the name, \fIcsh\fP
+(usually control-D), then, instead of completing the name,
+.Nm csh
 will list all file names matching the prefix.  For example,
 the input
 will list all file names matching the prefix.  For example,
 the input
-.br
-       % vi D<control-D>
-.br
+.Pp
+.Dl \&% vi D<control-D>
+.Pp
 causes all files beginning with ``D'' to be listed:
 causes all files beginning with ``D'' to be listed:
-.br
-       DSC.NEW DSC.OLD
-.br
+.Pp
+.Dl \&DSC.NEW  DSC.OLD
+.Pp
 while the input line remains unchanged.
 while the input line remains unchanged.
-.PP
+.Pp
 The same system of escape and end-of-file can also be used to
 expand partial user names, if the word to be completed
 (or listed) begins with the character ``~''.  For example,
 typing
 The same system of escape and end-of-file can also be used to
 expand partial user names, if the word to be completed
 (or listed) begins with the character ``~''.  For example,
 typing
-.br
-       cd ~ro<control-D>
-.br
+.Pp
+.Dl \&cd ~ro<escape>
+.Pp
 may produce the expansion
 may produce the expansion
-.br
-       cd ~root
-.PP
+.Pp
+.Dl \&cd ~root
+.Pp
 The use of the terminal bell to signal errors or multiple matches
 The use of the terminal bell to signal errors or multiple matches
-can be inhibited by setting the variable \fInobeep\fP.
-.PP
+can be inhibited by setting the variable
+.Ar nobeep  .
+.Pp
 Normally, all files in the particular directory are candidates
 for name completion.  Files with certain suffixes can be excluded
 Normally, all files in the particular directory are candidates
 for name completion.  Files with certain suffixes can be excluded
-from consideration by setting the variable \fIfignore\fP to the
-list of suffixes to be ignored.  Thus, if \fIfignore\fP is set by
+from consideration by setting the variable
+.Ar fignore
+to the
+list of suffixes to be ignored.  Thus, if
+.Ar fignore
+is set by
 the command
 the command
-.br
-       % set fignore = (.o .out)
-.br
+.Pp
+.Dl \&% set fignore = (.o .out)
+.Pp
 then typing
 then typing
-.br
-       % vi x<escape>
-.br
+.Pp
+.Dl \&% vi x<escape>
+.Pp
 would result in the completion to
 would result in the completion to
-.br
-       % vi xmpl.c
-.br
+.Pp
+.Dl \&% vi xmpl.c
+.Pp
 ignoring the files "xmpl.o" and "xmpl.out".
 However, if the only completion possible requires not ignoring these
 ignoring the files "xmpl.o" and "xmpl.out".
 However, if the only completion possible requires not ignoring these
-suffixes, then they are not ignored.  In addition, \fIfignore\fP
+suffixes, then they are not ignored.  In addition,
+.Ar fignore
 does not affect the listing of file names by control-D.  All files
 are listed regardless of their suffixes.
 does not affect the listing of file names by control-D.  All files
 are listed regardless of their suffixes.
-.sh Substitutions
+.Ss Substitutions
 We now describe the various transformations the shell performs on the
 input in the order in which they occur.
 We now describe the various transformations the shell performs on the
 input in the order in which they occur.
-.sh "History substitutions"
+.Ss 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 `!' and may begin
 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 `!' and may begin
-.B anywhere
+.Ar anywhere
 in the input stream (with the proviso that they
 in the input stream (with the proviso that they
-.B "do not"
+.Nm "do not"
 nest.)
 This `!' may be preceded by an `\e' to prevent its special meaning; for
 convenience, a `!' is passed unchanged when it is followed by a blank,
 nest.)
 This `!' may be preceded by an `\e' to prevent its special meaning; for
 convenience, a `!' is passed unchanged when it is followed by a blank,
@@ -296,36 +429,33 @@ tab, newline, `=' or `('.
 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.
 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.
-.PP
+.Pp
 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 which is controlled by the
 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 which is controlled by the
-.I history
+.Ar history
 variable; the previous command is always retained, regardless of its value.
 Commands are numbered sequentially from 1.
 variable; the previous command is always retained, regardless of its value.
 Commands are numbered sequentially from 1.
-.PP
+.Pp
 For definiteness, consider the following output from the
 For definiteness, consider the following output from the
-.I history
+.Ar history
 command:
 command:
-.PP
+.Pp
 .DT
 .DT
-.br
-       \09  write michael
-.br
-       10  ex write.c
-.br
-       11  cat oldwrite.c
-.br
-       12  diff *write.c
-.PP
+.Pp
+.Dl \&\09  write michael
+.Dl 10  ex write.c
+.Dl 11  cat oldwrite.c
+.Dl 12  diff *write.c
+.Pp
 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
 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
-.I prompt
+.Ar prompt
 by placing an `!' in the prompt string.
 by placing an `!' in the prompt string.
-.PP
+.Pp
 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
 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
@@ -335,114 +465,151 @@ These forms, without further modification, simply reintroduce the words
 of the specified events, each separated by a single blank.
 As a special case `!!' refers to the previous command; thus `!!'
 alone is essentially a
 of the specified events, each separated by a single blank.
 As a special case `!!' refers to the previous command; thus `!!'
 alone is essentially a
-.I redo.
-.PP
+.Ar redo .
+.Pp
 To select words from an event we can follow the event specification by
 a `:' and a designator for the desired words.
 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 words of an 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:
 the first (usually command) word being 0, the second word (first argument)
 being 1, etc.
 The basic word designators are:
-.PP
-.DT
-.nf
-       0       first (command) word
-       \fIn\fR \fIn\fR\|'th argument
-       \*(ua   first argument,  i.e. `1'
-       $       last argument
-       %       word matched by (immediately preceding) ?\fIs\fR\|? search
-       \fIx\fR\|\-\fIy\fR      range of words
-       \-\fIy\fR       abbreviates `0\-\fIy\fR\|'
-       *       abbreviates `\*(ua\-$', or nothing if only 1 word in event
-       \fIx\fR\|*      abbreviates `\fIx\fR\|\-$'
-       \fIx\fR\|\-     like `\fIx\fR\|*' but omitting word `$'
-.fi
-.PP
+.Pp
+.Dw Ds
+.Dp \&0
+first (command) word
+.Dp Ar n
+.Cx Ar n
+.Cx \'th
+.Cx
+argument
+.Dp \*(ua
+first argument,  i.e. `1'
+.Dp $
+last argument
+.Dp %
+word matched by (immediately preceding)
+.Cx \&?
+.Ar s
+.Cx \?
+.Cx
+search
+.Dp Ar \&x\-y
+range of words
+.Dp Ar \&\-y
+abbreviates
+.Ar `\&0\-y\'
+.Dp \&*
+abbreviates `\*(ua\-$', or nothing if only 1 word in event
+.Dp Ar x\&*
+abbreviates
+.Ar `x\-$\'
+.Dp Ar x\-
+like
+.Ar `x\&*\'
+but omitting word `$'
+.Dp
+.Pp
 The `:' separating the event specification from the word designator
 can be omitted if the argument selector begins with a `\*(ua', `$', `*'
 `\-' or `%'.
 After the optional word designator can be
 placed a sequence of modifiers, each preceded by a `:'.
 The following modifiers are defined:
 The `:' separating the event specification from the word designator
 can be omitted if the argument selector begins with a `\*(ua', `$', `*'
 `\-' or `%'.
 After the optional word designator can be
 placed a sequence of modifiers, each preceded by a `:'.
 The following modifiers are defined:
-.ta .5i 1.2i
-.PP
-.nf
-       h       Remove a trailing pathname component, leaving the head.
-       r       Remove a trailing `.xxx' component, leaving the root name.
-       e       Remove all but the extension `.xxx' part.
-       s/\fIl\fR\|/\fIr\fR\|/  Substitute \fIl\fR for \fIr\fR
-       t       Remove all leading pathname components, leaving the tail.
-       &       Repeat the previous substitution.
-       g       Apply the change globally, prefixing the above, e.g. `g&'.
-       p       Print the new command but do not execute it.
-       q       Quote the substituted words, preventing further substitutions.
-       x       Like q, but break into words at blanks, tabs and newlines.
-.fi
-.PP
+.Dw Ds
+.Dp h
+Remove a trailing pathname component, leaving the head.
+.Dp r
+Remove a trailing `.xxx' component, leaving the root name.
+.Dp e
+Remove all but the extension `.xxx' part.
+.Dp Cx s/
+.Ar l
+.Cx \/
+.Ar r
+.Cx \/
+.Cx
+Substitute
+.Ar l
+for
+.Ar r
+.Dp t
+Remove all leading pathname components, leaving the tail.
+.Dp \&&
+Repeat the previous substitution.
+.Dp g
+Apply the change globally, prefixing the above, e.g. `g&'.
+.Dp p
+Print the new command line but do not execute it.
+.Dp q
+Quote the substituted words, preventing further substitutions.
+.Dp x
+Like q, but break into words at blanks, tabs and newlines.
+.Dp
+.Pp
 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.
 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.
-.PP
+.Pp
 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 `/';
 a `\e' quotes the delimiter into the
 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 `/';
 a `\e' quotes the delimiter into the
-.IR l ""
+.Ar l  " "
 and
 and
-.IR r ""
+.Ar r  " "
 strings.
 The character `&' in the right hand side is replaced by the text from
 the left.
 A `\e' quotes `&' also.
 A null
 strings.
 The character `&' in the right hand side is replaced by the text from
 the left.
 A `\e' quotes `&' also.
 A null
-.IR l ""
+.Ar l  " "
 uses the previous string either from a
 uses the previous string either from a
-.IR l ""
+.Ar l  " "
 or from a
 contextual scan string
 or from a
 contextual scan string
-.IR s ""
-in `!?\fIs\fR\|?'.
+.Ar s  " "
+in `!?
+.Ar s
+\?'.
 The trailing delimiter in the substitution may be omitted if a newline
 follows immediately as may the trailing `?' in a contextual scan.
 The trailing delimiter in the substitution may be omitted if a newline
 follows immediately as may the trailing `?' in a contextual scan.
-.PP
+.Pp
 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?\*(ua !$' gives the first and last arguments
 from the command matching `?foo?'.
 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?\*(ua !$' gives the first and last arguments
 from the command matching `?foo?'.
-.PP
+.Pp
 A special abbreviation of a history reference occurs when the first
 non-blank character of an input line is a `\*(ua'.
 This is equivalent to `!:s\*(ua' providing a convenient shorthand for substitutions
 on the text of the previous line.
 A special abbreviation of a history reference occurs when the first
 non-blank character of an input line is a `\*(ua'.
 This is equivalent to `!:s\*(ua' providing a convenient shorthand for substitutions
 on the text of the previous line.
-Thus `\*(ualb\*(ualib' fixes the spelling of 
+Thus `\*(ualb\*(ualib' fixes the spelling of
 `lib'
 in the previous command.
 Finally, a history substitution may be surrounded with `{' and `}'
 if necessary to insulate it from the characters which follow.
 Thus, after `ls \-ld ~paul' we might do `!{l}a' to do `ls \-ld ~paula',
 while `!la' would look for a command starting `la'.
 `lib'
 in the previous command.
 Finally, a history substitution may be surrounded with `{' and `}'
 if necessary to insulate it from the characters which follow.
 Thus, after `ls \-ld ~paul' we might do `!{l}a' to do `ls \-ld ~paula',
 while `!la' would look for a command starting `la'.
-.PP
-.if n .ul
-\fBQuotations\ with\ \'\ and\ "\fR
-.PP
+.Pp
+.Ss Quotations with \' and \&"
 The quotation of strings by `\'' 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.
 The quotation of strings by `\'' 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.
-.PP
+.Pp
 In both cases the resulting text becomes (all or part of) a single word;
 only in one special case (see
 In both cases the resulting text becomes (all or part of) a single word;
 only in one special case (see
-.I "Command Substitition"
+.Em Command Substitition
 below) does a `"' quoted string yield parts of more than one word;
 `\'' quoted strings never do.
 below) does a `"' quoted string yield parts of more than one word;
 `\'' quoted strings never do.
-.sh "Alias substitution"
+.Ss Alias substitution
 The shell maintains a list of aliases which can be established, displayed
 and modified by the
 The shell maintains a list of aliases which can be established, displayed
 and modified by the
-.I alias
+.Ar alias
 and
 and
-.I unalias
+.Ar unalias
 commands.
 After a command line is scanned, it is parsed into distinct commands and
 the first word of each command, left-to-right, is checked to see if it
 commands.
 After a command line is scanned, it is parsed into distinct commands and
 the first word of each command, left-to-right, is checked to see if it
@@ -454,116 +621,116 @@ 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.
 command and argument list.
 If no reference is made to the history list, then the argument list is
 left unchanged.
-.PP
+.Pp
 Thus if the alias for `ls' is `ls \-l' the command `ls /usr' would map to
 `ls \-l /usr', the argument list here being undisturbed.
 Similarly if the alias for `lookup' was `grep !\*(ua /etc/passwd' then
 `lookup bill' would map to `grep bill /etc/passwd'.
 Thus if the alias for `ls' is `ls \-l' the command `ls /usr' would map to
 `ls \-l /usr', the argument list here being undisturbed.
 Similarly if the alias for `lookup' was `grep !\*(ua /etc/passwd' then
 `lookup bill' would map to `grep bill /etc/passwd'.
-.PP
+.Pp
 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.
 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.
-.PP
+.Pp
 Note that the mechanism allows aliases to introduce parser metasyntax.
 Note that the mechanism allows aliases to introduce parser metasyntax.
-Thus we can `alias print \'pr \e!* \||\| lpr\'' to make a command which
-.I pr's
+Thus we can `alias print \'pr \e!* \&| lpr\'' to make a command which
+.Ar pr 's
 its arguments to the line printer.
 its arguments to the line printer.
-.sh "Variable substitution"
+.Ss 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
 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
-.I argv
+.Ar argv
 variable is an image of the shell's argument list, and words of this
 variable's value are referred to in special ways.
 variable is an image of the shell's argument list, and words of this
 variable's value are referred to in special ways.
-.PP
+.Pp
 The values of variables may be displayed and changed by using the
 The values of variables may be displayed and changed by using the
-.I set
+.Ar set
 and
 and
-.I unset
+.Ar 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
 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
-.I verbose
+.Ar verbose
 variable is a toggle which causes command input to be echoed.
 The setting of this variable results from the
 variable is a toggle which causes command input to be echoed.
 The setting of this variable results from the
-.B \-v
+.Fl v
 command line option.
 command line option.
-.PP
+.Pp
 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.
 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.
-.PP
+.Pp
 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 `\e' except
 within `"'s where it
 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 `\e' except
 within `"'s where it
-.B always
+.Ar always
 occurs, and within `\''s where it
 occurs, and within `\''s where it
-.B never
+.Ar never
 occurs.
 Strings quoted by `\*(ga' are interpreted later (see
 occurs.
 Strings quoted by `\*(ga' are interpreted later (see
-.I "Command substitution"
+.Nm "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.
 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.
-.PP
+.Pp
 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.
 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.
-.PP
+.Pp
 Unless enclosed in `"' or given the `:q' modifier the results of variable
 substitution may eventually be command and filename substituted.
 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
+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.
 (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.
-.PP
+.Pp
 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.
 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.
-.HP 5
-$name
-.br
-.ns
-.HP 5
-${name}
-.br
+.Dw Ds
+.Di L
+.Dp $name
+.Dp ${name}
 Are replaced by the words of the value of variable
 Are replaced by the words of the value of variable
-.I name,
+.Ar name ,
 each separated by a blank.
 Braces insulate
 each separated by a blank.
 Braces insulate
-.I name
+.Ar 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.
 .br
 If
 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.
 .br
 If
-.I name
+.Ar name
 is not a shell variable, but is set in the environment, then
 is not a shell variable, but is set in the environment, then
-that value is returned (but \fB:\fR modifiers and the other forms
+that value is returned (but
+.Nm :
+modifiers and the other forms
 given below are not available in this case).
 given below are not available in this case).
-.HP 5
-$name[selector]
-.br
-.ns
-.HP 5
-${name[selector]}
-.br
+.Pp
+.Dp Cx $name
+.Op selector
+.Cx
+.Dp Cx ${name
+.Op selector
+.Cx }
+.Cx
 May be used to select only some of the words from the value of
 May be used to select only some of the words from the value of
-.I name.
+.Ar name .
 The selector is subjected to `$' substitution and may consist of a single
 number or two numbers separated by a `\-'.
 The first word of a variables value is numbered `1'.
 The selector is subjected to `$' substitution and may consist of a single
 number or two numbers separated by a `\-'.
 The first word of a variables value is numbered `1'.
@@ -572,63 +739,61 @@ If the last member of a range is omitted it defaults to `$#name'.
 The selector `*' selects all words.
 It is not an error for a range to be empty if the second argument is omitted
 or in range.
 The selector `*' selects all words.
 It is not an error for a range to be empty if the second argument is omitted
 or in range.
-.HP 5
-$#name
-.br
-.ns
-.HP 5
-${#name}
-.br
+.Pp
+.Dp $#name
+.Dp ${#name}
 Gives the number of words in the variable.
 Gives the number of words in the variable.
-This is useful for later use in a `[selector]'.
-.HP 5
-$0
-.br
+This is useful for later use in a
+.Cx `$argv
+.Op selector
+.Cx \' .
+.Cx
+.Pp
+.Dp $0
 Substitutes the name of the file from which command input is being read.
 An error occurs if the name is not known.
 Substitutes the name of the file from which command input is being read.
 An error occurs if the name is not known.
-.HP 5
-$number
-.br
-.ns
-.HP 5
-${number}
-.br
-Equivalent to `$argv[number]'.
-.HP 5
-$*
-.br
-Equivalent to `$argv[*]'.
-.PP
-The modifiers `:h', `:t', `:r', `:q' and `:x' may be applied to
+.Pp
+.Dp $number
+.Dp ${number}
+Equivalent to
+.Cx `$argv
+.Op number
+.Cx \' .
+.Cx
+.Pp
+.Dp $*
+Equivalent to
+.Cx `$argv
+.Op *
+.Cx \' .
+.Cx
+The modifiers `:e', `:h', `:t', `:r', `:q' and `:x' may be applied to
 the substitutions above as may `:gh', `:gt' and `:gr'.
 If braces `{' '}' appear in the command form then the modifiers
 must appear within the braces.
 the substitutions above as may `:gh', `:gt' and `:gr'.
 If braces `{' '}' appear in the command form then the modifiers
 must appear within the braces.
-.B  "The current implementation allows only one `:' modifier on each `$' expansion."
-.PP
+The current implementation allows only one `:' modifier on each `$' expansion.
+.Dp
+.Pp
 The following substitutions may not be modified with `:' modifiers.
 The following substitutions may not be modified with `:' modifiers.
-.HP 5
-$?name
-.br
-.ns
-.HP 5
-${?name}
-.br
+.Pp
+.Dw Ds
+.Di L
+.Dp $?name
+.Dp ${?name}
 Substitutes the string `1' if name is set, `0' if it is not.
 Substitutes the string `1' if name is set, `0' if it is not.
-.HP 5
-$?0
-.br
+.Pp
+.Dp $?0
 Substitutes `1' if the current input filename is known, `0' if it is not.
 Substitutes `1' if the current input filename is known, `0' if it is not.
-.HP 5
-$$
-.br
+.Pp
+.Dp $$
 Substitute the (decimal) process number of the (parent) shell.
 Substitute the (decimal) process number of the (parent) shell.
-.HP 5
-$<
-.br
+.Pp
+.Dp $<
 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.
 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.
-.sh "Command and filename substitution"
+.Dp
+.Ss 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
 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
@@ -638,17 +803,17 @@ 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.
 This occurs very late,
 after input-output redirection is performed, and in a child
 of the main shell.
-.sh "Command substitution"
+.Ss Command substitution
 Command substitution is indicated by a command enclosed in `\*(ga'.
 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 `"'s, only newlines force new words; blanks and tabs are preserved.
 Command substitution is indicated by a command enclosed in `\*(ga'.
 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 `"'s, only newlines force new words; blanks and tabs are preserved.
-.PP
+.Pp
 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.
 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.
-.sh "Filename substitution"
+.Ss Filename substitution
 If a word contains any of the characters `*', `?', `[' or `{'
 or begins with the character `~', then that word is a candidate for
 filename substitution, also known as `globbing'.
 If a word contains any of the characters `*', `?', `[' or `{'
 or begins with the character `~', then that word is a candidate for
 filename substitution, also known as `globbing'.
@@ -659,23 +824,26 @@ no pattern to match an existing file name, but it is not required
 for each pattern to match.
 Only the metacharacters `*', `?' and `[' imply pattern matching,
 the characters `~' and `{' being more akin to abbreviations.
 for each pattern to match.
 Only the metacharacters `*', `?' and `[' imply pattern matching,
 the characters `~' and `{' being more akin to abbreviations.
-.PP
+.Pp
 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 `?' matches any single character.
 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 `?' matches any single character.
-The sequence `[...]' matches any one of the characters enclosed.
-Within `[...]',
+The sequence
+.Sq Op ...
+matches any one of the characters enclosed.
+Within
+.Sq Op ... ,
 a pair of characters separated by `\-' matches any character lexically between
 the two.
 a pair of characters separated by `\-' matches any character lexically between
 the two.
-.PP
+.Pp
 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
 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
-.I home.
+.Ar 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'
 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'
@@ -683,7 +851,7 @@ 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.
 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.
-.PP
+.Pp
 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.
 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.
@@ -695,90 +863,70 @@ if the home directory for `source' is `/usr/source'.
 Similarly `../{memo,*box}' might expand to `../memo ../box ../mbox'.
 (Note that `memo' was not sorted with the results of matching `*box'.)
 As a special case `{', `}' and `{}' are passed undisturbed.
 Similarly `../{memo,*box}' might expand to `../memo ../box ../mbox'.
 (Note that `memo' was not sorted with the results of matching `*box'.)
 As a special case `{', `}' and `{}' are passed undisturbed.
-.sh Input/output
+.Ss Input/output
 The standard input and standard output of a command may be redirected
 with the following syntax:
 The standard input and standard output of a command may be redirected
 with the following syntax:
-.HP 5
-< name
-.br
+.Dw Ds
+.Di L
+.Dp < name
 Open file
 Open file
-.I name
+.Ar name
 (which is first variable, command and filename expanded) as the standard
 input.
 (which is first variable, command and filename expanded) as the standard
 input.
-.HP 5
-<< word
-.br
+.Pp
+.Dp << word
 Read the shell input up to a line which is identical to
 Read the shell input up to a line which is identical to
-.I word.
-.I Word
+.Ar word .
+.Ar Word
 is not subjected to variable, filename or command substitution,
 and each input line is compared to
 is not subjected to variable, filename or command substitution,
 and each input line is compared to
-.I word
+.Ar word
 before any substitutions are done on this input line.
 Unless a quoting `\e', `"', `\*(aa' or `\*(ga' appears in
 before any substitutions are done on this input line.
 Unless a quoting `\e', `"', `\*(aa' or `\*(ga' appears in
-.I word
+.Ar word
 variable and command substitution is performed on the intervening lines,
 allowing `\e' to quote `$', `\e' and `\*(ga'.
 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.
 variable and command substitution is performed on the intervening lines,
 allowing `\e' to quote `$', `\e' and `\*(ga'.
 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.
-.HP 5
-> name
-.br
-.ns
-.HP 5
->! name
-.br
-.ns
-.HP 5
->& name
-.br
-.ns
-.HP 5
->&! name
-.br
+.Pp
+.Dp > name
+.Dp >! name
+.Dp >& name
+.Dp >&! name
 The file
 The file
-.I name
+.Ar 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.
 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.
-.IP
+.Pp
 If the variable
 If the variable
-.I noclobber
+.Ar 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.
 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.
-.IP
+.Pp
 The forms involving `&' route the diagnostic output into the specified
 file as well as the standard output.
 The forms involving `&' route the diagnostic output into the specified
 file as well as the standard output.
-.I Name
+.Ar Name
 is expanded in the same way as `<' input filenames are.
 is expanded in the same way as `<' input filenames are.
-.HP 5
->> name
-.br
-.ns
-.HP 5
->>& name
-.br
-.ns
-.HP 5
->>! name
-.br
-.ns
-.HP 5
->>&! name
-.br
+.Pp
+.Dp >> name
+.Dp >>& name
+.Dp >>! name
+.Dp >>&! name
 Uses file
 Uses file
-.I name
+.Ar name
 as standard output like `>' but places output at the end of the file.
 If the variable
 as standard output like `>' but places output at the end of the file.
 If the variable
-.I noclobber
+.Ar noclobber
 is set, then it is an error for the file not to exist unless
 one of the `!' forms is given.
 Otherwise similar to `>'.
 is set, then it is an error for the file not to exist unless
 one of the `!' forms is given.
 Otherwise similar to `>'.
-.PP
+.Dp
+.Pp
 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.
 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.
@@ -789,32 +937,36 @@ The `<<' 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
 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
-.B not
-modified to be the empty file `/dev/null'; rather the standard input
+.Ar not
+modified to be the empty file
+.Pa /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
 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
-.B Jobs
-above.)
-.PP
+.Ar Jobs
+above).
+.Pp
 Diagnostic output may be directed through a pipe with the standard output.
 Diagnostic output may be directed through a pipe with the standard output.
-Simply use the form `|\|&' rather than just `|'.
-.sh Expressions
+Simply use the form `\&|&' rather than just `\&|'.
+.Ss 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
 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
-.I @,
-.I exit,
-.I if,
+.Nm @,
+.Ar exit ,
+.Ar if ,
 and
 and
-.I while
+.Ar while
 commands.
 The following operators are available:
 commands.
 The following operators are available:
-.DT
-.PP
-       |\|\||  &&  |  \*(ua  &  ==  !=  =~  !~  <=  >=  <  >  <<  >>  +  \-  *  /  %  !  ~  (  )
-.PP
+.Pp
+.Ds I
+\&|\&|  &&  \&| *(ua  &  ==  !=  =~  !~  <=  >=  <  >
+<<  >>  +  \-  *  /  %  !  ~  (  )
+.De
+.Pp
 Here the precedence increases to the right,
 `==' `!=' `=~' and `!~', `<=' `>=' `<' and `>', `<<' and `>>', `+' and `\-',
 `*' `/' and `%' being, in groups, at the same level.
 Here the precedence increases to the right,
 `==' `!=' `=~' and `!~', `<=' `>=' `<' and `>', `<<' and `>>', `+' and `\-',
 `*' `/' and `%' being, in groups, at the same level.
@@ -822,40 +974,46 @@ The `==' `!=' `=~' and `!~' operators compare their arguments as strings;
 all others operate on numbers.
 The operators `=~' and `!~' are like `!=' and `==' except that the right
 hand side is a
 all others operate on numbers.
 The operators `=~' and `!~' are like `!=' and `==' except that the right
 hand side is a
-.I pattern
-(containing, e.g. `*'s, `?'s and instances of `[...]')
+.Ar pattern
+(containing, e.g. `*'s, `?'s and instances of
+.Cx `
+.Op ...
+.Cx \' )
+.Cx
 against which the left hand operand is matched.  This reduces the
 need for use of the
 against which the left hand operand is matched.  This reduces the
 need for use of the
-.I switch
+.Ar switch
 statement in shell scripts when all that is really needed is pattern matching.
 statement in shell scripts when all that is really needed is pattern matching.
-.PP
+.Pp
 Strings which begin with `0' are considered octal numbers.
 Null or missing arguments are considered `0'.
 The result of all 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
 Strings which begin with `0' are considered octal numbers.
 Null or missing arguments are considered `0'.
 The result of all 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 (`&' `|' `<' `>' `(' `)')
+are syntactically significant to the parser (`&' `\&|' `<' `>' `(' `)')
 they should be surrounded by spaces.
 they should be surrounded by spaces.
-.PP
+.Pp
 Also available in expressions as primitive operands are command executions
 enclosed in `{' and `}'
 Also available in expressions as primitive operands are command executions
 enclosed in `{' and `}'
-and file enquiries of the form `\-\fIl\fR  name' where
-.I  l
+and file enquiries of the form
+.Fl l
+.Ar name
+where
+.Ic l
 is one of:
 is one of:
-.PP
-.DT
-.nf
-       r       read access
-       w       write access
-       x       execute access
-       e       existence
-       o       ownership
-       z       zero size
-       f       plain file
-       d       directory
-.fi
-.PP
+.Pp
+.Ds I
+r      read access
+w      write access
+x      execute access
+e      existence
+o      ownership
+z      zero size
+f      plain file
+d      directory
+.De
+.Pp
 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
 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
@@ -865,565 +1023,574 @@ if the command exits with status 0, otherwise they fail, returning
 false, i.e. `0'.
 If more detailed status information is required then the command
 should be executed outside of an expression and the variable
 false, i.e. `0'.
 If more detailed status information is required then the command
 should be executed outside of an expression and the variable
-.I status
+.Ar status
 examined.
 examined.
-.sh "Control flow"
+.Ss 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
 (in limited 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 shell contains a number of commands which can be used to regulate the
 flow of control in command files (shell scripts) and
 (in limited 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.
-.PP
+.Pp
 The
 The
-.I foreach,
-.I switch,
+.Ic foreach ,
+.Ic switch ,
 and
 and
-.I while
+.Ic while
 statements, as well as the
 statements, as well as the
-.I if\-then\-else
+.Ic if\-then\-else
 form of the
 form of the
-.I if
+.Ic if
 statement require that the major keywords appear in a single simple command
 on an input line as shown below.
 statement require that the major keywords appear in a single simple command
 on an input line as shown below.
-.PP
+.Pp
 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.)
 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.)
-.sh "Builtin commands"
+.Ss 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.
 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.
-.HP 5
-.B  alias
-.br
-.ns
-.HP 5
-.BR alias " name"
-.br
-.ns
-.HP 5
-.BR alias " name wordlist"
-.br
+.Dw Ds
+.Di L
+.Dp Ic alias
+.Dp Cx Ic alias
+.Cx \&\ \&
+.Cx Ar name
+.Cx
+.Dp Cx Ic alias
+.Cx \&\ \&
+.Ar name wordlist
+.Cx
 The first form prints all aliases.
 The second form prints the alias for name.
 The final form assigns the specified
 The first form prints all aliases.
 The second form prints the alias for name.
 The final form assigns the specified
-.I wordlist
-as the alias of 
-.I name;
-.I wordlist
+.Ar wordlist
+as the alias of
+.Ar name ;
+.Ar wordlist
 is command and filename substituted.
 is command and filename substituted.
-.I Name
+.Ar Name
 is not allowed to be
 is not allowed to be
-.I alias
+.Ar alias
 or
 or
-.I unalias.
-.HP 5
-.B  alloc
-.br
+.Ar unalias .
+.Pp
+.Dp Ic alloc
 Shows the amount of dynamic memory acquired, broken down into used and
 free memory.
 With an argument shows the number of free and used blocks in each size
 category.  The categories start at size 8 and double at each step.
 This command's output may vary across system types, since
 systems other than the VAX may use a different memory allocator.
 Shows the amount of dynamic memory acquired, broken down into used and
 free memory.
 With an argument shows the number of free and used blocks in each size
 category.  The categories start at size 8 and double at each step.
 This command's output may vary across system types, since
 systems other than the VAX may use a different memory allocator.
-.HP 5
-.B bg
-.br
-.ns
-.HP 5
-\fBbg\ %\fRjob\ ...
-.br
+.Pp
+.Dp Ic bg
+.Dp Cx Ic bg \&%
+.Ar job ...
+.Cx
 Puts the current or specified jobs into the background, continuing them
 if they were stopped.
 Puts the current or specified jobs into the background, continuing them
 if they were stopped.
-.HP 5
-.B  break
-.br
+.Pp
+.Dp Ic break
 Causes execution to resume after the
 Causes execution to resume after the
-.I end
+.Ic end
 of the nearest enclosing
 of the nearest enclosing
-.I foreach
+.Ic foreach
 or
 or
-.I while.
+.Ic while .
 The remaining commands on the current line are executed.
 Multi-level breaks are thus possible by writing them all on one line.
 The remaining commands on the current line are executed.
 Multi-level breaks are thus possible by writing them all on one line.
-.HP 5
-.B  breaksw
-.br
+.Pp
+.Dp Ic breaksw
 Causes a break from a
 Causes a break from a
-.I switch,
+.Ic switch ,
 resuming after the
 resuming after the
-.I endsw.
-.HP 5
-.BR case " label:"
-.br
+.Ic endsw .
+.Pp
+.Dp Cx Ic case
+.Cx \&\ \&
+.Ar label :
+.Cx
 A label in a
 A label in a
-.I switch
+.Ic switch
 statement as discussed below.
 statement as discussed below.
-.HP 5
-.B  cd
-.br
-.ns
-.HP 5
-.BR cd " name"
-.br
-.ns
-.HP 5
-.B  chdir
-.br
-.ns
-.HP 5
-.BR chdir " name"
-.br
-Change the shells working directory to directory
-.I name.
+.Pp
+.Dp Ic cd
+.Dp Cx Ic cd
+.Cx \&\ \&
+.Ar name
+.Cx
+.Dp Ic chdir
+.Dp Cx Ic chdir
+.Cx \&\ \&
+.Ar name
+.Cx
+Change the shell's working directory to directory
+.Ar name .
 If no argument is given then change to the home directory of the user.
 If no argument is given then change to the home directory of the user.
-.br
 If
 If
-.I name
+.Ar name
 is not found as a subdirectory of the current directory (and does not begin
 with `/', `./' or `../'), then each
 component of the variable
 is not found as a subdirectory of the current directory (and does not begin
 with `/', `./' or `../'), then each
 component of the variable
-.I cdpath
+.Ic cdpath
 is checked to see if it has a subdirectory
 is checked to see if it has a subdirectory
-.I name.
+.Ar name .
 Finally, if all else fails but
 Finally, if all else fails but
-.I name
+.Ar name
 is a shell variable whose value begins with `/', then this
 is tried to see if it is a directory.
 is a shell variable whose value begins with `/', then this
 is tried to see if it is a directory.
-.HP 5
-.B  continue
-.br
+.Pp
+.Dp Ic continue
 Continue execution of the nearest enclosing
 Continue execution of the nearest enclosing
-.I while
+.Ic while
 or
 or
-.I foreach.
+.Ic foreach .
 The rest of the commands on the current line are executed.
 The rest of the commands on the current line are executed.
-.HP 5
-.B  default:
-.br
+.Pp
+.Dp Ic default :
 Labels the default case in a
 Labels the default case in a
-.I switch
+.Ic switch
 statement.
 The default should come after all
 statement.
 The default should come after all
-.I case
+.Ic case
 labels.
 labels.
-.HP 5
-.BR "dirs"
-.br
+.Pp
+.Dp Ic dirs
 Prints the directory stack; the top of the stack is at the left,
 the first directory in the stack being the current directory.
 Prints the directory stack; the top of the stack is at the left,
 the first directory in the stack being the current directory.
-.HP 5
-.BR echo " wordlist"
-.br
-.ns
-.HP 5
-.BR "echo \-n" " wordlist"
-.br
+.Pp
+.Dp Cx Ic echo
+.Cx \&\ \&
+.Ar  wordlist
+.Cx
+.Dp Cx Ic echo
+.Cx \&\ \&
+.Fl n
+.Cx \&\ \&
+.Ar wordlist
+.Cx
 The specified words are written to the shells standard output, separated
 by spaces, and terminated with a newline unless the
 The specified words are written to the shells standard output, separated
 by spaces, and terminated with a newline unless the
-.B \-n
+.Fl n
 option is specified.
 option is specified.
-.HP 5
-.B  else
-.br
-.ns
-.HP 5
-.B  end
-.br
-.ns
-.HP 5
-.B  endif
-.br
-.ns
-.HP 5
-.B  endsw
-.br
+.Pp
+.Dp Ic else
+.Dp Ic end
+.Dp Ic endif
+.Dp Ic endsw
 See the description of the
 See the description of the
-.I foreach,
-.I if,
-.I switch,
+.Ic foreach ,
+.Ic if ,
+.Ic switch ,
 and
 and
-.I while
+.Ic while
 statements below.
 statements below.
-.HP 5
-.BR eval " arg ..."
-.br
+.Pp
+.Dp Cx Ic eval
+.Cx \&\ \&
+.Ar arg ...
+.Cx
 (As in
 (As in
-.IR sh (1).)
+.Xr sh  1  . )
 The arguments are read 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
 The arguments are read 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
-.IR tset (1)
+.Xr tset  1
 for an example of using
 for an example of using
-.IR eval .
-.HP 5
-.BR exec " command"
-.br
+.Ic eval .
+.Pp
+.Dp Cx Ic exec
+.Cx \&\ \&
+.Ar command
+.Cx
 The specified command is executed in place of the current shell.
 The specified command is executed in place of the current shell.
-.HP 5
-.B  exit
-.br
-.ns
-.HP 5
-.BR exit (expr)
-.br
+.Pp
+.Dp Ic exit
+.Dp Cx Ic exit
+.Cx \&\ \&
+.Ar (expr )
+.Cx
 The shell exits either with the value of the
 The shell exits either with the value of the
-.I status
+.Ic status
 variable (first form) or with the value of the specified
 variable (first form) or with the value of the specified
-.I  expr
+.Ic expr
 (second form).
 (second form).
-.HP 5
-.B fg
-.br
-.ns
-.HP 5
-\fBfg\ %\fRjob\ ...
-.br
+.Pp
+.Dp Ic fg
+.Dp Cx Ic fg \&%
+.Ar job ...
+.Cx
 Brings the current or specified jobs into the foreground, continuing them if
 they were stopped.
 Brings the current or specified jobs into the foreground, continuing them if
 they were stopped.
-.HP 5
-.BR foreach " name (wordlist)"
-.br
-.ns
-.HP 5
-\    ...
-.br
-.ns
-.HP 5
-.B  end
-.br
+.Pp
+.Dp Cx Ic foreach
+.Cx \&\ \&
+.Ar name (wordlist)
+.Cx
+.Dp ...
+.Dp Ic end
 The variable
 The variable
-.I name
+.Ic name
 is successively set to each member of
 is successively set to each member of
-.I wordlist
+.Ic wordlist
 and the sequence of commands between this command and the matching
 and the sequence of commands between this command and the matching
-.I end
+.Ic end
 are executed.
 (Both
 are executed.
 (Both
-.I foreach
+.Ic foreach
 and
 and
-.I end
+.Ic end
 must appear alone on separate lines.)
 must appear alone on separate lines.)
-.IP
 The builtin command
 The builtin command
-.I continue
+.Ic continue
 may be used to continue the loop prematurely and the builtin
 command
 may be used to continue the loop prematurely and the builtin
 command
-.I break
+.Ic 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.
 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.
-.HP 5
-.BR glob " wordlist"
-.br
+.Pp
+.Dp Cx Ic glob
+.Cx \&\ \&
+.Ar wordlist
+.Cx
 Like
 Like
-.I echo
+.Ic echo
 but no `\e' 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.
 but no `\e' 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.
-.HP 5
-.BR goto " word"
-.br
+.Pp
+.Dp Cx Ic goto
+.Cx \&\ \&
+.Ar word
+.Cx
 The specified
 The specified
-.I word
+.Ic 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.
 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.
-.HP 5
-.BR hashstat
-.br
+.Pp
+.Dp Ic hashstat
 Print a statistics line indicating how effective the internal hash
 table has been at locating commands (and avoiding
 Print a statistics line indicating how effective the internal hash
 table has been at locating commands (and avoiding
-.IR exec 's).
+.Cx Ic exec
+.Cx 's ) .
+.Cx
 An
 An
-.I exec
+.Ic exec
 is attempted for each component of the
 is attempted for each component of the
-.I path
+.Em path
 where the hash function indicates a possible hit, and in each component
 which does not begin with a `/'.
 where the hash function indicates a possible hit, and in each component
 which does not begin with a `/'.
-.HP 5
-.B  history
-.br
-.ns
-.HP 5
-.BI history " n"
-.br
-.ns
-.HP 5
-.BI "history \-r" " n"
-.br
-.ns
-.HP 5
-.BI "history \-h" " n"
-.br
-Displays the history event list; if \fIn\fR is given only the
-.I n
+.Pp
+.Dp Ic history
+.Dp Cx Ic history
+.Cx \&\ \&
+.Ar n
+.Cx
+.Dp Cx Ic history
+.Cx \&\ \&
+.Fl r
+.Cx \&\ \&
+.Ar n
+.Cx
+.Dp Cx Ic history
+.Cx \&\ \&
+.Fl h
+.Cx \&\ \&
+.Ar n
+.Cx
+Displays the history event list; if
+.Ar n
+is given only the
+.Ar n
 most recent events are printed.
 The
 most recent events are printed.
 The
-.B \-r
+.Fl r
 option reverses the order of printout to be most recent first
 rather than oldest first.
 The
 option reverses the order of printout to be most recent first
 rather than oldest first.
 The
-.B \-h
+.Fl 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
 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
-.IR source .
-.HP 5
-.BR if " (expr) command"
-.br
+.Ic source  .
+.Pp
+.Dp Cx Ic if
+.Cx \&\ \&
+.Cx \&(
+.Ar expr
+.Cx \&)
+.Cx
+.Ar command
 If the specified expression evaluates true, then the single
 If the specified expression evaluates true, then the single
-. command
+.Ar command
 with arguments is executed.
 Variable substitution on
 with arguments is executed.
 Variable substitution on
-.IR command ""
+.Ar command
 happens early, at the same
 time it does for the rest of the
 happens early, at the same
 time it does for the rest of the
-.I if
-command.
-.I Command
+.Ic if
+.Ar command .
+.Ar Command
 must be a simple command, not
 a pipeline, a command list, or a parenthesized command list.
 Input/output redirection occurs even if
 must be a simple command, not
 a pipeline, a command list, or a parenthesized command list.
 Input/output redirection occurs even if
-.I expr
+.Ar expr
 is false, when command is
 is false, when command is
-.B not
+.Sy not
 executed (this is a bug).
 executed (this is a bug).
-.HP 5
-.BR if " (expr) " "then"
-.br
-.ns
-.HP 5
-\    ...
-.br
-.ns
-.HP 5
-.BR else " " "if\fR (expr2) \fBthen"
-.br
-.ns
-.HP 5
-\    ...
-.br
-.ns
-.HP 5
-.B  else
-.br
-.ns
-.HP 5
-\    ...
-.br
-.ns
-.HP 5
-.B  endif
-.br
+.Pp
+.Dp Cx Ic if
+.Cx \&\ \&
+.Cx \&(
+.Ar expr
+.Cx \&)
+.Cx \&\ \&
+.Ar then 
+.Cx
+.Dp ...
+.Dp Cx Ic else if
+.Cx \&\ \&
+.Cx \&(
+.Ar expr2
+.Cx \&)
+.Cx \&\ \&
+.Ic then
+.Cx
+.Dp ...
+.Dp Ic else
+.Dp ...
+.Dp Ic endif
 If the specified
 If the specified
-.IR expr ""
+.Ar expr
 is true then the commands to the first
 is true then the commands to the first
-.I else
-are executed; else if
-.IR expr2 ""
+.Ic else
+are executed; otherwise if
+.Ar expr2
 is true then the commands to the
 is true then the commands to the
-second else are executed, etc.
+second
+.Ic else
+are executed, etc.
 Any number of
 Any number of
-.I else-if
+.Ic else-if
 pairs are possible; only one
 pairs are possible; only one
-.I endif
+.Ic endif
 is needed.
 The
 is needed.
 The
-.I else
+.Ic else
 part is likewise optional.
 (The words
 part is likewise optional.
 (The words
-.I else
+.Ic else
 and
 and
-.I endif
+.Ic endif
 must appear at the beginning of input lines;
 the
 must appear at the beginning of input lines;
 the
-.I if
+.Ic if
 must appear alone on its input line or after an
 must appear alone on its input line or after an
-.I else.)
-.HP 5
-.B jobs
-.br
-.ns
-.HP 5
-.B "jobs \-l"
-.br
+.Ic else . )
+.Pp
+.Dp Ic jobs
+.Dp Cx Ic jobs
+.Cx \&\ \&
+.Fl l
+.Cx
 Lists the active jobs; given the
 Lists the active jobs; given the
-.B \-l
+.Fl l
 options lists process id's in addition to the normal information.
 options lists process id's in addition to the normal information.
-.HP 5
-\fBkill %\fRjob
-.br
-.ns
-.HP 5
-\fBkill\ \-\fRsig\ \fB%\fRjob\ ...
-.br
-.ns
-.HP 5
-\fBkill\fR\ pid
-.br
-.ns
-.HP 5
-\fBkill\ \-\fRsig\ pid\ ...
-.br
-.ns
-.HP 5
-\fBkill\ \-l\fR
-.br
+.Pp
+.Dp Cx Ic kill  %
+.Ar job
+.Cx
+.Dp Cx Ic kill
+.Cx \&\ \&
+.Ar pid
+.Cx
+.Dp Cx Ic kill
+.Cx \&\ \&
+.Fl sig
+.Ar pid ...
+.Cx
+.Dp Cx Ic kill
+.Cx \&\ \&
+.Fl l
+.Cx
 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
 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
-.I /usr/include/signal.h,
+.Pa /usr/include/signal.h,
 stripped of the prefix ``SIG'').
 The signal names are listed by ``kill \-l''.
 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.
 stripped of the prefix ``SIG'').
 The signal names are listed by ``kill \-l''.
 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.
-.HP
-\fBlimit\fR
-.br
-.ns
-.HP 5
-\fBlimit\fR \fIresource\fR
-.br
-.ns
-.HP 5
-\fBlimit\fR \fIresource\fR \fImaximum-use\fR
-.br
-.ns
-.HP 5
-\fBlimit\ \-h\fR
-.br
-.ns
-.HP 5
-\fBlimit\ \-h\fR \fIresource\fR
-.br
-.ns
-.HP 5
-\fBlimit\ \-h\fR \fIresource\fR \fImaximum-use\fR
-.br
+.Pp
+.Dp Ic limit
+.Dp Cx Ic limit
+.Cx \&\ \&
+.Ar resource
+.Cx
+.Dp Cx Ic limit
+.Cx \&\ \&
+.Ar resource maximum-use
+.Cx
+.Dp Cx Ic limit
+.Cx \&\ \&
+.Fl h
+.Cx
+.Dp Cx Ic limit
+.Cx \&\ \&
+.Fl h
+.Cx \&\ \&
+.Ar resource
+.Cx
+.Dp Cx Ic limit
+.Cx \&\ \&
+.Fl h
+.Cx \&\ \&
+.Ar resource maximum-use
+.Cx
 Limits the consumption by the current process and each process
 Limits the consumption by the current process and each process
-it creates to not individually exceed \fImaximum-use\fR on the
-specified \fIresource\fR.  If no \fImaximum-use\fR is given, then
-the current limit is printed; if no \fIresource\fR is given, then
-all limitations are given.  If the \fB\-h\fR
+it creates to not individually exceed
+.Ar maximum-use
+on the
+specified
+.Ar resource  .
+If no
+.Ar maximum-use
+is given, then
+the current limit is printed; if no
+.Ar resource
+is given, then
+all limitations are given.  If the
+.Fl h
 flag is given, the hard limits are used instead of the current
 limits.  The hard limits impose a ceiling on the values of
 the current limits.  Only the super-user may raise the hard limits,
 but a user may lower or raise the current limits within the legal range.
 flag is given, the hard limits are used instead of the current
 limits.  The hard limits impose a ceiling on the values of
 the current limits.  Only the super-user may raise the hard limits,
 but a user may lower or raise the current limits within the legal range.
-.IP
-Resources controllable currently include \fIcputime\fR (the maximum
-number of cpu-seconds to be used by each process), \fIfilesize\fR
-(the largest single file which can be created), \fIdatasize\fR
+.Pp
+Resources controllable currently include
+.Ar cputime
+(the maximum
+number of cpu-seconds to be used by each process),
+.Ar filesize
+(the largest single file which can be created),
+.Ar datasize
 (the maximum growth of the data+stack region via
 (the maximum growth of the data+stack region via
-.IR sbrk (2)
-beyond the end of the program text), \fIstacksize\fR (the maximum
-size of the automatically-extended stack region), and \fIcoredumpsize\fR
+.Xr sbrk  2
+beyond the end of the program text),
+.Ar stacksize
+(the maximum
+size of the automatically-extended stack region), and
+.Ar coredumpsize
 (the size of the largest core dump that will be created).
 (the size of the largest core dump that will be created).
-.IP
-The \fImaximum-use\fR may be given as a (floating point or integer)
-number followed by a scale factor.  For all limits other than \fIcputime\fR
+.Pp
+The
+.Ar maximum-use
+may be given as a (floating point or integer)
+number followed by a scale factor.  For all limits other than
+.Ar cputime
 the default scale is `k' or `kilobytes' (1024 bytes);
 a scale factor of `m' or `megabytes' may also be used.
 For
 the default scale is `k' or `kilobytes' (1024 bytes);
 a scale factor of `m' or `megabytes' may also be used.
 For
-.I cputime
+.Ar 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.
 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.
-.IP
-For both \fIresource\fR names and scale factors, unambiguous prefixes
+.Pp
+For both
+.Ar resource
+names and scale factors, unambiguous prefixes
 of the names suffice.
 of the names suffice.
-.HP 5
-.B  login
-.br
+.Pp
+.Dp Ic login
 Terminate a login shell, replacing it with an instance of
 Terminate a login shell, replacing it with an instance of
-.B /bin/login.
+.Pa /bin/login.
 This is one way to log off, included for compatibility with
 This is one way to log off, included for compatibility with
-.IR sh (1).
-.HP 5
-.B  logout
-.br
+.Xr sh  1  .
+.Pp
+.Dp Ic logout
 Terminate a login shell.
 Especially useful if
 Terminate a login shell.
 Especially useful if
-.I ignoreeof
+.Ic ignoreeof
 is set.
 is set.
-.HP 5
-.B  nice
-.br
-.ns
-.HP 5
-.BR nice " \+number"
-.br
-.ns
-.HP 5
-.BR nice " command"
-.br
-.ns
-.HP 5
-.BR nice " \+number command"
-.br
+.Pp
+.Dp Ic nice
+.Dp Cx Ic nice
+.Cx \&\ \&
+.Ar +number
+.Cx
+.Dp Cx Ic nice
+.Cx \&\ \&
+.Ar command
+.Cx
+.Dp Cx Ic nice
+.Cx \&\ \&
+.Ar +number command
+.Cx
 The first form sets the
 scheduling priority
 for this shell to 4.
 The second form sets the
 priority
 The first form sets the
 scheduling priority
 for this shell to 4.
 The second form sets the
 priority
-to the given number.
+to the given
+.Ar number .
 The final two forms run command at priority 4 and
 The final two forms run command at priority 4 and
-.I number
+.Ar number
 respectively.
 The greater the number, the less cpu the process will get.
 The super-user may specify negative priority by using `nice \-number ...'.
 Command is always executed in a sub-shell, and the restrictions
 placed on commands in simple
 respectively.
 The greater the number, the less cpu the process will get.
 The super-user may specify negative priority by using `nice \-number ...'.
 Command is always executed in a sub-shell, and the restrictions
 placed on commands in simple
-.I if
+.Ic if
 statements apply.
 statements apply.
-.HP 5
-.B  nohup
-.br
-.ns
-.HP 5
-.BR "nohup" " command"
-.br
+.Pp
+.Dp Ic nohup
+.Dp Cx Ic nohup
+.Cx \&\ \&
+.Ar command
+.Cx
 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
 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
-.I nohup'ed.
-.HP 5
-.B notify
-.br
-.ns
-.HP 5
-\fBnotify\ %\fRjob\ ...
-.br
+.Cx Ic nohup
+.Cx \'ed .
+.Cx
+.Pp
+.Dp Ic notify
+.Dp Cx Ic notify %
+.Cx \&\ \&
+.Ar job ...
+.Cx
 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
 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
-.I notify
+.Ic notify
 is set.
 is set.
-.HP 5
-.B  onintr
-.br
-.ns
-.HP 5
-.BR onintr "  \-"
-.br
-.ns
-.HP 5
-.BR onintr "  label"
-.br
+.Pp
+.Dp Ic onintr
+.Dp Cx Ic onintr
+.Cx \&\ \&
+.Fl
+.Cx
+.Dp Cx Ic onintr
+.Cx \&\ \&
+.Ar label
+.Cx
 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
 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
@@ -1432,823 +1599,740 @@ 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.
 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.
-.IP
+.Pp
 In any case, if the shell is running detached and interrupts are
 being ignored, all forms of
 In any case, if the shell is running detached and interrupts are
 being ignored, all forms of
-.I onintr
+.Ic onintr
 have no meaning and interrupts
 continue to be ignored by the shell and all invoked commands.
 have no meaning and interrupts
 continue to be ignored by the shell and all invoked commands.
-.HP 5
-.BR "popd"
-.br
-.ns
-.HP 5
-.BR "popd" " +n"
-.br
+.Pp
+.Dp Ic popd
+.Dp Cx Ic popd
+.Cx \&\ \&
+.Ar +n
+.Cx
 Pops the directory stack, returning to the new top directory.
 Pops the directory stack, returning to the new top directory.
-With a argument `+\fIn\fR' discards the \fIn\fR\|th
+With an argument
+.Cx `+
+.Ar n
+.Cx \'
+.Cx
+discards the
+.Cx Ar n
+.Cx \'
+.Cx th
+.Cx
 entry in the stack.
 The elements of the directory stack are numbered from 0 starting at the top.
 entry in the stack.
 The elements of the directory stack are numbered from 0 starting at the top.
-.HP 5
-.BR "pushd"
-.br
-.ns
-.HP 5
-.BR "pushd" " name"
-.br
-.ns
-.HP 5
-.BR "pushd" " +n"
-.br
+.Pp
+.Dp Ic pushd
+.Dp Cx Ic pushd
+.Cx \&\ \&
+.Ar name
+.Cx
+.Dp Cx Ic pushd
+.Cx \&\ \&
+.Ar n
+.Cx
 With no arguments,
 With no arguments,
-.I pushd
+.Ic pushd
 exchanges the top two elements of the directory stack.
 Given a
 exchanges the top two elements of the directory stack.
 Given a
-.I name
+.Ar name
 argument,
 argument,
-.I pushd
+.Ic pushd
 changes to the new directory (ala
 changes to the new directory (ala
-.I cd)
+.Ic cd )
 and pushes the old current working directory
 (as in
 and pushes the old current working directory
 (as in
-.I csw)
+.Ic csw )
 onto the directory stack.
 onto the directory stack.
-With a numeric argument, rotates the \fIn\fR\|th argument of the directory
+With a numeric argument, rotates the
+.Cx Ar n
+.Cx \'
+.Cx th
+.Cx
+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 0.
 stack around to be the top element and changes to it.  The members
 of the directory stack are numbered from the top starting at 0.
-.HP 5
-.BR rehash
-.br
+.Pp
+.Dp Ic rehash
 Causes the internal hash table of the contents of the directories in
 the
 Causes the internal hash table of the contents of the directories in
 the
-.I path
+.Ic path
 variable to be recomputed.  This is needed if new commands are added
 to directories in the
 variable to be recomputed.  This is needed if new commands are added
 to directories in the
-.I path
+.Ic 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.
 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.
-.HP 5
-.BR repeat " count command"
-.br
-The specified 
-.I command
+.Pp
+.Dp Cx Ic repeat
+.Cx \&\ \&
+.Ar count command
+.Cx
+The specified
+.Ar command
 which is subject to the same restrictions
 as the
 which is subject to the same restrictions
 as the
-.I command
+.Ar command
 in the one line
 in the one line
-.I if
+.Ic if
 statement above,
 is executed
 statement above,
 is executed
-.I count
+.Ar count
 times.
 I/O redirections occur exactly once, even if
 times.
 I/O redirections occur exactly once, even if
-.I count
+.Ar count
 is 0.
 is 0.
-.HP 5
-.B  set
-.br
-.ns
-.HP 5
-.BR set " name"
-.br
-.ns
-.HP 5
-.BR set " name=word"
-.br
-.ns
-.HP 5
-.BR set " name[index]=word"
-.br
-.ns
-.HP 5
-.BR set " name=(wordlist)"
-.br
+.Pp
+.Dp Ic set
+.Dp Cx Ic set
+.Cx \&\ \&
+.Ar name
+.Cx
+.Dp Cx Ic set
+.Cx \&\ \&
+.Ar name=word
+.Cx
+.Dp Cx Ic set
+.Cx \&\ \&
+.Ar name
+.Op index
+.Ar =word
+.Cx
+.Dp Cx Ic set
+.Cx \&\ \&
+.Ar name=(wordlist)
+.Cx
 The first form of the command shows the value of all shell variables.
 Variables which have other than a single word as value print as a parenthesized
 word list.
 The second form sets
 The first form of the command shows the value of all shell variables.
 Variables which have other than a single word as value print as a parenthesized
 word list.
 The second form sets
-.I name
+.Ic name
 to the null string.
 The third form sets
 to the null string.
 The third form sets
-.I name
+.Ic name
 to the single
 to the single
-.I word.
+.Ic word .
 The fourth form sets
 the
 The fourth form sets
 the
-.I index'th
+.Cx Ar index
+.Cx \'th
+.Cx
 component of name to word;
 this component must already exist.
 The final form sets
 component of name to word;
 this component must already exist.
 The final form sets
-.I name
+.Ar name
 to the list of words in
 to the list of words in
-.I wordlist.
+.Ar wordlist .
 In all cases the value is command and filename expanded.
 In all cases the value is command and filename expanded.
-.IP
+.Pp
 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.
 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.
-.HP 5
-.BR setenv
-.br
-.ns
-.HP 5
-.BR setenv " name value"
-.br
-.ns
-.HP 5
-.BR setenv " name"
-.br
+.Pp
+.Dp Ic setenv
+.Dp Cx Ic setenv
+.Cx \&\ \&
+.Ar name value
+.Cx
+.Dp Cx Ic setenv
+.Cx \&\ \&
+.Ar name
+.Cx
 The first form lists all current environment variables.
 The last form sets the value of environment variable
 The first form lists all current environment variables.
 The last form sets the value of environment variable
-.I name
+.Ar name
 to be
 to be
-.I value,
+.Ar value ,
 a single string.  The second form sets
 a single string.  The second form sets
-.I name
+.Ar name
 to an empty string.
 to an empty string.
-The most commonly used environment variable USER, TERM, and PATH
+The most commonly used environment variable
+.Ev USER ,
+.Ev TERM ,
+and
+.Ev PATH
 are automatically imported to and exported from the
 are automatically imported to and exported from the
-.I csh
+.Nm csh
 variables
 variables
-.I user,
-.I term,
+.Ar user ,
+.Op Ar term ,
 and
 and
-.I path;
+.Ar path ;
 there is no need to use
 there is no need to use
-.I setenv
+.Ic setenv
 for these.
 for these.
-.HP 5
-.B  shift
-.br
-.ns
-.HP 5
-.BR shift " variable"
-.br
+.Pp
+.Dp Ic shift
+.Dp Cx Ic shift
+.Cx \&\ \&
+.Ar variable
+.Cx
 The members of
 The members of
-.I argv
+.Ic argv
 are shifted to the left, discarding
 are shifted to the left, discarding
-.I argv[1].
+.Cx Ic argv
+.Op 1  .
+.Cx
 It is an error for
 It is an error for
-.I argv
+.Ic 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.
 not to be set or to have less than one word as value.
 The second form performs the same function on the specified variable.
-.HP 5
-.BR source " name"
-.br
-.ns
-.HP 5
-.BR "source \-h" " name"
-.br
+.Pp
+.Dp Cx Ic source
+.Cx \&\ \&
+.Ar name
+.Cx
+.Dp Cx Ic source
+.Cx \&\ \&
+.Fl h
+.Cx \&\ \&
+.Ar name
+.Cx
 The shell reads commands from
 The shell reads commands from
-.I name.
-.I Source
+.Ic name .
+.Ic Source
 commands may be nested; if they are nested too deeply the shell may
 run out of file descriptors.
 An error in a
 commands may be nested; if they are nested too deeply the shell may
 run out of file descriptors.
 An error in a
-.I source
+.Ic source
 at any level terminates all nested
 at any level terminates all nested
-.I source
+.Ic source
 commands.
 commands.
-Normally input during 
-.I source
+Normally input during
+.Ic source
 commands is not placed on the history list;
 the \-h option causes the commands to be placed in the
 history list without being executed.
 commands is not placed on the history list;
 the \-h option causes the commands to be placed in the
 history list without being executed.
-.HP 5
-.B stop
-.br
-.ns
-.HP 5
-\fBstop\ %\fRjob\ ...
-.br
+.Pp
+.Dp Ic stop
+.Dp Cx Ic stop %
+.Ar job ...
+.Cx
 Stops the current or specified job which is executing in the background.
 Stops the current or specified job which is executing in the background.
-.HP 5
-.B suspend
-.br
-.ns
+.Pp
+.Dp Ic suspend
 Causes the shell to stop in its tracks, much as if it had been sent a stop
 Causes the shell to stop in its tracks, much as if it had been sent a stop
-signal with \fB^Z\fR.  This is most often used to stop shells started by
-.IR su (1).
-.HP 5
-.BR switch " (string)"
-.br
-.ns
-.HP 5
-.BR case " str1:"
-.br
-.ns
-.HP 5
-\    ...
-.br
-.ns
-.HP 5
-\   
-.B  breaksw
-.br
-.ns
-.HP 5
-\&...
-.br
-.ns
-.HP 5
-.B  default:
-.br
-.ns
-.HP 5
-\    ...
-.br
-.ns
-.HP 5
-\   
-.B  breaksw
-.br
-.ns
-.HP 5
-.B  endsw
-.br
+signal with
+.Ic ^Z .
+This is most often used to stop shells started by
+.Xr su  1 .
+.Pp
+.Dp Cx Ic switch
+.Cx \&\ \&
+.Ar (string)
+.Cx
+.Dp Cx Ic case
+.Cx \&\ \&
+.Ar str1 :
+.Cx
+.Dp \&...
+.Dp Ic breaksw
+.Dp \&...
+.Dp Ic default :
+.Dp \&...
+.Dp Ic breaksw
+.Dp Ic endsw
 Each case label is successively matched, against the specified
 Each case label is successively matched, against the specified
-.I string
+.Ar string
 which is first command and filename expanded.
 which is first command and filename expanded.
-The file metacharacters `*', `?' and `[...]' may be used in the case labels,
+The file metacharacters `*', `?' and `[...]'
+may be used in the case labels,
 which are variable expanded.
 If none of the labels match before a `default' label is found, then
 the execution begins after the default label.
 Each case label and the default label must appear at the beginning of a line.
 which are variable expanded.
 If none of the labels match before a `default' label is found, then
 the execution begins after the default label.
 Each case label and the default label must appear at the beginning of a line.
-The command 
-.I breaksw
+The command
+.Ic breaksw
 causes execution to continue after the
 causes execution to continue after the
-.I endsw.
+.Ic endsw .
 Otherwise control may fall through case labels and default labels as in C.
 If no label matches and there is no default, execution continues after
 the
 Otherwise control may fall through case labels and default labels as in C.
 If no label matches and there is no default, execution continues after
 the
-.I endsw.
-.HP 5
-.B  time
-.br
-.ns
-.HP 5
-.BR time " command"
-.br
+.Ic endsw .
+.Pp
+.Dp Ic time
+.Dp Cx Ic time
+.Cx \&\ \&
+.Ar command
+.Cx
 With no argument, a summary of time used by this shell and its children
 is printed.
 If arguments are given
 the specified simple command is timed and a time summary
 as described under the
 With no argument, a summary of time used by this shell and its children
 is printed.
 If arguments are given
 the specified simple command is timed and a time summary
 as described under the
-.I time
+.Ic time
 variable is printed.  If necessary, an extra shell is created to print the time
 statistic when the command completes.
 variable is printed.  If necessary, an extra shell is created to print the time
 statistic when the command completes.
-.HP 5
-.B umask
-.br
-.ns
-.HP 5
-.BR umask " value"
-.br
+.Pp
+.Dp Ic umask
+.Dp Cx Ic umask
+.Cx \&\ \&
+.Ar value
+.Cx
 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.
 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.
-.HP 5
-.BR unalias " pattern"
-.br
+.Pp
+.Dp Cx Ic unalias
+.Cx \&\ \&
+.Ar pattern
+.Cx
 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
 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
-.I unaliased.
-.HP 5
-.BR unhash
-.br
+.Ic unaliased .
+.Pp
+.Dp Ic unhash
 Use of the internal hash table to speed location of executed programs
 is disabled.
 Use of the internal hash table to speed location of executed programs
 is disabled.
-.HP 5
-\fBunlimit\fR
-.br
-.ns
-.HP 5
-\fBunlimit\fR \fIresource\fR
-.br
-.ns
-.HP 5
-\fBunlimit\ \-h\fR
-.br
-.ns
-.HP 5
-\fBunlimit\ \-h\fR \fIresource\fR
-.br
-Removes the limitation on \fIresource\fR.  If no \fIresource\fR
-is specified, then all \fIresource\fR limitations are removed.  If
-\fB\-h\fR is given, the corresponding hard limits are removed.  Only the
+.Pp
+.Dp Ic unlimit
+.Dp Cx Ic unlimit
+.Cx \&\ \&
+.Ar  resource
+.Cx
+.Dp Cx Ic unlimit 
+.Cx \&\ \&
+.Fl h
+.Cx
+.Dp Cx Ic unlimit 
+.Cx \&\ \&
+.Fl h
+.Cx \&\ \&
+.Ar resource
+.Cx
+Removes the limitation on
+.Ar resource  .
+If no
+.Ar resource
+is specified, then all
+.Ar resource
+limitations are removed.  If
+.Fl h
+is given, the corresponding hard limits are removed.  Only the
 super-user may do this.
 super-user may do this.
-.HP 5
-.BR unset " pattern"
-.br
+.Pp
+.Dp Cx Ic unset
+.Cx \&\ \&
+.Ar pattern 
+.Cx
 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
 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
-.I unset.
-.HP 5
-.BR unsetenv " pattern"
-.br
+.Ic unset .
+.Pp
+.Dp Cx Ic unsetenv
+.Cx \&\ \&
+.Ar pattern
+.Cx
 Removes all variables whose name match the specified pattern from the
 environment.  See also the
 Removes all variables whose name match the specified pattern from the
 environment.  See also the
-.I setenv
+.Ic setenv
 command above and
 command above and
-.IR printenv (1).
-.HP 5
-.B  wait
-.br
+.Xr printenv  1  .
+.Pp
+.Dp Ic 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.
 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.
-.HP 5
-.BR while " (expr)"
-.br
-.ns
-.HP 5
-\    ...
-.br
-.ns
-.HP 5
-.B  end
-.br
+.Pp
+.Dp Cx Ic while
+.Cx \&\ \&
+.Ar (expr)
+.Cx
+.Dp \&...
+.Dp Ic end
 While the specified expression evaluates non-zero, the commands between
 the
 While the specified expression evaluates non-zero, the commands between
 the
-.I while
+.Ic while
 and the matching end are evaluated.
 and the matching end are evaluated.
-.I Break
+.Ic Break
 and
 and
-.I continue
+.Ic continue
 may be used to terminate or continue the loop prematurely.
 (The
 may be used to terminate or continue the loop prematurely.
 (The
-.I while
+.Ic while
 and
 and
-.I end
+.Ic end
 must appear alone on their input lines.)
 Prompting occurs here the first time through the loop as for the
 must appear alone on their input lines.)
 Prompting occurs here the first time through the loop as for the
-.I foreach
+.Ic foreach
 statement if the input is a terminal.
 statement if the input is a terminal.
-.HP 5
-\fB%\fRjob
-.br
+.Pp
+.Dp Cx Ic %
+.Cx \&\ \&
+.Ar job
+.Cx
 Brings the specified job into the foreground.
 Brings the specified job into the foreground.
-.HP 5
-\fB%\fRjob \fB&\fR
-.br
+.Pp
+.Dp Cx Ic %
+.Cx \&\ \&
+.Ar job
+.Cx \&\ \&
+.Ic &
+.Cx
 Continues the specified job in the background.
 Continues the specified job in the background.
-.HP 5
-.B "@"
-.br
-.ns
-.HP 5
-.BR "@" " name = expr"
-.br
-.ns
-.HP 5
-.BR "@" " name[index] = expr"
-.br
+.Pp
+.Dp Ic @
+.Dp Cx Ic @
+.Cx \&\ \&
+.Ar name = expr
+.Cx
+.Dp Cx Ic @
+.Cx \&\ \&
+.Ar name
+.Op index
+.Cx\&\ = expr
+.Cx
 The first form prints the values of all the shell variables.
 The second form sets the specified
 The first form prints the values of all the shell variables.
 The second form sets the specified
-.I name
+.Ar name
 to the value of
 to the value of
-.I expr.
-If the expression contains `<', `>', `&' or `|' then at least
+.Ar expr .
+If the expression contains `<', `>', `&' or `' then at least
 this part of the expression must be placed within `(' `)'.
 The third form assigns the value of
 this part of the expression must be placed within `(' `)'.
 The third form assigns the value of
-.I expr
+.Ar expr
 to the
 to the
-.I index'th
+.Cx Ar index
+.Cx \'th
+.Cx
 argument of
 argument of
-.I name.
-Both 
-.I name
+.Ar name .
+Both
+.Ar name
 and its
 and its
-.I index'th
+.Cx Ar index
+.Cx \'th
+.Cx
 component must already exist.
 component must already exist.
-.IP
+.Cx \&\ \&
+.Dp
+.Pp
 The operators `*=', `+=', 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
 The operators `*=', `+=', 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
-.I expr
+.Ar expr
 which would otherwise be single words.
 which would otherwise be single words.
-.IP
-Special postfix `++' and `\-\|\-' operators increment and decrement
-.I name
+.Pp
+Special postfix `++' and `\-\-' operators increment and decrement
+.Ar name
 respectively, i.e. `@  i++'.
 respectively, i.e. `@  i++'.
-.sh "Pre-defined and environment variables"
+.Ss Pre-defined and environment variables
 The following variables have special meaning to the shell.
 Of these,
 The following variables have special meaning to the shell.
 Of these,
-.I argv,
-.I cwd,
-.I home,
-.I path,
-.I prompt,
-.I shell
+.Ar argv ,
+.Ar cwd,
+.Ar home ,
+.Ar path,
+.Ar prompt ,
+.Ar shell
 and
 and
-.I status
+.Ar status
 are always set by the shell.
 Except for
 are always set by the shell.
 Except for
-.I cwd
+.Ar cwd
 and
 and
-.I status
+.Ar status
 this setting occurs only at initialization;
 these variables will not then be modified unless this is done
 explicitly by the user.
 this setting occurs only at initialization;
 these variables will not then be modified unless this is done
 explicitly by the user.
-.PP
-This shell copies the environment variable USER into the variable
-.I user,
-TERM into
-.I term,
+.Pp
+This shell copies the environment variable
+.Ev USER
+into the variable
+.Ar user ,
+.Ev TERM
+into
+.Ar term ,
 and
 and
-HOME into
-.I home,
+.Ev HOME
+into
+.Ar home ,
 and copies these back into the environment whenever the normal
 shell variables are reset.
 and copies these back into the environment whenever the normal
 shell variables are reset.
-The environment variable PATH is likewise handled; it is not
+The environment variable
+.Ev PATH
+is likewise handled; it is not
 necessary to worry about its setting other than in the file
 necessary to worry about its setting other than in the file
-.I \&.cshrc
+.Ar \&.cshrc
 as inferior
 as inferior
-.I csh
+.Nm csh
 processes will import the definition of
 processes will import the definition of
-.I path
+.Ar path
 from the environment, and re-export it if you then change it.
 from the environment, and re-export it if you then change it.
-.TP 15
-.B argv
-\c
+.Tp Ic argv
 Set to the arguments to the shell, it is from this variable that
 positional parameters are substituted, i.e. `$1' is replaced by
 Set to the arguments to the shell, it is from this variable that
 positional parameters are substituted, i.e. `$1' is replaced by
-`$argv[1]', etc.
-.TP 15
-.B cdpath
-\c
+`$argv[1]',
+etc.
+.Tp Ic cdpath
 Gives a list of alternate directories searched to find subdirectories
 in
 Gives a list of alternate directories searched to find subdirectories
 in
-.I chdir
+.Ar chdir
 commands.
 commands.
-.TP 15
-.B cwd
+.Tp Ic cwd
 The full pathname of the current directory.
 The full pathname of the current directory.
-.TP 15
-.B echo
-\c
+.Tp Ic echo
 Set when the
 Set when the
-.B \-x
+.Fl 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.
 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.
-.TP 15
-.B filec
+.Tp Ic filec
 Enable file name completion.
 Enable file name completion.
-\c
-.TP 15
-.B histchars
-\c
+.Tp Ic 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
 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 \(ua in
+history substitution character, replacing the default character `!'.
+The second character of its value replaces the character `\(ua' in
 quick substitutions.
 quick substitutions.
-.TP 15
-.B history
-\c
+.Tp Ic 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
 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
-.I history
+.Ar history
 may run the shell out of memory.
 The last executed command is always saved on the history list.
 may run the shell out of memory.
 The last executed command is always saved on the history list.
-.TP 15
-.B home
-\c
+.Tp Ic home
 The home directory of the invoker, initialized from the environment.
 The home directory of the invoker, initialized from the environment.
-The filename expansion of `\fB~\fR' refers to this variable.
-.TP 15
-.B ignoreeof
-\c
+The filename expansion of
+.Cx `
+.Pa ~
+.Cx \'
+.Cx
+refers to this variable.
+.Tp Ic 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.
 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.
-.TP 15
-.B mail
-\c
+.Tp Ic 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 `You have new mail.'
 if the file exists with an access time not greater than its modify time.
 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 `You have new mail.'
 if the file exists with an access time not greater than its modify time.
-.IP
+.Pp
 If the first word of the value of
 If the first word of the value of
-.I mail
+.Ar mail
 is numeric it specifies a different mail checking interval, in seconds,
 than the default, which is 10 minutes.
 is numeric it specifies a different mail checking interval, in seconds,
 than the default, which is 10 minutes.
-.IP
+.Pp
 If multiple mail files are specified, then the shell says
 `New mail in
 If multiple mail files are specified, then the shell says
 `New mail in
-.IR name '
+.Cx Ar name
+.Cx \'
+.Cx
 when there is mail in the file
 when there is mail in the file
-.I name.
-.TP 15
-.B noclobber
-\c
+.Ar name .
+.Tp Ic noclobber
 As described in the section on
 As described in the section on
-.I Input/output,
+.Ar Input/output ,
 restrictions are placed on output redirection to insure that
 files are not accidentally destroyed, and that `>>' redirections
 refer to existing files.
 restrictions are placed on output redirection to insure that
 files are not accidentally destroyed, and that `>>' redirections
 refer to existing files.
-.TP 15
-.B noglob
-\c
+.Tp Ic 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.
 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.
-.TP 15
-.B nonomatch
-\c
+.Tp Ic 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.
 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.
-.TP 15
-.B notify
-\c
+`echo ['
+still gives an error.
+.Tp Ic notify
 If set, the shell notifies asynchronously of job completions.  The
 default is to rather present job completions just before printing
 a prompt.
 If set, the shell notifies asynchronously of job completions.  The
 default is to rather present job completions just before printing
 a prompt.
-.TP 15
-.B path
-\c
+.Tp Ic 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
 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
-.I path
+.Ar 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 given neither the
 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 given neither the
-.B \-c
+.Fl c
 nor the
 nor the
-.B \-t
+.Fl t
 option will normally hash the contents of the directories in the
 option will normally hash the contents of the directories in the
-.I path
+.Ar path
 variable after reading
 variable after reading
-.I \&.cshrc,
+.Ar \&.cshrc ,
 and each time the
 and each time the
-.I path
+.Ar path
 variable is reset.  If new commands are added to these directories
 while the shell is active, it may be necessary to give the
 variable is reset.  If new commands are added to these directories
 while the shell is active, it may be necessary to give the
-.I rehash
+.Ar rehash
 or the commands may not be found.
 or the commands may not be found.
-.TP 15
-.B prompt
-\c
+.Tp Ic 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 `\e' is given.
 Default is `% ', or `# ' for the super-user.
 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 `\e' is given.
 Default is `% ', or `# ' for the super-user.
-.TP 15
-.B savehist
-\c
-is given a numeric value to control the number of entries of the
+.Tp Ic savehist
+Is given a numeric value to control the number of entries of the
 history list that are saved in ~/.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 ~/.history into the history list
 enabling history to be saved across logins.
 Too large values of
 history list that are saved in ~/.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 ~/.history into the history list
 enabling history to be saved across logins.
 Too large values of
-.I savehist
+.Ar savehist
 will slow down the shell during start up.
 will slow down the shell during start up.
-.TP 15
-.B shell
-\c
+.Tp Ic 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
 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
-.I "Non-builtin Command Execution"
+.Em Non-builtin Command Execution
 below.)
 Initialized to the (system-dependent) home of the shell.
 below.)
 Initialized to the (system-dependent) home of the shell.
-.TP 15
-.B status
-\c
+.Tp Ic 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 `0'.
 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 `0'.
-.TP 15
-.B time
-\c
+.Tp Ic 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.
 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.
-.TP 15
-.B verbose
-\c
+.Tp Ic verbose
 Set by the
 Set by the
-.B \-v
+.Fl v
 command line option, causes the words of each command to be printed
 after history substitution.
 command line option, causes the words of each command to be printed
 after history substitution.
-.sh "Non-builtin command execution"
+.Tp
+.Ss 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
 When a command to be executed is found to not be a builtin command
 the shell attempts to execute the command via
-.IR  execve (2).
+.Xr execve  2  .
 Each word in the variable
 Each word in the variable
-.I path
+.Ar path
 names a directory from which the shell will attempt to execute the command.
 If it is given neither a
 names a directory from which the shell will attempt to execute the command.
 If it is given neither a
-.B \-c
+.Fl c
 nor a
 nor a
-.B \-t
+.Fl t
 option, the shell will hash the names in these directories into an internal
 table so that it will only try an
 option, the shell will hash the names in these directories into an internal
 table so that it will only try an
-.I exec
+.Ic 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
 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
-.IR unhash ),
+.Ic unhash ) ,
 or if the shell was given a
 or if the shell was given a
-.B \-c
+.Fl c
 or
 or
-.B \-t
+.Fl t
 argument, and in any case for each directory component of
 argument, and in any case for each directory component of
-.I path
+.Ar 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.
 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.
-.PP
+.Pp
 Parenthesized commands are always executed in a subshell.
 Parenthesized commands are always executed in a subshell.
-Thus `(cd ; pwd) ; pwd' prints the
-.I home
+Thus
+.Pp
+.Dl (cd ; pwd) ; pwd
+.Pp
+prints the
+.Ar home
 directory; leaving you where you were (printing this after the home directory),
 directory; leaving you where you were (printing this after the home directory),
-while `cd ; pwd' leaves you in the
-.I home
+while
+.Pp
+.Dl cd ; pwd
+.Pp
+leaves you in the
+.Ar home
 directory.
 Parenthesized commands are most often used to prevent
 directory.
 Parenthesized commands are most often used to prevent
-.I chdir
+.Ic chdir
 from affecting the current shell.
 from affecting the current shell.
-.PP
+.Pp
 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 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.
-.PP
+.Pp
 If there is an
 If there is an
-.I alias
+.Ic alias
 for
 for
-.I shell
+.Ic shell
 then the words of the alias will be prepended to the argument list to form
 the shell command.
 The first word of the
 then the words of the alias will be prepended to the argument list to form
 the shell command.
 The first word of the
-.I alias
+.Ic alias
 should be the full path name of the shell
 (e.g. `$shell').
 Note that this is a special, late occurring, case of
 should be the full path name of the shell
 (e.g. `$shell').
 Note that this is a special, late occurring, case of
-.I alias
+.Ic alias
 substitution,
 and only allows words to be prepended to the argument list without modification.
 substitution,
 and only allows words to be prepended to the argument list without modification.
-.sh "Argument list processing"
-If argument 0 to the shell is `\-' then this
-is a login shell.
-The flag arguments are interpreted as follows:
-.TP 5
-.B  \-b
-\c
-This flag forces a ``break'' from option processing, causing any further
-shell arguments to be treated as non-option arguments.
-The remaining arguments will not be interpreted as shell options.
-This may be used to pass options to a shell script without confusion
-or possible subterfuge.
-The shell will not run a set-user ID script without this option.
-.TP 5
-.B  \-c
-\c
-Commands are read from the (single) following argument which must
-be present.
-Any remaining arguments are placed in
-.I argv.
-.TP 5
-.B  \-e
-\c
-The shell exits if any invoked command terminates abnormally
-or yields a non-zero exit status.
-.TP 5
-.B  \-f
-\c
-The shell will start faster, because it will neither search for nor
-execute commands from the file
-`\&.cshrc' in the invokers home directory.
-.TP 5
-.B  \-i
-\c
-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.
-.TP 5
-.B  \-n
-\c
-Commands are parsed, but not executed.
-This aids in syntactic checking of shell scripts.
-.TP 5
-.B  \-s
-\c
-Command input is taken from the standard input.
-.TP 5
-.B  \-t
-\c
-A single line of input is read and executed.
-A `\e' may be used to escape the newline at the end of this
-line and continue onto another line.
-.TP 5
-.B  \-v
-\c
-Causes the
-.I verbose
-variable to be set, with the effect
-that command input is echoed after history substitution.
-.TP 5
-.B  \-x
-\c
-Causes the 
-.I echo
-variable to be set, so that commands are echoed immediately before execution.
-.TP 5
-.B  \-V
-\c
-Causes the
-.I verbose
-variable to be set even before `\&.cshrc' is executed.
-.TP 5
-.B  \-X
-\c
-Is to
-.B \-x
-as
-.B \-V
-is to
-.B \-v.
-.PP
-After processing of flag arguments if arguments remain but none of the
-.B \-c,
-.B \-i,
-.B \-s,
-or
-.B \-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 comment.
-Remaining arguments initialize the variable
-.I argv.
-.sh "Signal handling"
+.Ss Signal handling
 The shell normally ignores
 The shell normally ignores
-.I quit
+.Ar quit
 signals.
 signals.
-Jobs running detached (either by `&' or the \fIbg\fR or \fB%... &\fR
+Jobs running detached (either by
+.Ic \&&
+or the
+.Ic bg
+or
+.Ic %... &
 commands) are immune to signals generated from the keyboard, including
 hangups.
 Other signals have the values which the shell inherited from its parent.
 commands) are immune to signals generated from the keyboard, including
 hangups.
 Other signals have the values which the shell inherited from its parent.
-The shells handling of interrupts and terminate signals
+The shell's handling of interrupts and terminate signals
 in shell scripts can be controlled by
 in shell scripts can be controlled by
-.I onintr.
+.Ic onintr .
 Login shells catch the
 Login shells catch the
-.I terminate
+.Ar 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
 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'.
-.SH AUTHOR
+.Pa \&.logout .
+.Sh 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.  File name completion
 code written by Ken Greer, HP Labs.
 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.  File name completion
 code written by Ken Greer, HP Labs.
-.SH FILES
-.ta 1.75i
-.nf
-~/.cshrc       Read at beginning of execution by each shell.
-~/.login       Read by login shell, after `.cshrc' at login.
-~/.logout      Read by login shell, at logout.
-/bin/sh        Standard shell, for shell scripts not starting with a `#'.
-/tmp/sh*       Temporary file for `<<'.
-/etc/passwd    Source of home directories for `~name'.
-.fi
-.SH LIMITATIONS
+.Sh FILES
+.Dw /etc/passwd
+.Di L
+.Dp Pa ~/.cshrc
+Read at beginning of execution by each shell.
+.Dp Pa ~/.login
+Read by login shell, after `.cshrc' at login.
+.Dp Pa ~/.logout
+Read by login shell, at logout.
+.Dp Pa /bin/sh
+Standard shell, for shell scripts not starting with a `#'.
+.Dp Pa /tmp/sh*
+Temporary file for `<<'.
+.Dp Pa /etc/passwd
+Source of home directories for `~name'.
+.Dp
+.Sh LIMITATIONS
+Word lengths \-
 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
 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
@@ -2256,46 +2340,74 @@ is limited to 1/6'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
 Command substitutions may substitute no more characters than are
 allowed in an argument list.
 To detect looping, the shell restricts the number of
-.I alias
+.Ic alias
 substitutions on a single line to 20.
 substitutions on a single line to 20.
-.SH "SEE ALSO"
-sh(1), access(2), execve(2), fork(2), killpg(2), pipe(2), sigvec(2),
-umask(2), setrlimit(2), wait(2), tty(4), a.out(5), environ(7),
-`An introduction to the C shell'
-.SH BUGS
+.Sh SEE ALSO
+.Xr sh 1 ,
+.Xr access 2 ,
+.Xr execve 2 ,
+.Xr fork 2 ,
+.Xr killpg 2 ,
+.Xr pipe 2 ,
+.Xr sigvec 2 ,
+.Xr umask 2 ,
+.Xr setrlimit 2 ,
+.Xr wait 2 ,
+.Xr tty 4 ,
+.Xr a.out 5 ,
+.Xr environ 7 ,
+.br
+.Em An introduction to the C shell
+.Sh HISTORY
+.Nm Csh
+Appeared in  3 BSD.  It
+was a first implementation of a command language interpreter
+incorporating a history mechanism (see
+.Nm History Substitutions ) ,
+job control facilities (see
+.Nm Jobs ) ,
+interactive file name
+and user name completion (see
+.Nm File Name Completion ) ,
+and a C-like syntax.
+There are now many shells which also have these mechanisms, plus
+a few more (and maybe some bugs too), which are available thru
+the internet, or as contributed software such as the
+.Xr ksh korn\ shell .
+.Sh 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.
 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.
-.PP
+.Pp
 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
 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
-.I alias.
+.Ar alias .
 It suffices to place the sequence of commands in ()'s to force it to
 a subshell, i.e. `( a ; b ; c )'.
 It suffices to place the sequence of commands in ()'s to force it to
 a subshell, i.e. `( a ; b ; c )'.
-.PP
+.Pp
 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.
 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.
-.PP
+.Pp
 Alias substitution is most often used to clumsily simulate shell procedures;
 shell procedures should be provided rather than aliases.
 Alias substitution is most often used to clumsily simulate shell procedures;
 shell procedures should be provided rather than aliases.
-.PP
+.Pp
 Commands within loops, prompted for by `?', are not placed in the
 Commands within loops, prompted for by `?', are not placed in the
-.I history
+.Ic history
 list.
 Control structure should be parsed rather than being recognized as built-in
 commands.  This would allow control commands to be placed anywhere,
 list.
 Control structure 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.
-.PP
+to be combined with `\&|', and to be used with `&' and `;' metasyntax.
+.Pp
 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.
 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.
-.PP
+.Pp
 The way the
 The way the
-.B filec
+.Ic filec
 facility is implemented is ugly and expensive.
 facility is implemented is ugly and expensive.