summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2000-03-17 18:48:44 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2000-03-17 18:48:44 +0000
commit2993ebaf558a2c24196c34cc6b42f9e962b8f527 (patch)
treee5d0f54f1b705385cf3bc8e9133edfad786967cf /bin/ksh
parente8c7db851c4c34cce1015e7f1984ea7d6c98402e (diff)
Try to synchronize the ksh(1) and sh(1) man pages somewhat.
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/ksh.130
-rw-r--r--bin/ksh/ksh.1tbl30
-rw-r--r--bin/ksh/sh.156
-rw-r--r--bin/ksh/sh.1tbl56
4 files changed, 100 insertions, 72 deletions
diff --git a/bin/ksh/ksh.1 b/bin/ksh/ksh.1
index 0273e68a0f0..32f8a23ddc4 100644
--- a/bin/ksh/ksh.1
+++ b/bin/ksh/ksh.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ksh.1,v 1.31 2000/03/17 18:15:16 aaron Exp $
+.\" $OpenBSD: ksh.1,v 1.32 2000/03/17 18:48:43 aaron Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -238,6 +238,7 @@ usually delimit commands.
The meta-characters are used in building the following tokens:
.Ql < ,
.Ql <& ,
+.Ql << ,
.Ql > ,
.Ql >& ,
.Ql >> ,
@@ -901,8 +902,7 @@ option is set (i.e.,
or
.Ic set Fl h ) ,
the shell tracks all commands.
-This option is set automatically for
-non-interactive shells.
+This option is set automatically for non-interactive shells.
For interactive shells, only the following commands are
automatically tracked:
.Ic cat , cc , chmod , cp ,
@@ -954,6 +954,7 @@ whitespace is stripped (i.e., no leading or trailing empty field is created by
it); leading or trailing
.Pf non- Ev IFS
whitespace does create an empty field.
+.Pp
Example: If
.Ev IFS
is set to
@@ -1626,6 +1627,7 @@ and
tilde expansion is done after any unquoted colon
.Pq Sq \&: ,
and login names are also delimited by colons.
+.Pp
The home directory of previously expanded login names are cached and re-used.
The
.Ic alias -d
@@ -2493,9 +2495,9 @@ Test.
In
.Tn POSIX
mode, the expression
-.Dq Fl t
+.Ql Fl t
(preceded by some number of
-.Dq Ic \&!
+.Ql Ic \&!
arguments) is always true as it is a non-zero length string; in
.Pf non- Tn POSIX
mode, it tests if file descriptor 1 is a tty (i.e., the
@@ -2752,7 +2754,7 @@ nor
.Fl V
options are given,
.Ar cmd
-is executed exactly as if the
+is executed exactly as if
.Ic command
had not been specified, with two exceptions.
First,
@@ -3289,8 +3291,7 @@ This can only be set/unset when the shell is invoked.
Parameter assignments are recognized anywhere in a command.
.It Fl l Ic login
The shell is a login shell.
-This can only be set/unset when the shell is
-invoked (see
+This can only be set/unset when the shell is invoked (see
.Sx Shell startup
above).
.It Fl m Ic monitor
@@ -3362,12 +3363,12 @@ To avoid infinite loops, the shell will exit if
is read 13 times in a row.
.It Ic nohup
Do not kill running jobs with a
-.Dv HUP
+.Dv SIGHUP
signal when a login shell exists.
Currently set by default, but this will
change in the future to be compatible with the original Korn shell (which
doesn't have this option, but does send the
-.Dv HUP
+.Dv SIGHUP
signal).
.It Ic nolog
No effect.
@@ -3785,7 +3786,7 @@ lists, as a series of
.Ic trap
commands, the current state of the traps that have been set since the shell
started.
-Note that the ouput of
+Note that the output of
.Ic trap
can not be usefully piped to another process (an artifact of the fact that
traps are cleared when subprocesses are created).
@@ -3869,9 +3870,8 @@ If
is not specified, the current width of a parameter (or the width of its first
assigned value) is used.
Trailing whitespace is stripped.
-If necessary, values
-are either stripped of leading characters or space padded to make them fit the
-field width.
+If necessary, values are either stripped of leading characters or space
+padded to make them fit the field width.
.It Fl Z Ns Ar n
Zero fill attribute.
If not combined with
@@ -4092,7 +4092,7 @@ below for the format of
.Ic wait
will return if a signal for which a trap has been set is received, or if a
.Dv SIGHUP ,
-.Dv SIGINT
+.Dv SIGINT ,
or
.Dv SIGQUIT
signal is received.
diff --git a/bin/ksh/ksh.1tbl b/bin/ksh/ksh.1tbl
index 402cbfdc54a..b8094576a5a 100644
--- a/bin/ksh/ksh.1tbl
+++ b/bin/ksh/ksh.1tbl
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ksh.1tbl,v 1.31 2000/03/17 18:15:16 aaron Exp $
+.\" $OpenBSD: ksh.1tbl,v 1.32 2000/03/17 18:48:43 aaron Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -238,6 +238,7 @@ usually delimit commands.
The meta-characters are used in building the following tokens:
.Ql < ,
.Ql <& ,
+.Ql << ,
.Ql > ,
.Ql >& ,
.Ql >> ,
@@ -901,8 +902,7 @@ option is set (i.e.,
or
.Ic set Fl h ) ,
the shell tracks all commands.
-This option is set automatically for
-non-interactive shells.
+This option is set automatically for non-interactive shells.
For interactive shells, only the following commands are
automatically tracked:
.Ic cat , cc , chmod , cp ,
@@ -954,6 +954,7 @@ whitespace is stripped (i.e., no leading or trailing empty field is created by
it); leading or trailing
.Pf non- Ev IFS
whitespace does create an empty field.
+.Pp
Example: If
.Ev IFS
is set to
@@ -1626,6 +1627,7 @@ and
tilde expansion is done after any unquoted colon
.Pq Sq \&: ,
and login names are also delimited by colons.
+.Pp
The home directory of previously expanded login names are cached and re-used.
The
.Ic alias -d
@@ -2493,9 +2495,9 @@ Test.
In
.Tn POSIX
mode, the expression
-.Dq Fl t
+.Ql Fl t
(preceded by some number of
-.Dq Ic \&!
+.Ql Ic \&!
arguments) is always true as it is a non-zero length string; in
.Pf non- Tn POSIX
mode, it tests if file descriptor 1 is a tty (i.e., the
@@ -2752,7 +2754,7 @@ nor
.Fl V
options are given,
.Ar cmd
-is executed exactly as if the
+is executed exactly as if
.Ic command
had not been specified, with two exceptions.
First,
@@ -3289,8 +3291,7 @@ This can only be set/unset when the shell is invoked.
Parameter assignments are recognized anywhere in a command.
.It Fl l Ic login
The shell is a login shell.
-This can only be set/unset when the shell is
-invoked (see
+This can only be set/unset when the shell is invoked (see
.Sx Shell startup
above).
.It Fl m Ic monitor
@@ -3362,12 +3363,12 @@ To avoid infinite loops, the shell will exit if
is read 13 times in a row.
.It Ic nohup
Do not kill running jobs with a
-.Dv HUP
+.Dv SIGHUP
signal when a login shell exists.
Currently set by default, but this will
change in the future to be compatible with the original Korn shell (which
doesn't have this option, but does send the
-.Dv HUP
+.Dv SIGHUP
signal).
.It Ic nolog
No effect.
@@ -3785,7 +3786,7 @@ lists, as a series of
.Ic trap
commands, the current state of the traps that have been set since the shell
started.
-Note that the ouput of
+Note that the output of
.Ic trap
can not be usefully piped to another process (an artifact of the fact that
traps are cleared when subprocesses are created).
@@ -3869,9 +3870,8 @@ If
is not specified, the current width of a parameter (or the width of its first
assigned value) is used.
Trailing whitespace is stripped.
-If necessary, values
-are either stripped of leading characters or space padded to make them fit the
-field width.
+If necessary, values are either stripped of leading characters or space
+padded to make them fit the field width.
.It Fl Z Ns Ar n
Zero fill attribute.
If not combined with
@@ -4092,7 +4092,7 @@ below for the format of
.Ic wait
will return if a signal for which a trap has been set is received, or if a
.Dv SIGHUP ,
-.Dv SIGINT
+.Dv SIGINT ,
or
.Dv SIGQUIT
signal is received.
diff --git a/bin/ksh/sh.1 b/bin/ksh/sh.1
index 8082546623f..5cbee0f0329 100644
--- a/bin/ksh/sh.1
+++ b/bin/ksh/sh.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sh.1,v 1.17 2000/03/17 18:15:16 aaron Exp $
+.\" $OpenBSD: sh.1,v 1.18 2000/03/17 18:48:43 aaron Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -1022,14 +1022,17 @@ is
not specified, or the length of the string value of parameter
.Ar name .
.It Xo Ic ${# Ns Ar name Ns
-.Ic \&[\&*\&]\&} , ${# Ns Ar name Ns Ic \&[\&@\&]\&}
+.Ic [*\&]} , ${# Ns Ar name Ns Ic [@\&]}
.Xc
The number of elements in the array
.Ar name .
.Sm off
.It Xo
-.Ic ${ Ar name Ic \&# Ar pattern Ic \&},\ \&
-.Ic ${ Ar name Ic \&#\&# Ar pattern Ic \&}
+.Ic ${ Ar name Ic # Ar pattern
+.Sm on
+.Ic } ,
+.Sm off
+.Ic ${ Ar name Ic ## Ar pattern Ic \&}
.Xc
.Sm on
If
@@ -1043,8 +1046,11 @@ results in the shortest match, and two
of them result in the longest match.
.Sm off
.It Xo
-.Ic ${ Ar name Ic \&% Ar pattern Ic \&},\ \&
-.Ic ${ Ar name Ic \&%\&% Ar pattern Ic \&}
+.Ic ${ Ar name Ic % Ar pattern
+.Sm on
+.Ic } ,
+.Sm off
+.Ic ${ Ar name Ic %% Ar pattern Ic }
.Xc
.Sm on
Like
@@ -2055,7 +2061,8 @@ and
differ somewhat in which commands are considered
special or regular:
.Pp
-POSIX special commands
+.Tn POSIX
+special commands
.Pp
.Ic \&. , \&: , break , continue ,
.Ic eval , exec , exit , export ,
@@ -2066,11 +2073,13 @@ Additional ksh special commands
.Pp
.Ic builtin , times , typeset
.Pp
-Very special commands (non-POSIX mode)
+Very special commands
+.Pq Pf non- Tn POSIX
.Pp
.Ic alias , readonly , set , typset
.Pp
-POSIX regular commands
+.Tn POSIX
+regular commands
.Pp
.Ic alias , bg , cd , command ,
.Ic false , fc , fg , getopts ,
@@ -2276,7 +2285,8 @@ If the
.Fl p
option is given, a default search path is used instead of the current value of
.Ev PATH
-(the actual value of the default path is system dependent: on POSIXish
+(the actual value of the default path is system dependent: on
+.Tn POSIX Ns ish
systems, it is the value returned by
.Ic getconf CS_PATH ) .
.It Ic continue Op Ar level
@@ -2792,12 +2802,12 @@ The shell will not exit when end-of-file is read;
must be used.
.It Ic nohup
Do not kill running jobs with a
-.Dv HUP
+.Dv SIGHUP
signal when a login shell exists.
Currently set by default, but this will
change in the future to be compatible with the original Korn shell (which
doesn't have this option, but does send the
-.Dv HUP
+.Dv SIGHUP
signal).
.It Ic nolog
No effect.
@@ -3163,7 +3173,7 @@ With no arguments,
.Ic trap
lists, as a series of
.Ic trap
-commands, the current start of the traps that have been set since the shell
+commands, the current state of the traps that have been set since the shell
started.
.Pp
The original Korn shell's
@@ -3248,7 +3258,8 @@ Trailing whitespace is stripped.
If necessary, values are either stripped of leading characters or space
padded to make them fit the field width.
.It Fl Z Ns Ar n
-Zero fill attribute. If not combined with
+Zero fill attribute.
+If not combined with
.Fl L ,
this is the same as
.Fl R ,
@@ -3387,7 +3398,8 @@ kilobytes on the size of the stack area.
.It Fl t Ar n
Impose a time limit of
.Ar n
-CPU seconds to be used by each process.
+.Tn CPU
+seconds to be used by each process.
.It Fl v Ar n
Impose a limit of
.Ar n
@@ -3464,10 +3476,10 @@ below for the format of
.Ar job .
.Ic wait
will return if a signal for which a trap has been set is received, or if a
-.Dv HUP ,
-.Dv INT
+.Dv SIGHUP ,
+.Dv SIGINT ,
or
-.Dv QUIT
+.Dv SIGQUIT
signal is received.
.Pp
If no jobs are specified,
@@ -3605,7 +3617,9 @@ indicates the current state of the job and can be:
.Bl -tag -width "Running"
.It Cm Running
The job has neither stopped nor exited (note that running does not necessarily
-mean consuming CPU time -- the process could be blocked waiting for some
+mean consuming
+.Tn CPU
+time -- the process could be blocked waiting for some
event).
.It Cm Done Op Ar number
The job exited.
@@ -3638,7 +3652,7 @@ When an attempt is made to exit the shell while there are jobs in the stopped
state, the shell warns the user that there are stopped jobs and does not exit.
If another attempt is immediately made to exit the shell, the stopped jobs are
sent a
-.Dv HUP
+.Dv SIGHUP
signal and the shell exits.
Similarly, if the
.Ic nohup
@@ -3646,7 +3660,7 @@ option is not set and there are running jobs when an attempt is made to exit
a login shell, the shell warns the user and does not exit.
If another attempt
is immediately made to exit the shell, the running jobs are sent a
-.Dv HUP
+.Dv SIGHUP
signal and the shell exits.
.Sh FILES
.Bl -tag -width "/etc/suid_profile" -compact
diff --git a/bin/ksh/sh.1tbl b/bin/ksh/sh.1tbl
index 25787a52e3e..c1c63a9a77d 100644
--- a/bin/ksh/sh.1tbl
+++ b/bin/ksh/sh.1tbl
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sh.1tbl,v 1.17 2000/03/17 18:15:16 aaron Exp $
+.\" $OpenBSD: sh.1tbl,v 1.18 2000/03/17 18:48:43 aaron Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -1022,14 +1022,17 @@ is
not specified, or the length of the string value of parameter
.Ar name .
.It Xo Ic ${# Ns Ar name Ns
-.Ic \&[\&*\&]\&} , ${# Ns Ar name Ns Ic \&[\&@\&]\&}
+.Ic [*\&]} , ${# Ns Ar name Ns Ic [@\&]}
.Xc
The number of elements in the array
.Ar name .
.Sm off
.It Xo
-.Ic ${ Ar name Ic \&# Ar pattern Ic \&},\ \&
-.Ic ${ Ar name Ic \&#\&# Ar pattern Ic \&}
+.Ic ${ Ar name Ic # Ar pattern
+.Sm on
+.Ic } ,
+.Sm off
+.Ic ${ Ar name Ic ## Ar pattern Ic \&}
.Xc
.Sm on
If
@@ -1043,8 +1046,11 @@ results in the shortest match, and two
of them result in the longest match.
.Sm off
.It Xo
-.Ic ${ Ar name Ic \&% Ar pattern Ic \&},\ \&
-.Ic ${ Ar name Ic \&%\&% Ar pattern Ic \&}
+.Ic ${ Ar name Ic % Ar pattern
+.Sm on
+.Ic } ,
+.Sm off
+.Ic ${ Ar name Ic %% Ar pattern Ic }
.Xc
.Sm on
Like
@@ -2055,7 +2061,8 @@ and
differ somewhat in which commands are considered
special or regular:
.Pp
-POSIX special commands
+.Tn POSIX
+special commands
.Pp
.Ic \&. , \&: , break , continue ,
.Ic eval , exec , exit , export ,
@@ -2066,11 +2073,13 @@ Additional ksh special commands
.Pp
.Ic builtin , times , typeset
.Pp
-Very special commands (non-POSIX mode)
+Very special commands
+.Pq Pf non- Tn POSIX
.Pp
.Ic alias , readonly , set , typset
.Pp
-POSIX regular commands
+.Tn POSIX
+regular commands
.Pp
.Ic alias , bg , cd , command ,
.Ic false , fc , fg , getopts ,
@@ -2276,7 +2285,8 @@ If the
.Fl p
option is given, a default search path is used instead of the current value of
.Ev PATH
-(the actual value of the default path is system dependent: on POSIXish
+(the actual value of the default path is system dependent: on
+.Tn POSIX Ns ish
systems, it is the value returned by
.Ic getconf CS_PATH ) .
.It Ic continue Op Ar level
@@ -2792,12 +2802,12 @@ The shell will not exit when end-of-file is read;
must be used.
.It Ic nohup
Do not kill running jobs with a
-.Dv HUP
+.Dv SIGHUP
signal when a login shell exists.
Currently set by default, but this will
change in the future to be compatible with the original Korn shell (which
doesn't have this option, but does send the
-.Dv HUP
+.Dv SIGHUP
signal).
.It Ic nolog
No effect.
@@ -3163,7 +3173,7 @@ With no arguments,
.Ic trap
lists, as a series of
.Ic trap
-commands, the current start of the traps that have been set since the shell
+commands, the current state of the traps that have been set since the shell
started.
.Pp
The original Korn shell's
@@ -3248,7 +3258,8 @@ Trailing whitespace is stripped.
If necessary, values are either stripped of leading characters or space
padded to make them fit the field width.
.It Fl Z Ns Ar n
-Zero fill attribute. If not combined with
+Zero fill attribute.
+If not combined with
.Fl L ,
this is the same as
.Fl R ,
@@ -3387,7 +3398,8 @@ kilobytes on the size of the stack area.
.It Fl t Ar n
Impose a time limit of
.Ar n
-CPU seconds to be used by each process.
+.Tn CPU
+seconds to be used by each process.
.It Fl v Ar n
Impose a limit of
.Ar n
@@ -3464,10 +3476,10 @@ below for the format of
.Ar job .
.Ic wait
will return if a signal for which a trap has been set is received, or if a
-.Dv HUP ,
-.Dv INT
+.Dv SIGHUP ,
+.Dv SIGINT ,
or
-.Dv QUIT
+.Dv SIGQUIT
signal is received.
.Pp
If no jobs are specified,
@@ -3605,7 +3617,9 @@ indicates the current state of the job and can be:
.Bl -tag -width "Running"
.It Cm Running
The job has neither stopped nor exited (note that running does not necessarily
-mean consuming CPU time -- the process could be blocked waiting for some
+mean consuming
+.Tn CPU
+time -- the process could be blocked waiting for some
event).
.It Cm Done Op Ar number
The job exited.
@@ -3638,7 +3652,7 @@ When an attempt is made to exit the shell while there are jobs in the stopped
state, the shell warns the user that there are stopped jobs and does not exit.
If another attempt is immediately made to exit the shell, the stopped jobs are
sent a
-.Dv HUP
+.Dv SIGHUP
signal and the shell exits.
Similarly, if the
.Ic nohup
@@ -3646,7 +3660,7 @@ option is not set and there are running jobs when an attempt is made to exit
a login shell, the shell warns the user and does not exit.
If another attempt
is immediately made to exit the shell, the running jobs are sent a
-.Dv HUP
+.Dv SIGHUP
signal and the shell exits.
.Sh FILES
.Bl -tag -width "/etc/suid_profile" -compact