Begin new sentences on new lines. From Robert Elz (kre at munnari oz au).
This commit is contained in:
parent
a120eaa3ea
commit
6ab45c70b7
361
bin/ksh/ksh.Man
361
bin/ksh/ksh.Man
@ -1,5 +1,5 @@
|
|||||||
'\" t
|
'\" t
|
||||||
.\" $NetBSD: ksh.Man,v 1.8 2002/09/25 02:55:03 provos Exp $
|
.\" $NetBSD: ksh.Man,v 1.9 2002/09/26 11:11:17 wiz Exp $
|
||||||
.\"{{{}}}
|
.\"{{{}}}
|
||||||
.\"{{{ Notes about man page
|
.\"{{{ Notes about man page
|
||||||
.\" - use the pseudo-macros .sh( and .sh) to begin and end sh-specific
|
.\" - use the pseudo-macros .sh( and .sh) to begin and end sh-specific
|
||||||
@ -50,8 +50,8 @@ sh \- Public domain Bourne shell
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.ksh(
|
.ksh(
|
||||||
\fBksh\fP is a command interpreter that is intended for both
|
\fBksh\fP is a command interpreter that is intended for both
|
||||||
interactive and shell script use. Its command language is a superset
|
interactive and shell script use.
|
||||||
of the \fIsh\fP(1) shell language.
|
Its command language is a superset of the \fIsh\fP(1) shell language.
|
||||||
.ksh)
|
.ksh)
|
||||||
.sh(
|
.sh(
|
||||||
\fBsh\fP is a reimplementation of the Bourne shell, a command
|
\fBsh\fP is a reimplementation of the Bourne shell, a command
|
||||||
@ -293,7 +293,8 @@ are all valid, but
|
|||||||
is not.
|
is not.
|
||||||
.\"{{{ ( list )
|
.\"{{{ ( list )
|
||||||
.IP "\fB(\fP \fIlist\fP \fB)\fP"
|
.IP "\fB(\fP \fIlist\fP \fB)\fP"
|
||||||
Execute \fIlist\fP in a subshell. There is no implicit way to pass
|
Execute \fIlist\fP in a subshell.
|
||||||
|
There is no implicit way to pass
|
||||||
environment changes from a subshell back to its parent.
|
environment changes from a subshell back to its parent.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ { list }
|
.\"{{{ { list }
|
||||||
@ -305,12 +306,14 @@ Note that \fB{\fP and \fB}\fP are reserved words, not meta-characters.
|
|||||||
.IP "\fBcase\fP \fIword\fP \fBin\fP [ [\fB(\fP] \fIpattern\fP [\fB|\fP \fIpattern\fP] ... \fB)\fP \fIlist\fP \fB;;\fP ] ... \fBesac\fP"
|
.IP "\fBcase\fP \fIword\fP \fBin\fP [ [\fB(\fP] \fIpattern\fP [\fB|\fP \fIpattern\fP] ... \fB)\fP \fIlist\fP \fB;;\fP ] ... \fBesac\fP"
|
||||||
The \fBcase\fP statement attempts to match \fIword\fP against the specified
|
The \fBcase\fP statement attempts to match \fIword\fP against the specified
|
||||||
\fIpattern\fPs; the \fIlist\fP associated with the first successfully matched
|
\fIpattern\fPs; the \fIlist\fP associated with the first successfully matched
|
||||||
pattern is executed. Patterns used in \fBcase\fP statements are the same as
|
pattern is executed.
|
||||||
|
Patterns used in \fBcase\fP statements are the same as
|
||||||
those used for file name patterns except that the restrictions regarding
|
those used for file name patterns except that the restrictions regarding
|
||||||
\fB\&.\fP and \fB/\fP are dropped. Note that any unquoted space before and
|
\fB\&.\fP and \fB/\fP are dropped.
|
||||||
after a pattern is stripped; any space with a pattern must be quoted. Both the
|
Note that any unquoted space before and
|
||||||
word and the patterns are subject to parameter, command, and arithmetic
|
after a pattern is stripped; any space with a pattern must be quoted.
|
||||||
substitution as well as tilde substitution.
|
Both the word and the patterns are subject to parameter, command, and
|
||||||
|
arithmetic substitution as well as tilde substitution.
|
||||||
For historical reasons, open and close braces may be used instead
|
For historical reasons, open and close braces may be used instead
|
||||||
of \fBin\fP and \fBesac\fP (\fIe.g.\fP, \fBcase $foo { *) echo bar; }\fP).
|
of \fBin\fP and \fBesac\fP (\fIe.g.\fP, \fBcase $foo { *) echo bar; }\fP).
|
||||||
The exit status of a \fBcase\fP statement is that of the executed \fIlist\fP;
|
The exit status of a \fBcase\fP statement is that of the executed \fIlist\fP;
|
||||||
@ -320,7 +323,8 @@ if no \fIlist\fP is executed, the exit status is zero.
|
|||||||
.IP "\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ... \fIterm\fP ] \fBdo\fP \fIlist\fP \fBdone\fP"
|
.IP "\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ... \fIterm\fP ] \fBdo\fP \fIlist\fP \fBdone\fP"
|
||||||
where \fIterm\fP is either a newline or a \fB;\fP.
|
where \fIterm\fP is either a newline or a \fB;\fP.
|
||||||
For each \fIword\fP in the specified word list, the parameter \fIname\fP is
|
For each \fIword\fP in the specified word list, the parameter \fIname\fP is
|
||||||
set to the word and \fIlist\fP is executed. If \fBin\fP is not used to
|
set to the word and \fIlist\fP is executed.
|
||||||
|
If \fBin\fP is not used to
|
||||||
specify a word list, the positional parameters (\fB"$1"\fP, \fB"$2"\fP,
|
specify a word list, the positional parameters (\fB"$1"\fP, \fB"$2"\fP,
|
||||||
\fIetc.\fP) are used instead.
|
\fIetc.\fP) are used instead.
|
||||||
For historical reasons, open and close braces may be used instead
|
For historical reasons, open and close braces may be used instead
|
||||||
@ -332,7 +336,8 @@ of \fIlist\fP; if \fIlist\fP is never executed, the exit status is zero.
|
|||||||
.IP "\fBif\fP \fIlist\fP \fBthen\fP \fIlist\fP [\fBelif\fP \fIlist\fP \fBthen\fP \fIlist\fP] ... [\fBelse\fP \fIlist\fP] \fBfi\fP"
|
.IP "\fBif\fP \fIlist\fP \fBthen\fP \fIlist\fP [\fBelif\fP \fIlist\fP \fBthen\fP \fIlist\fP] ... [\fBelse\fP \fIlist\fP] \fBfi\fP"
|
||||||
If the exit status of the first \fIlist\fP is zero, the second \fIlist\fP
|
If the exit status of the first \fIlist\fP is zero, the second \fIlist\fP
|
||||||
is executed; otherwise the \fIlist\fP following the \fBelif\fP, if any, is
|
is executed; otherwise the \fIlist\fP following the \fBelif\fP, if any, is
|
||||||
executed with similar consequences. If all the lists following the \fBif\fP
|
executed with similar consequences.
|
||||||
|
If all the lists following the \fBif\fP
|
||||||
and \fBelif\fPs fail (\fIi.e.\fP, exit with non-zero status), the \fIlist\fP
|
and \fBelif\fPs fail (\fIi.e.\fP, exit with non-zero status), the \fIlist\fP
|
||||||
following the \fBelse\fP is executed.
|
following the \fBelse\fP is executed.
|
||||||
The exit status of an \fBif\fP statement is that
|
The exit status of an \fBif\fP statement is that
|
||||||
@ -373,7 +378,8 @@ exit status of the first \fIlist\fP is non-zero.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ while list do list done
|
.\"{{{ while list do list done
|
||||||
.IP "\fBwhile\fP \fIlist\fP \fBdo\fP \fIlist\fP \fBdone\fP"
|
.IP "\fBwhile\fP \fIlist\fP \fBdo\fP \fIlist\fP \fBdone\fP"
|
||||||
A \fBwhile\fP is a prechecked loop. Its body is executed as often
|
A \fBwhile\fP is a prechecked loop.
|
||||||
|
Its body is executed as often
|
||||||
as the exit status of the first \fIlist\fP is zero.
|
as the exit status of the first \fIlist\fP is zero.
|
||||||
The exit status of a \fBwhile\fP statement is the last exit status
|
The exit status of a \fBwhile\fP statement is the last exit status
|
||||||
of the \fIlist\fP in the body of the loop; if the body is not executed,
|
of the \fIlist\fP in the body of the loop; if the body is not executed,
|
||||||
@ -478,13 +484,17 @@ of the form \fB"\fP...\fB`\fP...\fB\e"\fP...\fB`\fP..\fB"\fP.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ Aliases
|
.\"{{{ Aliases
|
||||||
.SS "Aliases"
|
.SS "Aliases"
|
||||||
There are two types of aliases: normal command aliases and tracked
|
There are two types of aliases: normal command aliases and tracked aliases.
|
||||||
aliases. Command aliases are normally used as a short hand for a long
|
Command aliases are normally used as a short hand for a long
|
||||||
or often used command. The shell expands command aliases (\fIi.e.\fP,
|
or often used command.
|
||||||
|
The shell expands command aliases (\fIi.e.\fP,
|
||||||
substitutes the alias name for its value) when it reads the first word
|
substitutes the alias name for its value) when it reads the first word
|
||||||
of a command. An expanded alias is re-processed to check for more
|
of a command.
|
||||||
aliases. If a command alias ends in a space or tab, the following word
|
An expanded alias is re-processed to check for more
|
||||||
is also checked for alias expansion. The alias expansion process stops
|
aliases.
|
||||||
|
If a command alias ends in a space or tab, the following word
|
||||||
|
is also checked for alias expansion.
|
||||||
|
The alias expansion process stops
|
||||||
when a word that is not an alias is found, when a quoted word is found
|
when a word that is not an alias is found, when a quoted word is found
|
||||||
or when an alias word that is currently being expanded is found.
|
or when an alias word that is currently being expanded is found.
|
||||||
.PP
|
.PP
|
||||||
@ -526,15 +536,17 @@ type='whence \-v'
|
|||||||
.ft P
|
.ft P
|
||||||
.PP
|
.PP
|
||||||
Tracked aliases allow the shell to remember where it found a particular
|
Tracked aliases allow the shell to remember where it found a particular
|
||||||
command. The first time the shell does a path search for a command that
|
command.
|
||||||
|
The first time the shell does a path search for a command that
|
||||||
is marked as a tracked alias, it saves the full path of the command.
|
is marked as a tracked alias, it saves the full path of the command.
|
||||||
The next time the command is executed, the shell checks the saved path
|
The next time the command is executed, the shell checks the saved path
|
||||||
to see that it is still valid, and if so, avoids repeating the path
|
to see that it is still valid, and if so, avoids repeating the path search.
|
||||||
search. Tracked aliases can be listed and created using \fBalias
|
Tracked aliases can be listed and created using \fBalias \-t\fP.
|
||||||
\-t\fP. Note that changing the \fBPATH\fP parameter clears the saved
|
Note that changing the \fBPATH\fP parameter clears the saved
|
||||||
paths for all tracked aliases. If the \fBtrackall\fP option is set (\fIi.e.\fP,
|
paths for all tracked aliases.
|
||||||
\fBset \-o trackall\fP or \fBset \-h\fP), the shell tracks all
|
If the \fBtrackall\fP option is set (\fIi.e.\fP,
|
||||||
commands. This option is set automatically for non-interactive shells.
|
\fBset \-o trackall\fP or \fBset \-h\fP), the shell tracks all commands.
|
||||||
|
This option is set automatically for non-interactive shells.
|
||||||
For interactive shells, only the following commands are automatically
|
For interactive shells, only the following commands are automatically
|
||||||
tracked: \fBcat\fP, \fBcc\fP, \fBchmod\fP, \fBcp\fP, \fBdate\fP, \fBed\fP,
|
tracked: \fBcat\fP, \fBcc\fP, \fBchmod\fP, \fBcp\fP, \fBdate\fP, \fBed\fP,
|
||||||
\fBemacs\fP, \fBgrep\fP, \fBls\fP, \fBmail\fP, \fBmake\fP, \fBmv\fP,
|
\fBemacs\fP, \fBgrep\fP, \fBls\fP, \fBmail\fP, \fBmake\fP, \fBmv\fP,
|
||||||
@ -586,8 +598,8 @@ is carried out more efficiently because no process is started).
|
|||||||
.br
|
.br
|
||||||
.\"todo: fix this( $(..) parenthesis counting).
|
.\"todo: fix this( $(..) parenthesis counting).
|
||||||
NOTE: \fB$(\fP\fIcommand\fP\fB)\fP expressions are currently parsed by
|
NOTE: \fB$(\fP\fIcommand\fP\fB)\fP expressions are currently parsed by
|
||||||
finding the matching parenthesis, regardless of quoting. This will hopefully
|
finding the matching parenthesis, regardless of quoting.
|
||||||
be fixed soon.
|
This will hopefully be fixed soon.
|
||||||
.PP
|
.PP
|
||||||
Arithmetic substitutions are replaced by the value of the specified
|
Arithmetic substitutions are replaced by the value of the specified
|
||||||
expression.
|
expression.
|
||||||
@ -688,8 +700,8 @@ The number of elements in the array \fIname\fP.
|
|||||||
.\"{{{ ${name#pattern}, ${name##pattern}
|
.\"{{{ ${name#pattern}, ${name##pattern}
|
||||||
.IP "\fB${\fP\fIname\fP\fB#\fP\fIpattern\fP\fB}\fP, \fB${\fP\fIname\fP\fB##\fP\fIpattern\fP\fB}\fP"
|
.IP "\fB${\fP\fIname\fP\fB#\fP\fIpattern\fP\fB}\fP, \fB${\fP\fIname\fP\fB##\fP\fIpattern\fP\fB}\fP"
|
||||||
If \fIpattern\fP matches the beginning of the value of parameter \fIname\fP,
|
If \fIpattern\fP matches the beginning of the value of parameter \fIname\fP,
|
||||||
the matched text is deleted from the result of substitution. A single
|
the matched text is deleted from the result of substitution.
|
||||||
\fB#\fP results in the shortest match, two \fB#\fP's results in the
|
A single \fB#\fP results in the shortest match, two \fB#\fP's results in the
|
||||||
longest match.
|
longest match.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ ${name%pattern}, ${name%%pattern}
|
.\"{{{ ${name%pattern}, ${name%%pattern}
|
||||||
@ -703,8 +715,8 @@ The following special parameters are implicitly set by the shell and cannot be
|
|||||||
set directly using assignments:
|
set directly using assignments:
|
||||||
.\"{{{ !
|
.\"{{{ !
|
||||||
.IP \fB!\fP
|
.IP \fB!\fP
|
||||||
Process id of the last background process started. If no background
|
Process id of the last background process started.
|
||||||
processes have been started, the parameter is not set.
|
If no background processes have been started, the parameter is not set.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ #
|
.\"{{{ #
|
||||||
.IP \fB#\fP
|
.IP \fB#\fP
|
||||||
@ -778,7 +790,8 @@ the name of the file that changed (see \fBMAILPATH\fP parameter below).
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ CDPATH
|
.\"{{{ CDPATH
|
||||||
.IP \fBCDPATH\fP
|
.IP \fBCDPATH\fP
|
||||||
Search path for the \fBcd\fP built-in command. Works the same way as
|
Search path for the \fBcd\fP built-in command.
|
||||||
|
Works the same way as
|
||||||
\fBPATH\fP for those directories not beginning with \fB/\fP in \fBcd\fP
|
\fBPATH\fP for those directories not beginning with \fB/\fP in \fBcd\fP
|
||||||
commands.
|
commands.
|
||||||
Note that if CDPATH is set and does not contain \fB.\fP nor an empty path,
|
Note that if CDPATH is set and does not contain \fB.\fP nor an empty path,
|
||||||
@ -804,8 +817,8 @@ See \fBVISUAL\fP parameter below for how this works.
|
|||||||
.\"{{{ ENV
|
.\"{{{ ENV
|
||||||
.IP \fBENV\fP
|
.IP \fBENV\fP
|
||||||
If this parameter is found to be set after any profile files are
|
If this parameter is found to be set after any profile files are
|
||||||
executed, the expanded value is used as a shell start-up file. It
|
executed, the expanded value is used as a shell start-up file.
|
||||||
typically contains function and alias definitions.
|
It typically contains function and alias definitions.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ ERRNO
|
.\"{{{ ERRNO
|
||||||
.IP \fBERRNO\fP
|
.IP \fBERRNO\fP
|
||||||
@ -841,7 +854,8 @@ Also, several invocations of the
|
|||||||
shell running on the same machine will share history if their
|
shell running on the same machine will share history if their
|
||||||
\fBHISTFILE\fP parameters all point at the same file.
|
\fBHISTFILE\fP parameters all point at the same file.
|
||||||
.br
|
.br
|
||||||
NOTE: if HISTFILE isn't set, no history file is used. This is
|
NOTE: if HISTFILE isn't set, no history file is used.
|
||||||
|
This is
|
||||||
different from the original Korn shell, which uses \fB$HOME/.sh_history\fP;
|
different from the original Korn shell, which uses \fB$HOME/.sh_history\fP;
|
||||||
in future, pdksh may also use a default history file.
|
in future, pdksh may also use a default history file.
|
||||||
.ksh)
|
.ksh)
|
||||||
@ -861,7 +875,8 @@ substituted for an unqualified \fB~\fP (see Tilde Expansion below).
|
|||||||
.IP \fBIFS\fP
|
.IP \fBIFS\fP
|
||||||
Internal field separator, used during substitution and by the \fBread\fP
|
Internal field separator, used during substitution and by the \fBread\fP
|
||||||
command, to split values into distinct arguments; normally set to
|
command, to split values into distinct arguments; normally set to
|
||||||
space, tab and newline. See Substitution above for details.
|
space, tab and newline.
|
||||||
|
See Substitution above for details.
|
||||||
.br
|
.br
|
||||||
\fBNote:\fP this parameter is not imported from the environment
|
\fBNote:\fP this parameter is not imported from the environment
|
||||||
when the shell is started.
|
when the shell is started.
|
||||||
@ -897,24 +912,27 @@ Not implemented yet.
|
|||||||
.\"{{{ MAIL
|
.\"{{{ MAIL
|
||||||
.ksh(
|
.ksh(
|
||||||
.IP \fBMAIL\fP
|
.IP \fBMAIL\fP
|
||||||
If set, the user will be informed of the arrival of mail in the named
|
If set, the user will be informed of the arrival of mail in the named file.
|
||||||
file. This parameter is ignored if the \fBMAILPATH\fP parameter is set.
|
This parameter is ignored if the \fBMAILPATH\fP parameter is set.
|
||||||
.ksh)
|
.ksh)
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ MAILCHECK
|
.\"{{{ MAILCHECK
|
||||||
.ksh(
|
.ksh(
|
||||||
.IP \fBMAILCHECK\fP
|
.IP \fBMAILCHECK\fP
|
||||||
How often, in seconds, the shell will check for mail in the file(s)
|
How often, in seconds, the shell will check for mail in the file(s)
|
||||||
specified by \fBMAIL\fP or \fBMAILPATH\fP. If 0, the shell checks
|
specified by \fBMAIL\fP or \fBMAILPATH\fP.
|
||||||
before each prompt. The default is 600 (10 minutes).
|
If 0, the shell checks before each prompt.
|
||||||
|
The default is 600 (10 minutes).
|
||||||
.ksh)
|
.ksh)
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ MAILPATH
|
.\"{{{ MAILPATH
|
||||||
.ksh(
|
.ksh(
|
||||||
.IP \fBMAILPATH\fP
|
.IP \fBMAILPATH\fP
|
||||||
A list of files to be checked for mail. The list is colon separated,
|
A list of files to be checked for mail.
|
||||||
|
The list is colon separated,
|
||||||
and each file may be followed by a \fB?\fP and a message to be printed
|
and each file may be followed by a \fB?\fP and a message to be printed
|
||||||
if new mail has arrived. Command, parameter and arithmetic substitution is
|
if new mail has arrived.
|
||||||
|
Command, parameter and arithmetic substitution is
|
||||||
performed on the message, and, during substitution, the parameter \fB$_\fP
|
performed on the message, and, during substitution, the parameter \fB$_\fP
|
||||||
contains the name of the file.
|
contains the name of the file.
|
||||||
The default message is \fByou have mail in $_\fP.
|
The default message is \fByou have mail in $_\fP.
|
||||||
@ -959,7 +977,8 @@ The process ID of the shell's parent (readonly).
|
|||||||
.ksh(
|
.ksh(
|
||||||
Parameter, command and arithmetic substitutions are performed, and
|
Parameter, command and arithmetic substitutions are performed, and
|
||||||
\fB!\fP is replaced with the current command number (see \fBfc\fP
|
\fB!\fP is replaced with the current command number (see \fBfc\fP
|
||||||
command below). A literal ! can be put in the prompt by placing !! in PS1.
|
command below).
|
||||||
|
A literal ! can be put in the prompt by placing !! in PS1.
|
||||||
Note that since the command line editors try to figure out how long the
|
Note that since the command line editors try to figure out how long the
|
||||||
prompt is (so they know how far it is to edge of the screen),
|
prompt is (so they know how far it is to edge of the screen),
|
||||||
escape codes in the prompt tend to mess things up.
|
escape codes in the prompt tend to mess things up.
|
||||||
@ -1002,13 +1021,14 @@ Default is `\fB+\ \fP'.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ PWD
|
.\"{{{ PWD
|
||||||
.IP \fBPWD\fP
|
.IP \fBPWD\fP
|
||||||
The current working directory. Maybe unset or null if shell doesn't
|
The current working directory.
|
||||||
know where it is.
|
Maybe unset or null if shell doesn't know where it is.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ RANDOM
|
.\"{{{ RANDOM
|
||||||
.ksh(
|
.ksh(
|
||||||
.IP \fBRANDOM\fP
|
.IP \fBRANDOM\fP
|
||||||
A simple random number generator. Every time \fBRANDOM\fP is
|
A simple random number generator.
|
||||||
|
Every time \fBRANDOM\fP is
|
||||||
referenced, it is assigned the next number in a random number series.
|
referenced, it is assigned the next number in a random number series.
|
||||||
The point in the series can be set by assigning a number to
|
The point in the series can be set by assigning a number to
|
||||||
\fBRANDOM\fP (see \fIrand\fP(3)).
|
\fBRANDOM\fP (see \fIrand\fP(3)).
|
||||||
@ -1033,21 +1053,22 @@ the value that was assigned.
|
|||||||
.IP \fBTMOUT\fP
|
.IP \fBTMOUT\fP
|
||||||
If set to a positive integer in an interactive shell, it specifies
|
If set to a positive integer in an interactive shell, it specifies
|
||||||
the maximum number of seconds the shell will wait for input after
|
the maximum number of seconds the shell will wait for input after
|
||||||
printing the primary prompt (\fBPS1\fP). If the time is exceeded, the
|
printing the primary prompt (\fBPS1\fP).
|
||||||
shell exits.
|
If the time is exceeded, the shell exits.
|
||||||
.ksh)
|
.ksh)
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ TMPDIR
|
.\"{{{ TMPDIR
|
||||||
.IP \fBTMPDIR\fP
|
.IP \fBTMPDIR\fP
|
||||||
The directory shell temporary files are created in. If this parameter
|
The directory shell temporary files are created in.
|
||||||
is not set, or does not contain the absolute path of a writable
|
If this parameter is not set, or does not contain the absolute path of a
|
||||||
directory, temporary files are created in \fB/tmp\fP.
|
writable directory, temporary files are created in \fB/tmp\fP.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ VISUAL
|
.\"{{{ VISUAL
|
||||||
.ksh(
|
.ksh(
|
||||||
.IP \fBVISUAL\fP
|
.IP \fBVISUAL\fP
|
||||||
If set, this parameter controls the command line editing mode for
|
If set, this parameter controls the command line editing mode for
|
||||||
interactive shells. If the last component of the path specified in this
|
interactive shells.
|
||||||
|
If the last component of the path specified in this
|
||||||
parameter contains the string \fBvi\fP, \fBemacs\fP or \fBgmacs\fP, the
|
parameter contains the string \fBvi\fP, \fBemacs\fP or \fBgmacs\fP, the
|
||||||
vi, emacs or gmacs (Gosling emacs) editing mode is enabled, respectively.
|
vi, emacs or gmacs (Gosling emacs) editing mode is enabled, respectively.
|
||||||
.ksh)
|
.ksh)
|
||||||
@ -1057,13 +1078,15 @@ vi, emacs or gmacs (Gosling emacs) editing mode is enabled, respectively.
|
|||||||
.\"{{{ Tilde Expansion
|
.\"{{{ Tilde Expansion
|
||||||
.SS "Tilde Expansion"
|
.SS "Tilde Expansion"
|
||||||
Tilde expansion, which is done in parallel with parameter substitution,
|
Tilde expansion, which is done in parallel with parameter substitution,
|
||||||
is done on words starting with an unquoted \fB~\fP. The characters
|
is done on words starting with an unquoted \fB~\fP.
|
||||||
following the tilde, up to the first \fB/\fP, if any, are assumed to be
|
The characters following the tilde, up to the first \fB/\fP, if any,
|
||||||
a login name. If the login name is empty, \fB+\fP or \fB\-\fP, the
|
are assumed to be a login name.
|
||||||
|
If the login name is empty, \fB+\fP or \fB\-\fP, the
|
||||||
value of the \fBHOME\fP, \fBPWD\fP, or \fBOLDPWD\fP parameter is
|
value of the \fBHOME\fP, \fBPWD\fP, or \fBOLDPWD\fP parameter is
|
||||||
substituted, respectively. Otherwise, the password file is searched for
|
substituted, respectively.
|
||||||
the login name, and the tilde expression is substituted with the
|
Otherwise, the password file is searched for the login name, and the
|
||||||
user's home directory. If the login name is not found in the password
|
tilde expression is substituted with the user's home directory.
|
||||||
|
If the login name is not found in the password
|
||||||
file or if any quoting or parameter substitution occurs in the login name,
|
file or if any quoting or parameter substitution occurs in the login name,
|
||||||
no substitution is performed.
|
no substitution is performed.
|
||||||
.PP
|
.PP
|
||||||
@ -1073,7 +1096,8 @@ and \fBtypeset\fP), tilde expansion is done after any unquoted colon
|
|||||||
(\fB:\fP), and login names are also delimited by colons.
|
(\fB:\fP), and login names are also delimited by colons.
|
||||||
.PP
|
.PP
|
||||||
The home directory of previously expanded login names are cached and
|
The home directory of previously expanded login names are cached and
|
||||||
re-used. The \fBalias \-d\fP command may be used to list, change and
|
re-used.
|
||||||
|
The \fBalias \-d\fP command may be used to list, change and
|
||||||
add to this cache (\fIe.g.\fP, `alias \-d fac=/usr/local/facilities; cd
|
add to this cache (\fIe.g.\fP, `alias \-d fac=/usr/local/facilities; cd
|
||||||
~fac/bin').
|
~fac/bin').
|
||||||
.\"}}}
|
.\"}}}
|
||||||
@ -1099,22 +1123,27 @@ file name generation.
|
|||||||
.SS "File Name Patterns"
|
.SS "File Name Patterns"
|
||||||
.PP
|
.PP
|
||||||
A file name pattern is a word containing one or more unquoted \fB?\fP or
|
A file name pattern is a word containing one or more unquoted \fB?\fP or
|
||||||
\fB*\fP characters or \fB[\fP..\fB]\fP sequences. Once brace expansion has
|
\fB*\fP characters or \fB[\fP..\fB]\fP sequences.
|
||||||
|
Once brace expansion has
|
||||||
been performed, the shell replaces file name patterns with the sorted names
|
been performed, the shell replaces file name patterns with the sorted names
|
||||||
of all the files that match the pattern (if no files match, the word is
|
of all the files that match the pattern (if no files match, the word is
|
||||||
left unchanged). The pattern elements have the following meaning:
|
left unchanged).
|
||||||
|
The pattern elements have the following meaning:
|
||||||
.IP \fB?\fP
|
.IP \fB?\fP
|
||||||
matches any single character.
|
matches any single character.
|
||||||
.IP \fB*\fP
|
.IP \fB*\fP
|
||||||
matches any sequence of characters.
|
matches any sequence of characters.
|
||||||
.IP \fB[\fP..\fB]\fP
|
.IP \fB[\fP..\fB]\fP
|
||||||
matches any of the characters inside the brackets. Ranges of characters
|
matches any of the characters inside the brackets.
|
||||||
|
Ranges of characters
|
||||||
can be specified by separating two characters by a \fB\-\fP, \fIe.g.\fP,
|
can be specified by separating two characters by a \fB\-\fP, \fIe.g.\fP,
|
||||||
\fB[a0\-9]\fP matches the letter \fBa\fP or any digit.
|
\fB[a0\-9]\fP matches the letter \fBa\fP or any digit.
|
||||||
In order to represent itself, a
|
In order to represent itself, a
|
||||||
\fB\-\fP must either be quoted or the first or last character in the character
|
\fB\-\fP must either be quoted or the first or last character in the character
|
||||||
list. Similarly, a \fB]\fP must be quoted or the first character in the list
|
list.
|
||||||
if it is represent itself instead of the end of the list. Also, a \fB!\fP
|
Similarly, a \fB]\fP must be quoted or the first character in the list
|
||||||
|
if it is represent itself instead of the end of the list.
|
||||||
|
Also, a \fB!\fP
|
||||||
appearing at the start of the list has special meaning (see below), so to
|
appearing at the start of the list has special meaning (see below), so to
|
||||||
represent itself it must be quoted or appear later in the list.
|
represent itself it must be quoted or appear later in the list.
|
||||||
.IP \fB[!\fP..\fB]\fP
|
.IP \fB[!\fP..\fB]\fP
|
||||||
@ -1175,7 +1204,8 @@ created when job control is disabled, for which standard input is initially
|
|||||||
set to be from \fB/dev/null\fP, and commands for which any of the following
|
set to be from \fB/dev/null\fP, and commands for which any of the following
|
||||||
redirections have been specified:
|
redirections have been specified:
|
||||||
.IP "\fB>\fP \fIfile\fP"
|
.IP "\fB>\fP \fIfile\fP"
|
||||||
standard output is redirected to \fIfile\fP. If \fIfile\fP does not exist,
|
standard output is redirected to \fIfile\fP.
|
||||||
|
If \fIfile\fP does not exist,
|
||||||
it is created; if it does exist, is a regular file and the \fBnoclobber\fP
|
it is created; if it does exist, is a regular file and the \fBnoclobber\fP
|
||||||
option is set, an error occurs, otherwise the file is truncated.
|
option is set, an error occurs, otherwise the file is truncated.
|
||||||
Note that this means the command \fIcmd < foo > foo\fP will open
|
Note that this means the command \fIcmd < foo > foo\fP will open
|
||||||
@ -1186,7 +1216,8 @@ same as \fB>\fP, except the file is truncated, even if the \fBnoclobber\fP
|
|||||||
option is set.
|
option is set.
|
||||||
.IP "\fB>>\fP \fIfile\fP"
|
.IP "\fB>>\fP \fIfile\fP"
|
||||||
same as \fB>\fP, except the file an existing file is appended to instead
|
same as \fB>\fP, except the file an existing file is appended to instead
|
||||||
of being truncated. Also, the file is opened in append mode, so writes
|
of being truncated.
|
||||||
|
Also, the file is opened in append mode, so writes
|
||||||
always go to the end of the file (see \fIopen\fP(2)).
|
always go to the end of the file (see \fIopen\fP(2)).
|
||||||
.IP "\fB<\fP \fIfile\fP"
|
.IP "\fB<\fP \fIfile\fP"
|
||||||
standard input is redirected from \fIfile\fP, which is opened for reading.
|
standard input is redirected from \fIfile\fP, which is opened for reading.
|
||||||
@ -1312,7 +1343,8 @@ original value of the parameter.
|
|||||||
similar to \fB++\fP, except the paramter is decremented by 1.
|
similar to \fB++\fP, except the paramter is decremented by 1.
|
||||||
.IP "\fB,\fP"
|
.IP "\fB,\fP"
|
||||||
separates two arithmetic expressions; the left hand side is evaluated first,
|
separates two arithmetic expressions; the left hand side is evaluated first,
|
||||||
then the right. The result is value of the expression on the right hand side.
|
then the right.
|
||||||
|
The result is value of the expression on the right hand side.
|
||||||
.IP "\fB=\fP"
|
.IP "\fB=\fP"
|
||||||
assignment; variable on the left is set to the value on the right.
|
assignment; variable on the left is set to the value on the right.
|
||||||
.IP "\fB*= /= %= += \-= <<= >>= &= ^= |=\fP"
|
.IP "\fB*= /= %= += \-= <<= >>= &= ^= |=\fP"
|
||||||
@ -1338,7 +1370,8 @@ not equal; the result is 0 if both arguments are equal, 1 if not.
|
|||||||
less than; the result is 1 if the left argument is less than the right,
|
less than; the result is 1 if the left argument is less than the right,
|
||||||
0 if not.
|
0 if not.
|
||||||
.IP "\fB<= >= >\fP"
|
.IP "\fB<= >= >\fP"
|
||||||
less than or equal, greater than or equal, greater than. See <.
|
less than or equal, greater than or equal, greater than.
|
||||||
|
See <.
|
||||||
.IP "\fB<< >>\fP"
|
.IP "\fB<< >>\fP"
|
||||||
shift left (right); the result is the left argument with its bits shifted
|
shift left (right); the result is the left argument with its bits shifted
|
||||||
left (right) by the amount given in the right argument.
|
left (right) by the amount given in the right argument.
|
||||||
@ -1346,8 +1379,8 @@ left (right) by the amount given in the right argument.
|
|||||||
addition, subtraction, multiplication, and division.
|
addition, subtraction, multiplication, and division.
|
||||||
.IP "\fB%\fP"
|
.IP "\fB%\fP"
|
||||||
remainder; the result is the remainder of the division of the left argument
|
remainder; the result is the remainder of the division of the left argument
|
||||||
by the right. The sign of the result is unspecified if either argument
|
by the right.
|
||||||
is negative.
|
The sign of the result is unspecified if either argument is negative.
|
||||||
.IP "\fI<arg1>\fP \fB?\fP \fI<arg2>\fP \fB:\fP \fI<arg3>\fP"
|
.IP "\fI<arg1>\fP \fB?\fP \fI<arg2>\fP \fB:\fP \fI<arg3>\fP"
|
||||||
if \fI<arg1>\fP is non-zero, the result is \fI<arg2>\fP,
|
if \fI<arg1>\fP is non-zero, the result is \fI<arg2>\fP,
|
||||||
otherwise \fI<arg3>\fP.
|
otherwise \fI<arg3>\fP.
|
||||||
@ -1428,7 +1461,8 @@ Functions can have two attributes, trace and export, which can be set
|
|||||||
with \fBtypeset \-ft\fP and \fBtypeset \-fx\fP, respectively.
|
with \fBtypeset \-ft\fP and \fBtypeset \-fx\fP, respectively.
|
||||||
When a traced function is executed, the shell's \fBxtrace\fP option is turned
|
When a traced function is executed, the shell's \fBxtrace\fP option is turned
|
||||||
on for the functions duration, otherwise the \fBxtrace\fP option is turned off.
|
on for the functions duration, otherwise the \fBxtrace\fP option is turned off.
|
||||||
The export attribute of functions is currently not used. In the original
|
The export attribute of functions is currently not used.
|
||||||
|
In the original
|
||||||
Korn shell, exported functions are visible to shell scripts that are executed.
|
Korn shell, exported functions are visible to shell scripts that are executed.
|
||||||
.PP
|
.PP
|
||||||
Since functions are executed in the current shell environment, parameter
|
Since functions are executed in the current shell environment, parameter
|
||||||
@ -1501,8 +1535,10 @@ is not expanded and included when the shell starts.
|
|||||||
\fB\e"\fP inside double quoted \fB`\fP..\fB`\fP command substitutions:
|
\fB\e"\fP inside double quoted \fB`\fP..\fB`\fP command substitutions:
|
||||||
in posix mode, the \fB\e"\fP is interpreted when the command is interpreted;
|
in posix mode, the \fB\e"\fP is interpreted when the command is interpreted;
|
||||||
in non-posix mode, the backslash is stripped before the command substitution
|
in non-posix mode, the backslash is stripped before the command substitution
|
||||||
is interpreted. For example, \fBecho "`echo \e"hi\e"`"\fP produces `"hi"' in
|
is interpreted.
|
||||||
posix mode, `hi' in non-posix mode. To avoid problems, use the \fB$(...\fP)
|
For example, \fBecho "`echo \e"hi\e"`"\fP produces `"hi"' in
|
||||||
|
posix mode, `hi' in non-posix mode.
|
||||||
|
To avoid problems, use the \fB$(...\fP)
|
||||||
form of command substitution.
|
form of command substitution.
|
||||||
.IP \ \ \(bu
|
.IP \ \ \(bu
|
||||||
\fBkill \-l\fP output: in posix mode, signal names are listed one a single line;
|
\fBkill \-l\fP output: in posix mode, signal names are listed one a single line;
|
||||||
@ -1536,7 +1572,8 @@ explicitly turned on later.
|
|||||||
if there are no errors; in non-posix mode, the exit status is that of
|
if there are no errors; in non-posix mode, the exit status is that of
|
||||||
any command substitutions performed in generating the set command.
|
any command substitutions performed in generating the set command.
|
||||||
For example, `\fBset \-\- `false`; echo $?\fP' prints 0 in posix mode,
|
For example, `\fBset \-\- `false`; echo $?\fP' prints 0 in posix mode,
|
||||||
1 in non-posix mode. This construct is used in most shell scripts that
|
1 in non-posix mode.
|
||||||
|
This construct is used in most shell scripts that
|
||||||
use the old \fIgetopt\fP(1) command.
|
use the old \fIgetopt\fP(1) command.
|
||||||
.IP \ \ \(bu
|
.IP \ \ \(bu
|
||||||
argument expansion of \fBalias\fP, \fBexport\fP, \fBreadonly\fP, and
|
argument expansion of \fBalias\fP, \fBexport\fP, \fBreadonly\fP, and
|
||||||
@ -1690,14 +1727,16 @@ Execute the built-in command \fIcommand\fP.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ cd [-LP] [dir]
|
.\"{{{ cd [-LP] [dir]
|
||||||
.IP "\fBcd\fP [\fB\-LP\fP] [\fIdir\fP]"
|
.IP "\fBcd\fP [\fB\-LP\fP] [\fIdir\fP]"
|
||||||
Set the working directory to \fIdir\fP. If the parameter \fBCDPATH\fP
|
Set the working directory to \fIdir\fP.
|
||||||
|
If the parameter \fBCDPATH\fP
|
||||||
is set, it lists directories to search in for \fIdir\fP.
|
is set, it lists directories to search in for \fIdir\fP.
|
||||||
\fIdir\fP. An empty entry in the \fBCDPATH\fP entry means the current
|
\fIdir\fP.
|
||||||
directory.
|
An empty entry in the \fBCDPATH\fP entry means the current directory.
|
||||||
If a non-empty directory from \fBCDPATH\fP is used, the resulting full
|
If a non-empty directory from \fBCDPATH\fP is used, the resulting full
|
||||||
path is printed to standard output.
|
path is printed to standard output.
|
||||||
If \fIdir\fP is
|
If \fIdir\fP is
|
||||||
missing, the home directory \fB$HOME\fP is used. If \fIdir\fP is
|
missing, the home directory \fB$HOME\fP is used.
|
||||||
|
If \fIdir\fP is
|
||||||
\fB\-\fP, the previous working directory is used (see OLDPWD parameter).
|
\fB\-\fP, the previous working directory is used (see OLDPWD parameter).
|
||||||
If \fB\-L\fP option (logical path) is used or if the \fBphysical\fP option
|
If \fB\-L\fP option (logical path) is used or if the \fBphysical\fP option
|
||||||
(see \fBset\fP command below) isn't set, references to \fB..\fP in \fIdir\fP
|
(see \fBset\fP command below) isn't set, references to \fB..\fP in \fIdir\fP
|
||||||
@ -1821,9 +1860,11 @@ A command that exits with a non-zero status.
|
|||||||
\fIfirst\fP and \fIlast\fP select commands from the history.
|
\fIfirst\fP and \fIlast\fP select commands from the history.
|
||||||
Commands can be selected by
|
Commands can be selected by
|
||||||
history number, or a string specifying the most recent command starting
|
history number, or a string specifying the most recent command starting
|
||||||
with that string. The \fB\-l\fP option lists the command on stdout,
|
with that string.
|
||||||
and \fB\-n\fP inhibits the default command numbers. The \fB\-r\fP
|
The \fB\-l\fP option lists the command on stdout,
|
||||||
option reverses the order of the list. Without \fB\-l\fP, the selected
|
and \fB\-n\fP inhibits the default command numbers.
|
||||||
|
The \fB\-r\fP option reverses the order of the list.
|
||||||
|
Without \fB\-l\fP, the selected
|
||||||
commands are edited by the editor specified with the \fB\-e\fP
|
commands are edited by the editor specified with the \fB\-e\fP
|
||||||
option, or if no \fB\-e\fP is specified, the editor specified by the
|
option, or if no \fB\-e\fP is specified, the editor specified by the
|
||||||
\fBFCEDIT\fP parameter (if this parameter is not set, \fB/bin/ed\fP is used),
|
\fBFCEDIT\fP parameter (if this parameter is not set, \fB/bin/ed\fP is used),
|
||||||
@ -1833,9 +1874,10 @@ and then executed by the shell.
|
|||||||
.\"{{{ fc [-e - | -s] [-g] [old=new] [prefix]
|
.\"{{{ fc [-e - | -s] [-g] [old=new] [prefix]
|
||||||
.IP "\fBfc\fP [\fB\-e \-\fP | \fB\-s\fP] [\fB\-g\fP] [\fIold\fP\fB=\fP\fInew\fP] [\fIprefix\fP]"
|
.IP "\fBfc\fP [\fB\-e \-\fP | \fB\-s\fP] [\fB\-g\fP] [\fIold\fP\fB=\fP\fInew\fP] [\fIprefix\fP]"
|
||||||
Re-execute the selected command (the previous command by default) after
|
Re-execute the selected command (the previous command by default) after
|
||||||
performing the optional substitution of \fIold\fP with \fInew\fP. If
|
performing the optional substitution of \fIold\fP with \fInew\fP.
|
||||||
\fB\-g\fP is specified, all occurrences of \fIold\fP are replaced with
|
If \fB\-g\fP is specified, all occurrences of \fIold\fP are replaced with
|
||||||
\fInew\fP. This command is usually accessed with the predefined alias
|
\fInew\fP.
|
||||||
|
This command is usually accessed with the predefined alias
|
||||||
\fBr='fc \-e \-'\fP.
|
\fBr='fc \-e \-'\fP.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ fg [job ...]
|
.\"{{{ fg [job ...]
|
||||||
@ -1851,8 +1893,8 @@ See Job Control below for more information.
|
|||||||
(or positional parameters, if no arguments are given) and to check for legal
|
(or positional parameters, if no arguments are given) and to check for legal
|
||||||
options.
|
options.
|
||||||
\fIoptstring\fP contains the option letters that
|
\fIoptstring\fP contains the option letters that
|
||||||
\fBgetopts\fP is to recognize. If a letter is followed by a colon, the
|
\fBgetopts\fP is to recognize.
|
||||||
option is expected to have an argument.
|
If a letter is followed by a colon, the option is expected to have an argument.
|
||||||
Options that do not take arguments may be grouped in a single argument.
|
Options that do not take arguments may be grouped in a single argument.
|
||||||
If an option takes an argument and the option character is not the last
|
If an option takes an argument and the option character is not the last
|
||||||
character of the argument it is found in, the remainder of the argument
|
character of the argument it is found in, the remainder of the argument
|
||||||
@ -1934,12 +1976,13 @@ quoted, \fB((\fP \fIexpr\fP \fB))\fP is syntactic sugar for \fBlet
|
|||||||
.\"{{{ print [-nprsun | -R [-en]] [argument ...]
|
.\"{{{ print [-nprsun | -R [-en]] [argument ...]
|
||||||
.IP "\fBprint\fP [\fB\-nprsu\fP\fIn\fP | \fB\-R\fP [\fB\-en\fP]] [\fIargument ...\fP]"
|
.IP "\fBprint\fP [\fB\-nprsu\fP\fIn\fP | \fB\-R\fP [\fB\-en\fP]] [\fIargument ...\fP]"
|
||||||
\fBPrint\fP prints its arguments on the standard output, separated by
|
\fBPrint\fP prints its arguments on the standard output, separated by
|
||||||
spaces, and terminated with a newline. The \fB\-n\fP option suppresses
|
spaces, and terminated with a newline.
|
||||||
the newline. By default, certain C escapes are translated. These
|
The \fB\-n\fP option suppresses the newline.
|
||||||
include \eb, \ef, \en, \er, \et, \ev, and \e0### (# is an octal digit, of
|
By default, certain C escapes are translated.
|
||||||
which there may be 0 to 3).
|
These include \eb, \ef, \en, \er, \et, \ev, and \e0### (# is an octal digit,
|
||||||
\ec is equivalent to using the \fB\-n\fP option. \e expansion may be
|
of which there may be 0 to 3).
|
||||||
inhibited with the \fB\-r\fP option.
|
\ec is equivalent to using the \fB\-n\fP option.
|
||||||
|
\e expansion may be inhibited with the \fB\-r\fP option.
|
||||||
The \fB\-s\fP option prints to the history file instead of standard output,
|
The \fB\-s\fP option prints to the history file instead of standard output,
|
||||||
the \fB\-u\fP option prints to file descriptor \fIn\fP (\fIn\fP
|
the \fB\-u\fP option prints to file descriptor \fIn\fP (\fIn\fP
|
||||||
defaults to 1 if omitted), and the \fB\-p\fP option prints to the co-process
|
defaults to 1 if omitted), and the \fB\-p\fP option prints to the co-process
|
||||||
@ -1985,7 +2028,8 @@ If the \fB\-s\fP option is used, input is saved to the history file.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ readonly [-p] [parameter[=value] ...]
|
.\"{{{ readonly [-p] [parameter[=value] ...]
|
||||||
.IP "\fBreadonly\fP [\fB\-p\fP] [\fIparameter\fP[\fB=\fP\fIvalue\fP]] ..."
|
.IP "\fBreadonly\fP [\fB\-p\fP] [\fIparameter\fP[\fB=\fP\fIvalue\fP]] ..."
|
||||||
Sets the readonly attribute of the named parameters. If values are given,
|
Sets the readonly attribute of the named parameters.
|
||||||
|
If values are given,
|
||||||
parameters are set to them before setting the attribute.
|
parameters are set to them before setting the attribute.
|
||||||
Once a parameter is made readonly, it cannot be unset and its value cannot
|
Once a parameter is made readonly, it cannot be unset and its value cannot
|
||||||
be changed.
|
be changed.
|
||||||
@ -2072,12 +2116,12 @@ T}
|
|||||||
\-p privileged T{
|
\-p privileged T{
|
||||||
Set automatically if, when the shell starts, the read uid or gid does not
|
Set automatically if, when the shell starts, the read uid or gid does not
|
||||||
match the effective uid or gid, respectively.
|
match the effective uid or gid, respectively.
|
||||||
See Shell Startup above for a description of what this
|
See Shell Startup above for a description of what this means.
|
||||||
means.
|
|
||||||
T}
|
T}
|
||||||
-r restricted T{
|
-r restricted T{
|
||||||
Enable restricted mode \(em this option can only be used when the shell is
|
Enable restricted mode \(em this option can only be used when the shell is
|
||||||
invoked. See Shell Startup above for a description of what this
|
invoked.
|
||||||
|
See Shell Startup above for a description of what this
|
||||||
means.
|
means.
|
||||||
T}
|
T}
|
||||||
\-s stdin T{
|
\-s stdin T{
|
||||||
@ -2143,13 +2187,15 @@ Causes the \fBcd\fP and \fBpwd\fP commands to use `physical'
|
|||||||
(\fIi.e.\fP, the filesystem's) \fB..\fP directories instead of `logical'
|
(\fIi.e.\fP, the filesystem's) \fB..\fP directories instead of `logical'
|
||||||
directories (\fIi.e.\fP, the shell handles \fB..\fP, which allows the user
|
directories (\fIi.e.\fP, the shell handles \fB..\fP, which allows the user
|
||||||
to be obliveous of symlink links to directories).
|
to be obliveous of symlink links to directories).
|
||||||
Clear by default. Note that setting
|
Clear by default.
|
||||||
|
Note that setting
|
||||||
this option does not effect the current value of the \fBPWD\fP parameter;
|
this option does not effect the current value of the \fBPWD\fP parameter;
|
||||||
only the \fBcd\fP command changes \fBPWD\fP.
|
only the \fBcd\fP command changes \fBPWD\fP.
|
||||||
See the \fBcd\fP and \fBpwd\fP commands above for more details.
|
See the \fBcd\fP and \fBpwd\fP commands above for more details.
|
||||||
T}
|
T}
|
||||||
posix T{
|
posix T{
|
||||||
Enable posix mode. See POSIX Mode above.
|
Enable posix mode.
|
||||||
|
See POSIX Mode above.
|
||||||
T}
|
T}
|
||||||
vi T{
|
vi T{
|
||||||
Enable vi-like command line editing (interactive shells only).
|
Enable vi-like command line editing (interactive shells only).
|
||||||
@ -2174,8 +2220,8 @@ tab (^I) is entered in insert mode. This is the default.
|
|||||||
T}
|
T}
|
||||||
.TE
|
.TE
|
||||||
.sp
|
.sp
|
||||||
These options can also be used upon invocation of the shell. The current
|
These options can also be used upon invocation of the shell.
|
||||||
set of options (with single letter names) can be found in the
|
The current set of options (with single letter names) can be found in the
|
||||||
parameter \fB\-\fP.
|
parameter \fB\-\fP.
|
||||||
\fBset -o\fP with no option name will list all the options and whether each
|
\fBset -o\fP with no option name will list all the options and whether each
|
||||||
is on or off; \fBset +o\fP will print the long names of all options that
|
is on or off; \fBset +o\fP will print the long names of all options that
|
||||||
@ -2208,7 +2254,8 @@ The following basic expressions are available:
|
|||||||
.TS
|
.TS
|
||||||
afB ltw(3.2i).
|
afB ltw(3.2i).
|
||||||
\fIstr\fP T{
|
\fIstr\fP T{
|
||||||
\fIstr\fP has non-zero length. Note that there is the potential
|
\fIstr\fP has non-zero length.
|
||||||
|
Note that there is the potential
|
||||||
for problems if \fIstr\fP turns out to be an operator (\fIe.g.\fP, \fB-r\fP)
|
for problems if \fIstr\fP turns out to be an operator (\fIe.g.\fP, \fB-r\fP)
|
||||||
- it is generally better to use a test like
|
- it is generally better to use a test like
|
||||||
.ce
|
.ce
|
||||||
@ -2372,7 +2419,8 @@ operator, including an unstripped \fB!\fP).
|
|||||||
\fBNote:\fP A common mistake is to use \fBif [ $foo = bar ]\fP which
|
\fBNote:\fP A common mistake is to use \fBif [ $foo = bar ]\fP which
|
||||||
fails if parameter \fBfoo\fP is null or unset, if it has embedded spaces
|
fails if parameter \fBfoo\fP is null or unset, if it has embedded spaces
|
||||||
(\fIi.e.\fP, \fBIFS\fP characters), or if it is a unary operator like \fB!\fP or
|
(\fIi.e.\fP, \fBIFS\fP characters), or if it is a unary operator like \fB!\fP or
|
||||||
\fB\-n\fP. Use tests like \fBif [ "X$foo" = Xbar ]\fP instead.
|
\fB\-n\fP.
|
||||||
|
Use tests like \fBif [ "X$foo" = Xbar ]\fP instead.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ time [-p] [pipeline]
|
.\"{{{ time [-p] [pipeline]
|
||||||
.IP "\fBtime\fP [\fB-p\fP] [ \fIpipeline\fP ]"
|
.IP "\fBtime\fP [\fB-p\fP] [ \fIpipeline\fP ]"
|
||||||
@ -2531,14 +2579,16 @@ Upper case attribute: all lower case characters in values are converted to
|
|||||||
upper case.
|
upper case.
|
||||||
(In the original Korn shell, this parameter meant `unsigned integer' when used
|
(In the original Korn shell, this parameter meant `unsigned integer' when used
|
||||||
with the \fB\-i\fP option, which meant upper case letters would never be used
|
with the \fB\-i\fP option, which meant upper case letters would never be used
|
||||||
for bases greater than 10. See the \fB\-U\fP option).
|
for bases greater than 10.
|
||||||
|
See the \fB\-U\fP option).
|
||||||
.sp
|
.sp
|
||||||
For functions, \fB\-u\fP is the undefined attribute. See Functions above
|
For functions, \fB\-u\fP is the undefined attribute.
|
||||||
for the implications of this.
|
See Functions above for the implications of this.
|
||||||
T}
|
T}
|
||||||
\-x T{
|
\-x T{
|
||||||
Export attribute: parameters (or functions) are placed in the environment of
|
Export attribute: parameters (or functions) are placed in the environment of
|
||||||
any executed commands. Exported functions are not implemented yet.
|
any executed commands.
|
||||||
|
Exported functions are not implemented yet.
|
||||||
T}
|
T}
|
||||||
.TE
|
.TE
|
||||||
.\"}}}
|
.\"}}}
|
||||||
@ -2768,7 +2818,8 @@ the job has neither stopped or exited (note that running does not
|
|||||||
necessarily mean consuming CPU time \(em the process could be blocked waiting
|
necessarily mean consuming CPU time \(em the process could be blocked waiting
|
||||||
for some event).
|
for some event).
|
||||||
.IP "\fBDone\fP [\fB(\fP\fInumber\fP\fB)\fP]"
|
.IP "\fBDone\fP [\fB(\fP\fInumber\fP\fB)\fP]"
|
||||||
the job exited. \fInumber\fP is the exit status of the job, which is
|
the job exited.
|
||||||
|
\fInumber\fP is the exit status of the job, which is
|
||||||
omitted if the status is zero.
|
omitted if the status is zero.
|
||||||
.IP "\fBStopped\fP [\fB(\fP\fIsignal\fP\fB)\fP]"
|
.IP "\fBStopped\fP [\fB(\fP\fIsignal\fP\fB)\fP]"
|
||||||
the job was stopped by the indicated \fIsignal\fP (if no signal is given,
|
the job was stopped by the indicated \fIsignal\fP (if no signal is given,
|
||||||
@ -2823,11 +2874,13 @@ The line is scrolled horizontally as necessary.
|
|||||||
.\"{{{ Emacs Editing Mode
|
.\"{{{ Emacs Editing Mode
|
||||||
.SS "Emacs Editing Mode"
|
.SS "Emacs Editing Mode"
|
||||||
When the \fBemacs\fP option is set, interactive input line editing is
|
When the \fBemacs\fP option is set, interactive input line editing is
|
||||||
enabled. \fBWarning\fP: This mode is slightly different from the emacs
|
enabled.
|
||||||
|
\fBWarning\fP: This mode is slightly different from the emacs
|
||||||
mode in the original Korn shell and the 8th bit is stripped in emacs mode.
|
mode in the original Korn shell and the 8th bit is stripped in emacs mode.
|
||||||
In this mode various editing commands (typically bound to one or more
|
In this mode various editing commands (typically bound to one or more
|
||||||
control characters) cause immediate actions without waiting for a
|
control characters) cause immediate actions without waiting for a
|
||||||
new-line. Several editing commands are bound to particular control
|
new-line.
|
||||||
|
Several editing commands are bound to particular control
|
||||||
characters when the shell is invoked; these bindings can be changed
|
characters when the shell is invoked; these bindings can be changed
|
||||||
using the following commands:
|
using the following commands:
|
||||||
.\"{{{ bind
|
.\"{{{ bind
|
||||||
@ -2839,12 +2892,15 @@ The current bindings are listed.
|
|||||||
The specified editing command is bound to the given \fBstring\fP, which
|
The specified editing command is bound to the given \fBstring\fP, which
|
||||||
should consist of a control character (which may be written using caret
|
should consist of a control character (which may be written using caret
|
||||||
notation \fB^\fP\fIX\fP), optionally preceded by one of the two prefix
|
notation \fB^\fP\fIX\fP), optionally preceded by one of the two prefix
|
||||||
characters. Future input of the \fIstring\fP will cause the editing
|
characters.
|
||||||
command to be immediately invoked. Note that although only two prefix
|
Future input of the \fIstring\fP will cause the editing
|
||||||
|
command to be immediately invoked.
|
||||||
|
Note that although only two prefix
|
||||||
characters (usually ESC and ^X) are supported, some multi-character
|
characters (usually ESC and ^X) are supported, some multi-character
|
||||||
sequences can be supported. The following binds the arrow keys on
|
sequences can be supported.
|
||||||
an ANSI terminal, or xterm (these are in the default bindings). Of course
|
The following binds the arrow keys on
|
||||||
some escape sequences won't work out quite this nicely:
|
an ANSI terminal, or xterm (these are in the default bindings).
|
||||||
|
Of course some escape sequences won't work out quite this nicely:
|
||||||
.sp
|
.sp
|
||||||
.RS
|
.RS
|
||||||
\fBbind '^[['=prefix\-2
|
\fBbind '^[['=prefix\-2
|
||||||
@ -2878,10 +2934,12 @@ A count prefix for a command is entered using the sequence
|
|||||||
\fB^[\fP\fIn\fP, where \fIn\fP is a sequence of 1 or more digits;
|
\fB^[\fP\fIn\fP, where \fIn\fP is a sequence of 1 or more digits;
|
||||||
unless otherwise specified, if a count is omitted, it defaults to 1.
|
unless otherwise specified, if a count is omitted, it defaults to 1.
|
||||||
Note that editing command names are
|
Note that editing command names are
|
||||||
used only with the \fBbind\fP command. Furthermore, many editing
|
used only with the \fBbind\fP command.
|
||||||
commands are useful only on terminals with a visible cursor. The
|
Furthermore, many editing
|
||||||
default bindings were chosen to resemble corresponding EMACS key
|
commands are useful only on terminals with a visible cursor.
|
||||||
bindings. The users tty characters (\fIe.g.\fP, ERASE) are bound to
|
The default bindings were chosen to resemble corresponding EMACS key
|
||||||
|
bindings.
|
||||||
|
The users tty characters (\fIe.g.\fP, ERASE) are bound to
|
||||||
reasonable substitutes and override the default bindings.
|
reasonable substitutes and override the default bindings.
|
||||||
.\"{{{ abort ^G
|
.\"{{{ abort ^G
|
||||||
.IP "\fBabort ^G\fP"
|
.IP "\fBabort ^G\fP"
|
||||||
@ -2890,8 +2948,8 @@ order to abort the search.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ auto-insert n
|
.\"{{{ auto-insert n
|
||||||
.IP "\fBauto-insert\fP \fIn\fP"
|
.IP "\fBauto-insert\fP \fIn\fP"
|
||||||
Simply causes the character to appear as literal input. Most ordinary
|
Simply causes the character to appear as literal input.
|
||||||
characters are bound to this.
|
Most ordinary characters are bound to this.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ backward-char n ^B
|
.\"{{{ backward-char n ^B
|
||||||
.IP "\fBbackward-char\fP \fIn\fP \fB^B\fP"
|
.IP "\fBbackward-char\fP \fIn\fP \fB^B\fP"
|
||||||
@ -2925,10 +2983,11 @@ are removed and the cursor is placed at the beginning of the line.
|
|||||||
.IP "\fBcomplete ^[^[\fP"
|
.IP "\fBcomplete ^[^[\fP"
|
||||||
.IP "\fBcomplete ^I\fP"
|
.IP "\fBcomplete ^I\fP"
|
||||||
Automatically completes as much as is unique of the command name
|
Automatically completes as much as is unique of the command name
|
||||||
or the file name containing the cursor. If the entire remaining command
|
or the file name containing the cursor.
|
||||||
|
If the entire remaining command
|
||||||
or file name is unique a space is printed after its completion, unless
|
or file name is unique a space is printed after its completion, unless
|
||||||
it is a directory name in which case \fB/\fP is appended. If there is
|
it is a directory name in which case \fB/\fP is appended.
|
||||||
no command or file name with the current partial word as its
|
If there is no command or file name with the current partial word as its
|
||||||
prefix, a bell character is output (usually causing a audio beep).
|
prefix, a bell character is output (usually causing a audio beep).
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ complete-command ^X^[
|
.\"{{{ complete-command ^X^[
|
||||||
@ -2965,7 +3024,8 @@ Deletes characters after the cursor up to the end of \fIn\fP words.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ down-history n ^N
|
.\"{{{ down-history n ^N
|
||||||
.IP "\fBdown-history\fP \fIn\fP \fB^N\fP"
|
.IP "\fBdown-history\fP \fIn\fP \fB^N\fP"
|
||||||
Scrolls the history buffer forward \fIn\fP lines (later). Each input line
|
Scrolls the history buffer forward \fIn\fP lines (later).
|
||||||
|
Each input line
|
||||||
originally starts just after the last entry in the history buffer, so
|
originally starts just after the last entry in the history buffer, so
|
||||||
\fBdown-history\fP is not useful until either \fBsearch-history\fP or
|
\fBdown-history\fP is not useful until either \fBsearch-history\fP or
|
||||||
\fBup-history\fP has been performed.
|
\fBup-history\fP has been performed.
|
||||||
@ -3046,19 +3106,20 @@ can complete the partial word containing the cursor.
|
|||||||
.\"{{{ list-file ^X^Y
|
.\"{{{ list-file ^X^Y
|
||||||
.IP "\fBlist-file ^X^Y\fP"
|
.IP "\fBlist-file ^X^Y\fP"
|
||||||
Prints a sorted, columnated list of file names (if any) that can
|
Prints a sorted, columnated list of file names (if any) that can
|
||||||
complete the partial word containing the cursor. File type indicators
|
complete the partial word containing the cursor.
|
||||||
|
File type indicators
|
||||||
are appended as described under \fBlist\fP above.
|
are appended as described under \fBlist\fP above.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ newline ^J and ^M
|
.\"{{{ newline ^J and ^M
|
||||||
.IP "\fBnewline ^J\fP, \fB^M\fP"
|
.IP "\fBnewline ^J\fP, \fB^M\fP"
|
||||||
Causes the current input line to be processed by the shell. The
|
Causes the current input line to be processed by the shell.
|
||||||
current cursor position may be anywhere on the line.
|
The current cursor position may be anywhere on the line.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ newline-and-next ^O
|
.\"{{{ newline-and-next ^O
|
||||||
.IP "\fBnewline-and-next ^O\fP"
|
.IP "\fBnewline-and-next ^O\fP"
|
||||||
Causes the current input line to be processed by the shell, and
|
Causes the current input line to be processed by the shell, and
|
||||||
the next line from history becomes the current line. This is
|
the next line from history becomes the current line.
|
||||||
only useful after an up-history or search-history.
|
This is only useful after an up-history or search-history.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ no-op QUIT
|
.\"{{{ no-op QUIT
|
||||||
.IP "\fBno-op QUIT\fP"
|
.IP "\fBno-op QUIT\fP"
|
||||||
@ -3098,12 +3159,15 @@ next character typed.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ search-history ^R
|
.\"{{{ search-history ^R
|
||||||
.IP "\fBsearch-history ^R\fP"
|
.IP "\fBsearch-history ^R\fP"
|
||||||
Enter incremental search mode. The internal history list is searched
|
Enter incremental search mode.
|
||||||
backwards for commands matching the input. An initial \fB^\fP in the
|
The internal history list is searched
|
||||||
search string anchors the search. The abort key will leave search mode.
|
backwards for commands matching the input.
|
||||||
Other commands will be executed after leaving search mode. Successive
|
An initial \fB^\fP in the search string anchors the search.
|
||||||
\fBsearch-history\fP commands continue searching backward to the next
|
The abort key will leave search mode.
|
||||||
previous occurrence of the pattern. The history buffer retains only a
|
Other commands will be executed after leaving search mode.
|
||||||
|
Successive \fBsearch-history\fP commands continue searching backward to
|
||||||
|
the next previous occurrence of the pattern.
|
||||||
|
The history buffer retains only a
|
||||||
finite number of lines; the oldest are discarded as necessary.
|
finite number of lines; the oldest are discarded as necessary.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ set-mark-command ^[<space>
|
.\"{{{ set-mark-command ^[<space>
|
||||||
@ -3114,8 +3178,8 @@ Set the mark at the cursor position.
|
|||||||
.IP "\fBstuff\fP"
|
.IP "\fBstuff\fP"
|
||||||
On systems supporting it, pushes the bound character back onto the
|
On systems supporting it, pushes the bound character back onto the
|
||||||
terminal input where it may receive special processing by the terminal
|
terminal input where it may receive special processing by the terminal
|
||||||
handler. This is useful for the BRL \fB^T\fP mini-systat feature, for
|
handler.
|
||||||
example.
|
This is useful for the BRL \fB^T\fP mini-systat feature, for example.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ stuff-reset
|
.\"{{{ stuff-reset
|
||||||
.IP "\fBstuff-reset\fP"
|
.IP "\fBstuff-reset\fP"
|
||||||
@ -3138,7 +3202,8 @@ Uppercases the next \fIn\fP words.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ version ^V
|
.\"{{{ version ^V
|
||||||
.IP "\fBversion ^V\fP"
|
.IP "\fBversion ^V\fP"
|
||||||
Display the version of ksh. The current edit buffer is restored as soon
|
Display the version of ksh.
|
||||||
|
The current edit buffer is restored as soon
|
||||||
as any key is pressed (the key is then processed, unless it is a space).
|
as any key is pressed (the key is then processed, unless it is a space).
|
||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ yank ^Y
|
.\"{{{ yank ^Y
|
||||||
@ -3414,8 +3479,8 @@ the current line is deleted.
|
|||||||
replace the next \fIn\fP characters with the character \fIc\fP.
|
replace the next \fIn\fP characters with the character \fIc\fP.
|
||||||
.IP "\fIn\fP\fBR\fP"
|
.IP "\fIn\fP\fBR\fP"
|
||||||
replace: enter insert mode but overwrite existing characters instead of
|
replace: enter insert mode but overwrite existing characters instead of
|
||||||
inserting before existing characters. The replacement is repeated \fIn\fP
|
inserting before existing characters.
|
||||||
times.
|
The replacement is repeated \fIn\fP times.
|
||||||
.IP "\fIn\fP\fB~\fP"
|
.IP "\fIn\fP\fB~\fP"
|
||||||
change the case of the next \fIn\fP characters.
|
change the case of the next \fIn\fP characters.
|
||||||
.IP "\fIn\fP\fBy\fP\fImove-cmd\fP"
|
.IP "\fIn\fP\fBy\fP\fImove-cmd\fP"
|
||||||
@ -3473,14 +3538,17 @@ be deleted and a new prompt to be printed.
|
|||||||
.\"}}}
|
.\"}}}
|
||||||
.\"{{{ Bugs
|
.\"{{{ Bugs
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Any bugs in pdksh should be reported to pdksh@cs.mun.ca. Please
|
Any bugs in pdksh should be reported to pdksh@cs.mun.ca.
|
||||||
|
Please
|
||||||
include the version of pdksh (echo $KSH_VERSION shows it), the machine,
|
include the version of pdksh (echo $KSH_VERSION shows it), the machine,
|
||||||
operating system and compiler you are using and a description of how to
|
operating system and compiler you are using and a description of how to
|
||||||
repeat the bug (a small shell script that demonstrates the bug is
|
repeat the bug (a small shell script that demonstrates the bug is
|
||||||
best). The following, if relevant (if you are not sure, include them),
|
best).
|
||||||
|
The following, if relevant (if you are not sure, include them),
|
||||||
can also helpful: options you are using (both options.h options and set
|
can also helpful: options you are using (both options.h options and set
|
||||||
\-o options) and a copy of your config.h (the file generated by the
|
\-o options) and a copy of your config.h (the file generated by the
|
||||||
configure script). New versions of pdksh can be obtained from
|
configure script).
|
||||||
|
New versions of pdksh can be obtained from
|
||||||
ftp://ftp.cs.mun.ca/pub/pdksh/.
|
ftp://ftp.cs.mun.ca/pub/pdksh/.
|
||||||
.PP
|
.PP
|
||||||
BTW, the most frequently reported bug is
|
BTW, the most frequently reported bug is
|
||||||
@ -3500,11 +3568,12 @@ of the public domain korn shell.
|
|||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
This shell is based on the public domain 7th edition Bourne shell clone by
|
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,
|
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
|
Ron Natalie, Arnold Robbins, Lou Salkind and others.
|
||||||
|
The first release
|
||||||
of pdksh was created by Eric Gisin, and it was subsequently maintained by
|
of pdksh was created by Eric Gisin, and it was subsequently maintained by
|
||||||
John R.\& MacMillan (chance!john@sq.sq.com), and
|
John R.\& MacMillan (chance!john@sq.sq.com), and
|
||||||
Simon J.\& Gerraty (sjg@zen.void.oz.au). The current maintainer is
|
Simon J.\& Gerraty (sjg@zen.void.oz.au).
|
||||||
Michael Rendell (michael@cs.mun.ca).
|
The current maintainer is Michael Rendell (michael@cs.mun.ca).
|
||||||
The CONTRIBUTORS file in the source distribution contains a more complete
|
The CONTRIBUTORS file in the source distribution contains a more complete
|
||||||
list of people and their part in the shell's development.
|
list of people and their part in the shell's development.
|
||||||
.\"}}}
|
.\"}}}
|
||||||
|
Loading…
Reference in New Issue
Block a user