sync
This commit is contained in:
parent
51053f03f5
commit
3d0671eced
250
sh.1tbl
250
sh.1tbl
@ -1,7 +1,7 @@
|
|||||||
.\" $MirBSD: src/bin/ksh/sh.1tbl,v 2.2 2004/12/13 18:24:34 tg Exp $
|
.\" $MirBSD: src/bin/ksh/sh.1tbl,v 2.3 2004/12/13 19:47:25 tg Exp $
|
||||||
.\" _MirBSD: src/bin/ksh/ksh.1tbl,v 1.41 2004/11/10 17:18:29 tg Exp $
|
.\" _MirBSD: src/bin/ksh/ksh.1tbl,v 2.5 2004/12/13 19:36:27 tg Exp $
|
||||||
.\" $OpenBSD: ksh.1tbl,v 1.78 2004/11/08 23:42:02 jmc Exp $
|
.\" $OpenBSD: ksh.1tbl,v 1.79 2004/12/04 07:05:13 jaredy Exp $
|
||||||
.\" $OpenBSD: sh.1tbl,v 1.52 2004/11/09 21:56:54 jmc Exp $
|
.\" $OpenBSD: sh.1tbl,v 1.53 2004/12/10 01:56:56 jaredy Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1980, 1990, 1993
|
.\" Copyright (c) 1980, 1990, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
@ -37,26 +37,11 @@
|
|||||||
.Dd November 10, 2004
|
.Dd November 10, 2004
|
||||||
.Dt SH 1
|
.Dt SH 1
|
||||||
.Os MirOS
|
.Os MirOS
|
||||||
.\" define Mx macro for portable mksh, just in case...
|
|
||||||
.de Mx
|
|
||||||
.nr cF \\n(.f
|
|
||||||
.nr cZ \\n(.s
|
|
||||||
.ds aa \&\f\\n(cF\s\\n(cZ
|
|
||||||
.if \\n(aC==0 \{\
|
|
||||||
. if \\n(.$==0 \&MirOS\\*(aa
|
|
||||||
.\}
|
|
||||||
.if \\n(.$==1 \{\
|
|
||||||
. if "\\$1"6" \&MirOS #6\\*(aa
|
|
||||||
. if "\\$1"." \&MirOS\\$1\\*(aa
|
|
||||||
. if "\\$1"," \&MirOS\\$1\\*(aa
|
|
||||||
. if "\\$1"MirBSD" \&MirBSD\\*(aa
|
|
||||||
.\}
|
|
||||||
..
|
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
.Nm sh ,
|
||||||
.Nm ksh ,
|
.Nm ksh ,
|
||||||
.Nm mksh ,
|
.Nm mksh
|
||||||
.Nm sh
|
.Nd MirBSD Bourne shell
|
||||||
.Nd MirBSD Korn/Bourne shell
|
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl +abCefhiklmnprsuvxX
|
.Op Fl +abCefhiklmnprsuvxX
|
||||||
@ -109,7 +94,7 @@ If there are no non-option
|
|||||||
arguments, the shell reads commands from the standard input.
|
arguments, the shell reads commands from the standard input.
|
||||||
The name of
|
The name of
|
||||||
the shell (i.e., the contents of
|
the shell (i.e., the contents of
|
||||||
.Va $0 )
|
.Ic $0 )
|
||||||
is determined as follows: if the
|
is determined as follows: if the
|
||||||
.Fl c
|
.Fl c
|
||||||
option is used and there is a non-option argument, it is used as the name;
|
option is used and there is a non-option argument, it is used as the name;
|
||||||
@ -122,8 +107,8 @@ A shell is
|
|||||||
.Dq interactive
|
.Dq interactive
|
||||||
if the
|
if the
|
||||||
.Fl i
|
.Fl i
|
||||||
option is used or if both standard input and standard error are attached
|
option is used or if both standard input and standard error are attached to a
|
||||||
to a tty.
|
.Xr tty 4 .
|
||||||
An interactive shell has job control enabled (if available), ignores the
|
An interactive shell has job control enabled (if available), ignores the
|
||||||
.Dv SIGINT ,
|
.Dv SIGINT ,
|
||||||
.Dv SIGQUIT
|
.Dv SIGQUIT
|
||||||
@ -151,7 +136,7 @@ parameter match the pattern
|
|||||||
.Dq \&*r\&*sh
|
.Dq \&*r\&*sh
|
||||||
(e.g.,
|
(e.g.,
|
||||||
.Dq rsh ,
|
.Dq rsh ,
|
||||||
.Dq rksh ,
|
.Dq rmksh ,
|
||||||
.Dq rpdksh ,
|
.Dq rpdksh ,
|
||||||
etc.).
|
etc.).
|
||||||
The following restrictions come into effect after the shell processes any
|
The following restrictions come into effect after the shell processes any
|
||||||
@ -234,8 +219,8 @@ If the
|
|||||||
parameter is not set (and not
|
parameter is not set (and not
|
||||||
.Dv NULL )
|
.Dv NULL )
|
||||||
and
|
and
|
||||||
.Nm pdksh
|
.Nm
|
||||||
was compiled with the
|
was compiled with the non-default
|
||||||
.Dv DEFAULT_ENV
|
.Dv DEFAULT_ENV
|
||||||
macro defined, the file named in that macro is included (after the above
|
macro defined, the file named in that macro is included (after the above
|
||||||
mentioned substitutions have been performed).
|
mentioned substitutions have been performed).
|
||||||
@ -316,7 +301,7 @@ The first three of these are the above mentioned quoting characters (see
|
|||||||
.Sx Quoting
|
.Sx Quoting
|
||||||
below);
|
below);
|
||||||
.Ql # ,
|
.Ql # ,
|
||||||
if used at the beginning of a word, introduces a comment -- everything after
|
if used at the beginning of a word, introduces a comment \(em everything after
|
||||||
the
|
the
|
||||||
.Ql #
|
.Ql #
|
||||||
up to the nearest newline is ignored;
|
up to the nearest newline is ignored;
|
||||||
@ -419,7 +404,7 @@ only if the exit status of
|
|||||||
.Ar cmd1
|
.Ar cmd1
|
||||||
is zero;
|
is zero;
|
||||||
.Ql ||
|
.Ql ||
|
||||||
is the opposite --
|
is the opposite \(em
|
||||||
.Ar cmd2
|
.Ar cmd2
|
||||||
is executed only if the exit status of
|
is executed only if the exit status of
|
||||||
.Ar cmd1
|
.Ar cmd1
|
||||||
@ -508,14 +493,14 @@ In the following compound command descriptions, command lists (denoted as
|
|||||||
that are followed by reserved words must end with a semicolon, a newline, or
|
that are followed by reserved words must end with a semicolon, a newline, or
|
||||||
a (syntactically correct) reserved word.
|
a (syntactically correct) reserved word.
|
||||||
For example,
|
For example,
|
||||||
.Bd -unfilled -offset -indent
|
.Bd -unfilled -offset indent
|
||||||
.Ic { echo foo; echo bar; }
|
.Ic { echo foo; echo bar; }
|
||||||
.Ic { echo foo; echo bar<newline> }
|
.Ic { echo foo; echo bar<newline> }
|
||||||
.Ic { { echo foo; echo bar; } }
|
.Ic { { echo foo; echo bar; } }
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
are all valid, but
|
are all valid, but
|
||||||
.Bd -unfilled -offset -indent
|
.Bd -unfilled -offset indent
|
||||||
.Ic { echo foo; echo bar }
|
.Ic { echo foo; echo bar }
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
@ -593,7 +578,7 @@ If
|
|||||||
.Ic in
|
.Ic in
|
||||||
is not used to specify a word list, the positional parameters
|
is not used to specify a word list, the positional parameters
|
||||||
.Po
|
.Po
|
||||||
.Va $1 , $2 ,
|
.Ic $1 , $2 ,
|
||||||
etc.\&
|
etc.\&
|
||||||
.Pc
|
.Pc
|
||||||
are used instead.
|
are used instead.
|
||||||
@ -819,8 +804,10 @@ whitespace
|
|||||||
characters, delimit a field.
|
characters, delimit a field.
|
||||||
As a special case, leading and trailing
|
As a special case, leading and trailing
|
||||||
.Ev IFS
|
.Ev IFS
|
||||||
whitespace is stripped (i.e., no leading or trailing empty field is created by
|
whitespace and trailing
|
||||||
it); leading or trailing
|
.Ev IFS
|
||||||
|
non-whitespace are stripped (i.e., no leading or trailing
|
||||||
|
empty field is created by it); leading
|
||||||
.Pf non- Ev IFS
|
.Pf non- Ev IFS
|
||||||
whitespace does create an empty field.
|
whitespace does create an empty field.
|
||||||
.Pp
|
.Pp
|
||||||
@ -1115,7 +1102,7 @@ Process ID of the last background process started.
|
|||||||
If no background processes have been started, the parameter is not set.
|
If no background processes have been started, the parameter is not set.
|
||||||
.It Ev \&#
|
.It Ev \&#
|
||||||
The number of positional parameters (i.e.,
|
The number of positional parameters (i.e.,
|
||||||
.Va $1 , $2 ,
|
.Ic $1 , $2 ,
|
||||||
etc.).
|
etc.).
|
||||||
.It Ev \&$
|
.It Ev \&$
|
||||||
The process ID of the shell, or the
|
The process ID of the shell, or the
|
||||||
@ -1159,7 +1146,7 @@ Further positional parameters may be accessed using
|
|||||||
.Ic ${ Ns Ar number Ns Ic \&} .
|
.Ic ${ Ns Ar number Ns Ic \&} .
|
||||||
.It Ev \&*
|
.It Ev \&*
|
||||||
All positional parameters (except parameter 0); i.e.,
|
All positional parameters (except parameter 0); i.e.,
|
||||||
.Va $1 , $2 , $3 ,
|
.Ic $1 , $2 , $3 ,
|
||||||
\&...
|
\&...
|
||||||
If used
|
If used
|
||||||
outside of double quotes, parameters are separate words (which are subjected
|
outside of double quotes, parameters are separate words (which are subjected
|
||||||
@ -1268,13 +1255,9 @@ above for details.
|
|||||||
This parameter is not imported from the environment when the shell is
|
This parameter is not imported from the environment when the shell is
|
||||||
started.
|
started.
|
||||||
.It Ev SH_VERSION
|
.It Ev SH_VERSION
|
||||||
The version of the shell, consisting of the upstream
|
The version of
|
||||||
.Nm pdksh
|
.Nm
|
||||||
version (and sometimes date), the string
|
(read-only).
|
||||||
.Dq MirOS
|
|
||||||
and the
|
|
||||||
.Xr rcs 1
|
|
||||||
revision number (read-only).
|
|
||||||
.It Ev LINENO
|
.It Ev LINENO
|
||||||
The line number of the function or shell script that is currently being
|
The line number of the function or shell script that is currently being
|
||||||
executed.
|
executed.
|
||||||
@ -1511,7 +1494,7 @@ matches all strings (think about it).
|
|||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
Note that
|
Note that
|
||||||
.Nm pdksh
|
.Nm
|
||||||
currently never matches
|
currently never matches
|
||||||
.Dq \&.
|
.Dq \&.
|
||||||
and
|
and
|
||||||
@ -1523,11 +1506,6 @@ Bourne
|
|||||||
and GNU
|
and GNU
|
||||||
.Xr bash
|
.Xr bash
|
||||||
do.
|
do.
|
||||||
For
|
|
||||||
.Nm pdksh ,
|
|
||||||
this may have to change (too bad), but
|
|
||||||
.Nm mksh
|
|
||||||
will not adopt this behaviour.
|
|
||||||
.Pp
|
.Pp
|
||||||
Note that none of the above pattern elements match either a period
|
Note that none of the above pattern elements match either a period
|
||||||
.Pq Sq \&.
|
.Pq Sq \&.
|
||||||
@ -1677,7 +1655,7 @@ any redirections must appear at the end.
|
|||||||
Redirections are processed after
|
Redirections are processed after
|
||||||
pipelines are created and in the order they are given, so
|
pipelines are created and in the order they are given, so
|
||||||
.Pp
|
.Pp
|
||||||
.Ic cat /foo/bar 2\&>&1 \&> /dev/null \&| cat -n
|
.Dl Ic cat /foo/bar 2\*(Gt&1 \*(Gt /dev/null \&| cat -n
|
||||||
.Pp
|
.Pp
|
||||||
will print an error with a line number prepended to it.
|
will print an error with a line number prepended to it.
|
||||||
.Ss Arithmetic expressions
|
.Ss Arithmetic expressions
|
||||||
@ -1858,7 +1836,7 @@ in that they are executed in the current environment.
|
|||||||
However, unlike
|
However, unlike
|
||||||
.Li .-scripts ,
|
.Li .-scripts ,
|
||||||
shell arguments (i.e., positional parameters
|
shell arguments (i.e., positional parameters
|
||||||
.Va $1 , $2 ,
|
.Ic $1 , $2 ,
|
||||||
etc.) are never visible
|
etc.) are never visible
|
||||||
inside them.
|
inside them.
|
||||||
When the shell is determining the location of a command, functions
|
When the shell is determining the location of a command, functions
|
||||||
@ -1917,7 +1895,9 @@ assignments made inside functions are visible after the function completes.
|
|||||||
If this is not the desired effect, the
|
If this is not the desired effect, the
|
||||||
.Ic typeset
|
.Ic typeset
|
||||||
command can be used inside a function to create a local parameter.
|
command can be used inside a function to create a local parameter.
|
||||||
Note that special parameters (e.g., $$, $\&!) can't be scoped in this way.
|
Note that special parameters (e.g.
|
||||||
|
.Ic \&$$ , $\&! )
|
||||||
|
can't be scoped in this way.
|
||||||
.Pp
|
.Pp
|
||||||
The exit status of a function is that of the last command executed in the
|
The exit status of a function is that of the last command executed in the
|
||||||
function.
|
function.
|
||||||
@ -1933,8 +1913,11 @@ defined with the
|
|||||||
notation:
|
notation:
|
||||||
.Bl -bullet
|
.Bl -bullet
|
||||||
.It
|
.It
|
||||||
The $0 parameter is set to the name of the function (Bourne-style functions
|
The
|
||||||
leave $0 untouched).
|
.Ic $0
|
||||||
|
parameter is set to the name of the function (Bourne-style functions leave
|
||||||
|
.Ic $0
|
||||||
|
untouched).
|
||||||
.It
|
.It
|
||||||
Parameter assignments preceding function calls are not kept in the shell
|
Parameter assignments preceding function calls are not kept in the shell
|
||||||
environment (executing Bourne-style functions will keep assignments).
|
environment (executing Bourne-style functions will keep assignments).
|
||||||
@ -2034,7 +2017,7 @@ mode, signal names are listed one per line; in
|
|||||||
.Pf non- Tn POSIX
|
.Pf non- Tn POSIX
|
||||||
mode,
|
mode,
|
||||||
signal numbers, names, and descriptions are printed in columns.
|
signal numbers, names, and descriptions are printed in columns.
|
||||||
In future, a new option
|
In the future, a new option
|
||||||
.Po Fl v
|
.Po Fl v
|
||||||
\ perhaps
|
\ perhaps
|
||||||
.Pc
|
.Pc
|
||||||
@ -2176,7 +2159,9 @@ mode, the expression
|
|||||||
.Sq Ic \&!
|
.Sq Ic \&!
|
||||||
arguments) is always true as it is a non-zero length string; in
|
arguments) is always true as it is a non-zero length string; in
|
||||||
.Pf non- Tn POSIX
|
.Pf non- Tn POSIX
|
||||||
mode, it tests if file descriptor 1 is a tty (i.e., the
|
mode, it tests if file descriptor 1 is a
|
||||||
|
.Xr tty 4
|
||||||
|
(i.e., the
|
||||||
.Ar fd
|
.Ar fd
|
||||||
argument to the
|
argument to the
|
||||||
.Fl t
|
.Fl t
|
||||||
@ -2220,7 +2205,9 @@ special commands
|
|||||||
.Ic readonly , return , set , shift ,
|
.Ic readonly , return , set , shift ,
|
||||||
.Ic trap , unset
|
.Ic trap , unset
|
||||||
.Pp
|
.Pp
|
||||||
Additional ksh special commands
|
Additional
|
||||||
|
.Nm
|
||||||
|
special commands
|
||||||
.Pp
|
.Pp
|
||||||
.Ic builtin , times , typeset
|
.Ic builtin , times , typeset
|
||||||
.Pp
|
.Pp
|
||||||
@ -2237,12 +2224,16 @@ regular commands
|
|||||||
.Ic jobs , kill , read , true ,
|
.Ic jobs , kill , read , true ,
|
||||||
.Ic umask , unalias , wait
|
.Ic umask , unalias , wait
|
||||||
.Pp
|
.Pp
|
||||||
Additional ksh regular commands
|
Additional
|
||||||
|
.Nm
|
||||||
|
regular commands
|
||||||
.Pp
|
.Pp
|
||||||
.Ic \&[ , echo , let , print ,
|
.Ic \&[ , echo , let , print ,
|
||||||
.Ic pwd , test , ulimit , whence
|
.Ic pwd , test , ulimit , whence
|
||||||
.Pp
|
.Pp
|
||||||
In the future, the additional ksh special and regular commands may be treated
|
In the future, the additional
|
||||||
|
.Nm
|
||||||
|
special and regular commands may be treated
|
||||||
differently from the
|
differently from the
|
||||||
.Tn POSIX
|
.Tn POSIX
|
||||||
special and regular commands.
|
special and regular commands.
|
||||||
@ -2273,8 +2264,7 @@ Exit status is set to zero.
|
|||||||
.Op Ic +-
|
.Op Ic +-
|
||||||
.Oo Ar name
|
.Oo Ar name
|
||||||
.Op Ns = Ns Ar value
|
.Op Ns = Ns Ar value
|
||||||
.Ar ...
|
.Ar ... Oc
|
||||||
.Oc
|
|
||||||
.Xc
|
.Xc
|
||||||
Without arguments,
|
Without arguments,
|
||||||
.Ic alias
|
.Ic alias
|
||||||
@ -2485,7 +2475,7 @@ The shell exits with the specified exit status.
|
|||||||
If
|
If
|
||||||
.Ar status
|
.Ar status
|
||||||
is not specified, the exit status is the current value of the
|
is not specified, the exit status is the current value of the
|
||||||
.Ic \&?
|
.Ic $\&?
|
||||||
parameter.
|
parameter.
|
||||||
.It Xo Ic export Op Fl p
|
.It Xo Ic export Op Fl p
|
||||||
.Op Ar parameter Ns Op \&= Ns Ar value
|
.Op Ar parameter Ns Op \&= Ns Ar value
|
||||||
@ -2628,10 +2618,10 @@ below for the format of
|
|||||||
.Ar job
|
.Ar job
|
||||||
and the displayed job.
|
and the displayed job.
|
||||||
.It Xo Ic kill
|
.It Xo Ic kill
|
||||||
.Oo Fl s Ar signame No \&|
|
.Oo Fl s Ar signame \*(Ba
|
||||||
.Fl signum No \&| Fl signame Oc {
|
.Fl Ar signum | Fl Ar signame Oc {
|
||||||
.Ar job No \&|
|
.Ar job |
|
||||||
.Ar pid No \&|
|
.Ar pid |
|
||||||
.Ar pgrp No } Ar ...
|
.Ar pgrp No } Ar ...
|
||||||
.Xc
|
.Xc
|
||||||
Send the specified signal to the specified jobs, process IDs, or process
|
Send the specified signal to the specified jobs, process IDs, or process
|
||||||
@ -2651,7 +2641,7 @@ specified
|
|||||||
If no arguments are specified, a list of all the signals, their numbers and
|
If no arguments are specified, a list of all the signals, their numbers and
|
||||||
a short description of them are printed.
|
a short description of them are printed.
|
||||||
.It Xo Ic print
|
.It Xo Ic print
|
||||||
.Oo Fl nprsu Ns Ar n No \&|
|
.Oo Fl nprsu Ns Ar n \*(Ba
|
||||||
.Fl R Op Fl en Oc
|
.Fl R Op Fl en Oc
|
||||||
.Op Ar argument ...
|
.Op Ar argument ...
|
||||||
.Xc
|
.Xc
|
||||||
@ -2703,7 +2693,7 @@ The
|
|||||||
.Fl R
|
.Fl R
|
||||||
option is used to emulate, to some degree, the
|
option is used to emulate, to some degree, the
|
||||||
.Bx
|
.Bx
|
||||||
.Xr echo
|
.Xr echo 1
|
||||||
command, which does not process
|
command, which does not process
|
||||||
.Ql \e
|
.Ql \e
|
||||||
sequences unless the
|
sequences unless the
|
||||||
@ -2756,7 +2746,9 @@ exits with a non-zero status.
|
|||||||
.Pp
|
.Pp
|
||||||
The first parameter may have a question mark and a string appended to it, in
|
The first parameter may have a question mark and a string appended to it, in
|
||||||
which case the string is used as a prompt (printed to standard error before
|
which case the string is used as a prompt (printed to standard error before
|
||||||
any input is read) if the input is a tty (e.g.,
|
any input is read) if the input is a
|
||||||
|
.Xr tty 4
|
||||||
|
(e.g.,
|
||||||
.Ic read nfoo?'number of foos: ' ) .
|
.Ic read nfoo?'number of foos: ' ) .
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
@ -2802,7 +2794,7 @@ If used outside of a function or
|
|||||||
script, it has the same effect as
|
script, it has the same effect as
|
||||||
.Ic exit .
|
.Ic exit .
|
||||||
Note that
|
Note that
|
||||||
.Nm pdksh
|
.Nm
|
||||||
treats both profile and
|
treats both profile and
|
||||||
.Ev ENV
|
.Ev ENV
|
||||||
files as
|
files as
|
||||||
@ -3000,10 +2992,12 @@ Enable vi-like command-line editing (interactive shells only).
|
|||||||
No effect.
|
No effect.
|
||||||
In the original Korn shell, unless
|
In the original Korn shell, unless
|
||||||
.Ic viraw
|
.Ic viraw
|
||||||
was set, the vi command-line mode would let the tty driver do the work until
|
was set, the vi command-line mode would let the
|
||||||
|
.Xr tty 4
|
||||||
|
driver do the work until
|
||||||
.Tn ESC
|
.Tn ESC
|
||||||
(^[) was entered.
|
(^[) was entered.
|
||||||
.Nm pdksh
|
.Nm
|
||||||
is always in viraw mode.
|
is always in viraw mode.
|
||||||
.It Ic vi-esccomplete
|
.It Ic vi-esccomplete
|
||||||
In vi command-line editing, do command and file name completion when escape
|
In vi command-line editing, do command and file name completion when escape
|
||||||
@ -3029,7 +3023,7 @@ will print the long names of all options that are currently on.
|
|||||||
.Pp
|
.Pp
|
||||||
Remaining arguments, if any, are positional parameters and are assigned, in
|
Remaining arguments, if any, are positional parameters and are assigned, in
|
||||||
order, to the positional parameters (i.e.
|
order, to the positional parameters (i.e.
|
||||||
.Va $1 , $2 ,
|
.Ic $1 , $2 ,
|
||||||
etc.).
|
etc.).
|
||||||
If options end with
|
If options end with
|
||||||
.Ql --
|
.Ql --
|
||||||
@ -3037,7 +3031,7 @@ and there are no remaining arguments, all positional parameters are cleared.
|
|||||||
If no options or arguments are given, the values of all names are printed.
|
If no options or arguments are given, the values of all names are printed.
|
||||||
For unknown historical reasons, a lone
|
For unknown historical reasons, a lone
|
||||||
.Ql -
|
.Ql -
|
||||||
option is treated specially -- it clears both the
|
option is treated specially \(em it clears both the
|
||||||
.Fl x
|
.Fl x
|
||||||
and
|
and
|
||||||
.Fl v
|
.Fl v
|
||||||
@ -3142,25 +3136,24 @@ doesn't exist (thus
|
|||||||
returns true if and only if option
|
returns true if and only if option
|
||||||
.Ar foo
|
.Ar foo
|
||||||
exists).
|
exists).
|
||||||
.It Ar file Fl nt Ar file
|
.It Ar file1 Fl nt Ar file2
|
||||||
first
|
.Ar file1
|
||||||
.Ar file
|
is newer than
|
||||||
is newer than second
|
.Ar file2 .
|
||||||
.Ar file .
|
.It Ar file1 Fl ot Ar file2
|
||||||
.It Ar file Fl ot Ar file
|
.Ar file1
|
||||||
first
|
is older than
|
||||||
.Ar file
|
.Ar file2 .
|
||||||
is older than second
|
.It Ar file1 Fl ef Ar file2
|
||||||
.Ar file .
|
.Ar file1
|
||||||
.It Ar file Fl ef Ar file
|
is the same file as
|
||||||
first
|
.Ar file2 .
|
||||||
.Ar file
|
|
||||||
is the same file as second
|
|
||||||
.Ar file .
|
|
||||||
.It Fl t Op Ar fd
|
.It Fl t Op Ar fd
|
||||||
File descriptor
|
File descriptor
|
||||||
.Ar fd
|
.Ar fd
|
||||||
is a tty device.
|
is a
|
||||||
|
.Xr tty 4
|
||||||
|
device.
|
||||||
If the
|
If the
|
||||||
.Ic posix
|
.Ic posix
|
||||||
option is not set,
|
option is not set,
|
||||||
@ -3171,7 +3164,21 @@ to the special
|
|||||||
rules described below).
|
rules described below).
|
||||||
.It Ar string
|
.It Ar string
|
||||||
.Ar string
|
.Ar string
|
||||||
is not empty.
|
is not empty (has non-zero length).
|
||||||
|
Note that there is the potential for problems if
|
||||||
|
.Ar string
|
||||||
|
turns out to be an operator (e.g.
|
||||||
|
.Fl r ) .
|
||||||
|
It is generally better to use a test like
|
||||||
|
.No ( Ns Nm sh )
|
||||||
|
.Bk -words
|
||||||
|
.Sm off
|
||||||
|
.Ic \&[\ X\&" Ar string Ic \&" Ic \ \&]
|
||||||
|
.Sm on
|
||||||
|
.Ek
|
||||||
|
instead (double quotes are used in case
|
||||||
|
.Ar string
|
||||||
|
contains spaces or globbing characters).
|
||||||
.It Fl z Ar string
|
.It Fl z Ar string
|
||||||
.Ar string
|
.Ar string
|
||||||
is empty.
|
is empty.
|
||||||
@ -3247,7 +3254,9 @@ if the first argument is a unary operator, including an unstripped
|
|||||||
.Pp
|
.Pp
|
||||||
.Sy Note:
|
.Sy Note:
|
||||||
A common mistake is to use
|
A common mistake is to use
|
||||||
|
.Bk -words
|
||||||
.Ic if \&[ $foo = bar \&]
|
.Ic if \&[ $foo = bar \&]
|
||||||
|
.Ek
|
||||||
which fails if parameter
|
which fails if parameter
|
||||||
.Ic foo
|
.Ic foo
|
||||||
is
|
is
|
||||||
@ -3259,14 +3268,17 @@ characters), or if it is a unary operator like
|
|||||||
or
|
or
|
||||||
.Sq Fl n .
|
.Sq Fl n .
|
||||||
Use tests like
|
Use tests like
|
||||||
|
.No ( Ns Nm sh )
|
||||||
|
.Bk -words
|
||||||
.Ic if \&[ \&"X$foo\&" = Xbar \&]
|
.Ic if \&[ \&"X$foo\&" = Xbar \&]
|
||||||
|
.Ek
|
||||||
instead.
|
instead.
|
||||||
.It Ic times
|
.It Ic times
|
||||||
Print the accumulated user and system times used by the shell and by processes
|
Print the accumulated user and system times used by the shell and by processes
|
||||||
which have exited that the shell started.
|
which have exited that the shell started.
|
||||||
.It Ic trap Op Ar handler signal ...
|
.It Ic trap Op Ar handler signal ...
|
||||||
Sets trap handler that is to be executed when any of the specified signals are
|
Sets a trap handler that is to be executed when any of the
|
||||||
received.
|
specified signals are received.
|
||||||
.Ar handler
|
.Ar handler
|
||||||
is either a
|
is either a
|
||||||
.Dv NULL
|
.Dv NULL
|
||||||
@ -3490,7 +3502,7 @@ limit is imposed.
|
|||||||
Note that some systems may not allow limits to be increased
|
Note that some systems may not allow limits to be increased
|
||||||
once they are set.
|
once they are set.
|
||||||
Also note that the types of limits available are system
|
Also note that the types of limits available are system
|
||||||
dependent -- some systems have only the
|
dependent \(em some systems have only the
|
||||||
.Fl f
|
.Fl f
|
||||||
limit.
|
limit.
|
||||||
.Bl -tag -width 5n
|
.Bl -tag -width 5n
|
||||||
@ -3706,8 +3718,9 @@ A job may be referred to in the
|
|||||||
and
|
and
|
||||||
.Ic wait
|
.Ic wait
|
||||||
commands either by the process ID of the last process in the command pipeline
|
commands either by the process ID of the last process in the command pipeline
|
||||||
(as stored in the $! parameter) or by prefixing the job number with a percent
|
(as stored in the
|
||||||
sign
|
.Ic $\&!
|
||||||
|
parameter) or by prefixing the job number with a percent sign
|
||||||
.Pq Sq % .
|
.Pq Sq % .
|
||||||
Other percent sequences can also be used to refer to jobs:
|
Other percent sequences can also be used to refer to jobs:
|
||||||
.Bl -tag -width 10n
|
.Bl -tag -width 10n
|
||||||
@ -3736,8 +3749,9 @@ The job starting with string
|
|||||||
.Pp
|
.Pp
|
||||||
When a job changes state (e.g., a background job finishes or foreground job is
|
When a job changes state (e.g., a background job finishes or foreground job is
|
||||||
stopped), the shell prints the following status information:
|
stopped), the shell prints the following status information:
|
||||||
.Pp
|
.Bd -unfilled -offset indent
|
||||||
.Ic \&[ Ar number Ic \&] Ar flag status command
|
.Ic \&[ Ar number Ic \&] Ar flag status command
|
||||||
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
where
|
where
|
||||||
.Bl -tag -width "status"
|
.Bl -tag -width "status"
|
||||||
@ -3759,7 +3773,7 @@ indicates the current state of the job and can be:
|
|||||||
The job has neither stopped nor exited (note that running does not necessarily
|
The job has neither stopped nor exited (note that running does not necessarily
|
||||||
mean consuming
|
mean consuming
|
||||||
.Tn CPU
|
.Tn CPU
|
||||||
time -- the process could be blocked waiting for some
|
time \(em the process could be blocked waiting for some
|
||||||
event).
|
event).
|
||||||
.It Cm Done Op Ar number
|
.It Cm Done Op Ar number
|
||||||
The job exited.
|
The job exited.
|
||||||
@ -3833,6 +3847,7 @@ signal and the shell exits.
|
|||||||
.Xr srand 3 ,
|
.Xr srand 3 ,
|
||||||
.Xr srandom 3 ,
|
.Xr srandom 3 ,
|
||||||
.Xr system 3 ,
|
.Xr system 3 ,
|
||||||
|
.Xr tty 4 ,
|
||||||
.Xr environ 7
|
.Xr environ 7
|
||||||
.Pp
|
.Pp
|
||||||
.Pa http://docsrv.sco.com:507/en/man/html.C/sh.C.html
|
.Pa http://docsrv.sco.com:507/en/man/html.C/sh.C.html
|
||||||
@ -3856,14 +3871,10 @@ signal and the shell exits.
|
|||||||
.%D 1993
|
.%D 1993
|
||||||
.%O "ISBN 1-55937-266-9"
|
.%O "ISBN 1-55937-266-9"
|
||||||
.Re
|
.Re
|
||||||
.Sh VERSION
|
|
||||||
This page documents version @(#)PD KSH v5.2.14 99/07/13.2 of the public
|
|
||||||
domain Korn shell, as delivered with
|
|
||||||
.Mx .
|
|
||||||
.Sh NOTES
|
.Sh NOTES
|
||||||
.Nm sh
|
.Nm sh
|
||||||
is implemented as a run-time option of
|
is implemented as a run-time option of
|
||||||
.Nm pdksh ,
|
.Nm mksh ,
|
||||||
with only those
|
with only those
|
||||||
.Nm ksh
|
.Nm ksh
|
||||||
features whose syntax or semantics are incompatible with a traditional Bourne
|
features whose syntax or semantics are incompatible with a traditional Bourne
|
||||||
@ -3877,7 +3888,7 @@ compliant shells is an issue.
|
|||||||
.Pp
|
.Pp
|
||||||
.Nm mksh
|
.Nm mksh
|
||||||
is the name for the portable version of
|
is the name for the portable version of
|
||||||
.Mx MirBSD
|
.Mx
|
||||||
.Nm ksh
|
.Nm ksh
|
||||||
installed as
|
installed as
|
||||||
.Pa /bin/mksh
|
.Pa /bin/mksh
|
||||||
@ -3887,26 +3898,9 @@ Visit
|
|||||||
to obtain the latest version of
|
to obtain the latest version of
|
||||||
.Nm mksh .
|
.Nm mksh .
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
This shell is based on the public domain 7th edition Bourne shell clone by
|
|
||||||
Charles Forsyth and parts of the BRL shell by Doug A. Gwyn, Doug Kingston,
|
|
||||||
Ron Natalie, Arnold Robbins, Lou Salkind, and others.
|
|
||||||
The first release of
|
|
||||||
.Nm pdksh
|
|
||||||
was created by Eric Gisin, and it was subsequently maintained by
|
|
||||||
.An John R. MacMillan Aq change!john@sq.sq.com
|
|
||||||
and
|
|
||||||
.An Simon J. Gerraty Aq sjg@zen.void.oz.au .
|
|
||||||
The current maintainer is
|
|
||||||
.An Michael Rendell Aq michael@cs.mun.ca
|
|
||||||
for the upstream version of
|
|
||||||
.Nm pdksh
|
|
||||||
and
|
|
||||||
.An Thorsten Glaser Aq tg@66h.42h.de
|
|
||||||
for
|
|
||||||
.Mx .
|
|
||||||
The
|
The
|
||||||
.Pa CONTRIBUTORS
|
.Pa CONTRIBUTORS
|
||||||
file in the source distribution contains a more complete list of people and
|
file in the source distribution contains an almost complete list of people and
|
||||||
their part in the shell's development.
|
their part in the shell's development.
|
||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
Send bug reports for
|
Send bug reports for
|
||||||
@ -3915,15 +3909,7 @@ to the
|
|||||||
.Mx
|
.Mx
|
||||||
development team at
|
development team at
|
||||||
.Aq miros\-discuss@66h.42h.de .
|
.Aq miros\-discuss@66h.42h.de .
|
||||||
Please include the version of
|
Please test first if the bug appears with the latest version of the full
|
||||||
.Nm
|
|
||||||
.Po
|
|
||||||
.Ic echo $KSH_VERSION
|
|
||||||
shows it
|
|
||||||
.Pc ,
|
|
||||||
the machine, operating system, and compiler you are using and how you built
|
|
||||||
.Nm .
|
|
||||||
Please test if the bug appears with the latest version of the full
|
|
||||||
.Nm mksh
|
.Nm mksh
|
||||||
as well.
|
as well.
|
||||||
We do not extensively use nor support
|
We do not extensively use nor support
|
||||||
|
Loading…
x
Reference in New Issue
Block a user