7106955 move ksh93 from ON to userland
authorEdwin Beasant <Edwin.Beasant@oracle.com>
Mon, 23 Apr 2012 08:30:27 -0700
changeset 789 5f074ca23733
parent 788 ab1a623335b6
child 790 dcdb1da2980b
7106955 move ksh93 from ON to userland
components/ksh93/Makefile
components/ksh93/developer-astdev.p5m
components/ksh93/files/alias.1
components/ksh93/files/alias.1.ja_JP.UTF-8
components/ksh93/files/dirs.1
components/ksh93/files/dirs.1.ja_JP.UTF-8
components/ksh93/files/jsh.1
components/ksh93/files/jsh.1.ja_JP.UTF-8
components/ksh93/files/ksh.1
components/ksh93/files/ksh.1.ja_JP.UTF-8
components/ksh93/files/ksh.1.zh_CN.UTF-8
components/ksh93/files/ksh93.1
components/ksh93/files/ksh93.1.ja_JP.UTF-8
components/ksh93/files/ksh93.1.zh_CN.UTF-8
components/ksh93/files/msgcc.1
components/ksh93/files/msgcpp.1
components/ksh93/files/msgcvt.1
components/ksh93/files/msggen.1
components/ksh93/files/msgget.1
components/ksh93/files/popd.1
components/ksh93/files/popd.1.ja_JP.UTF-8
components/ksh93/files/pushd.1
components/ksh93/files/pushd.1.ja_JP.UTF-8
components/ksh93/files/rksh.1
components/ksh93/files/rksh.1.ja_JP.UTF-8
components/ksh93/files/rksh.1.zh_CN.UTF-8
components/ksh93/files/sh.1
components/ksh93/files/sh.1.ja_JP.UTF-8
components/ksh93/files/shcomp.1
components/ksh93/files/shcomp.1.ja_JP.UTF-8
components/ksh93/files/shcomp.1.zh_CN.UTF-8
components/ksh93/ksh.kshrc
components/ksh93/ksh93.license
components/ksh93/ksh93.p5m
components/ksh93/patches/CR6919590.patch
components/ksh93/patches/CR6964621.patch
components/ksh93/patches/CR7025778.patch
components/ksh93/patches/CR7026179.patch
components/ksh93/patches/CR7032821.patch
components/ksh93/patches/CR7036535.patch
components/ksh93/patches/CR7057565.patch
components/ksh93/patches/CR7065478.patch
components/ksh93/patches/CR7065900.patch
components/ksh93/patches/CR7071431.patch
components/ksh93/patches/CR7105086.patch
components/ksh93/patches/CR7110983.patch
components/ksh93/patches/CRXXX_Error_Catalog.patch
components/ksh93/patches/build_cflags.patch
components/ksh93/patches/disable_dll.patch
components/ksh93/patches/multi_lang_arith.patch
components/ksh93/patches/package-pax-suid.patch
components/ksh93/patches/path_utmp.patch
components/ksh93/patches/solaris_alias.patch
components/ksh93/source-demo-ksh.p5m
make-rules/attpackagemake.mk
make-rules/prep.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/Makefile	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,119 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+include ../../make-rules/shared-macros.mk
+
+COMPONENT_PROJECT_URL= http://www2.research.att.com/sw/download/
+
+# These are required if retrieving packages from the AT&T website.
+ATT_USERNAME= "I accept www.opensource.org/licenses/cpl"
+ATT_PASSWD= "."
+
+# This flag controls the prep.mk behaviour to patch each archive individually
+PATCH_EACH_ARCHIVE = 1
+
+COMPONENT_NAME = INIT
+COMPONENT_VERSION = 2011-02-08
+COMPONENT_SRC = $(COMPONENT_NAME).$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE =	$(COMPONENT_NAME).$(COMPONENT_VERSION).tgz
+COMPONENT_ARCHIVE_HASH = sha1:69f909e437376c1ebcf0b1298794ccfc93504faf
+COMPONENT_ARCHIVE_URL = http://www2.research.att.com/~gsf/download/tgz/$(COMPONENT_ARCHIVE) 
+COMPONENT_PATCHES = 
+
+# Patch only required if building ksh93 only and not ast-base
+# package-pax-suid.patch
+
+# The ksh93 tarballs don't unpack cleanly into their own directories.
+UNPACK_ARGS= -r $(COMPONENT_SRC)
+
+NUM_EXTRA_ARCHIVES= 1
+COMPONENT_NAME_1= ast-base
+COMPONENT_VERSION_1= 2011-02-08
+COMPONENT_SRC_1= $(COMPONENT_NAME_1).$(COMPONENT_VERSION_1)
+COMPONENT_ARCHIVE_1= $(COMPONENT_NAME_1).$(COMPONENT_VERSION_1).tgz
+COMPONENT_ARCHIVE_HASH_1= sha1:1c9af1389a54d5c94e63f26aad9578f584ab573b
+COMPONENT_ARCHIVE_URL_1= http://www2.research.att.com/~gsf/download/tgz/$(COMPONENT_ARCHIVE_1)
+COMPONENT_PATCHES_1= solaris_alias.patch build_cflags.patch path_utmp.patch \
+					 CR6919590.patch CR7032821.patch CR7071431.patch \
+					 CR6964621.patch CR7036535.patch \
+					 CRXXX_Error_Catalog.patch CR7025778.patch \
+					 CR7065478.patch CR7026179.patch \
+					 CR7065900.patch CR7110983.patch \
+					 CR7105086.patch disable_dll.patch \
+					 CR7057565.patch
+
+# Make the unpack of the second archive relocate to a sensible place
+UNPACK_ARGS_1= -r $(COMPONENT_SRC_1)
+
+# We override LD_B_DIRECT because -B direct has unfortunate consequences for the
+# interposition used by the Safe/Fast IO library (i.e. it becomes neither safe
+# nor fast, and causes the build to deadly embrace). 
+LD_B_DIRECT=
+
+# Disable nmake's probing of runpaths
+CC.RUNPATH=
+CC.LD.RUNPATH=
+CC.LD.ORIGIN=
+CC.DLL.ORIGIN=
+
+# Prevent nmake from taking over the entire machine
+NPROCS=1
+
+# Set the built to build all targets, install all of ast-base, and test ksh93.
+COMPONENT_BUILD_TARGETS += 
+COMPONENT_INSTALL_PACKAGES += ast-base
+COMPONENT_TEST_TARGETS += ksh93
+
+# Unpack the ast-base tarball and copy it into the INIT tree,
+# mark it as un-patched 
+COMPONENT_POST_UNPACK_ACTION_1= \
+	$(RM) $(COMPONENT_SRC)/*patched_1; \
+    $(CP) -r $(COMPONENT_SRC_1)/* $(COMPONENT_SRC)
+
+# Add the two tarball paths to the paths to be cleaned
+CLEAN_PATHS+= build $(COMPONENT_NAME_1).$(COMPONENT_VERSION_1) \
+              $(COMPONENT_NAME).$(COMPONENT_VERSION)
+
+# ksh.kshrc needs to be installed with the ksh package
+COMPONENT_POST_INSTALL_ACTION= \
+	@$(MKDIR) -p $(PROTO_DIR)/etc/; \
+	$(CP) ksh.kshrc $(PROTO_DIR)/etc/ 
+
+# Packaging information
+IPS_PKG_NAME= ksh93
+IPS_COMPONENT_VERSION= 20110208
+
+# common targets
+build:		$(BUILD_32_and_64)
+	
+install:	$(INSTALL_32_and_64)	
+		
+test:		$(TEST_32_and_64)
+
+BUILD_PKG_DEPENDENCIES= $(BUILD_TOOLS)
+
+PKG_PROTO_DIRS +=   $(COMPONENT_DIR)/files
+
+include ../../make-rules/prep.mk
+include ../../make-rules/attpackagemake.mk
+include ../../make-rules/ips.mk
+include ../../make-rules/depend.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/developer-astdev.p5m	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,60 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+#
+
+# The man pages are all at the top of a "files" directory; setting the hash to
+# # point to the files therein.
+<transform file path=usr/share/man/man.+/(.+)$ -> set action.hash %<\1> >
+# Bypassing the mangler for these files because they are pre-Solarified.
+<transform file path=usr/share/man/.+$ -> add mangler.bypass true >
+set name=pkg.fmri \
+    value=pkg:/developer/astdev@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.description \
+    value="AT&T AST development utilities for extracting messages for localisation"
+set name=pkg.summary value="AT&T AST development utilities"
+set name=info.classification \
+    value="org.opensolaris.category.2008:System/Software Management"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream \
+    value="AT&T Software Technology (AST) OpenSource Software Collection"
+set name=info.upstream-url value=$(COMPONENT_ARCHIVE_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2012/002
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+dir path=usr group=sys
+dir path=usr/ast group=sys
+dir path=usr/ast/bin
+dir path=usr/share/man/man1
+file $(MACH64)/bin/msgcc path=usr/ast/bin/msgcc mode=0555
+file $(MACH64)/bin/msgcpp path=usr/ast/bin/msgcpp mode=0555
+file $(MACH64)/bin/msgcvt path=usr/ast/bin/msgcvt mode=0555
+file $(MACH64)/bin/msggen path=usr/ast/bin/msggen mode=0555
+file $(MACH64)/bin/msgget path=usr/ast/bin/msgget mode=0555
+file path=usr/share/man/man1/msgcc.1
+file path=usr/share/man/man1/msgcpp.1
+file path=usr/share/man/man1/msgcvt.1
+file path=usr/share/man/man1/msggen.1
+file path=usr/share/man/man1/msgget.1
+legacy pkg=SUNWastdev desc="AT&T AST development utilities" \
+    name="AT&T AST development utilities"
+license ksh93.license license=CPL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/alias.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,394 @@
+'\" te
+.\" Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\"  Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at  http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.  This notice shall appear on any product containing this material. 
+.TH alias 1 "8 Apr 2008" "SunOS 5.11" "User Commands"
+.SH NAME
+alias, unalias \- create or remove a pseudonym or shorthand for a command or series of commands
+.SH SYNOPSIS
+.LP
+.nf
+\fB/usr/bin/alias\fR [\fIalias-name\fR[= \fIstring\fR...]]
+.fi
+
+.LP
+.nf
+\fB/usr/bin/unalias\fR \fIalias-name\fR...
+.fi
+
+.LP
+.nf
+\fB/usr/bin/unalias\fR \fB-a\fR
+.fi
+
+.SS "\fBcsh\fR"
+.LP
+.nf
+\fBalias\fR [\fIname\fR [\fIdef\fR]]
+.fi
+
+.LP
+.nf
+\fBunalias\fR \fIpattern\fR
+.fi
+
+.SS "\fBksh88\fR"
+.LP
+.nf
+\fBalias\fR [\fB-tx\fR] [\fIname\fR[= \fIvalue\fR]...]
+.fi
+
+.LP
+.nf
+\fBunalias\fR \fIname\fR...
+.fi
+
+.LP
+.nf
+\fBunalias\fR [\fB-a\fR]
+.fi
+
+.SS "\fBksh\fR"
+.LP
+.nf
+\fBalias\fR [\fB-ptx\fR] [\fIname\fR[= \fIvalue\fR]...]
+.fi
+
+.LP
+.nf
+\fBunalias\fR [\fB-a\fR] [\fIname\fR...]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBalias\fR and \fBunalias\fR utilities create or remove a pseudonym or shorthand term for a command or series of commands, with different functionality in the C-shell and Korn shell environments.
+.SS "\fB/usr/bin/alias\fR"
+.sp
+.LP
+The \fBalias\fR utility creates or redefines alias definitions or writes the values of existing alias definitions to standard output. An alias definition provides a string value that replaces a command name when it is encountered.
+.sp
+.LP
+An alias definition affects the current shell execution environment and the execution environments of the subshells of the current shell. When used as specified by this document, the alias definition does not affect the parent process of the current shell nor any utility environment invoked by the shell.
+.SS "\fB/usr/bin/unalias\fR"
+.sp
+.LP
+The \fBunalias\fR utility removes the definition for each alias name specified. The aliases are removed from the current shell execution environment. The \fB-a\fR option removes all alias definitions from the current execution environment.
+.SS "\fBcsh\fR"
+.sp
+.LP
+\fBalias\fR assigns \fIdef\fR to the alias \fIname\fR. The assigned \fIdef\fR is a list of words that can contain escaped history-substitution metasyntax. \fIname\fR is not allowed to be \fBalias\fR or \fBunalias\fR. If \fIdef\fR is omitted, the alias \fIname\fR is displayed along with its current definition. If both \fIname\fR and \fIdef\fR are omitted, all aliases are displayed.
+.sp
+.LP
+Because of implementation restrictions, an alias definition must have been entered on a previous command line before it can be used.
+.sp
+.LP
+\fBunalias\fR discards aliases that match (filename substitution) \fIpattern\fR. All aliases can be removed by `\fBunalias *\fR'.
+.SS "\fBksh88\fR"
+.sp
+.LP
+\fBalias\fR with no arguments prints the list of aliases in the form \fIname=value\fR on standard output. An \fBalias\fR is defined for each name whose \fIvalue\fR is specified. A trailing space in \fIvalue\fR causes the next word to be checked for alias substitution. The \fB-t\fR flag is used to set and list tracked aliases. The value of a tracked alias is the full pathname corresponding to the specified \fIname\fR. The value becomes undefined when the value of \fBPATH\fR is reset but the aliases remained tracked. Without the \fB-t\fR flag, for each \fIname\fR in the argument list for which no \fIvalue\fR is specified, the name and value of the alias is printed. The \fB-x\fR flag is used to set or print \fIexported alias\fRes. An exported alias is defined for scripts invoked by \fIname\fR. The exit status is non-zero if a \fIname\fR is specified, but no value, and no alias has been defined for the \fIname\fR.
+.sp
+.LP
+The \fBalias\fRs specified by the list of \fIname\fRs can be removed from the \fBalias\fR list with \fBunalias\fR.
+.SS "\fBksh\fR"
+.sp
+.LP
+\fBalias\fR creates or redefines alias definitions or writes the existing alias definitions to standard output. 
+.sp
+.LP
+An alias definition provides a string value that replaces a command name when the command is read. Alias names can contain any printable character that is not special to the shell. If an alias value ends in a SPACE or TAB, the word following the command name the alias replaces is also checked to see whether it is an alias. 
+.sp
+.LP
+If no names are specified, the names and values of all aliases are written to standard output. Otherwise, for each name that is specified, and \fB=\fR\fIvalue\fR is not specified, the current value of the alias corresponding to name is written to standard output. If \fB=\fR\fIvalue\fR is specified, the alias name is created or redefined. 
+.sp
+.LP
+\fBalias\fR is built-in to the shell as a declaration command so that field splitting and pathname expansion are not performed on the arguments. Tilde expansion occurs on \fIvalue\fR. An alias definition only affects scripts read by the current shell environment. It does not affect scripts run by this shell. 
+.sp
+.LP
+\fBunalias\fR removes the definition of each named alias from the current shell execution environment, or all aliases if \fB-a\fR is specified. It does not affect any commands that have already been read and subsequently executed.
+.SH OPTIONS
+.sp
+.LP
+The following option is supported by \fBunalias\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+Removes all alias definitions from the current shell execution environment.
+.RE
+
+.SS "\fBksh88\fR"
+.sp
+.LP
+The following option is supported by \fBalias\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+Sets and lists tracked aliases.
+.RE
+
+.SS "\fBksh\fR"
+.sp
+.LP
+The following options are supported by \fBalias\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+.rt  
+Causes the output to be in the form of \fBalias\fR commands that can be used as input to the shell to recreate the current aliases.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+Specifies tracked aliases. 
+.sp
+Tracked aliases connect a command name to the command's pathname, and are reset when the \fBPATH\fR variable is unset. The tracked aliases feature is now obsolete.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+Ignored, this option is obsolete.
+.RE
+
+.sp
+.LP
+The following option is supported by \fBunalias\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+Causes all alias definitions to be removed. \fIname\fR operands are optional and ignored if specified.
+.RE
+
+.SH OPERANDS
+.sp
+.LP
+The following operands are supported:
+.SS "\fBalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fIalias-name\fR\fR
+.ad
+.RS 14n
+.rt  
+Write the alias definition to standard output.
+.RE
+
+.SS "\fBunalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fIalias-name\fR\fR
+.ad
+.RS 21n
+.rt  
+The name of an alias to be removed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIalias-name\fR\fB=\fR\fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+Assign the value of \fIstring\fR to the alias \fIalias-name\fR.
+.RE
+
+.sp
+.LP
+If no operands are specified, all alias definitions are written to standard output.
+.SH OUTPUT
+.sp
+.LP
+The format for displaying aliases (when no operands or only \fIname\fR operands are specified) is:
+.sp
+.in +2
+.nf
+"%s=%s\en" \fIname\fR, \fIvalue\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+The \fIvalue\fR string is written with appropriate quoting so that it is suitable for reinput to the shell.
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRModifying a Command's Output
+.sp
+.LP
+This example specifies that the output of the \fBls\fR utility is columnated and more annotated:
+
+.sp
+.in +2
+.nf
+example% \fBalias ls="ls \(miCF"\fR
+.fi
+.in -2
+.sp
+
+.LP
+\fBExample 2 \fRRepeating Previous Entries in the Command History File
+.sp
+.LP
+This example creates a simple "redo" command to repeat previous entries in the command history file:
+
+.sp
+.in +2
+.nf
+example% \fBalias r='fc \(mis'\fR
+.fi
+.in -2
+.sp
+
+.LP
+\fBExample 3 \fRSpecifying a Command's Output Options
+.sp
+.LP
+This example provides that the \fBdu\fR utility summarize disk output in units of 1024 bytes:
+
+.sp
+.in +2
+.nf
+example% \fBalias du=du \(mik\fR
+.fi
+.in -2
+.sp
+
+.LP
+\fBExample 4 \fRDealing with an Argument That is an Alias Name
+.sp
+.LP
+This example sets up the \fBnohup\fR utility so that it can deal with an argument that is an alias name:
+
+.sp
+.in +2
+.nf
+example% \fBalias nohup="nohup "\fR
+.fi
+.in -2
+.sp
+
+.SH ENVIRONMENT VARIABLES
+.sp
+.LP
+See \fBenviron\fR(5) for descriptions of the following environment variables that affect the execution of \fBalias\fR and \fBunalias\fR: \fBLANG\fR, \fBLC_ALL\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
+.SH EXIT STATUS
+.sp
+.LP
+The following exit values are returned:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 5n
+.rt  
+Successful completion.
+.RE
+
+.SS "\fBalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+One of the \fIalias-name\fR operands specified did not have an alias definition, or an error occurred.
+.RE
+
+.SS "\fBunalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+One of the \fIalias-name\fR operands specified did not represent a valid alias definition, or an error occurred.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.SS "\fBcsh, ksh88\fR"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitysystem/core-os
+_
+Interface StabilityCommitted
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SS "\fBksh\fR"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitysystem/core-os
+_
+Interface StabilityUncommitted
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBcsh\fR(1), \fBksh\fR(1), \fBksh88\fR(1), \fBshell_builtins\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/alias.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,396 @@
+'\" te
+.\" Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\"  Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. 
+.TH alias 1 "2008 年 4 月 8 日" "SunOS 5.11" "ユーザーコマンド"
+.SH 名前
+alias, unalias \- コマンドまたはコマンド群の別名または省略形の生成と削除
+.SH 形式
+.LP
+.nf
+\fB/usr/bin/alias\fR [\fIalias-name\fR[= \fIstring\fR...]]
+.fi
+
+.LP
+.nf
+\fB/usr/bin/unalias\fR \fIalias-name\fR...
+.fi
+
+.LP
+.nf
+\fB/usr/bin/unalias\fR \fB-a\fR
+.fi
+
+.SS "\fBcsh\fR"
+.LP
+.nf
+\fBalias\fR [\fIname\fR [\fIdef\fR]]
+.fi
+
+.LP
+.nf
+\fBunalias\fR \fIpattern\fR
+.fi
+
+.SS "\fBksh88\fR"
+.LP
+.nf
+\fBalias\fR [\fB-tx\fR] [\fIname\fR[= \fIvalue\fR]...]
+.fi
+
+.LP
+.nf
+\fBunalias\fR \fIname\fR...
+.fi
+
+.LP
+.nf
+\fBunalias\fR [\fB-a\fR]
+.fi
+
+.SS "\fBksh\fR"
+.LP
+.nf
+\fBalias\fR [\fB-ptx\fR] [\fIname\fR[= \fIvalue\fR]...]
+.fi
+
+.LP
+.nf
+\fBunalias\fR [\fB-a\fR] [\fIname\fR...]
+.fi
+
+.SH 機能説明
+.sp
+.LP
+\fBalias\fR および \fBunalias\fR ユーティリティは、コマンドまたはコマンド群の別名あるいは省略形を作成または削除します。これらのユーティリティの動作は、C シェル環境と Korn シェル環境では異なります。
+.SS "\fB/usr/bin/alias\fR"
+.sp
+.LP
+\fBalias\fR ユーティリティは、別名定義を作成または再定義するか、あるいは既存の別名定義を標準出力に書き出します。別名定義は、コマンド名を置き換える文字列を指定するものです。
+.sp
+.LP
+別名定義は、現在のシェルの実行環境、およびそのシェルの全サブシェルの実行環境に影響を及ぼします。このマニュアルに記述されているように用いれば、別名定義は現在のシェルの親プロセスにも、シェルが呼び出すユーティリティーの環境にも影響を及ぼしません。
+.SS "\fB/usr/bin/unalias\fR"
+.sp
+.LP
+\fBunalias\fR ユーティリティは、指定された別名の定義を削除します。それにより、現在のシェルの実行環境から別名が削除されます。\fB-a\fR オプションは、現在の実行環境からすべての別名定義を削除します。
+.SS "\fBcsh\fR"
+.sp
+.LP
+\fBalias\fR は別名 \fIname\fR に \fIdef\fR で指定した別名の定義を割り当てます。その割り当てられた \fIdef\fR はワードの並びで、エスケープされたヒストリ置換のメタシンタックスを含んでいてもかまいません。\fIname\fR に \fBalias\fR または \fBunalias\fR を使用することはできません。\fIdef\fR を省略すると、別名 \fIname\fR が現在の定義と共に表示されます。\fIname\fR と \fIdef\fR の両方を省略すると、現在あるすべての別名が表示されます。
+.sp
+.LP
+実装状態の制限によって、別名の定義は、それが使われる前のコマンド行で入力されていなければなりません。
+.sp
+.LP
+\fBunalias\fR は \fIpattern\fR が示すファイル名置換パターンに一致する別名を破棄します。`\fBunalias *\fR' と指定すると、すべての別名を破棄できます。
+.SS "\fBksh88\fR"
+.sp
+.LP
+引数なしの場合、このコマンドは標準出力上に \fIname=value\fR という形式の別名のリストを表示します。\fB\fR\fIvalue\fR が指定された名前に対しては別名を定義します。\fB\fR\fIvalue\fR の末尾にスペースがあると、次のワードが別名置換指定かどうかをチェックします。\fB-t\fR フラグは、検索済みの別名を設定または一覧表示します。検索済み別名の値は、指定した \fIname\fR に対応する完全パス名になります。\fBPATH\fR の値を再設定するとこの値は未定義になりますが、別名は検索済みのままです。\fB-t\fR フラグを省略すると、\fIvalue\fR が指定されていない引数リスト内の各 \fIname\fR について、別名の名前と値を表示します。\fB-x\fR フラグは、エクスポートされた別名を設定または表示します。\fI\fRエクスポートされた別名は、\fI名前\fRで起動されるスクリプト用に定義されます。\fIname\fR が指定されているが、\fIvalue\fR は指定されておらず、name に対する別名も定義されていない場合は、終了ステータスは 0 以外になります。
+.sp
+.LP
+\fBunalias\fR を指定すると \fIname\fR が示す \fBalias\fR を \fBalias\fR リストから削除できます。
+.SS "\fBksh\fR"
+.sp
+.LP
+\fBalias\fR は、別名定義を作成または再定義したり、既存の別名定義を標準出力に書き出したりします。 
+.sp
+.LP
+別名定義は、コマンド名を置き換える文字列を指定するものです。別名には、シェルに対する特殊文字を除く、任意の出力可能な文字を含めることができます。別名の末尾がスペース (SPACE) またはタブ (TAB) の場合は、別名により置き換えられるコマンド名に続く語も別名かどうかがチェックされます。 
+.sp
+.LP
+名前が指定されていない場合は、すべての別名の名前と値が標準出力に書き込まれます。名前は指定されているが \fB=\fR\fIvalue\fR が指定されていない場合は、名前に対応する別名の現在値が名前ごとに標準出力に書き込まれます。\fB=\fR\fIvalue\fR が指定されている場合は、別名が作成または再定義されます。 
+.sp
+.LP
+\fBalias\fR は宣言コマンドとしてシェルに内蔵されているため、引数に対するフィールド分割およびパス名展開は実行されません。チルド展開は \fIvalue\fR に対して行われます。別名定義が影響を与えるのは、現在のシェル環境により読み込まれたスクリプトだけです。このシェルにより実行されるスクリプトには影響しません。 
+.sp
+.LP
+\fBunalias\fR は、指定された各別名の定義を現在のシェル実行環境から削除します。\fB-a\fR が指定されている場合は、すべての別名を削除します。すでに読み込まれ、実行されているコマンドには影響を与えません。
+.SH オプション
+.sp
+.LP
+\fBunalias\fR では、次のオプションがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR \fR
+.ad
+.RS 7n
+.rt  
+現在のシェルの実行環境から、すべての別名定義を削除します。
+.RE
+
+.SS "\fBksh88\fR"
+.sp
+.LP
+\fBalias\fR では次のオプションがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR \fR
+.ad
+.RS 7n
+.rt  
+検索済みの別名を設定または一覧表示します。
+.RE
+
+.SS "\fBksh\fR"
+.sp
+.LP
+\fBalias\fR では次のオプションがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+.rt  
+出力をシェルへの入力に使用可能な \fBalias\fR コマンドの形式にして、現在の別名を再作成できるようにします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+検索済みの別名を指定します。 
+.sp
+検索済みの別名は、コマンド名をコマンドのパス名に関連付けます。これらは、\fBPATH\fR 変数の設定解除時にリセットされます。検索済み別名の機能は、廃止または互換性がなくなる可能性があります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+無視されます。このオプションは廃止されています。
+.RE
+
+.sp
+.LP
+\fBunalias\fR では次のオプションがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+すべての別名定義を削除します。\fIname\fR オペランドは省略可能であり、指定されている場合は無視されます。
+.RE
+
+.SH オペランド
+.sp
+.LP
+次のオペランドがサポートされています。
+.SS "\fBalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fIalias-name\fR \fR
+.ad
+.RS 15n
+.rt  
+別名定義を標準出力に書き出します。
+.RE
+
+.SS "\fBunalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fIalias-name\fR \fR
+.ad
+.RS 21n
+.rt  
+削除する別名を指定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIalias-name\fR\fB=\fR\fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIalias-name\fR で示す別名に、\fIstring\fR で示す文字列を割り当てます。
+.RE
+
+.sp
+.LP
+オペランドを 1 つも指定しないと、すべての別名定義が標準出力に書き込まれます。
+.SH 出力
+.sp
+.LP
+オペランドがすべて省略された場合、または \fIname\fR オペランドだけが指定された場合の、別名の表示形式は次のとおりです。
+.sp
+.in +2
+.nf
+"%s=%s\en" \fIname\fR, \fIvalue\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+文字列 \fIvalue\fR は、シェルへ再入力できるよう、適切な引用符を付加して出力されます。
+.SH 使用例
+.LP
+\fB例 1 \fRコマンドの出力を変更する
+.sp
+.LP
+\fBls\fR ユーティリティの出力を複数カラム形式の注釈付きに変更します。
+
+.sp
+.in +2
+.nf
+example% \fBalias ls="ls \(miCF"\fR
+.fi
+.in -2
+.sp
+
+.LP
+\fB例 2 \fRコマンド履歴ファイルにある直前のエントリを繰り返す
+.sp
+.LP
+次の例は、コマンドの履歴ファイルにある直前の入力を繰り返す単純な "redo" コマンドを生成します。
+
+.sp
+.in +2
+.nf
+example% \fBalias r='fc \(mis'\fR
+.fi
+.in -2
+.sp
+
+.LP
+\fB例 3 \fRコマンドの出力オプションを指定する
+.sp
+.LP
+次の例は、\fBdu\fR ユーティリティがディスク出力を 1024 バイト単位にまとめるようにします。
+
+.sp
+.in +2
+.nf
+example% \fBalias du=du \(mik\fR
+.fi
+.in -2
+.sp
+
+.LP
+\fB例 4 \fR別名である引数を処理する
+.sp
+.LP
+次の例では、別名である引数を処理できるよう、\fBnohup\fR ユーティリティーを設定します。
+
+.sp
+.in +2
+.nf
+example% \fBalias nohup="nohup "\fR
+.fi
+.in -2
+.sp
+
+.SH 環境
+.sp
+.LP
+\fBalias\fR と \fBunalias\fR の実行に影響を与える次の環境変数についての詳細は、\fBenviron\fR(5) を参照してください。\fBLANG\fR、\fBLC_ALL\fR、\fBLC_CTYPE\fR、\fBLC_MESSAGES\fR、および \fBNLSPATH\fR。
+.SH 終了ステータス
+.sp
+.LP
+次の終了値が返されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR \fR
+.ad
+.RS 6n
+.rt  
+正常終了。
+.RE
+
+.SS "\fBalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+\fIalias-name\fR オペランドで指定した名前の 1 つが別名定義を持っていなかったか、もしくはエラーが発生しました。
+.RE
+
+.SS "\fBunalias\fR"
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+\fIalias-name\fR オペランドで指定した名前の 1 つが正しい別名定義を表していなかったか、もしくはエラーが発生しました。
+.RE
+
+.SH 属性
+.sp
+.LP
+属性についての詳細は、\fBattributes\fR(5) を参照してください。
+.SS "\fBcsh, ksh88\fR"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性タイプ属性値
+_
+使用条件system/core-os
+_
+インタフェースの安定性確実
+_
+標準T{
+\fBstandards\fR(5) を参照してください。
+T}
+.TE
+
+.SS "\fBksh\fR"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性タイプ属性値
+_
+使用条件system/core-os
+_
+インタフェースの安定性不確実
+.TE
+
+.SH 関連項目
+.sp
+.LP
+\fBcsh\fR(1), \fBksh\fR(1), \fBksh88\fR(1), \fBshell_builtins\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/dirs.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/cd.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/dirs.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/cd.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/jsh.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/sh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/jsh.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/sh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/ksh.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,6235 @@
+'\" te
+.\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+.TH ksh 1 "4 Jan 2012" "SunOS 5.11" "User Commands"
+.SH NAME
+ksh, ksh93, rksh \- Korn Shell, a standard and restricted command and programming language
+.SH SYNOPSIS
+.LP
+.nf
+\fBksh\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [ \fB\(+-o\fR \fIoption\fR] ...
+       [-] [\fIarg\fR ...]
+.fi
+
+.LP
+.nf
+\fBrksh\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [\fB\(+-o\fR \fIoption\fR] ...
+       [-] [\fIarg\fR ...]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBksh\fR is a command and programming language that executes commands read from a terminal or a file. \fBrksh\fR is a restricted version of the command interpreter \fBksh\fR. \fBrksh\fR is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell.
+.sp
+.LP
+See \fBInvocation\fR for the meaning of arguments to the shell.
+.SS "Definitions"
+.sp
+.LP
+A \fImetacharacter\fR is defined as one of the following characters:
+.sp
+.in +2
+.nf
+; & ( ) | < > NEWLINE SPACE TAB
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+A \fIblank\fR is a \fBTAB\fR or a \fBSPACE\fR. 
+.sp
+.LP
+An \fIidentifier\fR is a sequence of letters, digits, or underscores starting with a letter or underscore. Identifiers are used as components of \fIvariable names\fR. 
+.sp
+.LP
+A \fIvname\fR is a sequence of one or more identifiers separated by a period (\fB\&.\fR) and optionally preceded by a period (\fB\&.\fR). \fIvnames\fR are used as function and variable names. 
+.sp
+.LP
+A \fIword\fR is a sequence of \fIcharacters\fR from the character set defined by the current locale, excluding non-quoted \fImetacharacters\fR.
+.sp
+.LP
+A \fIcommand\fR is a sequence of characters in the syntax of the shell language. The shell reads each command and carries out the desired action either directly or by invoking separate utilities. A built-in command is a command that is carried out by the shell itself without creating a separate process. Some commands are built-in purely for convenience and are not documented in this manual page. Built-ins that cause side effects in the shell environment and built-ins that are found before performing a path search (see \fBExecution\fR) are documented in this manual page. For historical reasons, some of these built-ins behave differently than other built-ins and are called special built-ins.
+.SS "Commands"
+.sp
+.LP
+A \fIsimple-command\fR is a list of variable assignments (see \fBVariable Assignments\fR) or a sequence of \fIblank\fR-separated words which can be preceded by a list of variable assignments. See the \fBEnvironment\fR section of this manual page.
+.sp
+.LP
+The first word specifies the name of the command to be executed. Except as specified in this section, the remaining words are passed as arguments to the invoked command. The command name is passed as argument 0. See \fBexec\fR(2). The \fIvalue\fR of a simple-command is its exit status. If it terminates normally, its value is \fB0\fR-\fB255\fR. If it terminates abnormally, its value is \fB256+\fR\fIsignum\fR. The name of the signal corresponding to the exit status can be obtained by way of the \fB-l\fR option of the kill built-in utility. 
+.sp
+.LP
+A \fIpipeline\fR is a sequence of one or more commands separated by \fB|\fR. The standard output of each command but the last is connected by a \fBpipe\fR(2) to the standard input of the next command. Each command, except possibly the last, is run as a separate process. The shell waits for the last command to terminate. The exit status of a pipeline is the exit status of the last command unless the \fBpipefail\fR option is enabled. Each pipeline can be preceded by the reserved word\fB!\fR. This causes the exit status of the pipeline to become \fB0\fR if the exit status of the last command is \fBnon-zero\fR, and \fB1\fR if the exit status of the last command is \fB0\fR.
+.sp
+.LP
+A \fIlist\fR is a sequence of one or more pipelines separated by \fB;, &, |&, &&, or |\fR, and optionally terminated by \fB;, &,\fR or \fB|&\fR. Of these five symbols, \fB;, &\fR, and \fB|&\fR have equal precedence, which is lower than that of \fB&&\fR and \fB||\fR. The symbols \fB&&\fR and \fB||\fR also have equal precedence. 
+.sp
+.LP
+A semicolon (\fB;\fR) causes sequential execution of the preceding pipeline. An ampersand (\fB&\fR) causes asynchronous execution of the preceding pipeline, that is, the shell does \fInot\fR wait for that pipeline to finish. The symbol \fB|&\fR causes asynchronous execution of the preceding pipeline with a two-way pipe established to the parent shell. The standard input and output of the spawned pipeline can be written to and read from by the parent shell by applying the redirection operators \fB<&\fR and \fB>&\fR with \fBarg p\fR to commands and by using \fB-p\fR option of the built-in commands \fBread\fR and \fBprint\fR. The symbol \fB&&\fR (\fB||\fR) causes the \fIlist\fR following it to be executed only if the preceding pipeline returns a zero (\fBnon-zero\fR) value. One or more NEWLINEs can appear in a \fIlist\fR instead of a semicolon, to delimit a command. The first \fIitem\fR of the first \fIpipeline\fR of a \fIlist\fR that is a simple command not beginning with a redirection, and not occurring within a \fBwhile\fR, \fBuntil\fR, or \fBif\fR \fIlist\fR , can be preceded by a semicolon. This semicolon is ignored unless the \fBshowme\fR option is enabled as described with the \fBset\fR built-in.
+.sp
+.LP
+A \fIcommand\fR is either a simple-command or one of commands in the following list. Unless otherwise stated, the value returned by a command is that of the last simple-command executed in the command.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfor\fR \fIvname\fR \fB[ in\fR \fIword\fR \fB\&... ] ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+Each time a \fBfor\fR command is executed, \fIvname\fR is set to the next \fIword\fR taken from the \fBin\fR \fIword\fR list. If \fBin\fR \fIword ...\fR is omitted, the \fBfor\fR command executes the \fBdo\fR \fIlist\fR once for each positional parameter that is set starting from 1. Execution ends when there are no more words in the list. See \fBParameter Expansion\fR. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(( [\fR\fIexpr1\fR\fB] ; [\fR\fIexpr2\fR] ; [\fIexpr3\fR\fB] )) ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+The arithmetic expression \fIexpr1\fR is evaluated first. The arithmetic expression \fIexpr2\fR is repeatedly evaluated until it evaluates to \fBzero\fR and when \fBnon-zero\fR, \fIlist\fR is executed and the arithmetic expression \fIexpr3\fR evaluated. If any expression is omitted, then it behaves as if it evaluated to \fB1\fR. See \fBArithmetic Evaluation\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBselect\fR \fIvname\fR [ in \fIword\fR \fB\&... ] ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+A \fBselect\fR command prints on standard error (file descriptor 2) the set of \fIwords\fR, each preceded by a number. If \fBin\fR \fIword...\fR is omitted, the positional parameters starting from \fB1\fR are used instead. See \fBParameter Expansion\fR. The \fBPS3\fR prompt is printed and a line is read from the standard input. If this line consists of the number of one of the listed \fIword\fRs, then the value of the variable \fIvname\fR is set to the \fIword\fR corresponding to this number. If this line is empty, the selection list is printed again. Otherwise the value of the variable \fIvname\fR is set to \fBnull\fR. The contents of the line read from standard input is saved in the variable \fBREPLY\fR. The \fIlist\fR is executed for each selection until a break or \fBEOF\fR is encountered. If the \fBREPLY\fR variable is set to \fBnull\fR by the execution of \fIlist\fR, the selection list is printed before displaying the \fBPS3\fR prompt for the next selection.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcase\fR \fIword\fR \fBin [ [(]\fR \fIpattern\fR \fB[ |\fR \fIpattern\fR \fB] ... )\fR \fIlist\fR \fB;; ] ... esac\fR\fR
+.ad
+.sp .6
+.RS 4n
+A \fBcase\fR command executes the \fIlist\fR associated with the first \fIpattern\fR that matches \fIword\fR. The form of the patterns is the same as that used for file name generation. See \fBFile Name Generation\fR. 
+.sp
+The \fB;;\fR operator causes execution of \fBcase\fR to terminate. If \fB;&\fR is used in place of \fB;;\fR the next subsequent list, if any, is executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBif\fR \fIlist\fR \fB;then\fR \fIlist\fR \fB[ ;elif\fR \fIlist\fR \fB;then\fR \fIlist\fR ] \fB\&... [ ;else\fR \fIlist\fR \fB]\fR \fB;fi\fR\fR
+.ad
+.sp .6
+.RS 4n
+The \fIlist\fR following \fBif\fR is executed and, if it returns a \fBzero\fR exit status, the \fIlist\fR following the first \fBthen\fR is executed. Otherwise, the \fIlist\fR following \fBelif\fR is executed, and, if its value is \fBzero\fR, the \fIlist\fR following the next \fBthen\fR is executed. Failing each successive \fBelif\fR \fIlist\fR, the \fBelse\fR \fIlist\fR is executed. If the \fBif\fR \fIlist\fR has \fBnon-zero\fR exit status and there is no \fBelse\fR \fIlist\fR, then the \fBif\fR command returns a \fBzero\fR exit status.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhile\fR \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.br
+.na
+\fBuntil \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+A \fBwhile\fR command repeatedly executes the while \fIlist\fR and, if the exit status of the last command in the list is zero, executes the \fBdo\fR \fIlist\fR, otherwise the loop terminates. If no commands in the \fBdo\fR \fIlist\fR are executed, then the \fBwhile\fR command returns a \fBzero\fR exit status, \fBuntil\fR can be used in place of \fBwhile\fR to negate the loop termination test.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB((\fR\fIexpression\fR\fB))\fR\fR
+.ad
+.sp .6
+.RS 4n
+The \fIexpression\fR is evaluated using the rules for arithmetic evaluation described in this manual page. If the value of the arithmetic expression is \fBnon-zero\fR, the exit status is \fB0\fR. Otherwise the exit status is \fB1\fR. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fIlist\fR\fB;)\fR\fR
+.ad
+.sp .6
+.RS 4n
+Execute list in a separate environment. If two adjacent open parentheses are needed for nesting, a SPACE must be inserted to avoid evaluation as an arithmetic command as described in this section.
+.sp
+\fIlist\fR is simply executed. Unlike the metacharacters, \fB(\fR and \fB)\fR, \fB{\fR and \fB}\fR are \fIreserved words\fR and must occur at the beginning of a line or after a \fB;\fR to be recognized. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[[\fR \fIexpression\fR \fB]]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Evaluates \fIexpression\fR and returns a \fBzero\fR exit status when \fIexpression\fR is true. See \fBConditional Expressions\fR for a description of \fIexpression\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfunction\fR \fIvarname\fR \fB{\fR \fIlist\fR \fB;}\fR\fR
+.ad
+.br
+.na
+\fB\fIvarname\fR \fB() {\fR \fIlist\fR \fB;}\fR\fR
+.ad
+.sp .6
+.RS 4n
+Define a function which is referenced by \fIvarname\fR. A function whose \fIvarname\fR contains a \fB\&.\fR is called a discipline function and the portion of the \fIvarname\fR preceding the last \fB\&.\fR must refer to an existing variable. 
+.sp
+The body of the function is the \fIlist\fR of commands between \fB{\fR and \fB}\fR. A function defined with the function \fIvarname\fR syntax can also be used as an argument to the \fB\&.\fR special built-in command to get the equivalent behavior as if the \fIvarname\fR\fB()\fR syntax were used to define it. See \fBFunctions\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtime [\fR \fIpipeline\fR \fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIpipeline\fR is omitted, the user and system time for the current shell and completed child processes is printed on standard error. Otherwise, \fIpipeline\fR is executed and the elapsed time as well as the user and system time are printed on standard error. The \fBTIMEFORMAT\fR variable can be set to a format string that specifies how the timing information should be displayed. See \fBShell Variables\fR for a description of the \fBTIMEFORMAT\fR variable. 
+.RE
+
+.sp
+.LP
+The following reserved words are recognized as reserved only when they are the first word of a command and are not quoted: 
+.br
+.in +2
+\fBcase\fR
+.in -2
+.br
+.in +2
+\fBdo\fR
+.in -2
+.br
+.in +2
+\fBdone\fR
+.in -2
+.br
+.in +2
+\fBelse\fR
+.in -2
+.br
+.in +2
+\fBelif\fR
+.in -2
+.br
+.in +2
+\fBesac\fR
+.in -2
+.br
+.in +2
+\fBfor\fR
+.in -2
+.br
+.in +2
+\fBfi\fR
+.in -2
+.br
+.in +2
+\fBfunction\fR
+.in -2
+.br
+.in +2
+\fBif\fR
+.in -2
+.br
+.in +2
+\fBselect\fR
+.in -2
+.br
+.in +2
+\fBthen\fR
+.in -2
+.br
+.in +2
+\fBtime\fR
+.in -2
+.br
+.in +2
+\fBuntil\fR
+.in -2
+.br
+.in +2
+\fBwhile\fR
+.in -2
+.br
+.in +2
+\fB{ }\fR
+.in -2
+.br
+.in +2
+\fB[[ ]]\fR
+.in -2
+.br
+.in +2
+\fB!\fR
+.in -2
+.SS "Variable Assignments"
+.sp
+.LP
+One or more variable assignments can start a simple command or can be arguments to the \fBtypeset\fR, \fBexport\fR, or \fBreadonly\fR special built-in commands. The syntax for an \fIassignment\fR is of the form:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIvarname\fR\fB=\fR\fIword\fR\fR
+.ad
+.br
+.na
+\fB\fIvarname\fR\fB[\fR\fIword\fR\fB]=\fR\fIword\fR\fR
+.ad
+.sp .6
+.RS 4n
+No space is permitted between \fIvarname\fR and the \fB=\fR or between \fB=\fR and \fIword\fR. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIvarname\fR\fB=(\fR\fIassignlist\fR\fB)\fR\fR
+.ad
+.sp .6
+.RS 4n
+No space is permitted between \fIvarname\fR and the \fB=\fR. An \fIassignlist\fR can be one of the following:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIword ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+Indexed array assignment.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIword\fR\fB]=\fR\fIword ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+Associative array assignment. If prefixed by \fBtypeset\fR \fB-a\fR, creates an indexed array instead.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIassignment ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+Compound variable assignment. This creates a compound variable \fIvarname\fR with sub-variables of the form \fIvarname.name\fR, where \fIname\fR is the name portion of assignment. The value of \fIvarname\fR contains all the assignment elements. Additional assignments made to sub-variables of \fIvarname\fR are also displayed as part of the value of \fIvarname\fR. If no \fIassignment\fRs are specified, \fIvarname\fR is a compound variable allowing subsequence child elements to be defined.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtypeset [\fR\fIoptions\fR] \fIassignment\fR \fB\&...\fR\fR
+.ad
+.sp .6
+.RS 4n
+Nested variable assignment. Multiple assignments can be specified by separating each of them with a \fB;\fR. The previous value is unset before the assignment.
+.RE
+
+In addition, a \fB+=\fR can be used in place of the \fB=\fR to signify adding to or appending to the previous value. When \fB+=\fR is applied to an arithmetic type, \fIword\fR is evaluated as an arithmetic expression and added to the current value. When applied to a string variable, the value defined by \fIword\fR is appended to the value. For compound assignments, the previous value is not unset and the new values are appended to the current ones provided that the types are compatible. 
+.RE
+
+.SS "Comments"
+.sp
+.LP
+A word beginning with \fB#\fR causes that word and all the following characters up to a NEWLINE to be commented, or ignored.
+.SS "Aliasing"
+.sp
+.LP
+The first word of each command is replaced by the text of an alias if an alias for this word has been defined. An alias name consists of any number of characters excluding metacharacters, quoting characters, file expansion characters, parameter expansion characters, command substitution characters, and \fB=\fR. The replacement string can contain any valid shell script including the metacharacters listed in the \fBCommands\fR section. The first word of each command in the replaced text, other than any that are in the process of being replaced, are tested for aliases. If the last character of the alias value is a BLANK then the word following the alias is also checked for alias substitution. 
+.sp
+.LP
+Aliases can be used to redefine built-in commands but cannot be used to redefine the reserved words listed in the \fBCommands\fR section. Aliases can be created and listed with the alias command and can be removed with the \fBunalias\fR command.
+.sp
+.LP
+Aliasing is performed when scripts are read, not while they are executed. For an alias to take effect, the \fBalias\fR definition command has to be executed before the command which references the alias is read. The following aliases are compiled into the shell but can be unset or redefined:
+.sp
+.in +2
+.nf
+autoload='typeset -fu'
+command='command '
+fc=hist
+float='typeset -lE'
+functions='typeset -f'
+hash='alias -t --'
+history='hist -l'
+integer='typeset -li'
+nameref='typeset -n'
+nohup='nohup '
+r='hist -s'
+redirect='command exec'
+source='command .'
+stop='kill -s STOP'
+suspend='kill -s STOP $$'
+times='{ { time;} 2>&1;}'
+type='whence -v'
+.fi
+.in -2
+.sp
+
+.SS "Tilde Substitution"
+.sp
+.LP
+After alias substitution is performed, each word is checked to see if it begins with an unquoted tilde (\fB~\fR). For tilde substitution, \fIword\fR also refers to the \fIword\fR portion of parameter expansion. See \fBParameter Expansion\fR. 
+.sp
+.LP
+If it does, the word up to a \fB/\fR is checked to see if it matches a user name in the password database. If a match is found, the \fB~\fR and the matched login name are replaced by the login directory of the matched user. If no match is found, the original text is left unchanged. A \fB~\fR by itself, or in front of a \fB/\fR, is replaced by \fB$HOME\fR. A \fB~\fR followed by a \fB+\fR or \fB-\fR is replaced by the value of \fB$PWD\fR and \fB$OLDPWD\fR respectively.
+.sp
+.LP
+In addition, when expanding a \fIvariable assignment\fR, tilde substitution is attempted when the value of the assignment begins with a \fB~\fR, and when a \fB~\fR appears after a colon (\fB:\fR). The \fB:\fR also terminates a \fB~\fR login name.
+.SS "Command Substitution"
+.sp
+.LP
+The standard output from a command enclosed in parentheses preceded by a dollar sign (\fB$\fR) or a pair of grave accents (\fB``\fR) can be used as part or all of a word. Trailing NEWLINEs are removed. In the second (obsolete) form, the string between the quotes is processed for special quoting characters before the command is executed. See \fBQuoting\fR. 
+.sp
+.LP
+The command substitution \fB$(cat file)\fR can be replaced by the equivalent but faster \fB$(<file)\fR. The command substitution \fB$(\fR\fIn\fR\fB<#)\fR expands to the current byte offset for file descriptor \fIn\fR.
+.SS "Arithmetic Substitution"
+.sp
+.LP
+An arithmetic expression enclosed in double parentheses preceded by a dollar sign ( \fB$((\fR\fIarithmetic_expression\fR\fB))\fR) is replaced by the value of the arithmetic expression within the double parentheses.
+.SS "Process Substitution"
+.sp
+.LP
+Process substitution is only available on versions of the UNIX operating system that support the \fB/dev/fd\fR directory for naming open files. 
+.sp
+.LP
+Each command argument of the form \fB<(\fR\fIlist\fR\fB)\fR or \fB>(\fR\fIlist\fR\fB)\fR runs process \fIlist\fR asynchronously connected to some file in \fB/dev/fd\fR. The name of this file becomes the argument to the command. If the form with \fB>\fR is selected then writing on this file provides input for \fIlist\fR. If \fB<\fR is used, then the file passed as an argument contains the output of the \fIlist\fR process. 
+.sp
+.LP
+For example,
+.sp
+.in +2
+.nf
+paste <(cut -f1 \fIfile1\fR) <(cut -f3 \fIfile2\fR) | tee \e
+     >(\fIprocess1\fR) >(\fIprocess2\fR)
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+\fBcut\fRs fields 1 and 3 from the files \fIfile1\fR and \fIfile2\fR respectively, \fBpaste\fRs the results together, and sends it to the processes \fIprocess1\fR and \fIprocess2\fR. It also displays the results to the standard output. The file, which is passed as an argument to the command, is a UNIX \fBpipe\fR(2). Programs that expect to \fBlseek\fR(2) on the file do not work. 
+.SS "Parameter Expansion"
+.sp
+.LP
+A parameter is a variable, one or more digits, or any of the characters \fB*\fR, \fB@\fR, \fB#\fR, \fB?\fR, \fB-\fR, \fB$\fR, and \fB!\fR. A variable is denoted by a \fIvname\fR. To create a variable whose \fIvname\fR contains a \fB\&.\fR, a variable whose \fBvname\fR consists of everything before the last . must already exist. A variable has a value and zero or more attributes. Variables can be assigned values and attributes by using the \fBtypeset\fR special built-in command. The attributes supported by the shell are described later with the \fBtypeset\fR special built-in command. Exported variables pass values and attributes to the environment. 
+.sp
+.LP
+The shell supports both indexed and associative arrays. An element of an array variable is referenced by a subscript. A subscript for an indexed array is denoted by an arithmetic expression, (see \fBArithmetic Evaluation\fR), between a \fB[\fR and a \fB]\fR. Use \fBset -A\fR \fIvname value ...\fR to assign values to an indexed array. The value of all subscripts must be in the range of \fB0\fR through \fB1,048,575\fR. Indexed arrays do not need to be declared. Any reference to a variable with a valid subscript is legal and an array is created if necessary. 
+.sp
+.LP
+An associative array is created with the \fB-A\fR option to \fBtypeset\fR. A subscript for an associative array is denoted by a string enclosed between \fB[\fR and \fB]\fR. 
+.sp
+.LP
+Referencing any array without a subscript is equivalent to referencing the array with subscript \fB0\fR.
+.sp
+.LP
+The value of a variable can be assigned by:
+.sp
+.in +2
+.nf
+\fIvname\fR=\fIvalue\fR [\fIvname\fR=\fIvalue\fR] ...
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+or
+.sp
+.in +2
+.nf
+\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR [\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR] ...
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+No space is allowed before or after the \fB=\fR. A \fInameref\fR is a variable that is a reference to another variable. A \fInameref\fR is created with the \fB-n\fR attribute of \fBtypeset\fR. The value of the variable at the time of the \fBtypeset\fR command becomes the variable that is referenced whenever the \fInameref\fR variable is used. The name of a \fInameref\fR cannot contain a dot (\fI\&.\fR). When a variable or function name contains a \fB\&.,\fR and the portion of the name up to the first \fB\&.\fR matches the name of a \fInameref\fR, the variable referred to is obtained by replacing the \fInameref\fR portion with the name of the variable referenced by the \fInameref\fR. If a \fInameref\fR is used as the index of a \fBfor\fR loop, a name reference is established for each item in the list. A \fInameref\fR provides a convenient way to refer to the variable inside a function whose name is passed as an argument to a function. For example, if the name of a variable is passed as the first argument to a function, the command
+.sp
+.in +2
+.nf
+ typeset -n var=$1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+inside the function causes references and assignments to \fIvar\fR to be references and assignments to the variable whose name has been passed to the function. If either of the floating point attributes, \fB-E\fR, or \fB-F\fR, or the integer attribute, \fB-i\fR, is set for \fIvname\fR, then the \fIvalue\fR is subject to arithmetic evaluation as described in this manual page. Positional parameters, parameters denoted by a number, can be assigned values with the \fBset\fR special built-in command. Parameter \fB$0\fR is set from argument zero when the shell is invoked. The character \fB$\fR is used to introduce substitutable parameters.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+The shell reads all the characters from \fB${\fR to the matching \fB}\fR as part of the same word even if it contains braces or metacharacters. The value, if any, of the parameter is substituted. The braces are required when \fIparameter\fR is followed by a letter, digit, or underscore that is not to be interpreted as part of its name, when the variable name contains a \fB\&.\fR, or when a variable is subscripted. If \fIparameter\fR is one or more digits then it is a positional parameter. A positional parameter of more than one digit must be enclosed in braces. If \fIparameter\fR is \fB*\fR or \fB@\fR, then all the positional parameters, starting with \fB$1\fR, are substituted and separated by a field separator character. If an array \fIvname\fR with subscript \fB*\fR or \fB@\fR is used, then the value for each of the elements is substituted, separated by the first character of the value of \fBIFS\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${#\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIparameter\fR is \fB*\fR or \fB@\fR, the number of positional parameters is substituted. Otherwise, the length of the value of the \fIparameter\fR is substituted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${#\fR\fIvname\fR\fB[*]}\fR\fR
+.ad
+.br
+.na
+\fB\fB${#\fR\fIvname\fR\fB[@]}\fR\fR
+.ad
+.sp .6
+.RS 4n
+The number of elements in the array \fIvname\fR is substituted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIvname\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+Expands to the name of the variable referred to by \fIvname\fR. This is \fIvname\fR except when \fIvname\fR is a name reference.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIvname\fR\fB[\fR\fIsubscript\fR\fB]}\fR\fR
+.ad
+.sp .6
+.RS 4n
+Expands to name of the subscript unless \fIsubscript\fR is \fB*\fR or \fB@\fR. When \fIsubscript\fR is \fB*\fR, the list of array subscripts for \fIvname\fR is generated. For a variable that is not an array, the value is \fB0\fR if the variable is set. Otherwise it is \fBnull\fR. When \fIsubscript\fR is \fB@\fR, it is the same as \fB$ {\fR\fIvname\fR\fB[\fR\fI*\fR\fB]}\fR, except that when used in double quotes, each array subscript yields a separate argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIprefix\fR\fB*}\fR\fR
+.ad
+.sp .6
+.RS 4n
+Expands to the names of the variables whose names begin with \fIprefix\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:-\fR\fIword\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIparameter\fR is set and is non-null then substitute its value. Otherwise substitute \fIword\fR.
+.sp
+\fIword\fR is not evaluated unless it is to be used as the substituted string. 
+.sp
+In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or is NULL:
+.sp
+.in +2
+.nf
+print ${d:-$(pwd)}
+.fi
+.in -2
+.sp
+
+If the colon (\fB:\fR ) is omitted from the expression, the shell only checks whether \fIparameter\fR is set or not. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR:\fIlength\fR}\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+Expands to the portion of the value of \fIparameter\fR starting at the character (counting from \fB0\fR) determined by expanding offset as an arithmetic expression and consisting of the number of characters determined by the arithmetic expression defined by \fIlength\fR. 
+.sp
+In the second form, the remainder of the value is used. A negative offset counts backwards from the end of \fIparameter\fR.
+.sp
+One or more BLANKs is required in front of a minus sign to prevent the shell from interpreting the operator as \fB:-\fR. If parameter is \fB*\fR or \fB@\fR, or is an array name indexed by \fB*\fR or \fB@\fR, then \fIoffset\fR and \fIlength\fR refer to the array index and number of elements respectively. A negative \fIoffset\fR is taken relative to one greater than the highest subscript for indexed arrays. The order for associative arrays is unspecified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB#\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB##\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+If the shell \fIpattern\fR matches the beginning of the value of \fIparameter\fR, then the value of this expansion is the value of the \fIparameter\fR with the matched portion deleted. Otherwise the value of this \fIparameter\fR is substituted. In the first form the smallest matching \fIpattern\fR is deleted and in the second form the largest matching \fIpattern\fR is deleted. When \fIparameter\fR is \fB@\fR, \fB*\fR, or an array variable with subscript \fB@\fR or \fB*\fR, the substring operation is applied to each element in turn. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB%\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB%%\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+If the shell \fIpattern\fR matches the end of the value of \fIparameter\fR, then the value of this expansion is the value of the parameter with the matched part deleted. Otherwise substitute the value of \fIparameter\fR. In the first form the smallest matching pattern is deleted, and in the second form the largest matching pattern is deleted. When parameter is \fB@\fR, \fB*\fR, or an array variable with subscript \fB@\fR or \fB*\fR, the substring operation is applied to each element in turn. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB/\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB//\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB/#\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB/%\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+Expands \fIparameter\fR and replaces the longest match of \fIpattern\fR with the specified \fIstring\fR. Each occurrence of \fB\e\fR\fIn\fR in \fIstring\fR is replaced by the portion of \fIparameter\fR that matches the \fIn\fR\fBth\fR sub-pattern. 
+.sp
+When \fIstring\fR is null, the \fIpattern\fR is deleted and the \fB/\fR in front of string can be omitted. When \fIparameter\fR is \fB@\fR, \fB*\fR, or an array variable with subscript \fB@\fR or \fB*\fR, the substitution operation is applied to each element in turn. In this case, the \fIstring\fR portion of \fIword\fR is re-evaluated for each element.
+.sp
+In the first form, only the first occurrence of \fIpattern\fR is replaced. 
+.sp
+In the second form, each match for \fIpattern\fR is replaced by the specified \fIstring\fR. 
+.sp
+The third form restricts the pattern match to the beginning of the \fIstring\fR. 
+.sp
+The fourth form restricts the pattern match to the end of the \fIstring\fR. 
+.RE
+
+.sp
+.LP
+The following parameters are automatically set by the shell:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 19n
+.rt  
+The number of positional parameters in decimal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 19n
+.rt  
+Options supplied to the shell on invocation or by the \fBset\fR command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 19n
+.rt  
+The decimal value returned by the last executed command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 19n
+.rt  
+The process number of this shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB_\fR\fR
+.ad
+.RS 19n
+.rt  
+Initially, the value of \fB_\fR is the absolute pathname of the shell or script being executed as passed in the environment. It is subsequently assigned the last argument of the previous command. 
+.sp
+This parameter is not set for commands which are asynchronous. This parameter is also used to hold the name of the matching \fBMAIL\fR file when checking for mail.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR\fR
+.ad
+.RS 19n
+.rt  
+The process number of the last background command invoked or the most recent job put in the background with the \fBbg\fR built-in command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.command\fR\fR
+.ad
+.RS 19n
+.rt  
+When processing a \fBDEBUG\fR trap, this variable contains the current command line that is about to run.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edchar\fR\fR
+.ad
+.RS 19n
+.rt  
+This variable contains the value of the keyboard character (or sequence of characters if the first character is an ESC, \fBASCII 033\fR) that has been entered when processing a \fBKEYBD\fR trap. If the value is changed as part of the trap action, then the new value replaces the key (or key sequence) that caused the trap. See the \fBKey Bindings\fR section of this manual page.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edcol\fR\fR
+.ad
+.RS 19n
+.rt  
+The character position of the cursor at the time of the most recent \fBKEYBD\fR trap.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edmode\fR\fR
+.ad
+.RS 19n
+.rt  
+The value is set to ESC when processing a \fBKEYBD\fR trap while in \fBvi\fR insert mode. Otherwise, \fB\&.sh.edmode\fR is null when processing a \fBKEYBD\fR trap. See the \fBvi Editing Mode\fR section of this manual page.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edtext\fR\fR
+.ad
+.RS 19n
+.rt  
+The characters in the input buffer at the time of the most recent \fBKEYBD\fR trap. The value is null when not processing a \fBKEYBD\fR trap.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.file\fR\fR
+.ad
+.RS 19n
+.rt  
+The pathname of the file than contains the current command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.fun\fR\fR
+.ad
+.RS 19n
+.rt  
+The name of the current function that is being executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.match\fR\fR
+.ad
+.RS 19n
+.rt  
+An indexed array which stores the most recent match and sub-pattern matches after conditional pattern matches that match and after variables expansions using the operators \fB#\fR, \fB%\fR, or \fB/\fR. The \fB0\fRth element stores the complete match and the \fIi\fRth element stores the \fIi\fRth sub-match. The \fB\&.sh.match\fR variable is unset when the variable that has expanded is assigned a new value.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.name\fR\fR
+.ad
+.RS 19n
+.rt  
+Set to the name of the variable at the time that a discipline function is invoked.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.subscript\fR\fR
+.ad
+.RS 19n
+.rt  
+Set to the name subscript of the variable at the time that a discipline function is invoked.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.subshell\fR\fR
+.ad
+.RS 19n
+.rt  
+The current depth for sub-shells and command substitution.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.value\fR\fR
+.ad
+.RS 19n
+.rt  
+Set to the value of the variable at the time that the set or append discipline function is invoked.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.version\fR\fR
+.ad
+.RS 19n
+.rt  
+Set to a value that identifies the version of this shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLINENO\fR\fR
+.ad
+.RS 19n
+.rt  
+The current line number within the script or function being executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOLDPWD\fR\fR
+.ad
+.RS 19n
+.rt  
+The previous working directory set by the \fBcd\fR command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOPTARG\fR\fR
+.ad
+.RS 19n
+.rt  
+The value of the last option argument processed by the \fBgetopts\fR built-in command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOPTIND\fR\fR
+.ad
+.RS 19n
+.rt  
+The index of the last option argument processed by the \fBgetopts\fR built-in command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPPID\fR\fR
+.ad
+.RS 19n
+.rt  
+The process number of the parent of the shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPWD\fR\fR
+.ad
+.RS 19n
+.rt  
+The present working directory set by the \fBcd\fR command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRANDOM\fR\fR
+.ad
+.RS 19n
+.rt  
+Each time this variable is referenced, a random integer, uniformly distributed between \fB0\fR and \fB32767\fR, is generated. The sequence of random numbers can be initialized by assigning a numeric value to \fBRANDOM\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBREPLY\fR\fR
+.ad
+.RS 19n
+.rt  
+This variable is set by the \fBselect\fR statement and by the \fBread\fR built-in command when no arguments are supplied.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSECONDS\fR\fR
+.ad
+.RS 19n
+.rt  
+Each time this variable is referenced, the number of seconds since shell invocation is returned. If this variable is assigned a value, then the value returned upon reference is the value that was assigned plus the number of seconds since the assignment.
+.RE
+
+.sp
+.LP
+The following variables are used by the shell:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCDPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+Defines the search path for the \fBcd\fR command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCOLUMNS\fR\fR
+.ad
+.RS 14n
+.rt  
+Defines the width of the edit window for the shell edit modes and for printing select lists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDITOR\fR\fR
+.ad
+.RS 14n
+.rt  
+If the \fBVISUAL\fR variable is not set, the value of this variable is checked for the patterns as described with \fBVISUAL\fR and the corresponding editing option is turned on. 
+.sp
+See the \fBset\fR command in the \fBSpecial Command\fR section of this manual page. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENV\fR\fR
+.ad
+.RS 14n
+.rt  
+Performs parameter expansion, command substitution, and arithmetic substitution on the value to generate the pathname of the script that is executed when the shell is invoked. This file is typically used for alias and function definitions. The default value is \fB$HOME/.kshrc\fR. 
+.sp
+See the \fBInvocation\fR section of this manual page.
+.sp
+\fBENV\fR is not set by the shell. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFCEDIT\fR\fR
+.ad
+.RS 14n
+.rt  
+Obsolete name for the default editor name for the \fBhist\fR command. \fBFCEDIT\fR is not used when \fBHISTEDIT\fR is set.
+.sp
+The shell specifies a default value to \fBFCEDIT\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFIGNORE\fR\fR
+.ad
+.RS 14n
+.rt  
+A pattern that defines the set of file names that is ignored when performing file name matching.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+The search path for function definitions. The directories in this path are searched for a file with the same name as the function or command when a function with the \fB-u\fR attribute is referenced and when a command is not found. If an executable file with the name of that command is found, then it is read and executed in the current environment. Unlike \fBPATH\fR, the current directory must be represented explicitly by dot (\fB\&.\fR) rather than by adjacent colon (\fB:\fR) characters or a beginning or ending colon (\fB:\fR).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTCMD\fR\fR
+.ad
+.RS 14n
+.rt  
+The number of the current command in the history file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTEDIT\fR\fR
+.ad
+.RS 14n
+.rt  
+The name for the default editor name for the \fBhist\fR command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTFILE\fR\fR
+.ad
+.RS 14n
+.rt  
+If this variable is set when the shell is invoked, the value is the pathname of the file that is used to store the command history. See the \fBCommand Re-entry\fR section of this manual page. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTSIZE\fR\fR
+.ad
+.RS 14n
+.rt  
+If this variable is set when the shell is invoked, then the number of previously entered commands that are accessible by this shell is greater than or equal to this number. The default is \fB512\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHOME\fR\fR
+.ad
+.RS 14n
+.rt  
+The default argument (home directory) for the \fBcd\fR command.
+.sp
+\fBHOME\fR is not set by the shell. \fBHOME\fR is set by \fBlogin\fR(1).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIFS\fR\fR
+.ad
+.RS 14n
+.rt  
+Internal field separators, normally SPACE, TAB, and NEWLINE that are used to separate the results of command substitution or parameter expansion and to separate fields with the built-in command read. The first character of the \fBIFS\fR variable is used to separate arguments for the \fB"$*"\fR substitution. See the \fBQuoting\fR section of this manual page. 
+.sp
+Each single occurrence of an \fBIFS\fR character in the string to be split, that is not in the \fBissspace\fR character class, and any adjacent characters in \fBIFS\fR that are in the \fBissspace\fR character class, delimit a field. One or more characters in IFS that belong to the \fBissspace\fR character class, delimit a field. In addition, if the same \fBissspace\fR character appears consecutively inside \fBIFS\fR, this character is treated as if it were not in the \fBissspace\fR class, so that if \fBIFS\fR consists of two tab characters, then two adjacent tab characters delimit a null field.
+.sp
+The shell specifies a default value to \fBIFS\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLANG\fR\fR
+.ad
+.RS 14n
+.rt  
+This variable determines the locale category for any category not specifically selected with a variable starting with \fBLC_\fR or \fBLANG\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_ALL\fR\fR
+.ad
+.RS 14n
+.rt  
+This variable overrides the value of the \fBLANG\fR variable and any other \fBLC_\fR variable.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_COLLATE\fR\fR
+.ad
+.RS 14n
+.rt  
+This variable determines the locale category for character collation information.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_CTYPE\fR\fR
+.ad
+.RS 14n
+.rt  
+This variable determines the locale category for character handling functions. It determines the character classes for pattern matching. See the \fBFile Name Generation\fR section of this manual page.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_NUMERIC\fR\fR
+.ad
+.RS 14n
+.rt  
+This variable determines the locale category for the decimal point character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLINES\fR\fR
+.ad
+.RS 14n
+.rt  
+If this variable is set, the value is used to determine the column length for printing select lists. Select lists prints vertically until about two-thirds of \fBLINES\fR lines are filled.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAIL\fR\fR
+.ad
+.RS 14n
+.rt  
+If this variable is set to the name of a mail file \fBand\fR the \fBMAILPATH\fR variable is not set, then the shell informs the user of arrival of mail in the specified file.
+.sp
+\fBMAIL\fR is not set by the shell. On some systems, \fBMAIL\fR is set by \fBlogin\fR(1).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILCHECK\fR\fR
+.ad
+.RS 14n
+.rt  
+Specifies how often in seconds the shell checks for changes in the modification time of any of the files specified by the \fBMAILPATH\fR or \fBMAIL\fR variables. The default value is \fB600\fR seconds. When the time has elapsed the shell checks before issuing the next prompt.
+.sp
+The shell specifies a default value to \fBMAILCHECK\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+A colon ( \fB:\fR ) separated list of file names. If this variable is set, then the shell informs the user of any modifications to the specified files that have occurred within the last \fBMAILCHECK\fR seconds. Each file name can be followed by a \fB?\fR and a message that is printed. The message undergoes parameter expansion, command substitution, and arithmetic substitution with the variable \fB$_\fR defined as the name of the file that has changed. The default message is \fByou have mail in $_\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+The search path for commands. Except in \fB\&.profile\fR, users cannot change \fBPATH\fR if executing under \fBrksh\fR. See the \fBExecution\fR section of this manual page.
+.sp
+The shell specifies a default value to \fBPATH\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS1\fR\fR
+.ad
+.RS 14n
+.rt  
+The value of this variable is expanded for parameter expansion, command substitution, and arithmetic substitution to define the primary prompt string which by default is \fB$\fR. The character \fB!\fR in the primary prompt string is replaced by the command number. Two successive occurrences of \fB!\fR produces a single \fB!\fR when the prompt string is printed. See the \fBCommand Re-entry\fR section of this manual page.
+.sp
+The shell specifies a default value to \fBPS1\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS2\fR\fR
+.ad
+.RS 14n
+.rt  
+Secondary prompt string, by default, \fB>\fR.
+.sp
+The shell specifies a default value to \fBPS2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS3\fR\fR
+.ad
+.RS 14n
+.rt  
+Selection prompt string used within a select loop, by default \fB#?\fR.
+.sp
+The shell specifies a default value to \fBPS3\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS4\fR\fR
+.ad
+.RS 14n
+.rt  
+The value of this variable is expanded for parameter evaluation, command substitution, and arithmetic substitution and precedes each line of an execution trace. By default, \fBPS4\fR is \fB+\fR. When \fBPS4\fR is unset, the execution trace prompt is also \fB+\fR .
+.sp
+The shell specifies a default value to \fBPS4\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHELL\fR\fR
+.ad
+.RS 14n
+.rt  
+The pathname of the shell is kept in the environment. At invocation, if the basename of this variable is \fBrsh\fR, \fBrksh\fR, \fBrksh\fR, or \fBkrsh\fR, the shell becomes restricted.
+.sp
+\fBSHELL\fR is not set by the shell. On some systems, \fBSHELL\fR is set by \fBlogin\fR(1).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBTIMEFORMAT\fR\fR
+.ad
+.RS 14n
+.rt  
+The value of this parameter is used as a format string specifying how the timing information for pipelines prefixed with the \fBtime\fR reserved word should be displayed. The \fB%\fR character introduces a format sequence that is expanded to a time value or other information. 
+.sp
+The format sequences and their meanings are as follows.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%%\fR\fR
+.ad
+.sp .6
+.RS 4n
+A literal \fB%\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]R\fR\fR
+.ad
+.sp .6
+.RS 4n
+The elapsed time in seconds.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]U\fR\fR
+.ad
+.sp .6
+.RS 4n
+The number of CPU seconds spent in user mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]S\fR\fR
+.ad
+.sp .6
+.RS 4n
+The number of CPU seconds spent in system mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%P\fR\fR
+.ad
+.sp .6
+.RS 4n
+The CPU percentage, computed as \fB(U + S) / R\fR.
+.RE
+
+The braces denote optional portions. The optional \fIp\fR is a digit specifying the \fIprecision\fR, the number of fractional digits after a decimal point. A value of \fB0\fR causes no decimal point or fraction to be output. At most three places after the decimal point can be displayed. Values of \fIp\fR greater than \fB3\fR are treated as \fB3\fR. If \fIp\fR is not specified, the value \fB3\fR is used.
+.sp
+The optional \fBl\fR specifies a longer format, including hours if greater than zero, minutes, and seconds of the form \fIHHhMMmSS.FFs\fR. The value of \fIp\fR determines whether or not the fraction is included.
+.sp
+All other characters are output without change and a trailing NEWLINE is added. If unset, the default value, \fB$'\nreal\t%2lR\nuser\t%2lU\nsys%2lS'\fR, is used. If the value is null, no timing information is displayed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBTMOUT\fR\fR
+.ad
+.RS 14n
+.rt  
+If set to a value greater than zero, \fBTMOUT\fR is the default time-out value for the \fBread\fR built-in command. The \fBselect\fR compound command terminates after \fBTMOUT\fR seconds when input is from a terminal. Otherwise, the shell terminates if a line is not entered within the prescribed number of seconds while reading from a terminal. The shell can be compiled with a maximum bound for this value which cannot be exceeded.
+.sp
+The shell specifies a default value to \fBTMOUT\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBVISUAL\fR\fR
+.ad
+.RS 14n
+.rt  
+If the value of this variable matches the pattern \fB*[Vv][Ii]*\fR, then the \fBvi\fR option is turned on. See \fBSpecial Commands\fR. If the value matches the pattern \fB*gmacs*\fR , the \fBgmacs\fR option is turned on. If the value matches the pattern \fB*macs*\fR, then the \fBemacs\fR option is turned on. The value of \fBVISUAL\fR overrides the value of \fBEDITOR\fR.
+.RE
+
+.SS "Field Splitting"
+.sp
+.LP
+After parameter expansion and command substitution, the results of substitutions are scanned for the field separator characters (those found in \fBIFS\fR) and split into distinct fields where such characters are found. Explicit null fields (\fB""\fR or \fB\&''\fR) are retained. Implicit null fields, those resulting from parameters that have no values or command substitutions with no output, are removed.
+.sp
+.LP
+If the \fBbraceexpand\fR (\fB-B\fR) option is set, each of the fields resulting from \fBIFS\fR are checked to see if they contain one or more of the brace patterns. Valid brace patterns: \fB{*\fR,\fB*}\fR, \fB{\fR\fIl1\fR\fB\&..\fR\fIl2\fR\fB}\fR , \fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR\fB}\fR, \fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR\fB%\fR\fIfmt\fR\fB} {\fR\fIn1\fR\fB\&..\fR\fIn2\fR \fB\&..\fR\fIn3\fR\fB}\fR, or \fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR \fB\&..\fR\fIn3\fR\fB%\fR\fIfmt\fR\fB}\fR , where \fB*\fR represents any character, \fIl1\fR,\fIl2\fR are letters and \fIn1\fR,\fIn2\fR,\fIn3\fR are signed numbers and \fIfmt\fR is a format specified as used by \fBprintf\fR. In each case, fields are created by prepending the characters before the \fB{\fR and appending the characters after the } to each of the strings generated by the characters between the \fB{\fR and \fB}\fR. The resulting fields are checked to see if they have any brace patterns.
+.sp
+.LP
+In the first form, a field is created for each string between \fB{\fR and \fB,,\fR between \fB,\fR and \fB,,\fR and between , and \fB}\fR. The string represented by \fB*\fR can contain embedded matching { and } without quoting. Otherwise, each \fB{\fR and \fB}\fR with \fB*\fR must be quoted.
+.sp
+.LP
+In the second form, \fIl1\fR and \fIl2\fR must both be either upper case or both be lower case characters in the C locale. In this case a field is created for each character from \fIl1\fR through \fIl2\fR.
+.sp
+.LP
+In the remaining forms, a field is created for each number starting at \fIn1\fR. This continues until it reaches \fIn2\fR and increments \fIn1\fR by \fIn3\fR. The cases where \fIn3\fR is not specified behave as if \fIn3\fR were 1 if \fIn1\fR\fB<=\fR\fIn2\fR, and \fB-1\fR otherwise. In forms which specify \fB%\fR\fIfmt\fR, any format flags, widths and precisions can be specified and \fIfmt\fR can end in any of the specifiers \fBcdiouxX\fR. For example, \fB{a,z}{1..5..3%02d}{b..c}x\fR expands to the 8 fields, \fBa01bx, a01cx, a04bx, a04cx, z01bx, z01cx, z04bx,\fR and \fBz4cx\fR.
+.SS "File Name Generation"
+.sp
+.LP
+Following splitting, each field is scanned for the characters \fB*\fR, \fB?\fR, \fB(\fR, and \fB[\fR, unless the \fB-f\fR option has been set. If one of these characters appears, then the word is regarded as a pattern. 
+.sp
+.LP
+Each file name component that contains any pattern character is replaced with a lexicographically sorted set of names that matches the pattern from that directory. If no file name is found that matches the pattern, then that component of the file name is left unchanged unless the pattern is prefixed with \fB~(N)\fR in which case it is removed. If \fBFIGNORE\fR is set, then each file name component that matches the pattern defined by the value of \fBFIGNORE\fR is ignored when generating the matching file names. The names \fB\&.\fR and \fB\&..\fR are also ignored. If \fBFIGNORE\fR is not set, the character \fB\&.\fR at the start of each file name component is ignored unless the first character of the pattern corresponding to this component is the character \fB\&.\fR itself. For other uses of pattern matching the \fB/\fR and \fB\&.\fR are not specially treated.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 11n
+.rt  
+Match any string, including the null string. When used for file name expansion, if the \fBglobstar\fR option is on, two adjacent \fB*\fRs by themselves match all files and zero or more directories and subdirectories. If the two adjacent \fB*\fRs are followed by a \fB/\fR, only directories and subdirectories match.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 11n
+.rt  
+Matches any single character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB[\fB\&...\fR]\fR
+.ad
+.RS 11n
+.rt  
+Match any one of the enclosed characters. A pair of characters separated by \fB-\fR matches any character lexically between the pair, inclusive. If the first character following the opening \fB[\fR is a \fB!\fR, any character not enclosed is matched. A \fB-\fR can be included in the character set by putting it as the first or last character. Within \fB[\fR and \fB]\fR, character classes can be specified with the syntax \fB[:\fR\fIclass\fR\fB:]\fR where \fIclass\fR is one of the following classes defined in the \fBANSI-C\fR standard:
+.sp
+.in +2
+.nf
+\fIalnum alpha blank cntrl digit graph\fR
+\fIlower print punct space upper\fR
+\fIword xdigit\fR
+.fi
+.in -2
+.sp
+
+\fIword\fR is equivalent to \fIalnum\fR plus the character \fB_\fR. Within \fB[\fR and \fB]\fR, an equivalence class can be specified with the syntax \fB[=\fR\fIc\fR\fB=]\fR which matches all characters with the same primary collation weight (as defined by the current locale) as the character \fIc\fR. Within \fB[\fR and \fB]\fR, [\fI\&.symbol.\fR] matches the collating symbol \fIsymbol\fR.
+.RE
+
+.sp
+.LP
+A \fIpattern-list\fR is a list of one or more patterns separated from each other with an \fB&\fR or \fB|\fR. An \fB&\fR signifies that all patterns must be matched whereas \fB|\fR requires that only one pattern be matched. Composite patterns can be formed with one or more of the following sub-patterns:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 23n
+.rt  
+Optionally matches any one of the specified patterns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 23n
+.rt  
+Matches zero or more occurrences of the specified patterns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 23n
+.rt  
+Matches one or more occurrences of the specified patterns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR\fIn\fR\fB}(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 23n
+.rt  
+Matches \fIn\fR occurrences of the specified patterns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR\fIm\fR\fB,\fR\fIn\fR\fB}(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 23n
+.rt  
+Matches from \fIm\fR to \fIn\fR occurrences of the specified patterns. If \fIm\fR is omitted, \fB0\fR is used. If \fIn\fR is omitted at least \fIm\fR occurrences are matched.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB@(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 23n
+.rt  
+Matches exactly one of the specified patterns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 23n
+.rt  
+Matches anything except one of the specified patterns.
+.RE
+
+.sp
+.LP
+By default, each pattern, or sub-pattern matches the longest string possible consistent with generating the longest overall match. If more than one match is possible, the one starting closest to the beginning of the string is chosen. However, for each of the compound patterns a \fB-\fR can be inserted in front of the \fB(\fR to cause the shortest match to the specified \fIpattern-list\fR to be used.
+.sp
+.LP
+When \fIpattern-list\fR is contained within parentheses, the backslash character \fB\e\fR is treated specially even when inside a character class. All \fBANSI-C\fR character escapes are recognized and match the specified character. In addition the following escape sequences are recognized:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ed\fR\fR
+.ad
+.RS 7n
+.rt  
+Matches any character in the digit class.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eD\fR\fR
+.ad
+.RS 7n
+.rt  
+Matches any character not in the digit class.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\es\fR\fR
+.ad
+.RS 7n
+.rt  
+Matches any character in the space class.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eS\fR\fR
+.ad
+.RS 7n
+.rt  
+Matches any character not in the space class.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ew\fR\fR
+.ad
+.RS 7n
+.rt  
+Matches any character in the word class.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eW\fR\fR
+.ad
+.RS 7n
+.rt  
+Matches any character not in the word class.
+.RE
+
+.sp
+.LP
+A pattern of the form \fB%(\fR\fIpattern-pairs\fR\fB)\fR is a sub-pattern that can be used to match nested character expressions. Each \fIpattern-pair\fR is a two character sequence which cannot contain \fB&\fR or \fB|\fR. The first \fIpattern-pair\fR specifies the starting and ending characters for the match. Each subsequent \fIpattern-pair\fR represents the beginning and ending characters of a nested group that is skipped over when counting starting and ending character matches. The behavior is unspecified when the first character of a \fIpattern-pair\fR is alphanumeric except for the following:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD\fR\fR
+.ad
+.RS 5n
+.rt  
+Causes the ending character to terminate the search for this pattern without finding a match.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE\fR\fR
+.ad
+.RS 5n
+.rt  
+Causes the ending character to be interpreted as an escape character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBL\fR\fR
+.ad
+.RS 5n
+.rt  
+Causes the ending character to be interpreted as a quote character causing all characters to be ignored when looking for a match.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBQ\fR\fR
+.ad
+.RS 5n
+.rt  
+Causes the ending character to be interpreted as a quote character causing all characters other than any escape character to be ignored when looking for a match.
+.RE
+
+.sp
+.LP
+\fB%({}Q"E\e)\fR, matches characters starting at \fB{\fR until the matching \fB}\fR is found not counting any \fB{\fR or \fB}\fR that is inside a double quoted string or preceded by the escape character \fB\e\fR\&. Without the \fB{}\fR this pattern matches any C language string.
+.sp
+.LP
+Each sub-pattern in a composite pattern is numbered, starting at \fB1\fR, by the location of the \fB(\fR within the pattern. The sequence \fB\e\fR\fIn\fR, where \fIn\fR is a single digit and \fB\e\fR\fIn\fR comes after the \fIn\fRth. sub-pattern, matches the same string as the sub-pattern itself.
+.sp
+.LP
+A pattern can contain sub-patterns of the form \fB~(\fR\fIoptions\fR\fB:\fR\fIpattern-list\fR\fB)\fR, where either \fIoptions\fR or \fB:\fR\fIpattern-list\fR can be omitted. Unlike the other compound patterns, these sub-patterns are not counted in the numbered sub-patterns. If \fIoptions\fR is present, it can consist of one or more of the following:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+\fR\fR
+.ad
+.RS 5n
+.rt  
+Enable the following options. This is the default.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 5n
+.rt  
+Disable the following options.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE\fR\fR
+.ad
+.RS 5n
+.rt  
+The remainder of the pattern uses extended regular expression syntax like the \fBegrep\fR(1) command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF\fR\fR
+.ad
+.RS 5n
+.rt  
+The remainder of the pattern uses \fBfgrep\fR(1) expression syntax.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBg\fR\fR
+.ad
+.RS 5n
+.rt  
+File the longest match (greedy). 
+.sp
+This is the default.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBG\fR\fR
+.ad
+.RS 5n
+.rt  
+The remainder of the pattern uses basic regular expression syntax like the \fBgrep\fR(1) command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 5n
+.rt  
+Treat the match as case insensitive.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBK\fR\fR
+.ad
+.RS 5n
+.rt  
+The remainder of the pattern uses shell pattern syntax. 
+.sp
+This is the default.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBl\fR\fR
+.ad
+.RS 5n
+.rt  
+Left anchor the pattern. 
+.sp
+This is the default for \fBK\fR style patterns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBN\fR\fR
+.ad
+.RS 5n
+.rt  
+This is ignored. However, when it is the first letter and is used with file name generation, and no matches occur, the file pattern expands to the empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBr\fR\fR
+.ad
+.RS 5n
+.rt  
+Right anchor the pattern. 
+.sp
+This is the default for \fBK\fR style patterns.
+.RE
+
+.sp
+.LP
+If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the options apply only to \fIpattern-list\fR. Otherwise, these options remain in effect until they are disabled by a subsequent \fB~(...)\fR or at the end of the sub-pattern containing \fB~(...)\fR.
+.SS "Quoting"
+.sp
+.LP
+Each of the metacharacters listed in the \fBDefinitions\fR has a special meaning to the shell.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBg\fR\fR
+.ad
+.RS 5n
+.rt  
+File the longest match (greedy). This is the default.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 5n
+.rt  
+Treat the match as case insensitive. 
+.RE
+
+.sp
+.LP
+If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the options apply only to \fIpattern-list\fR. Otherwise, the options remain in effect until they are disabled by a subsequent \fB~(...)\fR or at the end of the sub-pattern containing \fB~(...)\fR.
+.sp
+.LP
+Each of the metacharacters listed in the \fBDefinitions\fR section of this manual page has a special meaning to the shell and causes termination of a word unless quoted. A character can be quoted, that is, made to stand for itself, by preceding it with a backslash (\fB\e\fR). The pair \fB\e\fRNEWLINE is removed. All characters enclosed between a pair of single quote marks (\fB\&''\fR) that is not preceded by a \fB$\fR are quoted. A single quote cannot appear within the single quotes. A single quoted string preceded by an unquoted \fB$\fR is processed as an \fBANSI-C\fR string except for the following:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e0\fR\fR
+.ad
+.RS 19n
+.rt  
+Causes the remainder of the string to be ignored.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ec\fR\fIx\fR\fR
+.ad
+.RS 19n
+.rt  
+Expands to the character CTRL-x.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eC\fR[\fB\&.\fR\fIname\fR\fB\&.\fR]\fR
+.ad
+.RS 19n
+.rt  
+Expands to the collating element \fIname\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ee\fR\fR
+.ad
+.RS 19n
+.rt  
+Equivalent to the escape character (\fBASCII\fR 033),
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eE\fR\fR
+.ad
+.RS 19n
+.rt  
+Equivalent to the escape character (\fBASCII\fR 033),
+.RE
+
+.sp
+.LP
+Inside double quote marks (\fB""\fR), parameter and command substitution occur and \fB\e\fR quotes the characters \fB\e\fR, \fB`\fR, \fB"\fR, and \fB$\fR. A \fB$\fR in front of a double quoted string is ignored in the \fBC\fR or \fBPOSIX\fR locale, and might cause the string to be replaced by a locale specific string otherwise. The meaning of \fB$*\fR and \fB$@\fR is identical when not quoted or when used as a variable assignment value or as a file name. However, when used as a command argument, \fB"$*"\fR is equivalent to \fB"$1\fId\fR$2\fId\fR..."\fR, where \fId\fR is the first character of the IFS variable, whereas \fB"$@"\fR is equivalent to \fB"$1" "$2" ....\fR Inside grave quote marks (\fB``\fR), \fB\\fR quotes the characters \fB\e\fR, \fB`\fR, and \fB$\fR. If the grave quotes occur within double quotes, then \fB\e\fR also quotes the character \fB"\fR.
+.sp
+.LP
+The special meaning of reserved words or aliases can be removed by quoting any character of the reserved word. The recognition of function names or built-in command names cannot be altered by quoting them.
+.SS "Arithmetic Evaluation"
+.sp
+.LP
+The shell performs arithmetic evaluation for arithmetic substitution, to evaluate an arithmetic command, to evaluate an indexed array subscript, and to evaluate arguments to the built-in commands \fBshift\fR and \fBlet\fR. Arithmetic evaluation is also performed on argument operands of the built-in command printf that correspond to numeric format specifiers in the format operand. See \fBprintf\fR(1). Evaluations are performed using double precision floating point arithmetic or long double precision floating point for systems that provide this data type. Floating point constants follow the \fBANSI-C\fR programming language floating point conventions. Integer constants follow the \fBANSI-C\fR programming language integer constant conventions although only single byte character constants are recognized and character casts are not recognized. Constants can be of the form \fB[\fR\fIbase#\fR\fB]\fR\fIn\fR where \fIbase\fR is a decimal number between two and sixty-four representing the arithmetic base and \fIn\fR is a number in that base. The digits greater than \fB9\fR are represented by the lower case letters, the upper case letters, \fB@\fR, and \fB_\fR respectively. For bases less than or equal to \fB36\fR, upper and lower case characters can be used interchangeably.
+.sp
+.LP
+An arithmetic expression uses the same syntax, precedence, and associativity of expression as the C language. All the C language operators that apply to floating point quantities can be used. In addition, the operator \fB**\fR can be used for exponentiation. It has higher precedence than multiplication and is left associative. When the value of an arithmetic variable or subexpression can be represented as a long integer, all C language integer arithmetic operations can be performed. Variables can be referenced by name within an arithmetic expression without using the parameter expansion syntax. When a variable is referenced, its value is evaluated as an arithmetic expression. 
+.sp
+.LP
+Any of the following math library functions that are in the C math library can be used within an arithmetic expression:
+.sp
+.in +2
+.nf
+abs acos acosh asin asinh atan atan2 atanh cbrt 
+copysign cos cosh erf erfc exp exp2 expm1 fabs
+fdim finite floor fma fmax fmod hypot ilogb 
+int isinf isnan lgamma log log2 logb 
+nearbyint nextafter nexttoward pow remainder
+rint round sin sinh sqrt tan tanh tgamma trunc
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+An internal representation of a \fIvariable\fR as a double precision floating point can be specified with the \fB-E [\fR\fIn\fR\fB]\fR or \fB-F [\fR\fIn\fR\fB]\fR option of the \fBtypeset\fR special built-in command. The \fB-E\fR option causes the expansion of the value to be represented using scientific notation when it is expanded. The optional option argument \fIn\fR defines the number of significant figures. The \fB-F\fR option causes the expansion to be represented as a floating decimal number when it is expanded. The optional option argument \fIn\fR defines the number of places after the decimal point in this case.
+.sp
+.LP
+An internal integer representation of a \fIvariable\fR can be specified with the \fB-i\fR \fB[\fR\fIn\fR\fB]\fR option of the \fBtypeset\fR special built-in command. The optional option argument \fIn\fR specifies an arithmetic base to be used when expanding the variable. If you do not specify an arithmetic base, base 10 is used.
+.sp
+.LP
+Arithmetic evaluation is performed on the value of each assignment to a variable with the \fB-E\fR, \fB-F\fR, or \fB-i\fR option. Assigning a floating point number to a variable whose type is an integer causes the fractional part to be truncated. 
+.SS "Prompting"
+.sp
+.LP
+When used interactively, the shell prompts with the value of \fBPS1\fR after expanding it for parameter expansion, command substitution, and arithmetic substitution, before reading a command. In addition, each single \fB!\fR in the prompt is replaced by the command number. A \fB!!\fR is required to place \fB!\fR in the prompt. If at any time a NEWLINE is typed and further input is needed to complete a command, then the secondary prompt, that is, the value of \fBPS2\fR, is issued.
+.SS "Conditional Expressions"
+.sp
+.LP
+A \fBconditional expression\fR is used with the \fB[[\fR compound command to test attributes of files and to compare strings. Field splitting and file name generation are not performed on the words between \fB[[\fR and \fB]]\fR.
+.sp
+.LP
+Each expression can be constructed from one or more of the following unary or binary expressions:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists.
+.sp
+This option is the same as \fB-e\fR. This option is obsolete.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is a block special file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is a character special file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is an ordinary file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-g\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and it has its \fBsetgid\fR bit set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-G\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and its group matches the effective group id of this process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is a symbolic link.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and it has its sticky bit set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-L\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is a symbolic link.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR \fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if length of \fIstring\fR is \fBnon-zero\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-N\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and the modification time is greater than the last access time.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIoption\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if option named \fIoption\fR is on.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fI?option\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if option named \fIoption\fR is a valid option name.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-O\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is owned by the effective user id of this process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is a \fBFIFO\fR special file or a pipe.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is readable by current process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and has size greater than zero.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-S\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is a socket.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR \fIfildes\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if file descriptor number \fIfildes\fR is open and associated with a terminal device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and it has its \fBsetuid\fR bit set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-w\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is writable by current process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile\fR exists and is executable by current process. If \fIfile\fR exists and is a directory, then true if the current process has permission to search in the directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-z\fR \fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if length of \fIstring\fR is zero.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-ef\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile1\fR and \fIfile2\fR exist and refer to the same file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-nt\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile1\fR exists and \fIfile2\fR does not, or \fIfile1\fR is newer than \fIfile2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-ot\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIfile2\fR exists and \fIfile1\fR does not, or \fIfile1\fR is older than \fIfile2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIstring\fR is not null.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB==\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIstring\fR matches \fIpattern\fR. Any part of \fIpattern\fR can be quoted to cause it to be matched as a string. With a successful match to \fIpattern\fR, the \fB\&.sh.match\fR array variable contains the match and sub-pattern matches.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB=\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+Same as \fB==\fR, but is obsolete.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB!=\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIstring\fR does not match \fIpattern\fR. When the \fIstring\fR matches the \fIpattern\fR the \fB\&.sh.match\fR array variable contains the match and sub-pattern matches.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB=~\fR \fIere\fR\fR
+.ad
+.RS 21n
+.rt  
+True if \fIstring\fR matches the pattern \fB~(E)\fR\fIere\fR where \fIere\fR is an extended regular expression.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring1\fR \fB<\fR \fIstring2\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIstring1\fR comes before \fIstring2\fR based on \fBASCII\fR value of their characters.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring1\fR \fB>\fR \fIstring2\fR\fR
+.ad
+.RS 21n
+.rt  
+True, if \fIstring1\fR comes after \fIstring2\fR based on \fBASCII\fR value of their characters.
+.RE
+
+.sp
+.LP
+In each of the following expressions, if \fIfile\fR is of the form \fB/dev/fd/\fR\fIn\fR, where \fIn\fR is an integer, the test is applied to the open file whose descriptor number is \fIn\fR. The following obsolete arithmetic comparisons are supported: 
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-eq\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True, if \fIexp1\fR is equal to \fIexp2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-ge\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True, if \fIexp1\fR is greater than or equal to \fIexp2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-gt\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True, if \fIexp1\fR is greater than \fIexp2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-le\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True, if \fIexp1\fR is less than or equal to \fIexp2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-lt\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True, if \fIexp1\fR is less than \fIexp2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-ne\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True, if \fIexp1\fR is not equal to \fIexp2\fR.
+.RE
+
+.sp
+.LP
+A compound expression can be constructed from these primitives by using any of the following, listed in decreasing order of precedence:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fIexpression\fR\fB)\fR\fR
+.ad
+.RS 30n
+.rt  
+True, if \fIexpression\fR is true. Used to group expressions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR \fIexpression\fR\fR
+.ad
+.RS 30n
+.rt  
+True, if \fIexpression\fR is false.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexpression1\fR \fB&&\fR \fIexpression2\fR\fR
+.ad
+.RS 30n
+.rt  
+True, if \fIexpression1\fR and \fIexpression2\fR are both true.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexpression1\fR \fB||\fR \fIexpression2\fR\fR
+.ad
+.RS 30n
+.rt  
+True, if either \fIexpression1\fR or \fIexpression2\fR is true.
+.RE
+
+.SS "Input and Output"
+.sp
+.LP
+Before a command is executed, its input and output can be redirected using a special notation interpreted by the shell. The following can appear anywhere in a simple command or can precede or follow a command and are \fBnot\fR passed on to the invoked command. Command substitution, parameter expansion, and arithmetic substitution occur before \fIword\fR or \fIdigit\fR is used except as noted in this section. File name generation occurs only if the shell is interactive and the pattern matches a single file. Field splitting is not performed.
+.sp
+.LP
+In each of the following redirections, if \fIfile\fR is of the form \fB/dev/sctp/\fR\fIhost\fR\fB/\fR\fIport\fR, \fB/dev/tcp/\fR\fIhost\fR\fB/\fR\fIport\fR, or \fB/dev/udp/\fR\fIhost\fR\fB/\fR\fIport\fR, where \fIhost\fR is a hostname or host address, and \fIport\fR is a service specified by name or an integer port number, then the redirection attempts to make a \fBtcp\fR, \fBsctp\fR or \fBudp\fR connection to the corresponding socket.
+.sp
+.LP
+No intervening space is allowed between the characters of redirection operators.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+Use file \fIword\fR as standard input (file descriptor 0). 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+Use file \fIword\fR as standard output (file descriptor 1). If the file does not exist then it is created. If the file exists, and the \fBnoclobber\fR option is on, this causes an error. Otherwise, it is truncated to zero length.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>|\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+Same as \fB>\fR, except that it overrides the \fBnoclobber\fR option.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+Use file \fIword\fR as standard output. If the file exists, then output is appended to it (by first seeking to the end-of-file). Otherwise, the file is created. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+Open file \fIword\fR for reading and writing as standard input.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<\fR\fB[-]\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+The shell input is read up to a line that is the same as \fIword\fR after any quoting has been removed, or to an end-of-file. No parameter substitution, command substitution, arithmetic substitution or file name generation is performed on \fIword\fR. The resulting document, called a \fBhere-document\fR, becomes the standard input. If any character of \fIword\fR is quoted, then no interpretation is placed upon the characters of the document. Otherwise, parameter expansion, command substitution, and arithmetic substitution occur, \fB\e\fRNEWLINE is ignored, and \fB\e\fR must be used to quote the characters \fB\e\fR, \fB$\fR, \fB`\fR\&. If \fB-\fR is appended to \fB<<\fR, then all leading tabs are stripped from \fIword\fR and from the document. If \fB#\fR is appended to \fB<<\fR, then leading SPACEs and TABs are stripped off the first line of the document and up to an equivalent indentation is stripped from the remaining lines and from \fIword\fR. A tab stop is assumed to occur at every 8 columns for the purposes of determining the indentation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<<\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+A short form of here document in which \fIword\fR becomes the contents of the here-document after any parameter expansion, command substitution, and arithmetic substitution occur.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fR
+.ad
+.RS 14n
+.rt  
+The standard input is duplicated from file descriptor \fIdigit\fR, and similarly for the standard output using \fB>&\fR\fIdigit\fR. See \fBdup\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fB-\fR\fR
+.ad
+.RS 14n
+.rt  
+The file descriptor specified by \fIdigit\fR is moved to standard input. Similarly for the standard output using \fB>&\fR\fIdigit\fR\fB-\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&-\fR\fR
+.ad
+.RS 14n
+.rt  
+The standard input is closed. Similarly for the standard output using \fB>&-\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&p\fR\fR
+.ad
+.RS 14n
+.rt  
+The input from the co-process is moved to standard input. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>&p\fR\fR
+.ad
+.RS 14n
+.rt  
+The output to the co-process is moved to standard output.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<#((\fR\fIexpr\fR\fB))\fR\fR
+.ad
+.RS 14n
+.rt  
+Evaluate arithmetic expression \fIexpr\fR and position file descriptor 0 to the resulting value bytes from the start of the file. The variables \fBCUR\fR and \fBEOF\fR evaluate to the current offset and end-of-file offset respectively when evaluating \fIexpr\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>#((\fR\fIexpr\fR\fB))\fR\fR
+.ad
+.RS 14n
+.rt  
+The same as \fB<#\fR except applies to file descriptor 1.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<#\fR\fIpattern\fR\fR
+.ad
+.RS 14n
+.rt  
+Seek forward to the beginning of the next line containing pattern.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<##\fR\fIpattern\fR\fR
+.ad
+.RS 14n
+.rt  
+The same as \fB<#\fR, except that the portion of the file that is skipped is copied to standard output.
+.RE
+
+.sp
+.LP
+If one of the redirection operators is preceded by a digit, with no intervening space, then the file descriptor number referred to is that specified by the digit (instead of the default 0 or 1). If one of the redirection operators other than \fB>&-\fR and the \fB>#\fR and \fB<#\fR forms, is preceded by \fB{\fR\fIvarname\fR\fB}\fR with no intervening space, then a file descriptor number \fB> 10\fR is selected by the shell and stored in the variable \fIvarname\fR. If \fB>&-\fR or the any of the \fB>#\fR and \fB<#\fR forms is preceded by \fB{\fR\fIvarname\fR\fB}\fR the value of \fIvarname\fR defines the file descriptor to close or position. For example:
+.sp
+.in +2
+.nf
+\&... 2>&1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+means file descriptor 2 is to be opened for writing as a duplicate of file descriptor 1 and
+.sp
+.in +2
+.nf
+exec [\fIn\fR]<\fIfile\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+means open \fIfile\fR for reading and store the file descriptor number in variable \fIn\fR. The order in which redirections are specified is significant. The shell evaluates each redirection in terms of the (\fIfile_descriptor\fR, \fIfile\fR) association at the time of evaluation. For example:
+.sp
+.in +2
+.nf
+\&... 1>\fIfname\fR 2>&1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+first associates file descriptor 1 with file \fIfname\fR. It then associates file descriptor 2 with the file associated with file descriptor 1, that is, \fIfname\fR. If the order of redirections were reversed, file descriptor 2 would be associated with the terminal (assuming file descriptor 1 had been) and then file descriptor 1 would be associated with file \fIfname\fR. If a command is followed by \fB&\fR and job control is not active, the default standard input for the command is the empty file \fB/dev/null\fR. Otherwise, the environment for the execution of a command contains the file descriptors of the invoking shell as modified by input and output specifications.
+.SS "Environment"
+.sp
+.LP
+The \fIenvironment\fR is a list of name-value pairs that is passed to an executed program in the same way as a normal argument list. See \fBenviron\fR(5).
+.sp
+.LP
+The names must be \fIidentifiers\fR and the values are character strings. The shell interacts with the environment in several ways. On invocation, the shell scans the environment and creates a variable for each name found, giving it the corresponding value and attributes and marking it \fBexport\fR. Executed commands inherit the environment. If the user modifies the values of these variables or creates new ones, using the \fBexport\fR or \fBtypeset\fR \fB-x\fR commands, they become part of the environment. The environment seen by any executed command is thus composed of any name-value pairs originally inherited by the shell, whose values can be modified by the current shell, plus any additions which must be noted in \fBexport\fR or \fBtypeset\fR \fB-x\fR commands. The environment for any simple-command or function can be augmented by prefixing it with one or more variable assignments. A variable assignment argument is a word of the form \fIidentifier\fR\fB=\fR\fIvalue\fR. Thus:
+.sp
+.in +2
+.nf
+TERM=450 cmd args
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+and 
+.sp
+.in +2
+.nf
+(export TERM; TERM=450; cmd args)
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+are equivalent (as far as the execution of \fIcmd\fR is concerned except for special built-in commands listed in the \fBBuilt-Ins\fR section, those that are preceded with a dagger. If the obsolete \fB-k\fR option is set, all variable assignment arguments are placed in the environment, even if they occur after the command name. 
+.sp
+.LP
+The following example first prints \fBa=b c\fR and then \fBc\fR:
+.sp
+.in +2
+.nf
+echo a=b c
+set -k
+echo a=b c
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+This feature is intended for use with scripts written for early versions of the shell and its use in new scripts is strongly discouraged.
+.SS "Functions"
+.sp
+.LP
+For historical reasons, there are two ways to define functions, the \fBname()\fR syntax and the \fBfunction\fR \fBname\fR syntax. These are described in the \fBCommands\fR section of this manual page. 
+.sp
+.LP
+Shell functions are read in and stored internally. Alias names are resolved when the function is read. Functions are executed like commands with the arguments passed as positional parameters. See the \fBExecution\fR section of this manual page for details.
+.sp
+.LP
+Functions defined by the \fBfunction\fR \fBname\fR syntax and called by name execute in the same process as the caller and share all files and present working directory with the caller. Traps caught by the caller are reset to their default action inside the function. A trap condition that is not caught or ignored by the function causes the function to terminate and the condition to be passed on to the caller. A trap on \fBEXIT\fR set inside a function is executed in the environment of the caller after the function completes. Ordinarily, variables are shared between the calling program and the function. However, the \fBtypeset\fR special built-in command used within a function defines local variables whose scope includes the current function. They can be passed to functions that they call in the variable assignment list that precedes the call or as arguments passed as name references. Errors within functions return control to the caller.
+.sp
+.LP
+Functions defined with the \fBname()\fR syntax and functions defined with the \fBfunction\fR \fBname\fR syntax that are invoked with the \fB\&.\fR special built-in are executed in the caller's environment and share all variables and traps with the caller. Errors within these function executions cause the script that contains them to abort.
+.sp
+.LP
+The special built-in command \fBreturn\fR is used to return from function calls.
+.sp
+.LP
+Function names can be listed with the \fB-f\fR or \fB+f\fR option of the \fBtypeset\fR special built-in command. The text of functions, when available, is also listed with \fB-f\fR. Functions can be undefined with the \fB-f\fR option of the \fBunset\fR special built-in command.
+.sp
+.LP
+Ordinarily, functions are unset when the shell executes a shell script. Functions that need to be defined across separate invocations of the shell should be placed in a directory and the \fBFPATH\fR variable should contain the name of this directory. They can also be specified in the \fBENV\fR file.
+.SS "Discipline Functions"
+.sp
+.LP
+Each variable can have zero or more discipline functions associated with it. The shell initially understands the discipline names \fBget\fR, \fBset\fR, \fBappend\fR, and \fBunset\fR but on most systems others can be added at run time via the C programming interface extension provided by the \fBbuiltin\fR built-in utility. If the \fBget\fR discipline is defined for a variable, it is invoked whenever the specified variable is referenced. If the variable \fB\&.sh.value\fR is assigned a value inside the discipline function, the referenced variable is evaluated to this value instead. If the \fBset\fR discipline is defined for a variable, it is invoked whenever the specified variable is assigned a value. If the \fBappend\fR discipline is defined for a variable, it is invoked whenever a value is appended to the specified variable. The variable \fB\&.sh.value\fR is specified the value of the variable before invoking the discipline, and the variable is assigned the value of \fB\&.sh.value\fR after the discipline completes. If .\fBsh.value\fR is \fBunset\fR inside the discipline, then that value is unchanged. If the \fBunset\fR discipline is defined for a variable, it is invoked whenever the specified variable is unset. The variable is not unset unless it is unset explicitly from within this discipline function.
+.sp
+.LP
+The variable \fB\&.sh.name\fR contains the name of the variable for which the discipline function is called, \fB\&.sh.subscript\fR is the subscript of the variable, and \fB\&.sh.value\fR contains the value being assigned inside the \fBset\fR discipline function. For the \fBset\fR discipline, changing \fB\&.sh.value\fR changes the value that gets assigned. 
+.SS "Jobs"
+.sp
+.LP
+If the monitor option of the \fBset\fR command is turned on, an interactive shell associates a job with each pipeline. It keeps a table of current jobs, printed by the \fBjobs\fR command, and assigns them small integer numbers. When a job is started asynchronously with \fB&\fR, the shell prints a line which looks like:
+.sp
+.in +2
+.nf
+[1] 1234
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+indicating that the job which was started asynchronously was job number 1 and had one (top-level) process, whose process id was \fB1234\fR.
+.sp
+.LP
+If you are running a job and wish to stop it, CTRL-z sends a \fBSTOP\fR signal to the current job. The shell normally displays a message that the job has been stopped, and displays another prompt. You can then manipulate the state of this job, putting it in the background with the \fBbg\fR command, or run some other commands and then eventually bring the job back into the foreground with the foreground command \fBfg\fR. A CTRL-z takes effect immediately and is like an interrupt in that pending output and unread input are discarded when it is typed.
+.sp
+.LP
+A job being run in the background stops if it tries to read from the terminal. Background jobs are normally allowed to produce output, but this can be disabled by giving the command \fBsttytostop\fR. If you set this \fBtty\fR option, then background jobs stop when they try to produce output like they do when they try to read input. 
+.sp
+.LP
+There are several ways to refer to jobs in the shell. A job can be referred to by the process id of any process of the job or by one of the following:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fInumber\fR\fR
+.ad
+.RS 12n
+.rt  
+The job with the specified number.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fIstring\fR\fR
+.ad
+.RS 12n
+.rt  
+Any job whose command line begins with \fIstring\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%?\fR\fIstring\fR\fR
+.ad
+.RS 12n
+.rt  
+Any job whose command line contains \fIstring\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%%\fR\fR
+.ad
+.RS 12n
+.rt  
+Current job.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%+\fR\fR
+.ad
+.RS 12n
+.rt  
+Equivalent to \fB%%\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%-\fR\fR
+.ad
+.RS 12n
+.rt  
+Previous job.
+.RE
+
+.sp
+.LP
+The shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints a prompt. This is done so that it does not otherwise disturb your work. The notify option of the \fBset\fR command causes the shell to print these job change messages as soon as they occur.
+.sp
+.LP
+When the \fBmonitor\fR option is on, each background job that completes triggers any trap set for \fBCHLD\fR.
+.sp
+.LP
+When you try to leave the shell while jobs are running or stopped, you are warned that \fBYou have stopped(running) jobs.\fR You can use the \fBjobs\fR command to see what they are. If you immediately try to exit again, the shell does not warn you a second time, and the stopped jobs are terminated. When a login shell receives a \fBHUP\fR signal, it sends a \fBHUP\fR signal to each job that has not been disowned with the \fBdisown\fR built-in command.
+.SS "Signals"
+.sp
+.LP
+The \fBINT\fR and \fBQUIT\fR signals for an invoked command are ignored if the command is followed by \fB&\fR and the \fBmonitor\fR option is not active. Otherwise, signals have the values inherited by the shell from its parent. See the \fBtrap\fR built-in command.
+.SS "Execution"
+.sp
+.LP
+Each time a command is read, the substitutions are carried out. If the command name matches one of the ones in the \fBSpecial Built-in Commands\fR section of this manual page, it is executed within the current shell process. Next, the command name is checked to see if it matches a user defined function. If it does, the positional parameters are saved and then reset to the arguments of the function call. A function is also executed in the current shell process. When the function completes or issues a return, the positional parameter list is restored. For functions defined with the \fBfunction\fR \fBname\fR syntax, any trap set on \fBEXIT\fR within the function is executed. The exit value of a function is the value of the last command executed. If a command name is not a special built-in command or a user defined function, but it is one of the built-in commands, it is executed in the current shell process.
+.sp
+.LP
+The shell variable \fBPATH\fR defines the search path for the directory containing the command. Alternative directory names are separated by a colon (\fB:\fR). The default path is \fB/bin:/usr/bin:\fR, specifying \fB/bin\fR, \fB/usr/bin\fR, and the current directory in that order. The current directory can be specified by two or more adjacent colons, or by a colon at the beginning or end of the path list. If the command name contains a slash (\fB/\fR), the search path is not used. Otherwise, each directory in the path is searched for an executable file of the specified name that is not a directory. If found, and if the shell determines that there is a built-in version of a command corresponding to a specified pathname, this built-in is invoked in the current process. If found, and this directory is also contained in the value of the \fBFPATH\fR variable, then this file is loaded into the current shell environment as if it were the argument to the . command except that only preset aliases are expanded, and a function of the specified name is executed as described in this manual page. If not found, and the file \fB\&.paths\fR is found, and this file contains a line of the form \fBFPATH=\fR\fIpath\fR where \fIpath\fR is an existing directory, and this directory contains a file of the specified name, then this file is loaded into the current shell environment as if it were the argument to the \fB\&. special\fR built-in command and a function of the specified name is executed. Otherwise, if found, a process is created and an attempt is made to execute the command using \fBexec\fR(2).
+.sp
+.LP
+When an executable is found, the directory where it is found in is searched for a file named \fB\&.paths\fR. If this file is found and it contains a line of the form \fBBUILTIN_LIB=\fR\fIvalue\fR, the library named by \fIvalue\fR is searched for as if it were an option argument to \fBbuiltin -f\fR, and if it contains a built-in of the specified name this is executed instead of a command by this name. Otherwise, if this file is found and it contains a line of the form \fIname\fR\fB=\fR\fIvalue\fR in the first or second line, then the environment variable \fIname\fR is modified by prepending the directory specified by \fIvalue\fR to the directory list. If \fIvalue\fR is not an absolute directory, then it specifies a directory relative to the directory that the executable was found. If the environment variable \fIname\fR does not already exist it is added to the environment list for the specified command.
+.sp
+.LP
+If the file has execute permission but is not an \fBa.out\fR file, it is assumed to be a file containing shell commands. A separate shell is spawned to read it. All non-exported variables are removed in this case. If the shell command file doesn't have read permission, and/or if the \fBsetuid\fR and \fBsetgid\fR bits are set on the file, then the shell executes an agent whose job it is to set up the permissions and execute the shell with the shell command file passed down as an open file. A parenthesized command is executed in a sub-shell without removing non-exported variables.
+.SS "Command Re-entry"
+.sp
+.LP
+The text of the last \fBHISTSIZE\fR (default 512) commands entered from a terminal device is saved in a history file. The file \fB$HOME/.sh_history\fR is used if the \fBHISTFILE\fR variable is not set or if the file it names is not writable. A shell can access the commands of all interactive shells which use the same named \fBHISTFILE\fR. The built-in command \fBhist\fR is used to list or edit a portion of this file. The portion of the file to be edited or listed can be selected by number or by giving the first character or characters of the command. A single command or range of commands can be specified. If you do not specify an editor program as an argument to \fBhist\fR then the value of the variable \fBHISTEDIT\fR is used. If \fBHISTEDIT\fR is unset, the obsolete variable \fBFCEDIT\fR is used. If \fBFCEDIT\fR is not defined, then \fB/bin/ed\fR is used. The edited commands are printed and executed again upon leaving the editor unless you quit without writing. The \fB-s\fR option (and in obsolete versions, the editor name \fB-\fR) is used to skip the editing phase and to re-execute the command. In this case a substitution parameter of the form \fIold\fR\fB=\fR\fInew\fRcan be used to modify the command before execution. For example, with the preset alias \fBr\fR, which is aliased to \fB\&'hist -s'\fR, typing \fB`r bad=good c'\fR re-executes the most recent command which starts with the letter \fBc\fR, replacing the first occurrence of the string bad with the string good. 
+.SS "Inline Editing Options"
+.sp
+.LP
+Normally, each command line entered from a terminal device is simply typed followed by a NEWLINE (RETURN or LINE FEED). If either the \fBemacs\fR, \fBgmacs\fR, or \fBvi\fR option is active, the user can edit the command line. To be in either of these edit modes set the corresponding option. An editing option is automatically selected each time the \fBVISUAL\fR or \fBEDITOR\fR variable is assigned a value ending in either of these option names.
+.sp
+.LP
+The editing features require that the user's terminal accept RETURN as carriage return without line feed and that a SPACE must overwrite the current character on the screen.
+.sp
+.LP
+Unless the \fBmultiline\fR option is on, the editing modes implement a concept where the user is looking through a window at the current line. The window width is the value of \fBCOLUMNS\fR if it is defined, otherwise \fB80\fR. If the window width is too small to display the prompt and leave at least 8 columns to enter input, the prompt is truncated from the left. If the line is longer than the window width minus two, a mark is displayed at the end of the window to notify the user. As the cursor moves and reaches the window boundaries the window is centered about the cursor. The mark is a \fB>\fR (\fB<, *\fR) if the line extends on the right , left, or both sides of the window.
+.sp
+.LP
+The search commands in each edit mode provide access to the history file. Only strings are matched, not patterns, although a leading \fB^\fR in the string restricts the match to begin at the first character in the line.
+.sp
+.LP
+Each of the edit modes has an operation to list the files or commands that match a partially entered word. When applied to the first word on the line, or the first word after a \fB;\fR, \fB|\fR, \fB&\fR, or \fB(\fR, and the word does not begin with \fB~\fR or contain a \fB/\fR, the list of aliases, functions, and executable commands defined by the \fBPATH\fR variable that could match the partial word is displayed. Otherwise, the list of files that match the specified word is displayed. If the partially entered word does not contain any file expansion characters, a \fB*\fR is appended before generating these lists. After displaying the generated list, the input line is redrawn. These operations are called command name listing and file name listing, respectively. There are additional operations, referred to as command name completion and file name completion, which compute the list of matching commands or files, but instead of printing the list, replace the current word with a complete or partial match. For file name completion, if the match is unique, a \fB/\fR is appended if the file is a directory and a space is appended if the file is not a directory. Otherwise, the longest common prefix for all the matching files replaces the word. For command name completion, only the portion of the file names after the last \fB/\fR are used to find the longest command prefix. If only a single name matches this prefix, then the word is replaced with the command name followed by a space. When using a \fBTAB\fR for completion that does not yield a unique match, a subsequent TAB provides a numbered list of matching alternatives. A specific selection can be made by entering the selection number followed by a TAB.
+.SS "Key Bindings"
+.sp
+.LP
+The \fBKEYBD\fR trap can be used to intercept keys as they are typed and change the characters that are actually seen by the shell. This trap is executed after each character (or sequence of characters when the first character is ESC) is entered while reading from a terminal.
+.sp
+.LP
+The variable \fB\&.sh.edchar\fR contains the character or character sequence which generated the trap. Changing the value of \fB\&.sh.edchar\fR in the trap action causes the shell to behave as if the new value were entered from the keyboard rather than the original value. The variable \fB\&.sh.edcol\fR is set to the input column number of the cursor at the time of the input. The variable \fB\&.sh.edmode\fR is set to \fBESC\fR when in \fBvi\fR insert mode and is null otherwise. By prepending \fB${.sh.editmode}\fR to a value assigned to \fB\&.sh.edchar\fR it causes the shell to change to control mode if it is not already in this mode.
+.sp
+.LP
+This trap is not invoked for characters entered as arguments to editing directives, or while reading input for a character search.
+.SS "\fBemacs\fR Editing Mode"
+.sp
+.LP
+This mode is entered by enabling either the \fBemacs\fR or \fBgmacs\fR option. The only difference between these two modes is the way they handle \fB^T\fR. To edit, the user moves the cursor to the point needing correction and then inserts or deletes characters or words as needed. All the editing commands are control characters or escape sequences. The notation for control characters is caret (\fB^\fR) followed by the character.
+.sp
+.LP
+For example, \fB^F\fR is the notation for CTRL/F. This is entered by depressing \fBf\fR while holding down the CTRL (control) key. The SHIFT key is not depressed. (The notation \fB^?\fR indicates the DEL (delete) key.)
+.sp
+.LP
+The notation for escape sequences is \fBM-\fR followed by a character. For example, \fBM-f\fR (pronounced \fBMeta f\fR) is entered by depressing ESC (\fBASCII 033\fR) followed by \fBf\fR. \fBM-F\fR is the notation for ESC followed by \fBF\fR.
+.sp
+.LP
+All edit commands operate from any place on the line, not just at the beginning. The RETURN or the LINE FEED key is not entered after edit commands except when noted.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^F\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor forward (right) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[C\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor forward (right) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-f\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor forward one word. The \fBemacs\fR editor's idea of a word is a string of characters consisting of only letters, digits and underscores.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^B\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor backward (left) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[D\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor backward (left) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-b\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor backward one word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^A\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the beginning of the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[H\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the beginning of the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^E\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the end of the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[Y\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the end of line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^]\fR\fIchar\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor forward to the character \fIchar\fR on the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^]\fR\fIchar\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor backwards to the character \fIchar\fR on the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^X^X\fR\fR
+.ad
+.RS 13n
+.rt  
+Interchange the cursor and the mark.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIerase\fR\fR
+.ad
+.RS 13n
+.rt  
+Delete the previous character. The user-defined erase character is defined by the \fBstty\fR(1) command, and is usually \fB^H\fR or \fB#\fR. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIlnext\fR\fR
+.ad
+.RS 13n
+.rt  
+Removes the next character's editing features. The user-defined literal next character is defined by the \fBstty\fR(1) command, or is \fB^V\fR if not defined. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^D\fR\fR
+.ad
+.RS 13n
+.rt  
+Delete the current character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-d\fR\fR
+.ad
+.RS 13n
+.rt  
+Delete the current word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^H\fR\fR
+.ad
+.RS 13n
+.rt  
+MetaBACKSPACE. Delete the previous word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-h\fR\fR
+.ad
+.RS 13n
+.rt  
+Delete the previous word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^?\fR\fR
+.ad
+.RS 13n
+.rt  
+MetaDEL. Delete the previous word. If your interrupt character is \fB^?\fR (DEL, the default), this command does not work.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^T\fR\fR
+.ad
+.RS 13n
+.rt  
+Transpose the current character with the previous character, and advance the cursor in \fBemacs\fR mode. Transpose two previous characters in \fBgmacs\fR mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^C\fR\fR
+.ad
+.RS 13n
+.rt  
+Capitalize the current character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-c\fR\fR
+.ad
+.RS 13n
+.rt  
+Capitalize the current word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-l\fR\fR
+.ad
+.RS 13n
+.rt  
+Change the current word to lower case.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^K\fR\fR
+.ad
+.RS 13n
+.rt  
+Delete from the cursor to the end of the line. If preceded by a numerical parameter whose value is less than the current cursor position, delete from specified position up to the cursor. If preceded by a numerical parameter whose value is greater than the current cursor position, then delete from cursor up to specified cursor position.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^W\fR\fR
+.ad
+.RS 13n
+.rt  
+Kill from the cursor to the mark.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-p\fR\fR
+.ad
+.RS 13n
+.rt  
+Push the region from the cursor to the mark on the stack.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIkill\fR\fR
+.ad
+.RS 13n
+.rt  
+Kill the entire current line. The user-defined kill character is defined by the \fBstty\fR(1) command, usually a \fB^G\fR or \fB@\fR. If two kill characters are entered in succession, all kill characters from then on cause a line feed. This is useful when using paper terminals.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^Y\fR\fR
+.ad
+.RS 13n
+.rt  
+Restore the last item removed from line. Yank the item back to the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^L\fR\fR
+.ad
+.RS 13n
+.rt  
+Line feed and print the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^L\fR\fR
+.ad
+.RS 13n
+.rt  
+Clear the screen.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^@\fR\fR
+.ad
+.RS 13n
+.rt  
+Null character. Set mark.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIspace\fR\fR
+.ad
+.RS 13n
+.rt  
+MetaSPACE. Set the mark.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^J\fR\fR
+.ad
+.RS 13n
+.rt  
+New line. Execute the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^M\fR\fR
+.ad
+.RS 13n
+.rt  
+Return. Execute the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOF\fR\fR
+.ad
+.RS 13n
+.rt  
+End-of-file character, normally \fB^D\fR, is processed as an \fBend-of-file\fR only if the current line is null.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^P\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the previous command. Each time \fB^P\fR is entered the previous command back in time is accessed. Moves back one line when it is not on the first line of a multi-line command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[A\fR\fR
+.ad
+.RS 13n
+.rt  
+Equivalent to \fB^P\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-<\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the least recent (oldest) history line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM->\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the most recent (youngest) history line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^N\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the next command line. Each time \fB^N\fR is entered the next command line forward in time is accessed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[B\fR\fR
+.ad
+.RS 13n
+.rt  
+Equivalent to \fB^N\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^R\fR\fIstring\fR\fR
+.ad
+.RS 13n
+.rt  
+Reverse search history for a previous command line containing \fIstring\fR. If a parameter of zero is specified, the search is forward. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is omitted, then the next command line containing the most recent \fIstring\fR is accessed. In this case a parameter of zero reverses the direction of the search.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^O\fR\fR
+.ad
+.RS 13n
+.rt  
+Operate. Execute the current line and fetch the next line relative to current line from the history file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIdigits\fR\fR
+.ad
+.RS 13n
+.rt  
+Escape. Define numeric parameter. The digits are taken as a parameter to the next command. The commands that accept a parameter are: \fB^F\fR, \fB^B\fR, \fBERASE\fR, \fB^C\fR, \fB^D\fR, \fB^K\fR, \fB^R\fR, \fB^P\fR, \fB^N\fR, \fB^]\fR, \fBM-.\fR, \fBM-\fR, \fBM-^]\fR, \fBM-_\fR, \fBM-=\fR, \fBM-b\fR, \fBM-c\fR, \fBM-d\fR, \fBM-f\fR, \fBM-h\fR, \fBM-l\fR, and \fBM-^H\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIletter\fR\fR
+.ad
+.RS 13n
+.rt  
+Soft-key. Search the alias list for an alias by the name \fIletter\fR. If an alias of \fIletter\fR is defined, insert its value on the input queue. \fIletter\fR must not be one of the metafunctions in this section.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[\fR\fIletter\fR\fR
+.ad
+.RS 13n
+.rt  
+Soft key. Search the alias list for an alias by the name \fIletter\fR. If an alias of this name is defined, insert its value on the input queue. This can be used to program function keys on many terminals.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-.\fR\fR
+.ad
+.RS 13n
+.rt  
+The last word of the previous command is inserted on the line. If preceded by a numeric parameter, the value of this parameter determines which word to insert rather than the last word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-_\fR\fR
+.ad
+.RS 13n
+.rt  
+Same as \fBM-.\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-*\fR\fR
+.ad
+.RS 13n
+.rt  
+Attempt filename generation on the current word. As asterisk is appended if the word does not match any file or contain any special pattern characters.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fRESC\fR
+.ad
+.RS 13n
+.rt  
+Command or file name completion as described in this manual page.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^I\fRTAB\fR
+.ad
+.RS 13n
+.rt  
+Attempts command or file name completion as described in this manual page. If a partial completion occurs, repeating this behaves as if \fBM-=\fR were entered. If no match is found or entered after SPACE, a TAB is inserted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-=\fR\fR
+.ad
+.RS 13n
+.rt  
+If not preceded by a numeric parameter, generates the list of matching commands or file names as described in this manual page. Otherwise, the word under the cursor is replaced by the item corresponding to the value of the numeric parameter from the most recently generated command or file list. If the cursor is not on a word, the word is inserted instead. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^U\fR\fR
+.ad
+.RS 13n
+.rt  
+Multiply parameter of next command by \fB4\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 13n
+.rt  
+Escape the next character. Editing characters, the user's erase, kill and interrupt (normally \fB^?\fR) characters can be entered in a command line or in a search string if preceded by a \fB\e\fR\&. The \fB\e\fR removes the next character's editing features, if any.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^V\fR\fR
+.ad
+.RS 13n
+.rt  
+Display the version of the shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-#\fR\fR
+.ad
+.RS 13n
+.rt  
+If the line does not begin with a \fB#\fR, a \fB#\fR is inserted at the beginning of the line and after each NEWLINE, and the line is entered. This causes a comment to be inserted in the history file. If the line begins with a \fB#\fR, the \fB#\fR is deleted and one \fB#\fR after each NEWLINE is also deleted.
+.RE
+
+.SS "\fBvi\fR Editing Mode"
+.sp
+.LP
+There are two typing modes. Initially, when you enter a command you are in the input mode. To edit, the user enters control mode by typing ESC (033) and moves the cursor to the point needing correction and then inserts or deletes characters or words as needed. Most control commands accept an optional repeat \fIcount\fR prior to the command. 
+.sp
+.LP
+When in vi mode on most systems, canonical processing is initially enabled and the command is echoed again if the speed is 1200 baud or greater and it contains any control characters or less than one second has elapsed since the prompt was printed. The ESC character terminates canonical processing for the remainder of the command and the user can then modify the command line. This scheme has the advantages of canonical processing with the type-ahead echoing of raw mode.
+.sp
+.LP
+If the option \fBviraw\fR is also set, the terminal is always have canonical processing disabled. This mode is implicit for systems that do not support two alternate end of line delimiters, and might be helpful for certain terminals. 
+.SS "Input Edit Commands"
+.sp
+.LP
+By default the editor is in input mode.
+.sp
+.LP
+The following input edit commands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fBERASE\fR
+.ad
+.RS 10n
+.rt  
+User defined erase character as defined by the \fBstty\fR command, usually \fB^H\fR or \fB#\fR. Delete previous character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^W\fR\fR
+.ad
+.RS 10n
+.rt  
+Delete the previous blank separated word. On some systems the \fBviraw\fR option might be required for this to work.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBEOF\fR
+.ad
+.RS 10n
+.rt  
+As the first character of the line causes the shell to terminate unless the \fBignoreeof\fR option is set. Otherwise this character is ignored.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIlnext\fR\fR
+.ad
+.RS 10n
+.rt  
+User defined literal next character as defined by the \fBstty\fR(1) or \fB^V\fR if not defined. Removes the next character's editing features, if any. On some systems the \fBviraw\fR option might be required for this to work.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 10n
+.rt  
+Escape the next ERASE or KILL character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^I\fR TAB\fR
+.ad
+.RS 10n
+.rt  
+Attempts command or file name completion as described in this manual page and returns to input mode. If a partial completion occurs, repeating this behaves as if \fB=\fR were entered from control mode. If no match is found or entered after SPACE, a TAB is inserted.
+.RE
+
+.SS "Motion Edit Commands"
+.sp
+.LP
+The motion edit commands move the cursor.
+.sp
+.LP
+The following motion edit commands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]l\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor forward (right) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][C\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor forward (right) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]w\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor forward one alphanumeric word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]W\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the beginning of the next word that follows a blank.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]e\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the end of the word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]E\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the end of the current blank delimited word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]h\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor backward (left) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][D\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor backward (left) one character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]b\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor backward one word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]B\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the preceding blank separated word.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]|\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to column \fIcount\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]f\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+Find the next character \fIc\fR in the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]F\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+Find the previous character \fIc\fR in the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]t\fR\fIC\fR\fR
+.ad
+.RS 13n
+.rt  
+Equivalent to \fBf\fR followed by \fBh\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]T\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+Equivalent to \fBF\fR followed by \fBl\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB];\fR\fR
+.ad
+.RS 13n
+.rt  
+Repeat \fIcount\fR times the last single character find command: \fBf\fR, \fBF\fR, \fBt,\fR or \fBT\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB],\fR\fR
+.ad
+.RS 13n
+.rt  
+Reverse the last single character find command \fIcount\fR times.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the start of line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to start of line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[H\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the first non-blank character in the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the end of the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[Y\fR\fR
+.ad
+.RS 13n
+.rt  
+Move the cursor to the end of the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fR
+.ad
+.RS 13n
+.rt  
+Moves to balancing \fB(\fR, \fB)\fR, \fB{\fR, \fB}\fR, \fB[\fR, or \fB]\fR. If cursor is not on one of the characters described in this section, the remainder of the line is searched for the first occurrence of one of the characters first.
+.RE
+
+.SS "Search Edit Commands"
+.sp
+.LP
+The search edit commands access your command history.
+.sp
+.LP
+The following search edit commands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]k\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]-\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed.
+.sp
+Equivalent to \fBk\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][A\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed.
+.sp
+Equivalent to \fBk\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]j\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]+\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed.
+.sp
+Equivalent to \fBj\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][B\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed.
+.sp
+Equivalent to \fBj\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]G\fR\fR
+.ad
+.RS 13n
+.rt  
+Fetch command number \fIcount\fR. The default is the least recent history command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/\fR\fIstring\fR\fR
+.ad
+.RS 13n
+.rt  
+Search backward through history for a previous command containing \fIstring\fR. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is null, the previous string is used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fIstring\fR\fR
+.ad
+.RS 13n
+.rt  
+Search forward through history for a previous command containing \fIstring\fR. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is null, the previous string is used.
+.sp
+Same as \fI/\fR except that search is in the forward direction.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBn\fR\fR
+.ad
+.RS 13n
+.rt  
+Search in the backwards direction for the next match of the last pattern to \fI/\fR or \fI?\fR commands.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBN\fR\fR
+.ad
+.RS 13n
+.rt  
+Search in the forward direction for next match of the last pattern to \fI/\fR or \fI?\fR.
+.RE
+
+.SS "Text Modification Edit Commands"
+.sp
+.LP
+The following commands modify the line:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBa\fR\fR
+.ad
+.RS 19n
+.rt  
+Enter input mode and enter text after the current character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA\fR\fR
+.ad
+.RS 19n
+.rt  
+Append text to the end of the line. Equivalent to \fB$a\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]c\fR\fImotion\fR\fR
+.ad
+.br
+.na
+\fB\fBc[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+Delete current character through the character that \fImotion\fR would move the cursor to and enter input mode. If \fImotion\fR is \fBc\fR, the entire line is deleted and input mode entered.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBC\fR\fR
+.ad
+.RS 19n
+.rt  
+Delete the current character through the end of line and enter input mode. Equivalent to \fBc$\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS\fR\fR
+.ad
+.RS 19n
+.rt  
+Equivalent to \fBcc\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]s\fR\fR
+.ad
+.RS 19n
+.rt  
+Replace characters under the cursor in input mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD[\fR\fIcount\fR\fB]d\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+Delete the current character through the end of line. Equivalent to d$.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBd[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+Delete current character through the character that \fImotion\fR would move to. If \fImotion\fR is d , the entire line is deleted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 19n
+.rt  
+Enter input mode and insert text before the current character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBI\fR\fR
+.ad
+.RS 19n
+.rt  
+Insert text before the beginning of the line. Equivalent to \fB0i\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]P\fR\fR
+.ad
+.RS 19n
+.rt  
+Place the previous text modification before the cursor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]p\fR\fR
+.ad
+.RS 19n
+.rt  
+Place the previous text modification after the cursor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBR\fR\fR
+.ad
+.RS 19n
+.rt  
+Enter input mode and replace characters on the screen with characters you type overlay fashion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]r\fR\fIc\fR\fR
+.ad
+.RS 19n
+.rt  
+Replace the \fIcount\fR characters starting at the current cursor position with \fIc\fR, and advance the cursor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]x\fR\fR
+.ad
+.RS 19n
+.rt  
+Delete current character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]X\fR\fR
+.ad
+.RS 19n
+.rt  
+Delete preceding character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR].\fR\fR
+.ad
+.RS 19n
+.rt  
+Repeat the previous text modification command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]~\fR\fR
+.ad
+.RS 19n
+.rt  
+Invert the case of the \fIcount\fR characters starting at the current cursor position and advance the cursor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]_\fR\fR
+.ad
+.RS 19n
+.rt  
+Causes the \fIcount\fR word of the previous command to be appended and input mode entered. The last word is used if \fIcount\fR is omitted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 19n
+.rt  
+Causes an \fB*\fR to be appended to the current word and file name generation attempted. If no match is found, it rings the bell. Otherwise, the word is replaced by the matching pattern and input mode is entered.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 19n
+.rt  
+Command or file name completion as described in this manual page.
+.RE
+
+.SS "Other Edit Commands"
+.sp
+.LP
+The following miscellaneous edit commands are supported: 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]y\fR\fImotion\fR\fR
+.ad
+.br
+.na
+\fB\fBy[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 18n
+.rt  
+Yank the current character through the character to which \fImotion\fR would move the cursor. Put the yanked characters in the delete buffer. The text and cursor position are unchanged.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fByy\fR\fR
+.ad
+.RS 18n
+.rt  
+Yank the current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBY\fR\fR
+.ad
+.RS 18n
+.rt  
+Yank the current line from the current cursor location to the end of the line. Equivalent to \fBy$\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBu\fR\fR
+.ad
+.RS 18n
+.rt  
+Undo the last text modifying command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBU\fR\fR
+.ad
+.RS 18n
+.rt  
+Undo all the text modifying commands performed on current line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]V\fR\fR
+.ad
+.RS 18n
+.rt  
+Return the command :
+.sp
+.in +2
+.nf
+hist -e ${VISUAL:-${EDITOR:-vi}} \fIcount\fR
+.fi
+.in -2
+.sp
+
+in the input buffer. If \fIcount\fR is omitted, the current line is used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^L\fR\fR
+.ad
+.RS 18n
+.rt  
+Line feed and print the current line. This command only works in control mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^J\fR\fR
+.ad
+.RS 18n
+.rt  
+New line. Execute the current line, regardless of mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^M\fR\fR
+.ad
+.RS 18n
+.rt  
+Return. Execute the current line, regardless of mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 18n
+.rt  
+If the first character of the command is a \fB#\fR , delete this \fB#\fR and each \fB#\fR that follows a NEWLINE.
+.sp
+Otherwise, send the line after inserting a \fB#\fR in front of each line in the command. 
+.sp
+This is command is useful for causing the current line to be inserted in the history as a comment and un-commenting previously commented commands in the history file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]=\fR\fR
+.ad
+.RS 18n
+.rt  
+If \fIcount\fR is not specified, generate the list of matching commands or file names as described in this manual page.
+.sp
+Otherwise, replace the word at the current cursor location with the \fIcount\fR item from the most recently generated command or file list. If the cursor is not on a word, it is inserted after the current cursor location.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB@\fR\fIletter\fR\fR
+.ad
+.RS 18n
+.rt  
+Search your alias list for an alias by the name \fIletter\fR. If an alias of this name is defined, insert its value on the input queue for processing.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^V\fR\fR
+.ad
+.RS 18n
+.rt  
+Display version of the shell.
+.RE
+
+.SS "Built-in Commands"
+.sp
+.LP
+The following simple-commands are executed in the shell process. Input and output redirection is permitted. Unless otherwise indicated, the output is written on file descriptor \fB1\fR and the exit status, when there is no syntax error, is \fB0\fR. Except for \fB:\fR, \fBtrue\fR, \fBfalse\fR, \fBecho\fR, \fBnewgrp\fR, and \fBlogin\fR, all built-in commands accept \fB--\fR to indicate the end of options. They also interpret the option \fB--man\fR as a request to display the manual page onto standard error and \fB-?\fR as a help request which prints a usage message on standard error.
+.sp
+.LP
+Commands that are preceded by one or two \fB++\fR symbols are special built-in commands and are treated specially in the following ways:
+.RS +4
+.TP
+1.
+Variable assignment lists preceding the command remain in effect when the command completes.
+.RE
+.RS +4
+.TP
+2.
+I/O redirections are processed after variable assignments.
+.RE
+.RS +4
+.TP
+3.
+Errors cause a script that contains them to abort.
+.RE
+.RS +4
+.TP
+4.
+They are not valid function names.
+.RE
+.RS +4
+.TP
+5.
+Words following a command preceded by \fB++\fR that are in the format of a variable assignment are expanded with the same rules as a variable assignment. This means that tilde substitution is performed after the \fB=\fR sign and field splitting and file name generation are not performed.
+.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ : [\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+The command only expands parameters.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ .\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIname\fR is a function defined with the \fBfunction\fR \fBname\fR reserved word syntax, the function is executed in the current environment (as if it had been defined with the \fIname()\fR syntax.) Otherwise if \fIname\fR refers to a file, the file is read in its entirety and the commands are executed in the current shell environment. The search path specified by PATH is used to find the directory containing the file. If any arguments \fIarg\fR are specified, they become the positional parameters while processing the . command and the original positional parameters are restored upon completion. Otherwise the positional parameters are unchanged. The exit status is the exit status of the last command executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++ alias [\fR\fB-ptx\fR\fB] [\fR\fIname\fR\fB[ =\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBalias\fR with no arguments prints the list of aliases in the form \fIname\fR\fB=\fR\fIvalue\fR on standard output. The \fB-p\fR option causes the word alias to be inserted before each one. When one or more arguments are specified, an \fIalias\fR is defined for each \fIname\fR whose \fIvalue\fR is specified. A trailing space in \fIvalue\fR causes the next word to be checked for alias substitution. The obsolete \fB-t\fR option is used to set and list tracked aliases. The value of a tracked alias is the full pathname corresponding to the specified \fIname\fR. The value becomes undefined when the value of \fBPATH\fR is reset but the alias remains tracked. Without the \fB-t\fR option, for each \fIname\fR in the argument list for which no \fIvalue\fR is specified, the name and value of the alias is printed. The obsolete -x option has no effect. The exit status is \fBnon-zero\fR if a \fIname\fR is specified, but no value, and no alias has been defined for the \fIname\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbg [\fR \fIjob\fR\fB\&...]\fR\fR
+.ad
+.sp .6
+.RS 4n
+This command is only on systems that support job control. Puts each specified \fIjob\fR into the background. The current job is put in the background if \fIjob\fR is not specified. See the \fBJobs\fR section of this manual page for a description of the format of \fIjob\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ break [\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Exit from the enclosing \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR loop, if any. If \fIn\fR is specified, then break \fIn\fR levels. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbuiltin [\fR\fB-ds\fR \fB] [\fR\fB-f\fR \fIfile\fR\fB] [\fR\fIname ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIname\fR is not specified, and no \fB-f\fR option is specified, the built-ins are printed on standard output. The \fB-s\fR option prints only the special built-ins. Otherwise, each \fIname\fR represents the pathname whose basename is the name of the built-in. The entry point function name is determined by prepending \fIb\fR to the built-in name. The ISO C/C++ prototype is \fBb\fR\fImycommand(int argc, char *argv[], void *context)\fR for the built-in command \fImycommand\fR where \fIargv\fR is an array of \fIargc\fR elements and \fIcontext\fR is an optional pointer to a \fBShell_t\fR structure as described in \fB<ast/shell.h>\fR Special built-ins cannot be bound to a pathname or deleted. The \fB-d\fR option deletes each of the specified built-ins. On systems that support dynamic loading, the \fB-f\fR option names a shared library containing the code for built-ins. The shared library prefix and/or suffix, which depend on the system, can be omitted. Once a library is loaded, its symbols become available for subsequent invocations of \fBbuiltin\fR. Multiple libraries can be specified with separate invocations of the \fBbuiltin\fR command. Libraries are searched in the reverse order in which they are specified. When a library is loaded, it looks for a function in the library whose name is \fBlib_init()\fR and invokes this function with an argument of \fB0\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB] [\fR\fIarg\fR\fB]\fR\fR
+.ad
+.br
+.na
+\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB]\fR \fIold\fR \fInew\fR\fR
+.ad
+.sp .6
+.RS 4n
+This command has two forms. 
+.sp
+In the first form it changes the current directory to \fIarg\fR. If \fIarg\fR is a \fB-\fR, the directory is changed to the previous directory. The shell variable \fBHOME\fR is the default \fIarg\fR. The variable \fBPWD\fR is set to the current directory. The shell variable \fBCDPATH\fR defines the search path for the directory containing \fIarg\fR. Alternative directory names are separated by a colon (\fB:\fR). The default path is \fBNULL\fR (specifying the current directory). The current directory is specified by a null path name, which can appear immediately after the equal sign or between the colon delimiters anywhere else in the path list. If \fIarg\fR begins with a \fB/\fR, the search path is not used. Otherwise, each directory in the path is searched for \fIarg\fR. 
+.sp
+The second form of \fBcd\fR substitutes the string \fInew\fR for the string \fIold\fR in the current directory name, \fBPWD\fR, and tries to change to this new directory. By default, symbolic link names are treated literally when finding the directory name. This is equivalent to the \fB-L\fR option. The \fB-P\fR option causes symbolic links to be resolved when determining the directory. The last instance of \fB-L\fR or \fB-P\fR on the command line determines which method is used. The \fBcd\fR command cannot be executed by \fBrksh\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcommand\fR \fB[\fR\fB-pvVx\fR\fB]\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Without the \fB-v\fR or \fB-V\fR options, executes \fIname\fR with the arguments specified by \fIarg\fR. 
+.sp
+The \fB-p\fR option causes a default path to be searched rather than the one defined by the value of \fBPATH\fR. Functions are not searched when finding \fIname\fR. In addition, if \fIname\fR refers to a special built-in, none of the special properties associated with the leading daggers are honored. For example, the predefined alias \fBredirect='command exec'\fR prevents a script from terminating when an invalid redirection is specified. 
+.sp
+With the \fB-x\fR option, if command execution would result in a failure because there are too many arguments, \fBerrno E2BIG\fR, the shell invokes command \fIname\fR multiple times with a subset of the arguments on each invocation. Arguments that occur prior to the first word that expands to multiple arguments and after the last word that expands to multiple arguments are passed on each invocation. The exit status is the maximum invocation exit status. 
+.sp
+With the \fB-v\fR option, \fBcommand\fR is equivalent to the built-in \fBwhence\fR command described in this section. The \fB-V\fR option causes \fBcommand\fR to act like \fBwhence -v\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+continue\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Resumes the next iteration of the enclosing \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR loop. If \fIn\fR is specified, then resume at the \fIn\fRth enclosing loop.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBdisown\fR \fB[\fR\fIjob...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Causes the shell not to send a \fBHUP\fR signal to each specified \fIjob\fR, or all active jobs if \fIjob\fR is omitted, when a login shell terminates.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBecho\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+When the first \fIarg\fR does not begin with a \fB-\fR, and none of the arguments contain a backslash (\fB\e\fR), prints each of its arguments separated by a SPACE and terminated by a NEWLINE. Otherwise, the behavior of \fBecho\fR is system dependent and \fBprint\fR or \fBprintf\fR described in this section should be used. See \fBecho\fR(1) for usage and description.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+eval\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+The arguments are read as input to the shell and the resulting commands are executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+exec\fR [\fB-c\fR] [\fB-a\fR \fIname ...\fR] \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIarg\fR is specified, the command specified by the arguments is executed in place of this shell without creating a new process. The \fB-c\fR option causes the environment to be cleared before applying variable assignments associated with the exec invocation. The \fB-a\fR option causes \fIname\fR rather than the first \fIarg\fR, to become \fBargv[0]\fR for the new process. Input and output arguments can appear and affect the current process. If \fIarg\fR is not specified, the effect of this command is to modify file descriptors as prescribed by the input/output redirection list. In this case, any file descriptor numbers greater than \fB2\fR that are opened with this mechanism are closed when invoking another program.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+exit\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Causes the shell to exit with the exit status specified by \fIn\fR. The value is the least significant 8 bits of the specified status. If \fIn\fR is omitted, then the exit status is that of the last command executed. An end-of-file also causes the shell to exit except for a shell which has the \fBignoreeof\fR option turned on. See \fBset\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++export\fR \fB[\fR\fB-p\fR\fB]\fR \fB[\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIname\fR is not specified, the names and values of each variable with the export attribute are printed with the values quoted in a manner that allows them to be re-entered. The \fB-p\fR option causes the word export to be inserted before each one. Otherwise, the specified \fIname\fRs are marked for automatic export to the environment of subsequently-executed commands.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfalse\fR\fR
+.ad
+.sp .6
+.RS 4n
+Does nothing, and exits \fB1\fR. Used with \fBuntil\fR for infinite loops.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfg\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+This command is only on systems that support job control. Each \fIjob\fR specified is brought to the foreground and waited for in the specified order. Otherwise, the current job is brought into the foreground. See \fBJobs\fR for a description of the format of \fIjob\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetconf\fR \fB[\fR\fIname\fR \fB[\fR\fIpathname\fR\fB]]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Prints the current value of the configuration parameter specified by \fIname\fR. The configuration parameters are defined by the IEEE POSIX 1003.1 and IEEE POSIX 1003.2 standards. See \fBpathconf\fR(2) and \fBsysconf\fR(3C).
+.sp
+The \fIpathname\fR argument is required for parameters whose value depends on the location in the file system. If no arguments are specified, \fBgetconf\fR prints the names and values of the current configuration parameters. The pathname \fB/\fR is used for each of the parameters that requires \fIpathname\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetopts\fR \fB[\fR \fB-a\fR \fIname\fR\fB]\fR \fIoptstring\fR \fIvname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Checks \fIarg\fR for legal options. If \fIarg\fR is omitted, the positional parameters are used. An option argument begins with a \fB+\fR or a \fB-\fR. An option that does not begin with \fB+\fR or \fB-\fR or the argument \fB--\fR ends the options. Options beginning with \fB+\fR are only recognized when \fIoptstring\fR begins with a \fB+\fR. \fIoptstring\fR contains the letters that \fBgetopts\fR recognizes. If a letter is followed by a \fB:\fR, that option is expected to have an argument. The options can be separated from the argument by blanks. The option \fB-?\fRcauses \fBgetopts\fR to generate a usage message on standard error. The \fB-a\fR option can be used to specify the name to use for the usage message, which defaults to $0. \fBgetopts\fR places the next option letter it finds inside variable \fIvname\fR each time it is invoked. The option letter is prepended with a \fB+\fR when \fIarg\fR begins with a \fB+\fR. The index of the next \fIarg\fR is stored in \fBOPTIND\fR. The option argument, if any, gets stored in \fBOPTARG\fR. A leading : in \fIoptstring\fR causes \fBgetopts\fR to store the letter of an invalid option in \fBOPTARG\fR, and to set \fIvname\fR to \fB?\fR for an unknown option and to: when a required option argument is missing. Otherwise, \fBgetopts\fR prints an error message. The exit status is \fBnon-zero\fR when there are no more options. There is no way to specify any of the options \fB:\fR, \fB+\fR, \fB-\fR, \fB?\fR, \fB[\fR, and \fB]\fR. The option \fB#\fR can only be specified as the first option.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBhist\fR \fB[\fR \fB-e\fR \fIename\fR\fB]\fR\fB[\fR\fB-nlr\fR\fB]\fR \fB[\fR \fIfirst\fR\fB[\fR\fIlast\fR \fB] ]\fR\fR
+.ad
+.br
+.na
+\fB\fR
+.ad
+.br
+.na
+\fB\fBhist\fR \fB-s\fR \fB[\fR \fIold\fR\fB=\fR\fInew\fR \fB] [\fR \fIcommand\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+In the first form, a range of commands from \fIfirst\fR to \fIlast\fR is selected from the last \fBHISTSIZE\fR commands that were typed at the terminal. The arguments \fIfirst\fR and \fIlast\fR can be specified as a number or as a string. A string is used to locate the most recent command starting with the specified string. A negative number is used as an offset to the current command number. If the -l option is selected, the commands are listed on standard output. Otherwise, the editor program \fIename\fR is invoked on a file containing these keyboard commands. If \fIename\fR is not supplied, then the value of the variable \fBHISTEDIT\fR is used. If \fBHISTEDIT\fR is not set, then \fBFCEDIT\fR (default \fB/bin/ed\fR) is used as the editor. When editing is complete, the edited command(s) is executed if the changes have been saved. If \fIlast\fR is not specified, then it is set to \fIfirst\fR. If \fIfirst\fR is not specified, the default is the previous command for editing and \fB-16\fR for listing. The option \fB-r\fR reverses the order of the commands and the option \fB-n\fR suppresses command numbers when listing. In the second form, \fIcommand\fR is interpreted as \fIfirst\fR described in this section and defaults to the last command executed. The resulting command is executed after the optional substitution \fIold\fR\fB=\fR\fInew\fR is performed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBjobs\fR \fB-lnp\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Lists information about each specified job, or all active jobs if \fIjob\fR is omitted. The \fB-l\fR option lists process ids in addition to the normal information. The \fB-n\fR option only displays jobs that have stopped or exited since last notified. The \fB-p\fR option causes only the process group to be listed. See \fBJobs\fR for a description of the format of \fIjob\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkill\fR \fB[\fR\fB-s\fR \fIsigname\fR\fB]\fR \fIjob ...\fR\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB[\fR\fB-n\fR \fIsignum\fR\fB]\fR \fIjob ...\fR\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB-l\fR \fB[\fR\fIsig ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sends either the \fBTERM\fR (terminate) signal or the specified signal to the specified jobs or processes. Signals are either specified by number with the \fB-n\fR option or by name with the \fB-s\fR option (as specified in \fB<signal.h\fR>, stripped of the prefix `\fBSIG\fR with the exception that \fBSIGCLD\fR is named \fBCHLD\fR). For backward compatibility, the \fBn\fR and \fBs\fR can be omitted and the number or name placed immediately after the \fB-\fR. If the signal being sent is \fBTERM\fR (terminate) or \fBHUP\fR (hang up), then the job or process is sent a \fBCONT\fR (continue) signal if it is stopped. The argument \fIjob\fR can be the process id of a process that is not a member of one of the active jobs. See \fBJobs\fR for a description of the format of \fIjob\fR. In the third form, \fBkill -l\fR, if \fIsig\fR is not specified, the signal names are listed. Otherwise, for each \fIsig\fR that is a name, the corresponding signal number is listed. For each \fIsig\fR that is a number, the signal name corresponding to the least significant 8 bits of \fIsig\fR is listed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBlet\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Each \fIarg\fR is a separate arithmetic expression to be evaluated. See the \fBArithmetic Evaluation\fR section of this manual page for a description of arithmetic expression evaluation. The exit status is \fB0\fR if the value of the last expression is \fBnon-zero\fR, and \fB1\fR otherwise.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+newgrp\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Equivalent to \fBexec\fR \fB/bin/newgrp\fR \fIarg ...\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprint\fR [\fB-Renprs\fR] \fB[\fR \fB-u\fR \fIunit\fR\fB] [\fR \fB-f\fR \fIformat\fR \fB] [\fR \fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+With no options or with option \fB-\fR or \fB--\fR, each \fIarg\fR is printed on standard output. The \fB-f\fR option causes the arguments to be printed as described by \fBprintf\fR. In this case, any \fBe\fR, \fBn\fR, \fBr\fR, or \fBR\fR options are ignored. Otherwise, unless the \fB-R\fR or \fB-r,\fR are specified, the following escape conventions are applied:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ea\fR\fR
+.ad
+.RS 8n
+.rt  
+Alert character (\fBASCII\fR 07)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eb\fR\fR
+.ad
+.RS 8n
+.rt  
+Backspace character (\fBASCII\fR 010)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ec\fR\fR
+.ad
+.RS 8n
+.rt  
+Causes print to end without processing more arguments and not adding a NEWLINE
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ef\fR\fR
+.ad
+.RS 8n
+.rt  
+Form-feed character (\fBASCII\fR 014)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\en\fR\fR
+.ad
+.RS 8n
+.rt  
+NEWLINE character (\fBASCII\fR 012)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\er\fR\fR
+.ad
+.RS 8n
+.rt  
+RETURN character (\fBASCII\fR 015)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\et\fR\fR
+.ad
+.RS 8n
+.rt  
+TAB character (\fBASCII\fR 011)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ev\fR\fR
+.ad
+.RS 8n
+.rt  
+Vertical TAB character (\fBASCII\fR 013)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eE\fR\fR
+.ad
+.RS 8n
+.rt  
+Escape character (\fBASCII\fR 033)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\e\fR\fR
+.ad
+.RS 8n
+.rt  
+Backslash character \fB\e\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e0\fR\fIx\fR\fR
+.ad
+.RS 8n
+.rt  
+Character defined by the 1, 2, or 3-digit octal string specified by \fIx\fR
+.RE
+
+The \fB-R\fR option prints all subsequent arguments and options other than \fB-n\fR. The \fB-e\fR causes the escape conventions to be applied This is the default behavior. It reverses the effect of an earlier \fB-r\fR. The \fB-p\fR option causes the arguments to be written onto the pipe of the process spawned with \fB|&\fR instead of standard output. The \fB-s\fR option causes the arguments to be written onto the history file instead of standard output. The \fB-u\fR option can be used to specify a one digit file descriptor unit number \fIunit\fR on which the output is placed. The default is \fB1\fR. If the option \fB-n\fR is used, no NEWLINE is added to the output.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprintf\fR \fIformat\fR\fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+The arguments \fIarg\fR are printed on standard output in accordance with the \fBANSI-C\fR formatting rules associated with the format string \fIformat\fR. If the number of arguments exceeds the number of format specifications, the format string is reused to format remaining arguments. The following extensions can also be used: A \fB%b\fR format can be used instead of \fB%s\fR to cause escape sequences in the corresponding \fIarg\fR to be expanded as described in \fBprint\fR. A \fB%B\fR option causes each of the arguments to be treated as variable names and the binary value of the variables is printed. This is most useful for variables with an attribute of b. A \fB%H\fR format can be used instead of \fB%s\fR to cause characters in \fIarg\fR that are special in \fBHTML\fR and \fBXML\fR to be output as their entity name. A \fB%P\fR format can be used instead of \fB%s\fR to cause \fIarg\fR to be interpreted as an extended regular expression and be printed as a shell pattern. A \fB%R\fR format can be used instead of \fB%s\fR to cause \fIarg\fR to be interpreted as a shell pattern and to be printed as an extended regular expression. A \fB%q\fR format can be used instead of \fB%\fRs to cause the resulting string to be quoted in a manner than can be input again to the shell. A \fB%(\fR\fIdate-format\fR\fB)T\fR format can be use to treat an argument as a date/time string and to format the date/time according to the \fIdate-format\fR as defined for the \fBdate\fR(1) command. A \fB%Z\fR format outputs a byte whose value is 0. The precision field of the %d format can be followed by a . and the output base. In this case, the \fB#\fR flag character causes \fBbase\fR\fI#\fR to be prepended. The \fB#\fR flag when used with the \fBd\fR specifier without an output base, causes the output to be displayed in thousands units with one of the suffixes \fBk\fR \fBM\fR \fBG\fR \fBT\fR \fBP\fR \fBE\fR to indicate the unit. The \fB#\fR flag when used with the i specifier causes the output to be displayed in \fB1024\fR with one of the suffixes \fBKi\fR \fBMi\fR \fBGi\fR \fBTi\fR \fBPi\fR \fBEi\fR to indicate the unit. The \fB=\fR flag has been added to center the output within the specified field width.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpwd\fR [\fB-LP\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Outputs the value of the current working directory. The \fB-L\fR option is the default. It prints the logical name of the current directory. If the \fB-P\fR option is specified, all symbolic links are resolved from the name. The last instance of \fB-L\fR or \fB-P\fR on the command line determines which method is used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBread\fR \fB[\fR\fB-Aprs\fR\fB] [\fR\fB-d\fR \fIdelim\fR\fB] [\fR \fB-n\fR \fIn\fR\fB] [[\fR \fB-N\fR \fIn\fR\fB] [[\fR\fB-t\fR \fItimeout\fR\fB] [\fR\fB-u\fR \fIunit\fR\fB] [\fR\fIvname\fR\fB?\fR\fIprompt\fR\fB] [\fR \fIvname ...\fR \fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+The shell input mechanism. One line is read and is broken up into fields using the characters in IFS as separators. The escape character, \fB\e\fR, is used to remove any special meaning for the next character and for line continuation. The \fB-d\fR option causes the read to continue to the first character of \fIdelim\fR rather than \fBNEWLINE\fR. The \fB-n\fR option causes at most \fIn\fR bytes to read rather a full line but returns when reading from a slow device as soon as any characters have been read. The \fB-N\fR option causes exactly \fIn\fR to be read unless an end-of-file has been encountered or the read times out because of the \fB-t\fR option. In raw mode, \fB-r\fR, the \fB\e\fR character is not treated specially. The first field is assigned to the first \fIvname\fR, the second field to the second \fIvname\fR, etc., with leftover fields assigned to the last \fIvname\fR. When \fIvname\fR has the binary attribute and \fB-n\fR or \fB-N\fR is specified, the bytes that are read are stored directly into the variable. If the -v is specified, then the value of the first \fIvname\fR is used as a default value when reading from a terminal device. The \fB-A\fR option causes the variable \fIvname\fR to be unset and each field that is read to be stored in successive elements of the indexed array \fIvname\fR. The \fB-p\fR option causes the input line to be taken from the input pipe of a process spawned by the shell using \fB|&\fR. If the \fB-s\fR option is present, the input is saved as a command in the history file. The option \fB-u\fR can be used to specify a one digit file descriptor unit \fIunit\fR to read from. The file descriptor can be opened with the \fBexec\fR special built-in command. The default value of unit \fIn\fR is \fB0\fR. The option \fB-t\fR is used to specify a time out in seconds when reading from a terminal or pipe. If \fIvname\fR is omitted, then REPLY is used as the default \fIvname\fR. An end-of-file with the \fB-p\fR option causes cleanup for this process so that another can be spawned. If the first argument contains a \fB?\fR, the remainder of this word is used as a prompt on standard error when the shell is interactive. The exit status is \fB0\fR unless an end-of-file is encountered or read has timed out.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++readonly\fR \fB[\fR\fB-p\fR\fB] [\fR \fIvname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fIvname\fR is not specified, the names and values of each variable with the read-only attribute is printed with the values quoted in a manner that allows them to be input again. The \fB-p\fR option causes the word \fBreadonly\fR to be inserted before each one. Otherwise, the specified \fIvname\fRs are marked \fBreadonly\fR and these names cannot be changed by subsequent assignment. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+return\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Causes a shell function or script to return to the invoking script with the exit status specified by \fIn\fR. The value is the least significant 8 bits of the specified status. If \fBn\fR is omitted, then the return status is that of the last command executed. If return is invoked while not in a function or a script, then it behaves the same as exit. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+set [ \(+-BCGabefhkmnoprstuvx] [\(+-o [\fR \fIoption\fR \fB] ] ... [ \(+-A\fR \fIvname\fR\fB]\fR \fB[\fR\fIarg...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+The \fBset\fR command supports the following options:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.sp .6
+.RS 4n
+All subsequent variables that are defined are automatically exported.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.sp .6
+.RS 4n
+Array assignment. Unset the variable \fIvname\fR and assign values sequentially from the \fIarg\fR list. If \fB+A\fR is used, the variable \fIvname\fR is not unset first.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR\fR
+.ad
+.sp .6
+.RS 4n
+Prints job completion messages as soon as a background job changes state rather than waiting for the next prompt.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-B\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable brace pattern field generation. This is the default behavior.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-C\fR\fR
+.ad
+.sp .6
+.RS 4n
+Prevents redirection (\fB>\fR) from truncating existing files. Files that are created are opened with the \fBO_EXCL\fR mode. Requires \fB>|\fR to truncate a file when turned on.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR\fR
+.ad
+.sp .6
+.RS 4n
+If a command has a \fBnon-zero\fR exit status, execute the \fBERR\fR trap, if set, and exit. This mode is disabled while reading profiles.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.sp .6
+.RS 4n
+Disables file name generation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-G\fR\fR
+.ad
+.sp .6
+.RS 4n
+Causes the pattern \fB**\fR by itself to match files and zero or more directories and subdirectories when used for file name generation. If followed by a \fB/\fR only directories and subdirectories are matched.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR\fR
+.ad
+.sp .6
+.RS 4n
+Each command becomes a tracked alias when first encountered.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR\fR
+.ad
+.sp .6
+.RS 4n
+Obsolete. All variable assignment arguments are placed in the environment for a command, not just those that precede the command name.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR\fR
+.ad
+.sp .6
+.RS 4n
+Background jobs run in a separate process group and a line prints upon completion. The exit status of background jobs is reported in a completion message. On systems with job control, this option is turned on automatically for interactive shells.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.sp .6
+.RS 4n
+Read commands and check them for syntax errors, but do not execute them. Ignored for interactive shells.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR\fR
+.ad
+.sp .6
+.RS 4n
+If no option name is supplied, the list of options and their current settings are written to standard output. When invoked with a \fB+\fR, the options are written in a format that can be input again to the shell to restore the settings. This option can be repeated to enable or disable multiple options.
+.sp
+The following argument can be one of the following option names:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBallexport\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-a\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbgnice\fR\fR
+.ad
+.sp .6
+.RS 4n
+All background jobs are run at a lower priority. This is the default mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbraceexpand\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-\fRB.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBemacs\fR\fR
+.ad
+.sp .6
+.RS 4n
+Puts you in an \fBemacs\fR style inline editor for command entry.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBerrexit\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-e\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBglobstar\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-G\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgmacs\fR\fR
+.ad
+.sp .6
+.RS 4n
+Puts you in a \fBgmacs\fR style inline editor for command entry.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBignoreeof\fR\fR
+.ad
+.sp .6
+.RS 4n
+The shell does not exit on end-of-file. The command \fBexit\fR must be used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkeyword\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-k\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmarkdirs\fR\fR
+.ad
+.sp .6
+.RS 4n
+All directory names resulting from file name generation have a trailing / appended.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmonitor\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-m\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmultiline\fR\fR
+.ad
+.sp .6
+.RS 4n
+The built-in editors use multiple lines on the screen for lines that are longer than the width of the screen. This might not work for all terminals.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoclobber\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-C\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoexec\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-n\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoglob\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-f\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnolog\fR\fR
+.ad
+.sp .6
+.RS 4n
+Do not save function definitions in the history file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnotify\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-b\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnounset\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-u\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpipefail\fR\fR
+.ad
+.sp .6
+.RS 4n
+A pipeline does not complete until all components of the pipeline have completed, and the return value is the value of the last \fBnon-zero\fR command to fail or zero if no command has failed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprivileged\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-p\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBshowme\fR\fR
+.ad
+.sp .6
+.RS 4n
+When enabled, simple commands or pipelines preceded by a a semicolon (\fB;\fR) is displayed as if the \fBxtrace\fR option were enabled but is not executed. Otherwise, the leading \fB;\fR is ignored.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrackall\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-h\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBverbose\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-v\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBvi\fR\fR
+.ad
+.sp .6
+.RS 4n
+Puts you in insert mode of a \fBvi\fR style inline editor until you hit the escape character 033. This puts you in control mode. A return sends the line.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBviraw\fR\fR
+.ad
+.sp .6
+.RS 4n
+Each character is processed as it is typed in \fBvi\fR mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBxtrace\fR\fR
+.ad
+.sp .6
+.RS 4n
+Same as \fB-x\fR. 
+.sp
+If no option name is supplied, the current options settings are printed.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.sp .6
+.RS 4n
+Disables processing of the \fB$HOME/.profile\fR file and uses the file \fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is on whenever the effective \fBuid\fR (\fBgid\fR) is not equal to the real \fBuid\fR (\fBgid\fR). Turning this off causes the effective \fBuid\fR and \fBgid\fR to be set to the real \fBuid\fR and \fBgid\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enables the restricted shell. This option cannot be unset once set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sort the positional parameters lexicographically.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.sp .6
+.RS 4n
+Obsolete. Exit after reading and executing one command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.sp .6
+.RS 4n
+Treat \fBunset\fR parameters as an error when substituting.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.sp .6
+.RS 4n
+Print shell input lines as they are read.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.sp .6
+.RS 4n
+Print commands and their arguments as they are executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB--\fR\fR
+.ad
+.sp .6
+.RS 4n
+Do not change any of the options. This is useful in setting \fB$1\fR to a value beginning with \fB-\fR. If no arguments follow this option then the positional parameters are unset.
+.RE
+
+As an obsolete feature, if the first \fIarg\fR is - then the \fB-x\fR and \fB-v\fR options are turned off and the next \fIarg\fR is treated as the first argument. Using \fB+\fR rather than \fB-\fR causes these options to be turned off. These options can also be used upon invocation of the shell. The current set of options can be found in \fB$-\fR. Unless \fB-A\fR is specified, the remaining arguments are positional parameters and are assigned, in order, to \fB$1 $2 \&....\fR If no arguments are specified, then the names and values of all variables are printed on the standard output.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+shift\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+The positional parameters from \fB$\fR\fIn\fR\fB+1 ...\fR are renamed \fB$1 ...\fR, the default \fIn\fR is \fB1\fR. The parameter \fIn\fR can be any arithmetic expression that evaluates to a non-negative number less than or equal to \fB$#\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+trap\fR \fB-p\fR \fB[\fR\fIaction\fR\fB]\fR \fB[\fR\fIsig\fR\fB] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+The \fB-p\fR option causes the trap action associated with each trap as specified by the arguments to be printed with appropriate quoting. Otherwise, \fIaction\fR is processed as if it were an argument to \fBeval\fR when the shell receives signal(s) \fIsig\fR. Each \fIsig\fR can be specified as a number or as the name of the signal. Trap commands are executed in order of signal number. Any attempt to set a trap on a signal that was ignored on entry to the current shell is ineffective. If \fIaction\fR is omitted and the first \fIsig\fR is a number, or if \fIaction\fR is \fB-\fR, then the trap(s) for each \fIsig\fR are reset to their original values. If \fIaction\fR is the null string then this signal is ignored by the shell and by the commands it invokes. If \fIsig\fR is \fBERR\fR then \fIaction\fR is executed whenever a command has a \fBnon-zero\fR exit status. If \fIsig\fR is \fBDEBUG\fR then \fIaction\fR is executed before each command. The variable \fB\&.sh.command\fR contains the contents of the current command line when \fIaction\fR is running. If \fIsig\fR is \fB0\fR or \fBEXIT\fR and the trap statement is executed inside the body of a function defined with the \fBfunction\fR \fIname\fR syntax, then the command \fIaction\fR is executed after the function completes. If \fIsig\fR is \fB0\fR or \fBEXIT\fR for a trap set outside any function then the command \fIaction\fR is executed on exit from the shell. If \fIsig\fR is \fBKEYBD\fR, then \fIaction\fR is executed whenever a key is read while in \fBemacs\fR, \fBgmacs\fR, or \fBvi\fR mode. The \fBtrap\fR command with no arguments prints a list of commands associated with each signal number.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrue\fR\fR
+.ad
+.sp .6
+.RS 4n
+Does nothing, and exits \fB0\fR. Used with while for infinite loops.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++typeset [\(+-AHflabnprtux ] [ \(+-EFLRZi[\fR\fIn\fR\fB] ] [\fR \fIvname\fR\fB[=\fR\fIvalue\fR \fB] ]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets attributes and values for shell variables and functions. When invoked inside a function defined with the \fBfunction\fR \fIname\fR syntax, a new instance of the variable \fIvname\fR is created, and the variable's value and type are restored when the function completes. 
+.sp
+Using \fB+\fR rather than \fB-\fR causes these options to be turned off. If no \fIvname\fR arguments are specified, a list of \fIvname\fRs (and optionally the \fIvalue\fRs) of the variables is printed. Using \fB+\fR rather than \fB-\fR keeps the values from being printed.) The \fB-p\fR option causes \fBtypeset\fR followed by the option letters to be printed before each name rather than the names of the options. If any option other than \fB-p\fR is specified, only those variables which have all of the specified options are printed. Otherwise, the \fIvname\fRs and \fIattributes\fR of all variables that have attributes are printed.
+.sp
+The following list of attributes can be specified:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+Declares \fIvname\fR to be an indexed array. This is optional unless except for compound variable assignments.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.RS 6n
+.rt  
+Declares \fIvname\fR to be an associative array. Sub-scripts are strings rather than arithmetic expressions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR\fR
+.ad
+.RS 6n
+.rt  
+The variable can hold any number of bytes of data. The data can be text or binary. The value is represented by the \fBbase64\fR encoding of the data. If \fB-Z\fR is also specified, the size in bytes of the data in the buffer is determined by the size associated with the \fB-Z\fR. If the \fBbase64\fR string assigned results in more data, it is truncated. Otherwise, it is filled with bytes whose value is zero. The \fBprintf\fR format \fB%B\fR can be used to output the actual data in this buffer instead of the \fBbase64\fR encoding of the data.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-E\fR\fR
+.ad
+.RS 6n
+.rt  
+Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR is \fBnon-zero\fR, it defines the number of significant figures that are used when expanding \fIvname\fR. Otherwise, ten significant figures is used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+The names refer to function names rather than variable names. No assignments can be made and the only other valid options are \fB-t\fR, \fB-u\fR, and \fB-x.\fR The \fB-t\fR option turns on execution tracing for this function. The \fB-u\fR option causes this function to be marked undefined. The \fBFPATH\fR variable is searched to find the function definition when the function is referenced. If no options other than \fB-f\fR is specified, then the function definition is displayed on standard output. If \fB+f\fR is specified, then a line containing the function name followed by a shell comment containing the line number and path name of the file where this function was defined, if any, is displayed.
+.sp
+The \fB-i\fR attribute cannot be specified with \fB-f\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-F\fR\fR
+.ad
+.RS 6n
+.rt  
+Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR is \fBnon-zero\fR, it defines the number of places after the decimal point that are used when expanding \fIvname\fR. Otherwise ten places after the decimal point is used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.RS 6n
+.rt  
+This option provides UNIX to hostname file mapping on non-UNIX machines.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 6n
+.rt  
+Declares \fIvname\fR to be represented internally as integer. The right hand side of an assignment is evaluated as an arithmetic expression when assigning to an integer. If \fIn\fR is \fBnon-zero\fR, it defines the output arithmetic base, otherwise the output base is ten.
+.sp
+The \fB-i\fR attribute cannot be specified along with \fB-R\fR, \fB-L\fR, \fB-Z\fR, or \fB-f\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-l\fR\fR
+.ad
+.RS 6n
+.rt  
+All uppercase characters are converted to lowercase. The uppercase option, \fB-u\fR, is turned off.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-L\fR\fR
+.ad
+.RS 6n
+.rt  
+Left justify and remove leading blanks from \fIvalue\fR. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment. When the variable is assigned to, it is filled on the right with blanks or truncated, if necessary, to fit into the field. The \fB-R\fR option is turned off.
+.sp
+The \fB-i\fR attribute cannot be specified with \fB-L\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+Declares \fIvname\fR to be a reference to the variable whose name is defined by the value of variable \fIvname\fR. This is usually used to reference a variable inside a function whose name has been passed as an argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-R\fR\fR
+.ad
+.RS 6n
+.rt  
+Right justify and fill with leading blanks. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment. The field is left filled with blanks or truncated from the end if the variable is reassigned. The \fB-L\fR option is turned off.
+.sp
+The \fB-i\fR attribute cannot be specified with \fB-R\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 6n
+.rt  
+The specified \fIvname\fRs are marked read-only and these names cannot be changed by subsequent assignment.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+Tags the variables. Tags are user definable and have no special meaning to the shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.RS 6n
+.rt  
+All lowercase characters are converted to uppercase. The lowercase option, \fB-l\fR, is turned off.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+The specified \fIvname\fRs are marked for automatic export to the environment of subsequently-executed commands. Variables whose names contain a . cannot be exported.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-Z\fR\fR
+.ad
+.RS 6n
+.rt  
+Right justify and fill with leading zeros if the first non-blank character is a digit and the \fB-L\fR option has not been set. Remove leading zeros if the \fB-L\fR option is also set. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment.
+.sp
+The \fB-i\fR attribute cannot be specified with \fB-Z\fR.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBulimit [\fR\fB-HSacdfmnpstv\fR\fB] [\fR \fIlimit\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set or display a resource limit. Many systems do not support one or more of these limits. The limit for a specified resource is set when \fIlimit\fR is specified. The value of \fIlimit\fR can be a number in the unit specified with each resource, or the value unlimited. When more than one resource is specified, then the limit name and unit is printed before the value.
+.sp
+If no option is specified, \fB-f\fR is assumed.
+.sp
+The following are the available resource limits:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+Lists all of the current resource limits.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of 512-byte blocks on the size of core dumps.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of Kbytes on the size of the data area.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of 512-byte blocks on files that can be written by the current process or by child processes (files of any size can be read).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.RS 6n
+.rt  
+Specifies a hard limit for the specified resource.
+.sp
+A hard limit cannot be increased once it is set.
+.sp
+If neither the \fB-H\fR nor \fB-S\fR option is specified, the limit applies to both. The current resource limit is printed when \fIlimit\fR is omitted. In this case, the soft limit is printed unless \fB-H\fR is specified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of Kbytes on the size of physical memory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of file descriptors plus 1.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of 512-byte blocks for pipe buffering.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of Kbytes on the size of the stack area.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-S\fR\fR
+.ad
+.RS 6n
+.rt  
+Specifies a soft limit for the specified resource.
+.sp
+A soft limit can be increased up to the value of the hard limit. 
+.sp
+If neither the \fB-H\fR nor \fB-S\fR option is specified, the limit applies to both. The current resource limit is printed when \fIlimit\fR is omitted. In this case, the soft limit is printed unless \fB-H\fR is specified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of CPU seconds to be used by each process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.RS 6n
+.rt  
+The number of Kbytes for virtual memory.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBumask\fR \fB[\fR\fB-S\fR\fB]\fR\fB[\fR\fImask\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+The user file-creation mask is set to \fImask\fR. \fImask\fR can either be an octal number or a symbolic value as described in \fBchmod\fR(1). 
+.sp
+If a symbolic value is specified, the new \fBumask\fR value is the complement of the result of applying \fImask\fR to the complement of the previous \fBumask\fR value. If \fImask\fR is omitted, the current value of the mask is printed. The \fB-S\fR option causes the mode to be printed as a symbolic value. Otherwise, the mask is printed in octal. 
+.sp
+See \fBumask\fR(2)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+unalias\fR \fB[\fR\fB-a\fR\fB]\fR \fIname\fR\fR
+.ad
+.sp .6
+.RS 4n
+The aliases specified by the list of \fIname\fRs are removed from the alias list. The \fB-a\fR option causes all the aliases to be unset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+unset\fR \fB[\fR\fB-fnv\fR\fB]\fR \fIvname\fR\fR
+.ad
+.sp .6
+.RS 4n
+The variables specified by the list of \fIvname\fRs are unassigned, i.e., their values and attributes are erased. Read-only variables cannot be unset. If the \fB-f\fR option is set, then the names refer to function names. If the \fB-v\fR option is set, then the names refer to variable names. The \fB-f\fR option overrides \fB-v\fR. If \fB-n\fR is set and \fIname\fR is a name reference, then \fIname\fR is unset rather than the variable that it references. The default is equivalent to \fB-v\fR. Unsetting \fBLINENO\fR, \fBMAILCHECK\fR, \fBOPTARG\fR, \fBOPTIND\fR, \fBRANDOM\fR, \fBSECONDS\fR, \fBTMOUT\fR, and \fB_\fR removes their special meaning even if they are subsequently assigned to.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwait\fR \fB[\fR\fIjob\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Wait for the specified job and report its termination status. If \fIjob\fR is not specified, then all currently active child processes are waited for. The exit status from this command is that of the last process waited for if \fIjob\fR is specified; otherwise it is zero. See \fBJobs\fR for a description of the format of \fIjob\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhence\fR \fB[\fR\fB-afpv\fR\fB]\fR \fIname ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+For each \fIname\fR, indicate how it would be interpreted if used as a command name. The \fB-v\fR option produces a more verbose report. The \fB-f\fR option skips the search for functions. The \fB-p\fR option does a path search for \fIname\fR even if name is an alias, a function, or a reserved word. The \fB-a\fR option is similar to the -v option but causes all interpretations of the specified name to be reported.
+.RE
+
+.SS "Invocation"
+.sp
+.LP
+If the shell is invoked by \fBexec\fR(2), and the first character of argument zero (\fB$0\fR) is \fB-\fR, then the shell is assumed to be a login shell and commands are read from \fB/etc/profile\fR and then from either .\fBprofile\fR in the current directory or \fB$HOME/.profile\fR, if either file exists. Next, for interactive shells, commands are read first from \fB/etc/ksh.kshrc\fR, and then from the file named by performing parameter expansion, command substitution, and arithmetic substitution on the value of the environment variable \fBENV\fR if the file exists. If the \fB-s\fR option is not present and \fIarg\fR and a file by the name of \fIarg\fR exists, then it reads and executes this script. Otherwise, if the first \fIarg\fR does not contain a \fB/\fR, a path search is performed on the first \fIarg\fR to determine the name of the script to execute. The script \fIarg\fR must have execute permission and any \fBsetuid\fR and \fBsetgid\fR settings are ignored. If the script is not found on the path, \fIarg\fR is processed as if it named a built-in command or function. 
+.sp
+.LP
+Commands are then read as described, and the following options are interpreted by the shell when it is invoked:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-c\fR option is present, then commands are read from the first \fIarg\fR. Any remaining arguments become positional parameters starting at \fB0\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR\fR
+.ad
+.RS 15n
+.rt  
+A list of all double quoted strings that are preceded by a \fB$\fR is printed on standard output and the shell exits. This set of strings is subject to language translation when the locale is not C or POSIX. No commands are executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-i\fR option is present or if the shell input and output are attached to a terminal (as told by \fBtcgetattr\fR(3C), this shell is interactive. In this case \fBTERM\fR is ignored (so that \fBkill 0\fR does not kill an interactive shell) and \fBINTR\fR is caught and ignored (so that wait is interruptible). In all cases, \fBQUIT\fR is ignored by the shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-R\fR \fIfilename\fR\fR
+.ad
+.RS 15n
+.rt  
+The \fB-R\fR \fIfilename\fR option is used to generate a cross reference database that can be used by a separate utility to find definitions and references for variables and commands.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-r\fR option is present, the shell is a restricted shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-s\fR option is present or if no arguments remain, then commands are read from the standard input. Shell output, except for the output of the \fBSpecial Commands\fR listed, is written to file descriptor 2.
+.RE
+
+.sp
+.LP
+The remaining options and arguments are described under the \fBset\fR command. An optional \fB-\fR as the first argument is ignored.
+.SS "\fBrksh\fR Only"
+.sp
+.LP
+\fBrksh\fR is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell.
+.sp
+.LP
+The actions of \fBrksh\fR are identical to those of \fBksh\fR, except that the following are disallowed:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Unsetting the restricted option
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Changing directory. See \fBcd\fR(1).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Setting or unsetting the value or attributes of \fBSHELL\fR, \fBENV\fR, \fBFPATH\fR, or \fBPATH\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Specifying path or command names containing \fB/\fR,
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Redirecting output (\fB>\fR, \fB>\fR\fB|\fR, \fB<>\fR, and \fB>>\fR).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Adding or deleting built-in commands.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Using \fBcommand\fR \fB-p\fR to invoke a command.
+.RE
+.sp
+.LP
+These restrictions are enforced after .\fBprofile\fR and the \fBENV\fR files are interpreted.
+.sp
+.LP
+When a command to be executed is found to be a shell procedure, \fBrksh\fR invokes \fBksh\fR to execute it. Thus, it is possible to provide to the end-user shell procedures that have access to the full power of the standard shell, while imposing a limited menu of commands. This scheme assumes that the end-user does not have write and execute permissions in the same directory. The net effect of these rules is that the writer of the .\fBprofile\fR has complete control over user actions, by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands, for example, \fB/usr/rbin\fR, that can be safely invoked by \fBrksh\fR. 
+.SH USAGE
+.sp
+.LP
+See \fBlargefile\fR(5) for the description of the behavior of \fBksh\fR and \fBrksh\fR when encountering files greater than or equal to 2 Gbyte (2^31 bytes).
+.SH EXIT STATUS
+.sp
+.LP
+The following exit values are returned:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnon-zero\fR\fR
+.ad
+.sp .6
+.RS 4n
+Returns \fBnon-zero\fR when errors, such as syntax errors, are detected by the shell.
+.sp
+If the shell is being used non-interactively, then execution of the shell file is abandoned unless the error occurs inside a sub-shell in which case the sub-shell is abandoned.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexit status of last command executed\fR\fR
+.ad
+.sp .6
+.RS 4n
+Returns the exit status of the last command executed.
+.sp
+Run time errors detected by the shell are reported by printing the command or function name and the error condition. If the line number that the error occurred on is greater than one, then the line number is also printed in square brackets (\fB[]\fR) after the command or function name.
+.sp
+See the \fBksh exit\fR command for additional details.
+.RE
+
+.SH FILES
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+The system initialization file, executed for login shells.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/ksh.kshrc\fR\fR
+.ad
+.sp .6
+.RS 4n
+The system wide startup file, executed for interactive shells.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$HOME/.profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+The personal initialization file, executed for login shells after \fB/etc/profile\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$HOME/.kshrc\fR\fR
+.ad
+.sp .6
+.RS 4n
+Default personal initialization file, executed after \fB/etc/ksh.kshrc\fR, for interactive shells when \fBENV\fR is not set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/suid-profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+Alternative initialization file, executed instead of the personal initialization file when the real and effective user or group id do not match.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/dev/null\fR\fR
+.ad
+.sp .6
+.RS 4n
+NULL device.
+.RE
+
+.SH AUTHORS
+.sp
+.LP
+David Korn, \[email protected]\fR
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilityshell/ksh
+_
+Interface StabilitySee below.
+.TE
+
+.sp
+.LP
+The scripting interface is Uncommitted. The environment variables, \fB\&.paths\fR feature, and editing modes are Volatile.
+.SH SEE ALSO
+.sp
+.LP
+\fBcat\fR(1), \fBcd\fR(1), \fBchmod\fR(1), \fBcut\fR(1), \fBdate\fR(1), \fBegrep\fR(1), \fBecho\fR(1), \fBegrep\fR(1), \fBenv\fR(1), \fBfgrep\fR(1), \fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1), \fBprintf\fR(1), \fBshell_builtins\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBvi\fR(1), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBpathconf\fR(2), \fBpipe\fR(2), \fBsysconf\fR(3C), \fBulimit\fR(2), \fBumask\fR(2), \fBrand\fR(3C), \fBtcgetattr\fR(3C), \fBwait\fR(3C), \fBa.out\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
+.sp
+.LP
+Bolsky, Morris I. and Korn, David G., \fIThe New KornShell Command and Programming Language\fR, Prentice Hall, 1995.
+.sp
+.LP
+\fIPOSIX-Part 2: Shell and Utilities, IEEE Std 1003.2-1992, ISO/IEC 9945-2\fR, IEEE, 1993.
+.SH NOTES
+.sp
+.LP
+\fBksh\fR scripts should choose shell function names outside the namespace used by reserved keywords of the ISO C99, C++ and JAVA languages to avoid collisions with future enhancements to \fBksh\fR.
+.sp
+.LP
+If a command is executed, and then a command with the same name is installed in a directory in the search path before the directory where the original command was found, the shell continues to \fBexec\fR the original command. Use the \fB-t\fR option of the alias command to correct this situation.
+.sp
+.LP
+Some very old shell scripts contain a caret (\fB^\fR) as a synonym for the pipe character (\fB|\fR).
+.sp
+.LP
+Using the \fBhist\fR built-in command within a compound command causes the whole command to disappear from the history file.
+.sp
+.LP
+The built-in command \fB\&.\fR \fIfile\fR reads the whole file before any commands are executed. \fBalias\fR and \fBunalias\fR commands in the file do not apply to any commands defined in the file.
+.sp
+.LP
+Traps are not processed while a job is waiting for a foreground process. Thus, a trap on \fBCHLD\fR is not executed until the foreground job terminates.
+.sp
+.LP
+It is a good idea to leave a space after the comma operator in arithmetic expressions to prevent the comma from being interpreted as the decimal point character in certain locales. 
+.sp
+.LP
+There might be some restrictions on creating a \fB\&.paths\fR file which is portable across other operating systems.
+.sp
+.LP
+If the system supports the 64-bit instruction set, \fB/bin/ksh\fR executes the 64-bit version of \fBksh\fR.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/ksh.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,6235 @@
+'\" te
+.\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+.TH ksh 1 "2011 年 7 月 9 日" "SunOS 5.11" "ユーザーコマンド"
+.SH 名前
+ksh, ksh93, rksh \- Korn シェル。標準および制限付きコマンドとプログラミング言語
+.SH 形式
+.LP
+.nf
+\fBksh\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [ \fB\(+-o\fR \fIoption\fR] ...
+       [-] [\fIarg\fR ...]
+.fi
+
+.LP
+.nf
+\fBrksh\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [\fB\(+-o\fR \fIoption\fR] ...
+       [-] [\fIarg\fR ...]
+.fi
+
+.SH 機能説明
+.sp
+.LP
+\fBksh\fR は、端末またはファイルから読み取られたコマンドを実行するコマンドおよびプログラミング言語です。\fBrksh\fR は、コマンドインタプリタである \fBksh\fR の制限付きバージョンです。\fBrksh\fR は、標準シェルより機能が制限されたログイン名や実行環境を設定するために使用します。
+.sp
+.LP
+シェルに対する引数の意味については、「呼び出し」を参照してください。\fB\fR
+.SS "定義"
+.sp
+.LP
+メタキャラクタ (\fImetacharacter\fR) は、次のいずれかの文字として定義されます。
+.sp
+.in +2
+.nf
+; & ( ) | < > NEWLINE SPACE TAB
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+ブランク (\fIblank\fR) は、タブ (\fBTAB\fR) またはスペース文字 (\fBSPACE\fR) のことです。 
+.sp
+.LP
+識別子 (\fIidentifier\fR) は英文字、数字、または下線の並びで、先頭文字は英文字または下線です。識別子は変数名のコンポーネントとして使用されます。\fI\fR 
+.sp
+.LP
+\fIvname\fR は、1 つの識別子、またはピリオド (\fB\&.\fR) で区切られた複数の識別子の並びです。前にピリオド (\fB\&.\fR) を付けることもできます。\fIvnames\fR は関数名および変数名として使用されます。 
+.sp
+.LP
+ワード (\fIword\fR) は、引用符なしのメタキャラクタを除く、現在のロケールによって定義された文字セットの文字の並びのことです。\fI\fR\fI\fR
+.sp
+.LP
+コマンド (\fIcommand\fR) は、シェル言語の構文にそった文字の並びのことです。シェルは各コマンドを読み取り、指定された動作を直接実行するか、または動作を実行する別のユーティリティーを起動します。組み込みコマンドとは、別のプロセスを作成せずにシェル自体が実行するコマンドです。一部のコマンドは、便宜のためだけに組み込まれているので、このマニュアルページでは説明しません。シェル環境で副作用が発生する組み込みコマンドと、パス検索の実行前に見つかる組み込みコマンド (「実行」を参照) については、このマニュアルページで説明します。\fB\fR歴史的な理由から、これらの組み込みコマンドの中には、ほかの組み込みコマンドと動作が異なり、特殊組み込みコマンドと呼ばれるものがあります。
+.SS "コマンド"
+.sp
+.LP
+単純コマンド (\fIsimple-command\fR) は、変数代入のリストです(「変数代入」を参照)。つまり、ブランクで区切られたワードの並びであり、変数代入のリストが前に置かれることもあります。\fB\fR\fI\fRこのマニュアルページの「環境」節を参照してください。\fB\fR
+.sp
+.LP
+先頭のワードは、実行すべきコマンドの名前を指定します。残りのワードは、この節で述べる場合を除き、呼び出されたコマンドに引数として渡されます。コマンド名は引数 0 として渡されます。\fBexec\fR(2) を参照してください。単純コマンドの値 (\fIvalue\fR) は、コマンドの終了ステータスです。正常終了した場合、この値は \fB0\fR - \fB255\fR です。異常終了した場合は \fB256+\fR\fIsignum\fR です。終了ステータスに対応するシグナルの名前は、組み込みの kill ユーティリティーの \fB-l\fR オプションを使用すると取得できます。 
+.sp
+.LP
+パイプライン (\fIpipeline\fR) は、パイプ ( \fB|\fR ) で区切られた 1 つ以上のコマンドの並びです。最後のコマンドを除き、各コマンドの標準出力は \fBpipe\fR(2) によってその次のコマンドの標準入力と結合されます。最後とみなされるコマンドを除き、各コマンドは別々のプロセスとして実行されます。シェルは最後のコマンドが終了するのを待ちます。パイプラインの終了ステータスは、\fBpipefail\fR オプションが有効になっていないかぎり、最後のコマンドの終了ステータスになります。各パイプラインの前に予約語 \fB!\fR を指定できます。この場合、パイプラインの終了ステータスは、最後のコマンドの終了ステータスが \fB0\fR 以外であれば \fB0\fR に、\fB0\fR であれば \fB1\fR になります。
+.sp
+.LP
+リスト (\fIlist\fR) は、1 つのパイプライン、または \fB;、&、|&、&&、または |\fR で区切られた複数のパイプラインの並びです。終わりに、\fB;、&\fR、または \fB|&\fR を記述することもできます。これら 5 つの記号の中で、\fB;、&\fR、および \fB|&\fR の優先度は同じで、\fB&&\fR と \fB||\fR の優先度よりも低くなります。\fB&&\fR と \fB|\||\fR の優先度は同じです。 
+.sp
+.LP
+セミコロン (\fB;\fR) によって、直前のパイプラインが順次実行されます。アンパサンド記号 (\fB&\fR) によって、直前のパイプラインが非同期的に実行されます。つまりシェルはパイプラインが終了するのを待ちません。\fI\fR\fB|&\fR という記号によって、親シェルに対して双方向パイプが確立された直前のパイプラインが非同期的に実行されます。リダイレクト演算子である \fB<&\fR および \fB>&\fR を引数 \fBp\fR とともにコマンドに適用し、組み込みコマンドである \fBread\fR および \fBprint\fR の \fB-p\fR オプションを使用すると、生成されたパイプラインの標準入出力を親シェルに書き込んだり、親シェルから読み取ったりできます。\fB&&\fR (\fB||\fR) という記号は、直前のパイプラインの戻り値が 0 の値 (0 以外の値) の場合にのみ、後続のリストを実行します。\fI\fR\fB\fRコマンドの区切りとして、セミコロンの代わりに 1 つ以上の復帰改行をリストに指定できます。\fI\fRリダイレクションで始まっておらず、\fBwhile\fR、\fBuntil\fR、または \fBif\fR \fIlist\fR 内で実行されていない単純コマンドであるリストの最初のパイプラインの最初の項目の前に、セミコロンを指定できます。\fI\fR\fI\fR\fI\fR\fBset\fR 組み込みコマンドでの説明のように、\fBshowme\fR オプションが有効になっていないかぎり、このセミコロンは無視されます。
+.sp
+.LP
+コマンド (\fIcommand\fR) は、単純コマンドまたは次の一覧に示すコマンドのいずれかです。特に断わりのないかぎり、コマンドが返す値は、そのコマンド中で最後に実行された単純コマンドの値です。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfor\fR \fIvname\fR \fB[ in\fR \fIword\fR \fB\&... ] ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBfor\fR コマンドが実行されるたびに、\fIvname\fR は、\fBin\fR \fIword\fR リストから次に得られる \fIword\fR に設定されます。\fBin\fR \fIword ...\fR を省略すると、\fBfor\fR コマンドは、1 から開始するように設定された各定位置パラメータに対して \fBdo\fR \fIlist\fR を 1 回実行します。リストの word がなくなると、実行は終了します。「パラメータ展開」を参照してください。\fB\fR 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(( [\fR\fIexpr1\fR\fB] ; [\fR\fIexpr2\fR] ; [\fIexpr3\fR\fB] )) ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+算術式 \fIexpr1\fR が最初に評価されます。算術式 \fIexpr2\fR は評価の結果が \fB0\fR になるまで繰り返し評価され、評価の結果が \fB0\fR 以外であれば \fIlist\fR が実行され、算術式 \fIexpr3\fR が評価されます。いずれかの式を省略した場合、その式の評価が \fB1\fR になる場合と同様に処理されます。「算術評価」を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBselect\fR \fIvname\fR [ in \fIword\fR \fB\&... ] ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBselect\fR コマンドは、標準エラー (ファイル記述子 2) に、一群のワードをそれぞれの前に番号を付けて出力します。\fI\fR\fBin\fR \fIword...\fR を省略すると、\fB1\fR から始まる定位置パラメータが使用されます。「パラメータ展開」を参照してください。\fB\fR\fBPS3\fR プロンプトが出力され、標準入力から行が読み取られます。この行が、リストに示された \fIword\fR のいずれかの番号からなる場合、\fIvname\fR が示す変数の値はこの番号に該当する \fIword\fR に設定されます。この行が空の場合は、再度選択リストを出力します。それ以外の場合は、\fIvname\fR 変数の値を \fBNULL\fR に設定します。標準入力から読み取られた行の内容は、\fBREPLY\fR 変数に保存されます。break またはファイルの終わり (\fIEOF\fR) に行き当たるまで、選択が発生するたびに \fBlist\fR が実行されます。\fIlist\fR の実行によって \fBREPLY\fR 変数が \fBNULL\fR に設定されると、次の選択を求める \fBPS3\fR プロンプトの表示前に選択リストが出力されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcase\fR \fIword\fR \fBin [ [(]\fR \fIpattern\fR \fB[ |\fR \fIpattern\fR \fB] ... )\fR \fIlist\fR \fB;; ] ... esac\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBcase\fR コマンドは、\fIword\fR に一致する最初の \fIpattern\fR に対応した \fIlist\fR を実行します。pattern の形式は、ファイル名生成に使用される形式と同じです。「ファイル名の生成」を参照してください。\fB\fR 
+.sp
+\fB;;\fR 演算子を使用すると、\fBcase\fR の実行が終了します。\fB;;\fR の代わりに \fB;&\fR を使用した場合、後続のリストが存在するときは、そのリストが実行されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBif\fR \fIlist\fR \fB;then\fR \fIlist\fR \fB[ ;elif\fR \fIlist\fR \fB;then\fR \fIlist\fR ] \fB\&... [ ;else\fR \fIlist\fR \fB ]\fR \fB;fi\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBif\fR のあとの \fIlist\fR を実行後、\fB0\fR の終了ステータスが返されると、最初の \fBthen\fR のあとの \fIlist\fR が実行されます。それ以外の場合、\fBelif\fR のあとの \fIlist\fR が実行されます。この値が \fB0\fR の場合、次の \fBthen\fR のあとの \fIlist\fR が実行されます。連続した \fBelif\fR \fIlist\fR がすべて失敗すると、\fBelse\fR \fIlist\fR が実行されます。\fBif\fR \fIlist\fR が \fB0\fR 以外の終了ステータスを持ち、\fBelse\fR \fIlist\fR が存在しない場合、\fBif\fR コマンドは \fB0\fR の終了ステータスを返します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhile\fR \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.br
+.na
+\fBuntil \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBwhile\fR コマンドは、while \fIlist\fR を繰り返し実行し、リスト内の最後のコマンドの終了ステータスが 0 の場合、\fBdo\fR \fIlist\fR を実行します。それ以外の場合、ループは終了します。\fBdo\fR \fIlist\fR 中のコマンドを実行しない場合、\fBwhile\fR コマンドは \fB0\fR の終了ステータスを返します。ループ終了条件の判定を逆にするには、\fBwhile\fR の代わりに \fBuntil\fR を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB((\fR\fIexpression\fR\fB))\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIexpression\fR は、このマニュアルページで説明する算術評価の規則を使用して評価されます。算術式の値が \fB0\fR 以外の場合、終了ステータスは \fB0\fR です。それ以外の場合、終了ステータスは \fB1\fR です。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fIlist\fR\fB;)\fR\fR
+.ad
+.sp .6
+.RS 4n
+別の環境で list を実行します。入れ子で 2 つの開いた括弧を連続して記述する場合、この節で説明するように、算術コマンドとして評価されないようにスペースを挿入する必要があります。
+.sp
+単に \fIlist\fR を実行します。メタキャラクタの \fB(\fR および \fB)\fR とは異なり、\fB{\fR および \fB}\fR は予約語なので、認識されるには行の始めまたは \fB;\fR のあとに現れる必要があります。\fI\fR 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[[\fR\fIexpression\fR\fB]]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIexpression\fR を評価し、\fIexpression\fR が真のときに \fB0\fR の終了ステータスを返します。\fIexpression\fR については、「条件式」を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfunction\fR \fIvarname\fR \fB{\fR \fIlist\fR \fB;}\fR\fR
+.ad
+.br
+.na
+\fB\fIvarname\fR \fB() {\fR \fIlist\fR \fB;}\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIvarname\fR が参照する関数を定義します。\fIvarname\fR に \fB\&.\fR が含まれる関数はディシプリン関数と呼ばれ、\fIvarname\fR のうち最後の \fB\&.\fR の前にある部分は既存の変数を参照している必要があります。 
+.sp
+\fB{\fR と \fB}\fR の間のコマンド群 (\fIlist\fR) が関数の本体になります。function \fIvarname\fR の構文で定義された関数を、\fB\&.\fR という特殊組み込みコマンドの引数として使用すると、その定義に \fIvarname\fR\fB()\fR の構文を使用している場合と同等の動作をさせることができます。「関数」を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtime [\fR \fIpipeline\fR \fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIpipeline\fR を省略すると、現在のシェルおよび完了した子プロセスのユーザーおよびシステム時間が標準エラーに出力されます。それ以外の場合は、\fIpipeline\fR が実行され、経過時間、ユーザー時間、およびシステム時間が標準エラーに出力されます。\fBTIMEFORMAT\fR 変数は、時間情報の表示方法を指定する書式文字列に設定できます。\fBTIMEFORMAT\fR 変数についての詳細は、「シェル変数」を参照してください。\fB\fR 
+.RE
+
+.sp
+.LP
+次の予約語は、コマンドの最初のワードであり、かつ引用符を付けずに記述されたときにのみ、予約語と認識されます。 
+.br
+.in +2
+\fBcase\fR
+.in -2
+.br
+.in +2
+\fBdo\fR
+.in -2
+.br
+.in +2
+\fBdone\fR
+.in -2
+.br
+.in +2
+\fBelse\fR
+.in -2
+.br
+.in +2
+\fBelif\fR
+.in -2
+.br
+.in +2
+\fBesac\fR
+.in -2
+.br
+.in +2
+\fBfor\fR
+.in -2
+.br
+.in +2
+\fBfi\fR
+.in -2
+.br
+.in +2
+\fBfunction\fR
+.in -2
+.br
+.in +2
+\fBif\fR
+.in -2
+.br
+.in +2
+\fBselect\fR
+.in -2
+.br
+.in +2
+\fBthen\fR
+.in -2
+.br
+.in +2
+\fBtime\fR
+.in -2
+.br
+.in +2
+\fBuntil\fR
+.in -2
+.br
+.in +2
+\fBwhile\fR
+.in -2
+.br
+.in +2
+\fB{ }\fR
+.in -2
+.br
+.in +2
+\fB[[ ]]\fR
+.in -2
+.br
+.in +2
+\fB!\fR
+.in -2
+.SS "変数代入"
+.sp
+.LP
+1 つまたは複数の変数代入は、単純コマンドを開始することも、\fBtypeset\fR、\fBexport\fR、または \fBreadonly\fR の特殊組み込みコマンドの引数として使用することもできます。代入の構文は次の形式になります。\fI\fR
+.sp
+.ne 2
+.mk
+.na
+\fB\fIvarname\fR\fB=\fR\fIword\fR\fR
+.ad
+.br
+.na
+\fB\fIvarname\fR\fB[\fR\fIword\fR\fB]=\fR\fIword\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIvarname\fR と \fB=\fR の間、\fB=\fR と \fIword\fR の間にスペースを入れることはできません。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIvarname\fR\fB=(\fR\fIassignlist\fR\fB)\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIvarname\fR と \fB=\fR の間にスペースを入れることはできません。\fIassignlist\fR は次のいずれかにできます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fIword ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+インデックス付き配列の代入。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIword\fR\fB]=\fR\fIword ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+連想配列の代入。\fBtypeset\fR \fB-a\fR を前に付けると、代わりにインデックス付き配列が作成されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIassignment ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+複合変数代入。これは、\fIvarname.name\fR という形式のサブ変数を含んだ複合変数 \fIvarname\fR を作成します。ここで \fIname\fR は代入の名前の部分です。\fIvarname\fR の値にはすべての代入要素が含まれます。\fIvarname\fR のサブ変数に行われた追加の代入は、\fIvarname\fR の値の一部としても表示されます。\fIassignment\fR を指定しない場合、\fIvarname\fR はサブシーケンスの子要素を定義できる複合変数になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtypeset [\fR\fIoptions\fR] \fIassignment\fR \fB\&...\fR\fR
+.ad
+.sp .6
+.RS 4n
+入れ子になった変数代入。複数の代入を指定するには、\fB;\fR でそれぞれを区切ります。前の値は、代入前に設定解除されます。
+.RE
+
+また、前の値への加算または付加を指定するために、\fB=\fR の代わりに \fB+=\fR を使用できます。\fB+=\fR を算術タイプに適用すると、\fIword\fR は算術式として評価され、現在の値に加算されます。文字列変数に適用すると、\fIword\fR で定義された値が、この値に付加されます。複合代入の場合、前の値は設定解除されず、型に互換性があれば、新しい値が現在の値に付加されます。 
+.RE
+
+.SS "コメント"
+.sp
+.LP
+\fB#\fR で始まるワードがある場合、そのワードと、これ以降の復帰改行までの文字がすべてコメントになり、無視されます。
+.SS "別名"
+.sp
+.LP
+各コマンドの最初のワードに別名が定義されている場合、そのワードは別名のテキストに置き換えられます。別名は任意の数の文字で構成されます。別名に使用できない文字は、メタキャラクタ、引用符、ファイル展開文字、パラメータ展開文字、コマンド置換文字、および \fB=\fR です。置換文字列としては、「コマンド」節で示したメタキャラクタを含む有効なシェルスクリプトを指定できます。\fB\fR置換されたテキスト内にある各コマンドの最初のワードは、置換対象のものを除き、別名についてチェックされます。別名の最後の文字がブランクの場合、別名のあとのワードも別名置換についてチェックされます。 
+.sp
+.LP
+別名を使用すると、組み込みコマンドを再定義できますが、「コマンド」節で示した予約語は再定義できません。\fB\fR別名は alias コマンドで作成および一覧表示でき、\fBunalias\fR コマンドで削除できます。
+.sp
+.LP
+別名化はスクリプトの読み取り時に実行されますが、スクリプトの実行中には行われません。別名を有効にするには、別名を参照するコマンドの読み取り前に、\fBalias\fR コマンドで別名を定義しておく必要があります。次に示す別名は、シェルにコンパイルされますが、設定解除または再定義が可能です。
+.sp
+.in +2
+.nf
+autoload='typeset -fu'
+command='command '
+fc=hist
+float='typeset -lE'
+functions='typeset -f'
+hash='alias -t --'
+history='hist -l'
+integer='typeset -li'
+nameref='typeset -n'
+nohup='nohup '
+r='hist -s'
+redirect='command exec'
+source='command .'
+stop='kill -s STOP'
+suspend='kill -s STOP $$'
+times='{ { time;} 2>&1;}'
+type='whence -v'
+.fi
+.in -2
+.sp
+
+.SS "チルド置換"
+.sp
+.LP
+別名置換を実行すると、各ワードが引用符なしのチルド (\fB~\fR) で始まっているかどうかがチェックされます。チルド置換の場合、ワードは、パラメータ展開のワード部分も指します。\fI\fR\fI\fR「パラメータ展開」を参照してください。\fB\fR 
+.sp
+.LP
+この場合には、\fB/\fR までのワードについて、パスワードデータベースのユーザー名と一致するかどうかがチェックされます。一致した場合は、\fB~\fR および一致したログイン名が一致したユーザーのログインディレクトリに置き換えられます。一致するユーザー名が見つからない場合、元のテキストは変更されません。\fB~\fR が単独で指定された場合や、後ろに \fB/\fR を伴って指定された場合は、\fB$HOME\fR に置き換えられます。\fB~\fR のあとに \fB+\fR または \fB-\fR を指定すると、それぞれ \fB$PWD\fR または \fB$OLDPWD\fR の値に置き換えられます。
+.sp
+.LP
+さらに、変数代入を展開する場合で、代入する値が \fB~\fR で始まるとき、および \fB~\fR がコロン (\fB:\fR) のあとに置かれているときに、チルド置換が試行されます。\fI\fR\fB:\fR は \fB~\fR ログイン名の終了にも使用されます。
+.SS "コマンド置換"
+.sp
+.LP
+ドル記号 (\fB$\fR) を前に付けた括弧か、一対の逆引用符 (\fB``\fR) でコマンドを囲むと、その標準出力をワードの一部または全体として使用できます。末尾の復帰改行は削除されます。2 番目の (廃止された) 形式では、コマンドの実行前に、引用符間の文字列に含まれる特殊引用符文字が処理されます。「クォート」を参照してください。\fB\fR 
+.sp
+.LP
+\fB$(cat file)\fR というコマンド置換は、同じ動作で実行速度の速い \fB$(<file)\fR に置き換えることができます。\fB$(\fR\fIn\fR\fB<#)\fR というコマンド置換は、ファイル記述子 \fIn\fR の現在のバイトオフセットに展開されます。
+.SS "算術置換"
+.sp
+.LP
+ドル記号を前に付けた二重括弧で囲まれた算術式 (つまり (\fB$((\fR\fIarithmetic_expression\fR\fB))\fR) の形式) は、二重括弧内の算術式の値に置き換えられます。
+.SS "プロセス置換"
+.sp
+.LP
+プロセス置換は、UNIX オペレーティングシステムのバージョンが、開いたファイルに名前を付けるための \fB/dev/fd\fR ディレクトリをサポートしている場合にだけ使用できます。 
+.sp
+.LP
+\fB<(\fR\fIlist\fR\fB)\fR または \fB>(\fR\fI list\fR\fB)\fR 形式の各コマンド引数は、\fIlist\fR が示すプロセスを実行します。このプロセスは、\fB/dev/fd\fR 中のファイルに非同期的に接続されています。このファイルの名前がコマンドの引数になります。\fB>\fR が付いた形式を使用した場合は、このファイルに書き出すことで \fIlist\fR に入力できます。\fB<\fR の形式を使用した場合は、引数として渡されたファイルに \fIlist\fR プロセスからの出力が含まれます。 
+.sp
+.LP
+たとえば、次のように指定します。
+.sp
+.in +2
+.nf
+paste <(cut -f1 \fIfile1\fR) <(cut -f3 \fIfile2\fR) | tee \e
+     >(\fIprocess1\fR) >(\fIprocess2\fR)
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+これは \fIfile1\fR からフィールド 1 をカットし、\fIfile2\fR からフィールド 3 をカットし、その両者をペーストし、その結果を \fIprocess1\fR と \fIprocess2\fR に送ります。\fB\fR\fB\fRさらに標準出力に結果を表示します。引数としてコマンドに渡されるファイルは、UNIX の \fBpipe\fR(2) です。ファイルに対し \fBlseek\fR(2) を行えると想定しているプログラムは動作しません。 
+.SS "パラメータ展開"
+.sp
+.LP
+パラメータは、変数、1 つまたは複数の数字、または \fB*\fR、\fB@\fR、\fB#\fR、\fB?\fR、\fB-\fR、\fB$\fR、\fB!\fR のいずれかの文字です。変数は \fIvname\fR で指定されます。\fIvname\fR に \fB\&.\fR が含まれている変数を作成するには、最後の . の前にあるすべての文字から構成される \fBvname\fR 変数が、すでに存在している必要があります。変数には 1 つの値と、0 個以上の属性が割り当てられます。変数に値と属性を割り当てるには、\fBtypeset\fR 特殊組み込みコマンドを使用します。シェルがサポートする属性については、\fBtypeset\fR 特殊組み込みコマンドの節で後述します。エクスポートされた変数によって、値と属性が環境に渡されます。 
+.sp
+.LP
+シェルは、インデックス付き配列と連想配列の両方をサポートします。配列変数の要素は、添字 (subscript) によって参照されます。インデックス付き配列の添字は、\fB[\fR と \fB]\fR で囲まれた算術式で指定されます (「算術評価」を参照してください)。\fB\fRインデックス付き配列に値を代入するには、\fBset -A\fR \fIvname value ...\fR を使用します。添字の値は必ず \fB0\fR から \fB1,048,575\fR の範囲内で指定します。インデックス付き配列は宣言する必要はありません。有効な添字を伴う変数の参照は正当であり、必要に応じて配列が作成されます。 
+.sp
+.LP
+連想配列は、\fBtypeset\fR の \fB-A\fR オプションを使用して作成します。連想配列の添字は、\fB[\fR と \fB]\fR で囲まれた文字列で指定されます。 
+.sp
+.LP
+添字なしで配列を参照すると、\fB0\fR の添字で配列を参照したときと同等の結果になります。
+.sp
+.LP
+次によって変数に値を代入することもできます。
+.sp
+.in +2
+.nf
+\fIvname\fR=\fIvalue\fR [\fIvname\fR=\fIvalue\fR] ...
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+または
+.sp
+.in +2
+.nf
+\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR [\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR] ...
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+\fB=\fR の前後にスペースを入れることはできません。\fInameref\fR は、別の変数を参照する変数です。\fInameref\fR は、\fBtypeset\fR の \fB-n\fR 属性を使用して作成します。\fInameref\fR 変数が使用されたときは常に \fBtypeset\fR コマンドの実行時点での変数の値が参照されます。\fInameref\fR の名前にドット (\fI\&.\fR) を含めることはできません。変数名または関数名に \fB\&.\fR が含まれ、名前の最初の \fB\&.\fR までの部分が \fInameref\fR の名前と一致する場合、\fInameref\fR の部分を \fInameref\fR が参照している変数の名前に置き換えることによって、参照される変数が取得されます。\fInameref\fR を \fBfor\fR ループのインデックスとして使用すると、リスト内の項目ごとに名前参照が確立されます。\fInameref\fR を使用すると、関数への引数として名前が渡される変数を、関数内部で簡単に参照できます。たとえば、変数の名前が最初の引数として関数に渡される場合、その関数内のコマンドとして
+.sp
+.in +2
+.nf
+ typeset -n var=$1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+を実行すると、\fIvar\fR への参照および代入が、その関数に名前が渡される変数の参照および代入になります。浮動小数点属性 (\fB-E\fR または \fB-F\fR) または整数属性 (\fB-i\fR) のどちらかが \fIvname\fR に対して設定されている場合、このマニュアルページで説明するように、\fIvalue\fR は算術評価の対象になります。定位置パラメータは数値で設定されるパラメータで、\fBset\fR 特殊組み込みコマンドで値を代入できます。パラメータ \fB$0\fR は、シェルが呼び出されたときに、引数 0 から設定されます。文字 \fB$\fR は、置換可能なパラメータを示します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルは、中括弧やメタキャラクタが含まれていても、\fB${\fR からこれに対応する \fB}\fR までのすべての文字を、同じワードの一部として読み取ります。パラメータの値 (もしあれば) に置き換えられます。中括弧が必要となるのは、\fIparameter\fR のあとに、その名前の一部として解釈してはならない文字、数字、または下線が続く場合、変数名に \fB\&.\fR が含まれる場合、または変数に添字が付いている場合です。1 つまたは複数の数字からなるパラメータは、定位置パラメータになります。\fI\fR複数の数字からなる定位置パラメータは中括弧で囲む必要があります。\fIparameter\fR が \fB*\fR または \fB@\fR のときは、\fB$1\fR から始まるすべての定位置パラメータに置き換えられ、フィールド区切り文字で区切られます。配列の \fIvname\fR に添字として \fB*\fR または \fB@\fR を使用すると、各要素の値に置き換えられ、\fBIFS\fR の値の最初の文字で区切られます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${#\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIparameter\fR が \fB*\fR または \fB@\fR のときは、定位置パラメータの数に置き換えられます。それ以外の場合は、\fIparameter\fR の値の長さに置き換えられます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${#\fR\fIvname\fR\fB[*]}\fR\fR
+.ad
+.br
+.na
+\fB\fB${#\fR\fIvname\fR\fB[@]}\fR\fR
+.ad
+.sp .6
+.RS 4n
+配列 \fIvname\fR 内の要素の数に置き換えられます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIvname\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIvname\fR で参照される変数の名前に展開されます。\fIvname\fR が名前参照である場合を除いて、これは \fIvname\fR です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIvname\fR\fB[\fR\fIsubscript\fR\fB]}\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIsubscript\fR が \fB*\fR または \fB@\fR でなければ、添字の名前に展開されます。\fIsubscript\fR が \fB*\fR の場合は、\fIvname\fR の配列添字のリストが生成されます。配列でない変数の場合、変数が設定されていれば値は \fB0\fR になります。それ以外の場合は \fBNULL\fR です。\fIsubscript\fR が \fB@\fR の場合、\fB$ {\fR\fIvname\fR\fB[\fR\fI *\fR\fB]}\fR と同じになります。ただし、二重引用符で囲んで使用した場合に、それぞれの配列の添字が別々の引数を生成します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIprefix\fR\fB*}\fR\fR
+.ad
+.sp .6
+.RS 4n
+名前が \fIprefix\fR で始まる変数の名前に展開されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:-\fR\fIword\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIparameter\fR が設定されており、NULL でない場合は、その値に置き換えられます。それ以外の場合は、\fIword\fR に置き換えられます。
+.sp
+\fIword\fR は、置換された文字列として使用されるまで評価されません。 
+.sp
+次の例では、\fBd\fR が設定されていないか、NULL である場合にのみ、\fBpwd\fR が実行されます。
+.sp
+.in +2
+.nf
+print ${d:-$(pwd)}
+.fi
+.in -2
+.sp
+
+式からコロン (\fB:\fR) を省略すると、シェルは \fIparameter\fR が設定されているかどうかだけをチェックします。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR:\fIlength\fR}\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+オフセットを算術式として展開することにより決定される (\fB0\fR を基準とした) 文字から始まり、\fIlength\fR によって定義された算術式によって決定される文字数から構成される \fIparameter\fR の値の部分に展開されます。 
+.sp
+2 番目の形式では、値の残りの部分が使用されます。負のオフセットの場合は、\fIparameter\fR の最後から逆方向にカウントします。
+.sp
+シェルが演算子を \fB:-\fR と解釈しないように、1 つまたは複数のブランクをマイナスの記号の前に指定する必要があります。パラメータが \fB*\fR または \fB@\fR である場合や、\fB*\fR または \fB@\fR のインデックスが付けられた配列名である場合、\fIoffset\fR と \fIlength\fR はそれぞれ配列インデックスと要素数を指します。負の \fIoffset\fR は、インデックス付き配列の最大の添字より 1 大きい数値を基準に計算されます。連想配列の順序は不特定です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB#\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB##\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルの \fIpattern\fR が \fIparameter\fR の値の先頭に一致した場合、この展開式の値は、\fIparameter\fR の値から一致した部分を削除したものになります。それ以外の場合は、この \fIparameter\fR の値に置き換えられます。1 番目の形式では、一致した最小の \fIpattern\fR が削除され、2 番目の形式では、一致した最大の \fIpattern\fR が削除されます。\fIparameter\fR が \fB@\fR または \fB*\fR である場合や、\fB@\fR または \fB*\fR の添字が指定された配列変数である場合は、部分文字列操作が個々の要素に順番に適用されます。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB%\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB%%\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルの \fIpattern\fR が \fIparameter\fR の値の末尾に一致した場合、この展開式の値は、parameter の値から一致した部分を削除したものになります。それ以外の場合は、\fIparameter\fR の値に置き換えられます。1 番目の形式では、一致した最小の pattern が削除され、2 番目の形式では、一致した最大の pattern が削除されます。parameter が \fB@\fR または \fB*\fR である場合や、\fB@\fR または \fB*\fR の添字が指定された配列変数である場合は、部分文字列操作が個々の要素に順番に適用されます。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB/\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB//\fR\fI pattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB/#\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB/%\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIparameter\fR を展開し、一致した最長の \fIpattern\fR を、指定した \fIstring\fR に置き換えます。\fIstring\fR に \fB\e\fR\fIn\fR が現れるごとに、\fIparameter\fR の中の \fIn\fR 番目のサブパターンに一致する部分に置き換えられます。\fB\fR 
+.sp
+\fIstring\fR が NULL の場合、\fIpattern\fR は削除され、string の先頭の \fB/\fR を省略できます。\fIparameter\fR が \fB@\fR または \fB*\fR である場合や、\fB@\fR または \fB*\fR の添字が指定された配列変数である場合は、置換操作が個々の要素に順番に適用されます。この場合、\fIword\fR の \fIstring\fR 部分が要素ごとに繰り返し評価されます。
+.sp
+1 番目の形式では、最初に現れた \fIpattern\fR だけが置き換えられます。 
+.sp
+2 番目の形式では、\fIpattern\fR に一致するごとに、指定した \fIstring\fR に置き換えられます。 
+.sp
+3 番目の形式では、パターンの一致は \fIstring\fR の先頭に制限されます。 
+.sp
+4 番目の形式では、パターンの一致は \fIstring\fR の末尾に制限されます。 
+.RE
+
+.sp
+.LP
+次のパラメータはシェルが自動的に設定します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 19n
+.rt  
+定位置パラメータ数 (10 進数)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 19n
+.rt  
+呼び出し時、または \fBset\fR コマンドを使用してシェルに適用されるオプション。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 19n
+.rt  
+最後に実行されたコマンドが返した 10 進数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 19n
+.rt  
+このシェルのプロセス番号。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB_\fR\fR
+.ad
+.RS 19n
+.rt  
+\fB_\fR の値は、最初は環境に引き渡される実行中のシェルまたはスクリプトの絶対パス名です。その後、直前のコマンドの最後の引数が代入されます。 
+.sp
+このパラメータは、非同期式のコマンドに関しては設定されません。このパラメータは、メールのチェック時にも、一致する \fBMAIL\fR ファイルの名前を保持するために使用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR\fR
+.ad
+.RS 19n
+.rt  
+最後に呼び出されたバックグラウンドコマンドのプロセス番号、または \fBbg\fR 組み込みコマンドでバックグラウンドで実行された最新のジョブのプロセス番号。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.command\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBDEBUG\fR トラップを処理するときに、この変数には実行しようとしている現在のコマンド行が含まれます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edchar\fR\fR
+.ad
+.RS 19n
+.rt  
+この変数には、\fBKEYBD\fR トラップを処理するときに入力されたキーボード文字 (または、最初の文字が ESC、つまり \fBASCII 033\fR である場合には文字の並び) の値が含まれます。トラップアクションの一環として値が変更された場合は、そのトラップを引き起こしたキー (またはキーシーケンス) が新しい値に置き換えられます。このマニュアルページの「キーバインド」を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edcol\fR\fR
+.ad
+.RS 19n
+.rt  
+最新の \fBKEYBD\fR トラップの時点でのカーソルの文字位置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edmode\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBvi\fR 挿入モード中に \fBKEYBD\fR トラップを処理するときには、値は ESC に設定されます。それ以外の場合は、\fB\&.sh.edmode\fR は \fBKEYBD\fR トラップを処理するときに NULL になります。このマニュアルページの「vi 編集モード」節を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edtext\fR\fR
+.ad
+.RS 19n
+.rt  
+直前の \fBKEYBD\fR トラップの時点における入力バッファーに含まれていた文字。\fBKEYBD\fR トラップを処理していない場合は、値は NULL です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.file\fR\fR
+.ad
+.RS 19n
+.rt  
+現在のコマンドを含むファイルのパス名。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.fun\fR\fR
+.ad
+.RS 19n
+.rt  
+実行されている現在の関数の名前。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.match\fR\fR
+.ad
+.RS 19n
+.rt  
+一致した条件付きパターンマッチングのあと、および \fB#\fR、\fB%\fR、または \fB/\fR の演算子を使用した変数展開のあとに、最新の一致およびサブパターン一致を保存するインデックス付き配列。\fB0\fR 番目の要素には完全一致を格納し、\fIi\fR 番目の要素には \fIi\fR 番目の部分一致を格納します。展開された変数に新しい値が代入されると、\fB\&.sh.match\fR 変数は設定解除されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.name\fR\fR
+.ad
+.RS 19n
+.rt  
+ディシプリン関数が呼び出された時点での変数の名前に設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.subscript\fR\fR
+.ad
+.RS 19n
+.rt  
+ディシプリン関数が呼び出された時点での変数の名前添字に設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.subshell\fR\fR
+.ad
+.RS 19n
+.rt  
+サブシェルおよびコマンド置換の現在の深さ。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.value\fR\fR
+.ad
+.RS 19n
+.rt  
+set または append ディシプリン関数が呼び出された時点での変数の値に設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.version\fR\fR
+.ad
+.RS 19n
+.rt  
+このシェルのバージョンを識別する値に設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLINENO\fR\fR
+.ad
+.RS 19n
+.rt  
+実行しているスクリプトまたは関数内での現在の行番号。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOLDPWD\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBcd\fR コマンドで設定された直前の作業用ディレクトリ。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOPTARG\fR \fR
+.ad
+.RS 19n
+.rt  
+\fBgetopts\fR 組み込みコマンドで処理された最後のオプション引数の値。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOPTIND\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBgetopts\fR 組み込みコマンドで処理された最後のオプション引数のインデックス。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPPID\fR\fR
+.ad
+.RS 19n
+.rt  
+シェルの親のプロセス番号。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPWD\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBcd\fR コマンドで設定された現在の作業用ディレクトリ。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRANDOM\fR\fR
+.ad
+.RS 19n
+.rt  
+この変数が参照されるたびに、\fB0\fR から \fB32767\fR の間で均一に分散した乱整数を生成します。\fBRANDOM\fR に数値を代入すると、乱数の並びを初期化できます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBREPLY\fR\fR
+.ad
+.RS 19n
+.rt  
+この変数は、引数が指定されない場合、\fBselect\fR 文および \fBread\fR 組み込みコマンドによって設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSECONDS\fR\fR
+.ad
+.RS 19n
+.rt  
+この変数を参照するたびに、シェルを起動してからの秒数が返されます。この変数に値を代入すると、その値と代入処理実行時からの秒数との合計値が参照時に返されます。
+.RE
+
+.sp
+.LP
+次の変数はシェルによって使用されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCDPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBcd\fR コマンドの検索パスを定義します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCOLUMNS\fR\fR
+.ad
+.RS 14n
+.rt  
+シェル編集モードおよび選択リスト出力用の編集ウィンドウの幅を定義します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDITOR\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBVISUAL\fR 変数が設定されていない場合、\fBVISUAL\fR で説明するように、この変数の値のパターンがチェックされ、対応する編集オプションが有効になります。 
+.sp
+このマニュアルページの「特殊コマンド」節の \fBset\fR コマンドを参照してください。\fB\fR 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENV\fR\fR
+.ad
+.RS 14n
+.rt  
+値に対してパラメータ展開、コマンド置換、および算術置換を実行して、シェルが呼び出されたときに実行されるスクリプトのパス名を生成します。このファイルは通常、別名および関数の定義に使用されます。デフォルト値は \fB$HOME/.kshrc\fR です。 
+.sp
+このマニュアルページの「呼び出し」節を参照してください。\fB\fR
+.sp
+\fBENV\fR はシェルでは設定されません。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFCEDIT\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBhist\fR コマンドのデフォルトのエディタ名を表す廃止済みの名前。\fBHISTEDIT\fR が設定されている場合、\fBFCEDIT\fR は使用されません。
+.sp
+シェルではデフォルト値を \fBFCEDIT\fR に指定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFIGNORE\fR\fR
+.ad
+.RS 14n
+.rt  
+ファイル名の照合を実行するときに無視される一連のファイル名を定義するパターン。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+関数定義の検索パス。\fB-u\fR 属性を持つ関数が参照される場合や、コマンドが見つからなかった場合に、このパス内のディレクトリに対して、関数またはコマンドと同じ名前のファイルを検索します。このコマンドの名前の実行ファイルが見つかると、現在の環境に読み込まれ実行されます。\fBPATH\fR とは異なり、現在のディレクトリは、隣接するコロン (\fB:\fR) 文字や先頭または末尾のコロン (\fB:\fR) ではなく、ドット (\fB\&.\fR) で明示的に表す必要があります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTCMD\fR\fR
+.ad
+.RS 14n
+.rt  
+履歴ファイル内の現在のコマンドの番号。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTEDIT\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBhist\fR コマンドのデフォルトのエディタ名に使用する名前。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTFILE\fR\fR
+.ad
+.RS 14n
+.rt  
+シェルの起動時にこの変数が設定されていると、その値はコマンド履歴の格納に使用されるファイルのパス名になります。このマニュアルページの「コマンド行の再入力」節を参照してください。\fB\fR 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTSIZE\fR\fR
+.ad
+.RS 14n
+.rt  
+シェルの起動時にこの変数が設定されていると、このシェルで使用可能な入力済みコマンドの数がこの値以上になります。デフォルト値は \fB512\fR です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHOME\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBcd\fR コマンドのデフォルト引数 (ホームディレクトリ)。
+.sp
+\fBHOME\fR はシェルでは設定されません。\fBHOME\fR は \fBlogin\fR(1) で設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIFS\fR\fR
+.ad
+.RS 14n
+.rt  
+内部フィールド区切り文字。通常は、スペース文字、タブ、および復帰改行です。コマンド置換またはパラメータ展開の結果を区切る場合および組み込みコマンドの read でフィールドを区切る場合に使用します。\fB"$*"\fR 置換で引数を区切るときには、\fBIFS\fR 変数の最初の文字が使用されます。このマニュアルページの「クォート」節を参照してください。\fB\fR 
+.sp
+\fBissspace\fR 文字クラスに属していない \fBIFS\fR 文字、および \fBissspace\fR 文字クラスに属する隣接文字で \fBIFS\fR に含まれているものが、分割対象の文字列に現れるごとに、フィールドが区切られます。\fBissspace\fR 文字クラスに属する文字で IFS に含まれる 1 つまたは複数の文字によって、フィールドが区切られます。また、同じ \fBissspace\fR 文字が \fBIFS\fR の中で並んでいる場合、この文字は \fBissspace\fR クラスに属していない文字として扱われます。つまり、\fBIFS\fR が 2 つのタブ文字から構成されている場合、2 つの隣接するタブ文字によって NULL フィールドが区切られます。
+.sp
+シェルではデフォルト値を \fBIFS\fR に設定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLANG\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数は、\fBLC_\fR または \fBLANG\fR で始まる変数で明確に選択されていないすべてのロケールカテゴリを指定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_ALL\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数は、\fBLANG\fR 変数とほかのすべての \fBLC_\fR 変数の値を上書きします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_COLLATE\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数は、文字照合情報のロケールカテゴリを指定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_CTYPE\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数は、文字処理関数のロケールカテゴリを指定します。これは、パターンマッチング用の文字クラスを指定します。このマニュアルページの「ファイル名の生成」節を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_NUMERIC\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数は、小数点文字のロケールカテゴリを指定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLINES\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数を設定すると、その値は選択 (select) リスト出力用のカラム長の決定に使用されます。選択リストは、\fBLINES\fR が示す行数の約 3 分の 2 がいっぱいになるまで垂直に出力されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAIL\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数にメールファイルの名前が設定されていて、\fBMAILPATH\fR 変数が設定されていない場合、シェルは指定されたファイルにメールが到着するとユーザーに通知します。\fB\fR
+.sp
+\fBMAIL\fR はシェルでは設定されません。一部のシステムでは、\fBMAIL\fR は \fBlogin\fR(1) で設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILCHECK\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBMAILPATH\fR 変数または \fBMAIL\fR 変数で指定されたファイルの更新時間の変更をシェルが何秒ごとにチェックするかを指定します。デフォルト値は \fB600\fR 秒です。この時間が経過すると、シェルは次のプロンプトを出力する前にチェックします。
+.sp
+シェルではデフォルト値を \fBMAILCHECK\fR に指定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+コロン (\fB:\fR) で区切ったファイル名のリスト。この変数を設定すると、シェルは直前の \fBMAILCHECK\fR 秒間に発生した指定ファイルに対する変更をユーザーに通知します。各ファイル名のあとには \fB?\fR と、出力されるメッセージを指定できます。このメッセージには、変更されたファイルの名前に変数 \fB$_\fR を定義して、パラメータ展開、コマンド置換、および算術置換が行われます。デフォルトのメッセージは \fByou have mail in $_\fR です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+コマンド用の検索パス。\fB\&.profile\fR の場合を除き、\fBrksh\fR の環境下で実行する場合、ユーザーは \fBPATH\fR を変更できません。このマニュアルページの「実行」節を参照してください。\fB\fR
+.sp
+シェルではデフォルト値を \fBPATH\fR に設定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS1\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数の値は、パラメータ展開、コマンド置換、および算術置換用に展開され、1 次プロンプト文字列を定義します。デフォルトは \fB$\fR です。1 次プロンプト文字列内の文字 \fB!\fR は、コマンド番号で置き換えられます。\fB!\fR を 2 つ連続して指定すると、プロンプト文字列の出力時に \fB!\fR が 1 つ表示されます。このマニュアルページの「コマンド行の再入力」節を参照してください。\fB\fR
+.sp
+シェルではデフォルト値を \fBPS1\fR に設定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS2\fR\fR
+.ad
+.RS 14n
+.rt  
+2 次プロンプト文字列を指定します。デフォルトは \fB>\fR です。
+.sp
+シェルではデフォルト値を \fBPS2\fR に設定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS3\fR\fR
+.ad
+.RS 14n
+.rt  
+select ループ内で使用する選択プロンプト文字列を指定します。デフォルトは \fB#?\fR です。
+.sp
+シェルではデフォルト値を \fBPS3\fR に設定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS4\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数の値は、パラメータ評価、コマンド置換、および算術置換用に展開され、実行トレースの各行の前に指定されます。デフォルトでは、\fBPS4\fR は \fB+\fR です。\fBPS4\fR が設定解除されると、実行トレースプロンプトも \fB+\fR になります。
+.sp
+シェルではデフォルト値を \fBPS4\fR に設定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHELL\fR\fR
+.ad
+.RS 14n
+.rt  
+シェルのパス名は環境内に保持されます。呼び出し時に、この変数のベース名が \fBrsh\fR、\fBrksh\fR、\fBrksh\fR、または \fBkrsh\fR の場合、シェルの機能は制限されます。
+.sp
+\fBSHELL\fR はシェルでは設定されません。一部のシステムでは、\fBSHELL\fR は \fBlogin\fR(1) で設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBTIMEFORMAT\fR\fR
+.ad
+.RS 14n
+.rt  
+このパラメータの値は、\fBtime\fR の予約語が接頭辞として付けられたパイプラインの時間情報を表示する方法を指定する書式文字列として使用されます。\fB%\fR 文字は、時間値またはほかの情報に展開される書式シーケンスの始まりを示します。 
+.sp
+書式シーケンスとその意味を次に示します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%%\fR\fR
+.ad
+.sp .6
+.RS 4n
+リテラルな \fB%\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]R\fR\fR
+.ad
+.sp .6
+.RS 4n
+秒数での経過時間。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]U\fR\fR
+.ad
+.sp .6
+.RS 4n
+ユーザーモードで消費された CPU 時間 (秒)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]S\fR\fR
+.ad
+.sp .6
+.RS 4n
+システムモードで消費された CPU 時間 (秒)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%P\fR\fR
+.ad
+.sp .6
+.RS 4n
+CPU 時間の割合 (パーセント)。\fB(U + S) / R\fR で計算します。
+.RE
+
+中括弧は省略可能な部分を示します。省略可能な \fIp\fR は、\fI精度\fRを小数点以下の桁数で指定します。\fB0\fR の値にすると、小数点と小数点以下は出力されません。最大で、小数点以下第 3 位まで表示できます。\fIp\fR の値が \fB3\fR より大きい場合は、\fB3\fR として扱われます。\fIp\fR が指定されていなければ、\fB3\fR の値が使用されます。
+.sp
+省略可能な \fBl\fR を指定すると、時間 (0 より大きい場合)、分、秒から構成される \fIHHhMMmSS.FFs\fR という長い形式が使用されます。\fIp\fR の値は、小数点以下を含めるかどうかを指定します。
+.sp
+ほかの文字はすべて変更されずに出力され、末尾に復帰改行が追加されます。設定されていない場合、デフォルト値の \fB$'\nreal\t%2lR\nuser\t%2lU\nsys%2lS'\fR が使用されます。値が NULL の場合、時間情報は表示されません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBTMOUT\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBTMOUT\fR は、0 より大きな値に設定した場合に、\fBread\fR 組み込みコマンドのデフォルトのタイムアウト値になります。\fBselect\fR 複合コマンドは、端末から入力が行われているときに、\fBTMOUT\fR 秒後に終了します。それ以外の場合は、端末からの読み取り中、指定された秒数以内に行が入力されなければ、シェルは終了します。この値をユーザーが超えられないような大きい値に設定してシェルをコンパイルすることもできます。
+.sp
+シェルではデフォルト値を \fBTMOUT\fR に設定しています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBVISUAL\fR\fR
+.ad
+.RS 14n
+.rt  
+この変数の値がパターン \fB*[Vv][Ii]*\fR に一致した場合、\fBvi\fR オプションが有効になります。「特殊コマンド」を参照してください。\fB\fR値がパターン \fB*gmacs*\fR に一致した場合、\fBgmacs\fR オプションが有効になります。値がパターン \fB*macs*\fR に一致した場合、\fBemacs\fR オプションが有効になります。\fBVISUAL\fR の値は \fBEDITOR\fR の値を上書きします。
+.RE
+
+.SS "フィールド分割"
+.sp
+.LP
+パラメータ展開とコマンド置換後、置換結果からフィールド区切り文字 (\fBIFS\fR に含まれている文字) を検索し、その文字が見つかった位置で分割します。分割されたそれぞれの文字列がフィールドになります。明示的な NULL フィールド (\fB""\fR または \fB\&''\fR) は保持されます。暗示的な NULL フィールド、つまり値を持たないパラメータや出力のないコマンド置換から得られたフィールドは削除されます。
+.sp
+.LP
+\fBbraceexpand\fR (\fB-B\fR) オプションが設定されている場合、\fBIFS\fR から得られたそれぞれのフィールドは、1 つまたは複数の中括弧パターンが含まれているかどうかがチェックされます。有効な中括弧パターンは、\fB{*\fR,\fB*}\fR、\fB{\fR\fI l1\fR\fB\&..\fR\fIl2\fR\fB}\fR、\fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR\fB}\fR、\fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR\fB %\fR\fIfmt\fR\fB} {\fR\fIn1\fR\fB\&..\fR\fIn2\fR \fB\&..\fR\fIn3\fR\fB}\fR、または \fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR \fB\&..\fR\fIn3\fR\fB%\fR\fIfmt\fR\fB}\fR です。ここで、\fB*\fR は任意の文字を表し、\fIl1\fR、\fIl2\fR は英字であり、\fIn1\fR、\fIn2\fR、\fIn3\fR は符号付きの数値です。\fIfmt\fR は \fBprintf\fR で使用する場合と同様に指定された書式です。どの形式でも、\fB{\fR と \fB}\fR の間にある文字から生成されるそれぞれの文字列に対して、\fB{\fR よりも前にある文字列が前に指定され、} よりも後ろにある文字列が後方に付加されて、フィールドが作成されます。結果となるフィールドは、中括弧パターンを含んでいるかどうかがチェックされます。
+.sp
+.LP
+1 番目の形式では、\fB{\fR と \fB,\fR の間、\fB,\fR と\fB,\fR の間、および , と \fB}\fR の間の文字列ごとにフィールドが作成されます。\fB*\fR で表されている文字列には、対応する { と } を引用符で囲まずに埋め込むことができます。それ以外の場合は、\fB*\fR を伴うそれぞれの \fB{\fR および \fB}\fR は、引用符で囲む必要があります。
+.sp
+.LP
+2 番目の形式では、\fIl1\fR と \fIl2\fR は C ロケールでどちらも大文字か小文字にする必要があります。この場合、フィールドは \fIl1\fR から \fIl2\fR までの文字ごとに作成されます。
+.sp
+.LP
+残りの形式では、フィールド \fIn1\fR から始まる数値ごとに作成されます。これは、\fIn1\fR を \fIn3\fR ずつ増分して、\fIn2\fR になるまで続きます。\fIn3\fR が指定されていない形式では、\fIn1\fR\fB<=\fR\fIn2\fR の場合は \fIn3\fR を 1 とみなし、それ以外の場合は \fB-1\fR とみなして動作します。\fB%\fR\fIfmt\fR が指定されている形式では、すべての書式フラグ、幅、および精度を指定でき、\fIfmt\fR の末尾には任意の指定子 \fBcdiouxX\fR を指定できます。たとえば、\fB{a,z}{1..5..3%02d}{b..c}x\fR は、\fBa01bx、a01cx、a04bx、a04cx、z01bx、z01cx、z04bx、\fRおよび \fBz4cx\fR の 8 つのフィールドに展開されます。
+.SS "ファイル名の生成"
+.sp
+.LP
+分割後、\fB-f\fR オプションが設定されていなければ、各フィールドに \fB*\fR、\fB?\fR、\fB(\fR、および \fB[\fR の文字が含まれているかどうかが調べられます。これらの文字のいずれかが含まれていると、そのワードはパターンとみなされます。 
+.sp
+.LP
+いずれかのパターン文字を含む各ファイル名コンポーネントは、そのディレクトリのパターンに一致する名前が辞書編集方式の順にソートされたセットに置き換えられます。パターンに一致するファイル名が見つからなかった場合、パターンに接頭辞として \fB~(N)\fR が付けられていなければ (この接頭辞が付けられた場合は削除されます)、ファイル名のそのコンポーネントは変更されません。\fBFIGNORE\fR が設定されている場合、\fBFIGNORE\fR の値で定義されたパターンに一致したファイル名のコンポーネントそれぞれは、一致したファイル名を生成するときに無視されます。名前 \fB\&.\fR と \fB ..\fR も無視されます。\fBFIGNORE\fR が設定されていない場合、ファイル名の各コンポーネントに対応するパターンの最初の文字が \fB\&.\fR の文字そのものでないかぎり、このコンポーネントの先頭にある \fB\&.\fR の文字は無視されます。パターンマッチングのほかの使用法では、\fB/\fR と \fB\&.\fR は特別に扱われません。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 11n
+.rt  
+NULL 文字列を含むあらゆる文字列と一致します。ファイル名の展開に使用した場合で \fBglobstar\fR オプションが有効になっているときは、2 つの隣接する \fB*\fR は単独で、すべてのファイルと、0 個以上のディレクトリおよびサブディレクトリに一致します。2 つの隣接する \fB*\fR に \fB/\fR を続けると、ディレクトリおよびサブディレクトリだけが一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 11n
+.rt  
+任意の単一文字と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB[\fB\&...\fR]\fR
+.ad
+.RS 11n
+.rt  
+囲まれた文字のいずれかと一致します。2 つの文字を \fB-\fR で区切ると、その間にある任意の文字 (その 2 つの文字も含む) に一致します。開き括弧 \fB[\fR に続く先頭の文字が \fB!\fR である場合、囲まれていない任意の文字と一致します。\fB-\fR は、最初の文字または最後の文字として文字セットに挿入できます。\fB[\fR と \fB]\fR の内側では、\fB[:\fR\fIclass\fR\fB:]\fR という構文で文字クラスを指定できます。ここで \fIclass\fR は、\fBANSI-C\fR 標準で定義された次のクラスのいずれかになります。
+.sp
+.in +2
+.nf
+\fIalnum alpha blank cntrl digit graph\fR
+\fIlower print punct space upper\fR
+\fIword xdigit\fR
+.fi
+.in -2
+.sp
+
+\fIword\fR は、\fIalnum\fR に文字 \fB_\fR を加えたものと同等です。\fB[\fR と \fB]\fR の内側では、\fB[=\fR\fIc\fR\fB=]\fR という構文で同値化クラスを指定できます。この構文は、文字 \fIc\fR と同じ 1 次照合ウェイト (現在のロケールで定義) を持つすべての文字に一致します。\fB[\fR と \fB]\fR の内側では、[\fI\&.symbol.\fR] が照合シンボル \fIsymbol\fR に一致します。
+.RE
+
+.sp
+.LP
+\fIpattern-list\fR は、1 つのパターン、または \fB&\fR または \fB|\fR で区切られた複数のパターンのリストです。\fB&\fR はすべてのパターンが一致する必要があることを示しますが、\fB|\fR は 1 つのパターンだけ一致すればよいことを示します。複合パターンは、次のサブパターンの 1 つまたは複数から構成できます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+指定されたパターンのいずれかと任意に一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+指定されたパターンの 0 回以上の出現と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+指定されたパターンの 1 回以上の出現と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+指定されたパターンの \fIn\fR 回の出現と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR\fIm\fR\fB,\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+指定されたパターンの \fIm\fR から \fIn\fR 回の出現と一致します。\fIm\fR を省略すると、\fB0\fR が使用されます。\fIn\fR を省略すると、\fIm\fR 回以上の出現と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB@(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+指定されたパターンの 1 つと完全に一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+指定されたパターンのいずれにも一致しないものに一致します。
+.RE
+
+.sp
+.LP
+デフォルトでは、各パターンまたはサブパターンは、全体的にもっとも長い一致が生成される可能性のあるもっとも長い文字列に一致します。複数に一致する場合、文字列の先頭にもっとも近いものが選択されます。ただし、それぞれの複合パターンで \fB(\fR の前に \fB-\fR を挿入すると、指定された \fIpattern-list\fR に一致するもっとも短いものが使用されます。
+.sp
+.LP
+\fIpattern-list\fR が括弧で囲まれている場合、バックスラッシュ文字 \fB\e\fR は、文字クラスの内部にある場合でも特別に扱われます。すべての \fBANSI-C\fR 文字エスケープは認識され、指定された文字に一致します。さらに、次のエスケープシーケンスが認識されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ed\fR\fR
+.ad
+.RS 7n
+.rt  
+digit クラスの任意の文字と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eD\fR\fR
+.ad
+.RS 7n
+.rt  
+digit クラス以外の任意の文字と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\es\fR\fR
+.ad
+.RS 7n
+.rt  
+space クラスの任意の文字と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eS\fR\fR
+.ad
+.RS 7n
+.rt  
+space クラス以外の任意の文字と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ew\fR\fR
+.ad
+.RS 7n
+.rt  
+word クラスの任意の文字と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eW\fR\fR
+.ad
+.RS 7n
+.rt  
+word クラス以外の任意の文字と一致します。
+.RE
+
+.sp
+.LP
+\fB%(\fR\fIpattern-pairs\fR\fB)\fR の形式のパターンは、入れ子になった文字式の照合に使用できるサブパターンです。各 \fIpattern-pair\fR は、2 文字の並びであり、\fB&\fR や \fB|\fR を含めることはできません。最初の \fIpattern-pair\fR は照合の開始文字と終了文字を指定します。以降の \fIpattern-pair\fR はそれぞれ、開始文字と終了文字の一致をカウントするときにスキップされる入れ子になったグループの開始文字と終了文字を表します。\fIpattern-pair\fR の最初の文字が次の文字以外の英数字である場合、動作は不確定です。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD\fR\fR
+.ad
+.RS 5n
+.rt  
+終了文字が現れると、一致が見つからなくてもこのパターンの検索を終了します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE\fR\fR
+.ad
+.RS 5n
+.rt  
+終了文字が、エスケープ文字として解釈されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBL\fR\fR
+.ad
+.RS 5n
+.rt  
+終了文字が、一致の検索時にすべての文字を無視させる引用符文字として解釈されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBQ\fR\fR
+.ad
+.RS 5n
+.rt  
+終了文字が、一致の検索時にエスケープ文字以外のすべての文字を無視させる引用符文字として解釈されます。
+.RE
+
+.sp
+.LP
+\fB%({}Q"E\e)\fR は、\fB{\fR から始まり、対応する \fB}\fR が見つかるまでの文字を照合しますが、二重引用符で囲まれた文字列の中にあるか、エスケープ文字 \fB\e\fR が前に指定されている \fB{\fR または \fB}\fR はカウントしません。\fB{}\fR がない場合、このパターンは任意の C 言語文字列に一致します。
+.sp
+.LP
+複合パターン内の各サブパターンには、パターン内の \fB(\fR の位置に応じて、\fB1\fR から始まる番号が付けられます。\fB\e\fR\fIn\fR の並びは、サブパターンそのものと同じ文字列に一致します。ここで、\fIn\fR は 1 桁の数字で \fB\e\fR\fI n\fR は \fIn\fR 番目のサブパターンのあとに置かれます。
+.sp
+.LP
+パターンには \fB~(\fR\fIoptions\fR\fB:\fR\fIpattern-list\fR\fB)\fR の形式のサブパターンを含めることができます。\fIoptions\fR または \fB:\fR\fIpattern-list\fR のどちらかは省略できます。ほかの複合パターンとは異なり、これらのサブパターンは、番号が付けられたサブパターンではカウントされません。\fIoptions\fR が存在する場合、次の 1 つまたは複数から構成できます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+\fR\fR
+.ad
+.RS 6n
+.rt  
+以降のオプションを有効にします。これはデフォルトです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 6n
+.rt  
+以降のオプションを無効にします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE\fR\fR
+.ad
+.RS 6n
+.rt  
+パターンの残りの部分で、\fBegrep\fR(1) コマンドに類似した拡張正規表現の構文を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF\fR \fR
+.ad
+.RS 6n
+.rt  
+パターンの残りの部分で、\fBfgrep\fR(1) の表現の構文を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBg\fR \fR
+.ad
+.RS 6n
+.rt  
+最長の一致を提示します (貪欲)。 
+.sp
+これはデフォルトです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBG\fR\fR
+.ad
+.RS 6n
+.rt  
+パターンの残りの部分で、\fBgrep\fR(1) コマンドに類似した基本正規表現の構文を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 6n
+.rt  
+大文字と小文字を区別せずに一致を扱います。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBK\fR\fR
+.ad
+.RS 6n
+.rt  
+パターンの残りの部分で、シェルパターン構文を使用します。 
+.sp
+これはデフォルトです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBl\fR\fR
+.ad
+.RS 6n
+.rt  
+パターンを左側で固定します。 
+.sp
+これは \fBK\fR スタイルパターンのデフォルトです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBN\fR\fR
+.ad
+.RS 6n
+.rt  
+これは無視されます。ただし、これが最初の文字であり、ファイル名生成で使用され、一致が存在しない場合、ファイルパターンは空の文字列に展開されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBr\fR\fR
+.ad
+.RS 6n
+.rt  
+パターンを右側で固定します。 
+.sp
+これは \fBK\fR スタイルパターンのデフォルトです。
+.RE
+
+.sp
+.LP
+\fIoptions\fR と \fB:\fR\fIpattern-list\fR の両方を指定した場合、\fIpattern-list\fR だけにオプションは適用されます。それ以外の場合、これらのオプションは次の \fB~(...)\fR によって無効になるまで、または \fB~(...)\fR を含むサブパターンの末尾で無効になるまで、有効のままです。
+.SS "クォート"
+.sp
+.LP
+「定義」で一覧表示したメタキャラクタにはそれぞれ、シェルに対する特別な意味があります。\fB\fR
+.sp
+.ne 2
+.mk
+.na
+\fB\fBg\fR \fR
+.ad
+.RS 6n
+.rt  
+最長の一致を提示します (貪欲)。これはデフォルトです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 6n
+.rt  
+大文字と小文字を区別せずに一致を扱います。 
+.RE
+
+.sp
+.LP
+\fIoptions\fR と \fB:\fR\fIpattern-list\fR の両方を指定した場合、\fIpattern-list\fR だけにオプションは適用されます。それ以外の場合、オプションは後続の \fB~(...)\fR によって無効になるまで、または \fB~(...)\fR を含むサブパターンの末尾で無効になるまで、有効のままです。
+.sp
+.LP
+このマニュアルページの「定義」の節に一覧表示したメタキャラクタはそれぞれ、シェルに対して特別な意味を持ち、クォートしないかぎり、ワードの終わりを表します。\fB\fR文字は、その前にバックスラッシュ (\fB\e\fR) を指定するとクォートできます。つまり、その文字そのものを示すことができます。\fB\e\fRNEWLINE のペアは削除されます。\fB$\fR が前に指定されていない一対の単一引用符 (\fB\&''\fR) で囲まれた文字はすべてクォートされます。単一引用符は、単一引用符で囲んで表すことはできません。単一引用符で囲まれた文字列の前にクォートされていない \fB$\fR がある場合、次の場合を除き、\fBANSI-C\fR 文字列として処理されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e0\fR \fR
+.ad
+.RS 19n
+.rt  
+残りの文字列が無視されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ec\fR\fIx\fR\fR
+.ad
+.RS 19n
+.rt  
+文字 CTRL-x に展開します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eC\fR[\fB\&.\fR\fIname\fR\fB\&.\fR]\fR
+.ad
+.RS 19n
+.rt  
+照合要素 \fIname\fR に展開します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ee\fR\fR
+.ad
+.RS 19n
+.rt  
+エスケープ文字 (\fBASCII\fR 033) と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eE\fR\fR
+.ad
+.RS 19n
+.rt  
+エスケープ文字 (\fBASCII\fR 033) と同等です。
+.RE
+
+.sp
+.LP
+一対の二重引用符 (\fB""\fR) の内側では、パラメータとコマンドの置換が発生し、\fB\e\fR は \fB\e\fR、\fB`\fR、\fB"\fR、および \fB$\fR をクォートします。二重引用符に囲まれた文字列の前の \fB$\fR は、\fBC\fR または \fBPOSIX\fR ロケールでは無視され、その他のロケールでは、文字列がロケール固有の文字列に置き換えられる場合があります。\fB$*\fR と \fB$@\fR の意味は、クォートされない場合、または変数代入値やファイル名として使用される場合は同じです。ただし、コマンド引数として使用される場合は、\fB"$*"\fR は\fB"$1\fId\fR$2\fId\fR..."\fR と同等になります。\fId\fR は IFS 変数の最初の文字です。一方、\fB"$@"\fR は\fB"$1" "$2" ...\fR と同じになります。一対の逆引用符 (\fB``\fR) の内側では、\fB\\fR は、\fB\e\fR、\fB`\fR、および \fB$\fR をクォートします。逆引用符を二重引用符内で指定すると、\fB\e\fR も \fB"\fR をクォートします。
+.sp
+.LP
+予約語や別名が持つ特別な意味は、予約語のいずれかの文字をクォートすることで失われます。関数名や組み込みコマンド名の認識は、それらをクォートしても変えられません。
+.SS "算術評価"
+.sp
+.LP
+シェルは算術置換に対して算術評価を実行して、算術コマンドを評価し、インデックス付き配列添字を評価し、組み込みコマンド \fBshift\fR および \fBlet\fR への引数を評価します。算術評価は、書式オペランドでの数値書式指定子に対応する組み込みコマンド printf での引数オペランドに対しても実行されます。\fBprintf\fR(1) を参照してください。評価は、倍精度浮動小数点演算または 4 倍精度浮動小数点 (このデータ型が利用できるシステムの場合) を使用して実行されます。浮動小数点定数は、\fBANSI-C\fR プログラミング言語の浮動小数点規則に従います。シングルバイト文字定数しか認識されず、文字キャストは認識されませんが、整数定数は、\fBANSI-C\fR プログラミング言語の整数定数規則に従います。定数の形式には \fB[\fR\fIbase#\fR\fB]\fR\fIn\fR を使用できます。\fIbase\fR は底を表す 2 から 64 の範囲の 10 進数で、\fIn\fR はその底の数です。\fB9\fR より大きな数字は、小文字英字、大文字英字、\fB@\fR、および \fB_\fR でそれぞれ表されます。底が \fB36\fR 以下の場合は、大文字と小文字を区別せずに使用できます。
+.sp
+.LP
+算術式には、C 言語の式と同一の構文、優先度、および結合規則が使用されます。浮動小数点の数量に適用される C 言語の演算子をすべて使用できます。さらに、演算子 \fB**\fR を累乗に使用できます。これは乗算よりも優先度が高く、結合されたままになります。算術変数または部分式の値がロング整数として表現できる場合、C 言語の整数算術演算をすべて実行できます。算術式内では、パラメータ展開構文を使用しなくても、名前で変数を参照できます。変数を参照すると、その値は算術式として評価されます。 
+.sp
+.LP
+C 演算ライブラリにある次の演算ライブラリ関数のいずれも、算術式内で使用できます。
+.sp
+.in +2
+.nf
+abs acos acosh asin asinh atan atan2 atanh cbrt 
+copysign cos cosh erf erfc exp exp2 expm1 fabs
+fdim finite floor fma fmax fmod hypot ilogb 
+int isinf isnan lgamma log log2 logb 
+nearbyint nextafter nexttoward pow remainder
+rint round sin sinh sqrt tan tanh tgamma trunc
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+倍精度浮動小数点の変数の内部表現は、\fBtypeset\fR 特殊組み込みコマンドの \fB-E [\fR\fIn\fR\fB]\fR または \fB-F [\fR\fIn\fR\fB]\fR オプションで指定できます。\fI\fR\fB-E\fR オプションを指定すると、値の展開は、展開されるときに、科学表記法を使用して表現されます。省略可能なオプション引数 \fIn\fR は有効数字の桁数を定義します。\fB-F\fR オプションを指定すると、展開は、展開されるときに、浮動小数値として表現されます。省略可能なオプション引数 \fIn\fR は、この場合に、小数点以下の位数を定義します。
+.sp
+.LP
+整数の変数の内部表現は、\fBtypeset\fR 特殊組み込みコマンドの \fB-i\fR \fB[\fR\fIn\fR\fB]\fR オプションで指定できます。\fI\fR省略可能なオプション引数 \fIn\fR は、変数を展開するときに使用する底を指定します。底を指定しない場合、10 の底が使用されます。
+.sp
+.LP
+算術評価は、\fB-E\fR、\fB-F\fR、または \fB-i\fR オプションを使用した変数に対する代入値ごとに実行されます。型が整数である変数に浮動小数点値を代入すると、小数部分が切り捨てられます。 
+.SS "プロンプト"
+.sp
+.LP
+シェルは、対話的に使用すると、パラメータ展開、コマンド置換、および算術置換に展開したあとで、コマンドを読み取る前に、\fBPS1\fR の値のプロンプトが表示されます。さらに、プロンプト内の単一の \fB!\fR はそれぞれコマンド番号に置き換えられます。\fB!!\fR が、プロンプト内に \fB!\fR を指定するには必要です。 復帰改行を入力したあとで、コマンドを完了するためにさらに入力が必要な場合は、2 次プロンプト (\fBPS2\fR の値) が出力されます。
+.SS "条件式"
+.sp
+.LP
+条件式 (\fBconditional expression\fR) は、ファイルの属性をテストしたり文字列を比較したりするときに、複合コマンドの \fB[[\fR とともに使用します。\fB[[\fR と \fB]]\fR の間のワードについては、フィールド分割とファイル名生成は実行されません。
+.sp
+.LP
+各条件式は、次の単項式または 2 項式をいくつか組み合わせて構築できます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在すれば、真です。
+.sp
+このオプションは \fB-e\fR と同じです。このオプションは廃止されています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、ブロック型特殊ファイルであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、文字型特殊ファイルであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、ディレクトリであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在すれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、通常ファイルであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-g\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、\fBsetgid\fR ビットが設定されていれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-G\fR \fIfile\fR \fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、ファイルのグループがこのプロセスの実効グループ ID と一致していれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、シンボリックリンクであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR \fIfile\fR \fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、スティッキービットが設定されていれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-L\fR \fIfile\fR \fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、シンボリックリンクであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR \fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIstring\fR の長さが \fB0\fR 以外であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-N\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、更新時刻が最終アクセス時刻よりあとであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIoption\fR \fR
+.ad
+.RS 21n
+.rt  
+\fIoption\fR という名前のオプションが有効であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fI?option\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIoption\fR という名前のオプションが、有効なオプション名であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-O\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、このプロセスの実効ユーザー ID がそのファイルを所有していれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、\fBFIFO\fR 特殊ファイルまたはパイプであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、現在のプロセスで読み取り可能であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、サイズがゼロより大きければ、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-S\fR \fIfile\fR \fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、ソケットであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR \fIfildes\fR\fR
+.ad
+.RS 21n
+.rt  
+ファイル記述子番号が \fIfildes\fR であるファイルが開いていて、端末デバイスに対応していれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、\fBsetuid\fR ビットが設定されていれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-w\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、現在のプロセスで書き込み可能であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile\fR が存在し、現在のプロセスで実行可能であれば、真です。\fIfile\fR が存在し、ディレクトリである場合は、現在のプロセスにそのディレクトリを検索する権限があれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-z\fR \fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIstring\fR の長さがゼロであれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-ef\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile1\fR と \fIfile2\fR が存在し、同じファイルを参照していれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-nt\fR \fIfile2\fR \fR
+.ad
+.RS 21n
+.rt  
+\fIfile1\fR が存在し、\fIfile2\fR が存在しないか、または \fIfile1\fR が \fIfile2\fR よりも新しい場合は、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-ot\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIfile2\fR が存在し、\fIfile1\fR が存在しないか、または \fIfile1\fR が \fIfile2\fR よりも古い場合は、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIstring\fR が NULL でなければ、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB==\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIstring\fR が \fIpattern\fR と一致すれば、真です。\fIpattern\fR の任意の部分をクォートして、文字列として一致させることができます。\fIpattern\fR に一致した場合、\fB\&.sh.match\fR 配列変数には、その一致とサブパターンの一致が含まれます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB=\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+\fB==\fR と同じですが、廃止されました。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB!=\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIstring\fR が \fIpattern\fR と一致しなければ、真です。\fIstring\fR が \fIpattern\fR に一致した場合、\fB\&.sh.match\fR 配列には、その一致とサブパターンの一致が含まれます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB=~\fR \fIere\fR\fR
+.ad
+.RS 21n
+.rt  
+\fIstring\fR がパターン \fB~(E)\fR\fIere\fR に一致すれば、真です。\fIere\fR は拡張正規表現です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring1\fR \fB<\fR \fIstring2\fR\fR
+.ad
+.RS 21n
+.rt  
+それぞれの文字の \fBASCII\fR 値に基づいて、\fIstring1\fR が \fIstring2\fR より小さい場合に、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring1\fR \fB>\fR \fIstring2\fR\fR
+.ad
+.RS 21n
+.rt  
+それぞれの文字の \fBASCII\fR 値に基づいて、\fIstring1\fR が \fIstring2\fR より大きい場合に、真です。
+.RE
+
+.sp
+.LP
+次のそれぞれの式で、\fIfile\fR が \fB/dev/fd/\fR\fIn\fR (\fIn\fR は整数) という形式の場合は、記述子番号が \fIn\fR である開かれたファイルがテストされます。次の廃止された算術比較がサポートされています。 
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-eq\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+\fIexp1\fR が \fIexp2\fR と等しければ、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-ge\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+\fIexp1\fR が \fIexp2\fR 以上であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-gt\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+\fIexp1\fR が \fIexp2\fR より大きければ、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-le\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+\fIexp1\fR が \fIexp2\fR 以下であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-lt\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+\fIexp1\fR が \fIexp2\fR 未満であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-ne\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+\fIexp1\fR が \fIexp2\fR と等しくなければ、真です。
+.RE
+
+.sp
+.LP
+次のいずれかを使用して、これらの基本式から複合式を構築できます。優先度の高いものから順に並べてあります。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fIexpression\fR\fB)\fR\fR
+.ad
+.RS 30n
+.rt  
+\fIexpression\fR が真であれば、真です。式をグループ化するときに使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR \fIexpression\fR\fR
+.ad
+.RS 30n
+.rt  
+\fIexpression\fR が偽であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexpression1\fR \fB&&\fR \fIexpression2\fR\fR
+.ad
+.RS 30n
+.rt  
+\fIexpression1\fR と \fIexpression2\fR の両方が真であれば、真です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexpression1\fR \fB||\fR \fIexpression2\fR\fR
+.ad
+.RS 30n
+.rt  
+\fIexpression1\fR と \fIexpression2\fR のどちらかが真であれば、真です。
+.RE
+
+.SS "入出力"
+.sp
+.LP
+コマンドの実行前に、シェルが解釈する特殊な表記を使って入出力先を変更 (リダイレクト) できます。次の各項目は、単純コマンド内の任意の位置またはコマンドの前後に指定できますが、起動されたコマンドには引き渡されません。\fB\fRこの節で示す場合を除き、\fIword\fR または \fIdigit\fR を使用する前に、コマンド置換、パラメータ展開、および算術置換が発生します。シェルが対話型であり、パターンが単一のファイルに一致する場合にのみ、ファイル名生成が行われます。フィールド分割は実行されません。
+.sp
+.LP
+次のリダイレクションのそれぞれで、\fIfile\fR が \fB/dev/sctp/\fR\fIhost\fR\fB/\fR\fIport\fR、\fB/dev/tcp/\fR\fIhost\fR\fB/\fR\fI port\fR、または \fB/dev/udp/\fR\fIhost\fR\fB/\fR\fIport\fR の形式である場合 (\fIhost\fR はホスト名またはホストアドレス、\fIport\fR はサービスの名前または整数のポート番号)、リダイレクションは、対応するソケットへの \fBtcp\fR、\fBsctp\fR、または \fBudp\fR 接続を確立しようと試みます。
+.sp
+.LP
+リダイレクト演算子の文字間にはスペースを入れられません。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+\fIword\fR というファイルを標準入力 (ファイル記述子 0) として使用します。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+\fIword\fR というファイルを標準出力 (ファイル記述子 1) として使用します。ファイルが存在しない場合は、ファイルを作成します。ファイルが存在し、\fBnoclobber\fR オプションが有効である場合は、エラーになります。それ以外の場合は、長さが 0 になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>|\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+\fB>\fR と同じですが、\fBnoclobber\fR オプションを無視します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+\fIword\fR というファイルを標準出力として使用します。ファイルが存在する場合、(ファイルの終わりまでシークしたあと) そのファイルに出力を追加します。それ以外の場合は、ファイルを作成します。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB< \|>\fR\fIword\fR \fR
+.ad
+.RS 14n
+.rt  
+\fIword\fR というファイルを標準入力として読み書き用に開きます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<\fR\fB[-]\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+シェルへの入力として、すべてのクォートを削除したあとの \fIword\fR と同一の行まで、またはファイルの終わりまで読み取ります。\fIword\fR に対してパラメータ置換、コマンド置換、算術置換、ファイル名生成を実行しません。\fBhere-document\fR が生成されて標準入力になります。\fIword\fR のいずれかの文字がクォートされていると、ドキュメントの文字は解釈されません。それ以外の場合、パラメータ展開、コマンド置換、および算術置換が行われ、\fB\e\fRNEWLINE が無視されます。また、\fB\e\fR を使って、\fB\e\fR、\fB$\fR、\fB`\fR の文字をクォートする必要があります。\fB-\fR を \fB<<\fR のあとに付加すると、\fIword\fR とドキュメントから先行するタブがすべて取り除かれます。\fB#\fR を \fB<<\fR のあとに付加すると、先行するスペース文字とタブがドキュメントの先頭の行から取り除かれ、最大で同じだけのインデントが残りの行と \fIword\fR から取り除かれます。タブ位置は 8 カラムごとであると想定して、インデントは判断されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<<\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+パラメータ展開、コマンド置換、算術置換が行われたあとに、\fIword\fR が here-document の内容になる here-document の短い形式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fR
+.ad
+.RS 14n
+.rt  
+ファイル記述子 \fIdigit\fR から標準入力が複製されます。同様に、標準出力については \fB>&\fR\fIdigit\fR を使用します。\fBdup\fR(2) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fB-\fR\fR
+.ad
+.RS 14n
+.rt  
+\fIdigit\fR で指定されたファイル記述子は標準入力に移動します。同様に、標準出力については \fB>&\fR\fIdigit\fR\fB-\fR を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&-\fR\fR
+.ad
+.RS 14n
+.rt  
+標準入力を閉じます。同様に、標準出力については \fB>&-\fR を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&p\fR\fR
+.ad
+.RS 14n
+.rt  
+並行プロセスからの入力を標準入力に移動します。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>&p\fR\fR
+.ad
+.RS 14n
+.rt  
+並行プロセスへの出力を標準出力に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<#((\fR\fIexpr\fR\fB))\fR\fR
+.ad
+.RS 14n
+.rt  
+算術式 \fIexpr\fR を評価して、その結果得られた値のバイト数分だけファイルの先頭から離れた位置に、ファイル記述子 0 を配置します。\fIexpr\fR を評価するときに、\fBCUR\fR と \fBEOF\fR の変数はそれぞれ、現在のオフセットとファイルの終わりのオフセットに評価されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>#((\fR\fIexpr\fR\fB))\fR\fR
+.ad
+.RS 14n
+.rt  
+\fB<#\fR と同じですが、ファイル記述子 1 に適用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<#\fR\fIpattern\fR\fR
+.ad
+.RS 14n
+.rt  
+パターンを含む次の行の先頭を探します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<##\fR\fIpattern\fR\fR
+.ad
+.RS 14n
+.rt  
+\fB<#\fR と同じですが、スキップされるファイルの部分が、標準出力にコピーされる点が異なります。
+.RE
+
+.sp
+.LP
+いずれかのリダイレクト演算子の前に、スペースを入れずに数字を付けると、参照されるファイル記述子番号は (デフォルトの 0 または 1 ではなく) その数字で指定された番号になります。\fB>&-\fR、\fB>#\fR、および \fB<#\fR 形式以外のリダイレクト演算子のいずれかの前に、スペースを入れずに \fB{\fR\fIvarname\fR\fB}\fR を指定すると、シェルでは \fB> 10\fR のファイル記述子番号が選択され、変数 \fIvarname\fR に格納されます。\fB>&-\fR、または \fB>#\fR と \fB<#\fR のどちらかの形式の前に \fB{\fR\fIvarname\fR\fB}\fR が指定されている場合、\fIvarname\fR の値で、閉じるファイル記述子または配置するファイル記述子を定義します。例: 
+.sp
+.in +2
+.nf
+\&... 2>&1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+これは、ファイル記述子 2 をファイル記述子 1 の複製として書き込み用に開くことを意味し、また、
+.sp
+.in +2
+.nf
+exec [\fIn\fR]<\fIfile\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+これは、読み取り用に \fIfile\fR を開き、ファイル記述子番号を変数 \fIn\fR に格納することを意味します。リダイレクションを指定する場合、記述する順序が重要になります。シェルは、評価時点での (\fIfile_descriptor\fR と \fIfile\fR の) 関連性について、各リダイレクションを評価します。例: 
+.sp
+.in +2
+.nf
+\&... 1>\fIfname\fR 2>&1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+これは、まず \fIfname\fR というファイルにファイル記述子 1 を関連付けます。次に、ファイル記述子 1 (つまり \fIfname\fR) に関連するファイルに、ファイル記述子 2 を関連付けます。リダイレクションの向きが逆の場合は、まずファイル記述子 2 を端末に関連付け (ファイル記述子 1 はすでに端末に関連付けられているとして)、次にファイル記述子 1 をファイル \fIfname\fR に関連付けます。ジョブ制御が有効でない場合にコマンドのあとに \fB&\fR を指定すると、コマンドのデフォルトの標準入力は \fB/dev/null\fR という空ファイルになります。それ以外の場合は、コマンドを実行するための環境に起動側シェルのファイル記述子 (入出力指定で変更可能) が含まれます。
+.SS "環境"
+.sp
+.LP
+環境とは、実行されるプログラムに渡される、名前と値が対になったリストのことです。通常の引数リストと同様の方法で指定します\fI\fR (\fBenviron\fR(5) 参照)。
+.sp
+.LP
+名前は識別子、値は文字列である必要があります。\fI\fRシェルが環境と対話する方法はいくつかあります。シェルは、起動されると、環境を走査して、見つけた名前ごとに変数を作成し、対応する値および属性を設定し、さらに \fBexport\fR というマークを付けます。実行されるコマンドは環境を引き継ぎます。ユーザーがこれらの変数の値を変更するか、新しい変数を作成した場合は、\fBexport\fR コマンドまたは \fBtypeset\fR \fB-x\fR コマンドを使用すれば、それらの値が環境の一部になります。したがって、実行されるコマンドが参照する環境は、シェルが最初に引き継いだ名前と値のペア (その値は現在のシェルで変更可能) に、\fBexport\fR コマンドまたは \fBtypeset\fR \fB-x\fR コマンドで指定した変数を加えたものになります。1 つまたは複数の変数代入を先頭に付加すれば、単純コマンドまたは関数の環境を拡張できます。変数代入引数は、\fIidentifier\fR\fB=\fR\fIvalue\fR という形式のワードです。したがって、
+.sp
+.in +2
+.nf
+TERM=450 cmd args
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+および 
+.sp
+.in +2
+.nf
+(export TERM; TERM=450; cmd args)
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+は、\fIcmd\fR の実行に関するかぎり、同じことを意味します。ただし、「組み込みコマンド」節で示した特殊組み込みコマンドのうち、ダガーが先頭に置かれているものが指定された場合を除きます。\fB\fR廃止された \fB-k\fR オプションを設定すると、変数代入引数はすべて環境に格納されます。これらの引数がコマンド名のあとに指定された場合も同様です。 
+.sp
+.LP
+次の例では、最初に \fBa=b c\fR を表示し、次に \fBc\fR を表示します。
+.sp
+.in +2
+.nf
+echo a=b c
+set -k
+echo a=b c
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+この機能は、シェルの初期バージョン用に作成されたスクリプトで使用するためのものです。新しいスクリプトには使用しないでください。
+.SS "関数"
+.sp
+.LP
+歴史的な理由から、関数の定義には、\fBname()\fR 構文と \fBfunction\fR \fBname\fR 構文の 2 つの方法が存在します。これらについては、このマニュアルページの「コマンド」節を参照してください。\fB\fR 
+.sp
+.LP
+シェル関数は内部で読み取られ、保存されます。別名は、関数を読み取るときに解釈されます。関数はコマンドと同様に実行され、引数は定位置パラメータとして渡されます。詳細は、このマニュアルページの「実行」節を参照してください。\fB\fR
+.sp
+.LP
+\fBfunction\fR \fBname\fR 構文で定義され、名前で呼び出された関数は、呼び出し側と同じプロセスで実行され、すべてのファイルと現在の作業用ディレクトリを呼び出し側と共有します。呼び出し側が受け取るトラップは、関数の内部でデフォルトの動作に再設定されます。関数が受け取らないか、または無視するトラップ条件がある場合、関数は終了し、その条件が呼び出し側に引き渡されます。関数内部で設定された \fBEXIT\fR に基づくトラップは、関数が完了したあとに呼び出し側の環境で実行されます。通常、変数は呼び出し側プログラムと関数の間で共有されます。ただし、関数内で \fBtypeset\fR 特殊組み込みコマンドを使用すると、現在の関数をスコープとする局所変数を定義できます。関数内で別の関数を呼び出す際に、これらの局所変数を渡すには、呼び出しの前に変数代入リスト内に指定するか、または名前参照として渡される引数として指定します。関数内でエラーが発生すると、呼び出し側に制御が戻ります。
+.sp
+.LP
+\fBname()\fR 構文で定義された関数と、\fBfunction\fR \fBname\fR 構文で定義され \fB\&.\fR 特殊組み込みコマンドで呼び出された関数は、呼び出し側の環境で実行され、呼び出し側とすべての変数およびトラップを共有します。このような関数の実行中にエラーが発生すると、これらを含むスクリプトは中止されます。
+.sp
+.LP
+\fBreturn\fR 特殊組み込みコマンドは、関数の呼び出しから戻るときに使用します。
+.sp
+.LP
+\fBtypeset\fR 特殊組み込みコマンドの \fB-f\fR または \fB+f\fR オプションを使用すると、関数名を一覧表示できます。\fB-f\fR では、関数のテキストがある場合は、これも一覧表示されます。\fBunset\fR 特殊組み込みコマンドの \fB-f\fR オプションを使用すると、関数を未定義状態にできます。
+.sp
+.LP
+通常、シェルがシェルスクリプトを実行すると、関数は未設定になります。シェルの個別起動をまたがって定義する必要のある関数は、ディレクトリに置き、このディレクトリの名前を \fBFPATH\fR 変数に含めるようにしてください。これらは、\fBENV\fR ファイルで指定することもできます。
+.SS "ディシプリン関数"
+.sp
+.LP
+それぞれの変数に、0 個以上のディシプリン関数を関連付けられます。シェルは初期状態で \fBget\fR、\fBset\fR、\fBappend\fR、および \fBunset\fR のディシプリン名を認識しますが、ほとんどのシステムでは、\fBbuiltin\fR 組み込みユーティリティーが持つ C プログラミングインタフェース拡張機能を介して、実行時にほかのディシプリン名を追加できます。変数に対して \fBget\fR ディシプリンが定義されている場合、指定された変数が参照されるたびにこのディシプリンが呼び出されます。ディシプリン関数内で、変数 \fB\&.sh.value\fR に値が代入された場合、参照される変数は代わりにこの値に評価されます。変数に対して \fBset\fR ディシプリンが定義されている場合、指定された変数に値が代入されるたびにこのディシプリンが呼び出されます。変数に対して \fBappend\fR ディシプリンが定義されている場合、指定された変数に値が付加されるたびにこのディシプリンが呼び出されます。変数 \fB\&.sh.value\fR にはディシプリンを呼び出す前の変数の値が格納され、ディシプリンの完了後、変数には \fB\&.sh.value\fR の値が代入されます。ディシプリン内で \fBsh.value\fR が設定解除された場合、その値は変更されません。\fB\fR変数に対して \fBunset\fR ディシプリンが定義されている場合、指定された変数が設定解除されるたびに呼び出されます。このディシプリン関数内から明示的に設定解除されないかぎり、変数は設定解除されません。
+.sp
+.LP
+変数 \fB\&.sh.name\fR には、ディシプリン関数を呼び出す対象の変数の名前が含まれます。\fB\&.sh.subscript\fR は変数の添字です。\fB\&.sh.value\fR には、\fBset\fR ディシプリン関数内で代入される値が含まれます。\fBset\fR ディシプリンの場合、\fB\&.sh.value\fR を変更すると、代入される値が変更されます。 
+.SS "ジョブ"
+.sp
+.LP
+\fBset\fR コマンドの monitor オプションを有効にすると、対話型シェルがジョブを各パイプラインと関連付けます。このオプションは、\fBjobs\fR コマンドが表示する現在のジョブのテーブルを維持し、これらのジョブに整数番号を割り当てます。ジョブを \fB&\fR で非同期に起動すると、シェルは、次の形式の行を表示します。
+.sp
+.in +2
+.nf
+[1] 1234
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+非同期に起動されたジョブはジョブ番号 1 であり、プロセス ID が \fB1234\fR であるプロセスが 1 つ (トップレベル) あることを示します。
+.sp
+.LP
+ジョブの実行中に停止する必要がある場合は、CTRL-z を押して、\fBSTOP\fR シグナルを現在のジョブに送信します。シェルは通常、ジョブが停止されたことを示すメッセージを表示し、別のプロンプトを表示します。これで、このジョブの状態を \fBbg\fR コマンドでバックグラウンドで処理するか、またはほかのコマンドを実行してから、\fBfg\fR というコマンドでジョブをフォアグラウンドに移すことができます。CTRL-z はただちに効果を発揮します。つまり CTRL-z は、保留中の出力や読み取られていない入力がただちに中止されるという点で、割り込みに似ています。
+.sp
+.LP
+バックグラウンドで実行中のジョブは、端末から読み取ろうとすると停止します。通常バックグラウンドジョブは出力を生成できますが、\fBsttytostop\fR というコマンドを指定すればこの出力生成も無効にできます。この \fBtty\fR オプションを設定すると、バックグラウンドジョブは、入力の読み取り時と同様に出力を生成しようとすると停止します。 
+.sp
+.LP
+シェル内のジョブを参照する方法はいくつかあります。そのジョブのいずれかのプロセスの ID を使っても、また次のいずれかを使っても参照できます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fInumber\fR\fR
+.ad
+.RS 12n
+.rt  
+指定された番号のジョブ。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fIstring\fR\fR
+.ad
+.RS 12n
+.rt  
+コマンド行が \fIstring\fR で始まるジョブ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%?\fR\fIstring\fR\fR
+.ad
+.RS 12n
+.rt  
+コマンド行に \fIstring\fR を含むジョブ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%%\fR\fR
+.ad
+.RS 12n
+.rt  
+現在のジョブ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%+\fR\fR
+.ad
+.RS 12n
+.rt  
+\fB%%\fR と同等
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%-\fR\fR
+.ad
+.RS 12n
+.rt  
+直前のジョブ
+.RE
+
+.sp
+.LP
+シェルは、プロセスの状態が変更されると、ただちにそれを検出します。ジョブがブロックされてそれ以上進めない状態になると、プロンプトを発行する直前にだけ、シェルはその旨をユーザーに通知します。これは、ユーザーの作業の妨げにならないようにするためです。\fBset\fR コマンドの notify オプションを設定すると、変更が起きるとすぐに、シェルはこれらのジョブ変更メッセージを出力します。
+.sp
+.LP
+\fBmonitor\fR オプションが有効になっていると、バックグラウンドジョブが完了するたびに、\fBCHLD\fR に対して設定されているトラップをトリガーします。
+.sp
+.LP
+ジョブの実行中または停止中にシェルを終了しようとすると、「停止中 (実行中) のジョブがある (You have stopped(running) jobs.)」という警告を受けます。\fBjobs\fR コマンドを使用すれば、どのジョブが該当するのかを確認できます。\fB\fRただちにシェルを再終了しようとすると、シェルは 2 度目の警告は出さず、停止中のジョブは終了します。ログインシェルは、\fBHUP\fR シグナルを受信すると、\fBdisown\fR 組み込みコマンドで所有解除されていない各ジョブに \fBHUP\fR シグナルを送信します。
+.SS "シグナル"
+.sp
+.LP
+起動されたコマンドに対する \fBINT\fR シグナルと \fBQUIT\fR シグナルは、コマンドの後ろに \fB&\fR が指定され、ジョブの \fBmonitor\fR オプションが有効でない場合、無視されます。それ以外の場合は、シェルが親から引き継いだ値がシグナルに含まれます。\fBtrap\fR 組み込みコマンドを参照してください。
+.SS "実行"
+.sp
+.LP
+コマンドが読み込まれるたびに、置換が実行されます。コマンド名は、このマニュアルページの「特殊組み込みコマンド」節で記した、いずれかのコマンドと一致した場合、現在のシェルプロセス内で実行されます。\fB\fR次に、コマンド名がユーザー定義関数と一致するかどうかがチェックされます。一致する場合は、定位置パラメータが保存され、関数呼び出しの引数に再設定されます。関数は現在のシェルプロセスでも実行されます。関数が完了するか、return を発行すると、定位置パラメータリストが復元されます。\fBfunction\fR \fBname\fR 構文で定義された関数の場合、関数内の \fBEXIT\fR に設定されているトラップが実行されます。関数の終了値は、最後に実行されたコマンドの値です。コマンド名が、特殊組み込みコマンドやユーザー定義関数ではなく、組み込みコマンドの 1 つである場合は、現在のシェルプロセスで実行されます。
+.sp
+.LP
+\fBPATH\fR というシェル変数は、コマンドを含んでいるディレクトリの検索パスを定義します。2 つのディレクトリ名は、コロン (\fB:\fR) で区切ります。デフォルトのパスは \fB/bin:/usr/bin:\fR で、\fB/bin\fR、\fB/usr/bin\fR、現在のディレクトリの順に指定されています。現在のディレクトリは、複数のコロンを連続して記述するか、パスリストの始めか終わりにコロンを付ければ指定できます。コマンド名にスラッシュ (\fB/\fR) が含まれている場合は、検索パスは使用されません。スラッシュが含まれていなければ、指定された名前の、ディレクトリではない実行可能ファイルが、パスの各ディレクトリで検索されます。実行可能ファイルが見つかった場合、および指定されたパス名に対応するコマンドの組み込みバージョンがあるとシェルが判断した場合は、現在のプロセスでこの組み込みコマンドが呼び出されます。実行可能ファイルが見つかり、このディレクトリが \fBFPATH\fR 変数の値にも含まれている場合は、設定済みの別名だけが展開される点を除いて . コマンドの引数である場合と同様にこのファイルは現在のシェル環境に読み込まれ、このマニュアルページで説明するように、指定された名前の関数が実行されます。実行可能ファイルが見つからず、ファイル \fB\&.paths\fR が見つかり、このファイルに \fBFPATH=\fR\fIpath\fR という形式の行が含まれ (\fIpath\fR は既存のディレクトリ)、指定されている名前のファイルがこのディレクトリに含まれている場合、このファイルは、\fB\&.\fR 特殊組み込みコマンドの引数である場合と同様に現在のシェル環境に読み込まれ、指定された名前の関数が実行されます。これら以外で実行可能ファイルが見つかった場合は、プロセスが作成され、\fBexec\fR(2) を使用してコマンドの実行が試行されます。
+.sp
+.LP
+実行可能ファイルが見つかった場合、そのファイルが見つかったディレクトリ内で \fB\&.paths\fR という名前のファイルが検索されます。このファイルが見つかり、そこに \fBBUILTIN_LIB=\fR\fIvalue\fR という形式の行が含まれている場合、\fBbuiltin -f\fR のオプション引数である場合と同様に \fIvalue\fR で名前が付けられたライブラリが検索されます。指定された名前の組み込みコマンドが含まれている場合、この名前のコマンドではなく組み込みコマンドが実行されます。これ以外でこのファイルが見つかり、その最初の行または 2 行目に \fIname\fR\fB=\fR\fI value\fR の形式の行が含まれている場合、\fIvalue\fR で指定されたディレクトリをディレクトリリストの先頭に加えることによって、環境変数 \fIname\fR が変更されます。\fIvalue\fR が絶対ディレクトリでない場合は、実行可能ファイルが見つかったディレクトリに対する相対ディレクトリとしてディレクトリが指定されます。環境変数 \fIname\fR がまだ存在しない場合は、指定されたコマンドの環境リストに追加されます。
+.sp
+.LP
+ファイルが実行権を有するが、それが \fBa.out\fR ファイルでない場合、シェルコマンドの入ったファイルとみなされます。そのファイルを読み取るときは、別のシェルが生成されます。この場合、エクスポートされていない変数はすべて削除されます。シェルコマンドファイルに読み取り権がない場合またはファイルに \fBsetuid\fR および \fBsetgid\fR ビットが設定されている場合、あるいはその両方の場合、シェルはエージェントを実行します。そして、このエージェントがアクセス権を設定し、開かれているファイルとして渡されたシェルコマンドファイルでシェルを実行します。括弧で囲まれたコマンドは、エクスポートされていない変数を削除することなく、サブシェルで実行されます。
+.SS "コマンド行の再入力"
+.sp
+.LP
+端末装置から最近入力された \fBHISTSIZE\fR が示す個数 (デフォルトは 512 個) のコマンドのテキストは、履歴ファイルに保存されています。\fB$HOME/.sh_history\fR というファイルは、\fBHISTFILE\fR 変数が設定されていない場合、または変数が示すファイルが書き込み不可能な場合に使用されます。シェルは、同じ名前の \fBHISTFILE\fR を使用する対話型シェルすべてのコマンド履歴を使用できます。\fBhist\fR という組み込みコマンドは、このファイルの一部を一覧表示または編集するときに使用します。編集またはリスト表示されるファイルの部分は、番号か、またはコマンドの最初の文字を指定することによって選択できます。単一のコマンドを指定することも、コマンドの範囲を指定することも可能です。\fBhist\fR の引数としてエディタプログラムが指定されていないと、\fBHISTEDIT\fR という変数の値が使用されます。\fBHISTEDIT\fR が設定されていない場合、廃止された変数 \fBFCEDIT\fR が使用されます。\fBFCEDIT\fR が未定義の場合は、\fB/bin/ed\fR が使用されます。エディタを終了したときに、編集されたコマンドは出力され再実行されます。ただし、書き込まずに終了した場合は除きます。\fB-s\fR オプション (廃止されたバージョンではエディタ名 \fB-\fR) を指定すると、編集段階が省かれ、コマンドが再実行されます。この場合、\fIold\fR\fB=\fR\fInew\fR という形式の代入パラメータを使用すれば、実行前にコマンドを変更できます。たとえば、\fB\&'hist -s'\fR の別名として定義されている設定済みの別名 \fBr\fR を使用して、\fB`r bad=good c'\fR と入力すると、\fBc\fR という文字で始まるコマンドのうち最新のものが、その記述中の最初の bad という文字列を good に置き換えて再実行されます。 
+.SS "インライン編集オプション"
+.sp
+.LP
+通常、端末装置から入力する各コマンド行では、コマンドのあとに復帰改行 (RETURN または LINE FEED) しか入力できません。\fBemacs\fR、\fBgmacs\fR、\fBvi\fR のいずれかのオプションが有効な場合、ユーザーはコマンド行を編集できます。いずれかの編集モードにするには、対応するオプションを設定します。編集オプションは、いずれかのオプション名で終了する値を \fBVISUAL\fR 変数または \fBEDITOR\fR 変数に代入するたびに、自動的に選択されます。
+.sp
+.LP
+編集機能では、ユーザーの端末が RETURN を改行のないキャリッジリターンとして扱うこと、およびスペース文字がスクリーン上の現在の文字を上書きすることが必要です。
+.sp
+.LP
+\fBmultiline\fR オプションが有効になっていないかぎり、編集モードは、ユーザーがウィンドウを介して現在の行を見るという概念を実現します。ウィンドウ幅は、\fBCOLUMNS\fR が定義されていればその値になり、未定義の場合は \fB80\fR になります。ウィンドウの幅が小さすぎて、プロンプトを表示すると入力用に 8 カラム以上残すことができない場合は、プロンプトが左端から切り捨てられます。ウィンドウ幅から 2 を引いた長さより行が長い場合は、ウィンドウの終わりにマークを表示してユーザーに通知します。カーソルが移動し、ウィンドウの境界に達すると、ウィンドウはカーソルを中心としてセンタリングされます。行がウィンドウの右端、左端、または両端を超えている場合は、それぞれ \fB>\fR、\fB<、*\fR のマークが使用されます。
+.sp
+.LP
+各編集モードでは、検索コマンドから履歴ファイルにアクセスできます。パターンではなく文字列だけがマッチングの対象になります。ただし、文字列の先頭に \fB^\fR があると、マッチングの開始位置が行の先頭に限定されます。
+.sp
+.LP
+それぞれの編集モードには、部分的に入力したワードに一致するファイルまたはコマンドを一覧表示する操作が用意されています。行の最初のワードか、\fB;\fR、\fB|\fR、\fB&\fR、または \fB(\fR のあとの最初のワードに適用され、ワードの先頭が \fB~\fR でなく、ワードに \fB/\fR が含まれない場合、部分的なワードに一致する可能性のある、\fBPATH\fR 変数で定義された別名、関数、実行可能なコマンドのリストが表示されます。それ以外の場合、指定されたワードに一致するファイルのリストが表示されます。部分的に入力されたワードにファイル展開文字が含まれない場合、これらのリストを生成する前に、\fB*\fR が付加されます。生成されたリストを表示したあとで、入力行が再描画されます。これらの操作はそれぞれ、コマンド名一覧表示、ファイル名一覧表示と呼ばれます。ほかにもコマンド名補完とファイル名補完と呼ばれる操作があります。これらの操作では、一致するコマンドまたはファイルのリストを作成しますが、リストを出力するのではなく、現在のワードを完全一致または部分一致と置き換えます。ファイル名補完の場合、一致が 1 つしかなければ、ファイルがディレクトリの場合は \fB/\fR が付加され、ファイルがディレクトリでない場合はスペースが付加されます。それ以外の場合は、一致したファイルすべてに共通するもっとも長い接頭辞がワードと置き換えられます。コマンド名補完の場合、ファイル名のうち最後の \fB/\fR 以降の部分だけが、もっとも長いコマンド接頭辞の検出に使用されます。1 つの名前しかこの接頭辞に一致しない場合、ワードはコマンド名にスペースを続けた文字列に置き換えられます。補完に\fBタブ\fRを使用した場合で複数の一致が存在したときは、後続のタブで、一致する代替候補の番号付きリストが表示されます。選択番号に続けてタブを入力することにより、特定の項目を選択できます。
+.SS "キーバインド"
+.sp
+.LP
+\fBKEYBD\fR トラップは、キーの入力時にキーを傍受して、実際にシェルで表示される文字を変更するために使用できます。このトラップは、端末からの読み取り中に文字 (または、最初の文字が ESC のときは文字の並び) が入力されるたびに実行されます。
+.sp
+.LP
+変数 \fB\&.sh.edchar\fR には、トラップを生成した文字または文字の並びが含まれます。トラップアクションで \fB\&.sh.edchar\fR の値を変更すると、シェルは、元の値ではなく新しい値がキーボードから入力された場合と同じように動作します。変数 \fB\&.sh.edcol\fR は、入力時点のカーソルの入力カラム番号に設定されます。変数 \fB\&.sh.edmode\fR は、\fBvi\fR 挿入モードのときに \fBESC\fR に、それ以外の場合に NULL に設定されます。\fB\&.sh.edchar\fR に代入された値の前に \fB${.sh.editmode}\fR を付けると、シェルは、まだ制御モードになっていない場合はこのモードに切り替わります。
+.sp
+.LP
+このトラップは、編集指令への引数として入力された文字や、文字検索の入力を読み取っているときは呼び出されません。
+.SS "\fBemacs\fR 編集モード"
+.sp
+.LP
+\fBemacs\fR または \fBgmacs\fR オプションを有効にすると、対応する編集モードに移行します。この 2 つのモードは、\fB^T\fR の扱い方だけが異なります。編集を行うには、ユーザーは訂正が必要な位置にカーソルを移動し、必要に応じて文字やワードを挿入または削除します。編集用のコマンドは、いずれも制御文字またはエスケープシーケンスです。制御文字は、キャレット (\fB^\fR) とそれに続く文字で表記されます。
+.sp
+.LP
+たとえば、\fB^F\fR は CTRL/F を表します。これは、CTRL (コントロール) キーを押しながら \fBf\fR キーを押して入力します。シフトキーは押しません。(\fB^?\fR は DEL (削除) キーを表します。)
+.sp
+.LP
+エスケープシーケンスは \fBM-\fR とそれに続く文字で表記されます。たとえば、\fBM-f\fR (メタ f と呼ぶ) は ESC キー (\fBASCII 033\fR) に続いて \fBf\fR を押すことで入力します。\fB\fR\fBM-F\fR は ESC のあとに \fBF\fR を押すことを表します。
+.sp
+.LP
+すべての編集コマンドは、行の先頭だけでなく、行のどこからでも実行できます。特に断りのないかぎり、編集コマンドのあとに RETURN キーや LINE FEED キーは入力しません。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^F\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ前方 (右) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[C\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ前方 (右) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-f\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 ワードだけ前方に移動します。\fBemacs\fR エディタでは、「ワード」は英文字、数字、および下線からなる文字列を意味します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^B\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ後方 (左) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[D\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ後方 (左) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-b\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 ワードだけ後方に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^A\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の先頭に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[H\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の先頭に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^E\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の末尾に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[Y\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の末尾に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^]\fR\fIchar\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の行で文字 \fIchar\fR が次に現れる位置にカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^]\fR\fIchar\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の行で文字 \fIchar\fR が前に現れる位置にカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^X^X\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルとマークを入れ替えます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIerase\fR\fR
+.ad
+.RS 13n
+.rt  
+前の 1 文字を削除します。ユーザー定義の消去文字は、\fBstty\fR(1) コマンドで定義され、通常は、\fB^H\fR または \fB#\fR です。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIlnext\fR\fR
+.ad
+.RS 13n
+.rt  
+次の文字の編集機能を無効にします。ユーザー定義の次のリテラル文字は、\fBstty\fR(1) コマンドによって定義されます。定義されていない場合は \fB^V\fR です。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^D\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の文字を削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-d\fR\fR
+.ad
+.RS 13n
+.rt  
+現在のワードを削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^H\fR\fR
+.ad
+.RS 13n
+.rt  
+メタバックスペース。直前のワードを削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-h\fR\fR
+.ad
+.RS 13n
+.rt  
+直前のワードを削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^?\fR\fR
+.ad
+.RS 13n
+.rt  
+メタ DEL。直前のワードを削除します。割り込み文字が \fB^?\fR (デフォルトの DEL) である場合、このコマンドは動作しません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^T\fR\fR
+.ad
+.RS 13n
+.rt  
+\fBemacs\fR モードでは、現在の文字を前の文字と入れ替え、カーソルを進めます。\fBgmacs\fR モードでは、直前の 2 つの文字を入れ替えます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^C\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の文字を大文字にします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-c\fR\fR
+.ad
+.RS 13n
+.rt  
+現在のワードを大文字にします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-l\fR\fR
+.ad
+.RS 13n
+.rt  
+現在のワードを小文字にします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^K\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルから行の末尾までを削除します。直前に指定された数値パラメータの値が現在のカーソル位置より小さい場合は、指定された位置の文字から現在のカーソル位置の文字までを削除します。直前に指定された数値パラメータの値が現在のカーソル位置より大きい場合は、現在のカーソル位置の文字から指定された位置の文字までを削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^W\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソル位置の文字からマークまでを抹消します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-p\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソル位置からマークまでの領域をスタックにプッシュします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIkill\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の行全体を抹消します。ユーザー定義の抹消文字は、\fBstty\fR(1) コマンドで定義され、通常は \fB^G\fR または \fB@\fR です。2 つの抹消文字を連続して入力すると、そのあとの kill 文字はすべて改行を意味します。プリンタ端末 (印字式端末) を使用している場合に便利です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^Y\fR\fR
+.ad
+.RS 13n
+.rt  
+行から最後に削除された項目を復元します。つまり、退避していた項目を行に戻します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^L\fR\fR
+.ad
+.RS 13n
+.rt  
+改行を行い、現在の行を出力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^L\fR\fR
+.ad
+.RS 13n
+.rt  
+画面を消去します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^@\fR\fR
+.ad
+.RS 13n
+.rt  
+NULL 文字。マークを設定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIspace\fR\fR
+.ad
+.RS 13n
+.rt  
+メタスペース文字。マークを設定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^J\fR\fR
+.ad
+.RS 13n
+.rt  
+復帰改行。現在の行を実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^M\fR\fR
+.ad
+.RS 13n
+.rt  
+復帰。現在の行を実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOF\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の行が NULL の場合のみ、end-of-file 文字 (通常は \fB^D\fR) をファイルの終わりとして処理します。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^P\fR\fR
+.ad
+.RS 13n
+.rt  
+直前のコマンドを取り出します。\fB^P\fR を入力するたびに、さらに前のコマンドにアクセスします。複数行にまたがるコマンドで最初の行でない場合は、1 行戻ります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[A\fR\fR
+.ad
+.RS 13n
+.rt  
+\fB^P\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-<\fR\fR
+.ad
+.RS 13n
+.rt  
+もっとも古いコマンド行の履歴を取り出します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM->\fR\fR
+.ad
+.RS 13n
+.rt  
+もっとも新しいコマンド行の履歴を取り出します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^N\fR\fR
+.ad
+.RS 13n
+.rt  
+次のコマンド行を取り出します。\fB^N\fR を入力するたびに、さらに次のコマンドにアクセスします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[B\fR\fR
+.ad
+.RS 13n
+.rt  
+\fB^N\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^R\fR\fIstring\fR\fR
+.ad
+.RS 13n
+.rt  
+履歴をさかのぼって、\fIstring\fR を含むコマンド行を検索します。パラメータとして 0 を指定すると、順方向に検索します。\fIstring\fR の終わりは復帰改行 (RETURN または NEWLINE) で示します。\fIstring\fR の先頭に \fB^\fR が付加されると、その文字列で始まるコマンドだけを検索します。\fIstring\fR を省略すると、直前に指定した文字列を含む次のコマンド行にアクセスします。\fI\fRこの場合、パラメータとして 0 を指定すると検索方向が逆になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^O\fR\fR
+.ad
+.RS 13n
+.rt  
+(Operate) 現在の行を実行し、現在の行に対する次の行を履歴ファイルから取り出します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIdigits\fR\fR
+.ad
+.RS 13n
+.rt  
+エスケープ。数値パラメータを定義します。digits は次のコマンドに対するパラメータとみなされます。パラメータを受け入れるコマンドは、\fB^F\fR、\fB^B\fR、\fBERASE\fR、\fB^C\fR、\fB^D\fR、\fB^K\fR、\fB^R \fR、\fB^P\fR、\fB^N\fR、\fB^]\fR、\fBM-.\fR、\fBM-\fR、\fBM-^]\fR、\fBM-_\fR、\fBM-=\fR、\fBM-b\fR、\fBM-c\fR、\fBM-d\fR、\fBM-f\fR、\fBM-h\fR、\fBM-l\fR、および \fBM-^H\fR です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIletter\fR\fR
+.ad
+.RS 13n
+.rt  
+(ソフトキー) 別名リストから、名前 \fIletter\fR の別名を検索します。\fIletter\fR の別名が定義されている場合、入力待ち行列にその値を挿入します。\fIletter\fR は、この節で示したいずれかのメタ関数を示す文字であってはいけません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[\fR\fIletter\fR\fR
+.ad
+.RS 13n
+.rt  
+(ソフトキー) 別名リストから、名前 \fIletter\fR の別名を検索します。この名前の別名が定義されている場合、入力待ち行列にその値を挿入します。これは、多くの端末でファンクションキーをプログラムするために使用できます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-.\fR\fR
+.ad
+.RS 13n
+.rt  
+直前のコマンドの最後のワードを行に挿入します。数値パラメータが指定されると、最後のワードではなくその数値が示す位置のワードを挿入します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-_\fR\fR
+.ad
+.RS 13n
+.rt  
+\fBM-.\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-*\fR\fR
+.ad
+.RS 13n
+.rt  
+現在のワードに対してファイル名生成を試行します。ワードがどのファイルにも一致しない場合や、特殊パターン文字を含んでいない場合、アスタリスクが付加されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fRESC\fR
+.ad
+.RS 13n
+.rt  
+このマニュアルページで説明したコマンド名補完またはファイル名補完。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^I\fRTAB\fR
+.ad
+.RS 13n
+.rt  
+このマニュアルページで説明したコマンド名補完またはファイル名補完を試行します。部分補完が起きた場合、これを繰り返すと、\fBM-=\fR を入力した場合と同様に動作します。一致が見つからない場合、またはスペース文字のあとに入力されている場合は、タブが挿入されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-=\fR\fR
+.ad
+.RS 13n
+.rt  
+数値パラメータが前に付いていない場合、このマニュアルページで説明するように、一致するコマンドまたはファイル名のリストを生成します。それ以外の場合は、カーソルの下のワードが、もっとも新しく生成されたコマンドまたはファイルリストからの数値パラメータの値に対応する項目で置き換えられます。カーソルがワードの上にない場合、代わりにワードが挿入されます。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^U\fR\fR
+.ad
+.RS 13n
+.rt  
+次のコマンドのパラメータを \fB4\fR 倍します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 13n
+.rt  
+次の文字をエスケープします。編集用文字、ユーザーが設定した消去文字、抹消文字、および割り込み文字 (通常は \fB^?\fR) は、その前に \fB\e\fR を指定すれば、コマンド行または検索文字列に入力できます。\fB\e\fR は、次の文字の編集機能 (もしあれば) を無効にします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^V\fR\fR
+.ad
+.RS 13n
+.rt  
+シェルのバージョンを表示します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-#\fR\fR
+.ad
+.RS 13n
+.rt  
+行の先頭が \fB#\fR でない場合、行の先頭と各復帰改行のあとに \fB#\fR が挿入され、行が入力されます。これによって、履歴ファイルにコメントを挿入できます。行の先頭が \fB#\fR である場合、\fB#\fR が削除され、各復帰改行のあとの \fB#\fR も 1 つずつ削除されます。
+.RE
+
+.SS "\fBvi\fR 編集モード"
+.sp
+.LP
+2 つの入力モードがあります。初期状態では、コマンドを入力すると入力モードに移行します。編集するには、ユーザーは、エスケープ (ESC) キー (033) を入力して制御モードに移行し、訂正が必要な箇所にカーソルを移動してから、必要に応じて文字やワードを挿入または削除します。ほとんどの制御コマンドでは、コマンドの先頭に繰り返し数を指定できます。\fI\fR 
+.sp
+.LP
+ほとんどのシステムでは、vi モードに移行した直後は標準処理が有効になります。端末の回線速度が 1200 ボー以上であり、制御文字が含まれているか、またはプロンプトが表示されてからの経過時間が 1 秒未満であれば、コマンドが再度表示されます。ESC 文字を入力すると、コマンドの残りの部分に対する標準処理が終了し、ユーザーはコマンド行を変更できるようになります。この方式には、標準処理で raw モードの先行入力表示機能を利用できるという利点があります。
+.sp
+.LP
+\fBviraw\fR オプションも設定すると、端末の標準処理を常に無効にできます。このモードは、行の終わりの区切りを示す 2 つの代替記号をサポートしていないシステムでは暗黙的に設定されており、特定の端末で便利なことがあります。 
+.SS "入力編集コマンド"
+.sp
+.LP
+デフォルトでは、エディタは入力モードになります。
+.sp
+.LP
+次の入力編集コマンドがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fBERASE\fR
+.ad
+.RS 10n
+.rt  
+ユーザーが \fBstty\fR コマンドで定義した消去文字。通常は \fB^H\fR または \fB#\fR。前の 1 文字を削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^W\fR\fR
+.ad
+.RS 10n
+.rt  
+直前の、ブランクで区切られたワードを削除します。一部のシステムでは、この機能には \fBviraw\fR オプションが必要です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBEOF\fR
+.ad
+.RS 10n
+.rt  
+行の先頭の文字として使用すると、\fBignoreeof\fR オプションが設定されないかぎり、シェルが終了します。それ以外の場合、この文字は無視されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIlnext\fR\fR
+.ad
+.RS 10n
+.rt  
+\fBstty\fR(1) によって定義した、ユーザー定義の次のリテラル文字。定義されていない場合は \fB^V\fR。次の文字の編集機能がある場合はこれを無効にします。一部のシステムでは、この機能には \fBviraw\fR オプションが必要です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 10n
+.rt  
+次の ERASE または KILL 文字をエスケープします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^I\fR TAB\fR
+.ad
+.RS 10n
+.rt  
+このマニュアルページで説明したコマンド名補完またはファイル名補完を試行し、入力モードに戻ります。部分補完が起きた場合、これを繰り返すと、制御モードから \fB=\fR を入力した場合と同様に動作します。一致が見つからない場合、またはスペース文字のあとに入力されている場合は、タブが挿入されます。
+.RE
+
+.SS "移動編集コマンド"
+.sp
+.LP
+移動編集コマンドはカーソルを移動します。
+.sp
+.LP
+次の移動編集コマンドがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]l\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ前方 (右) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][C\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ前方 (右) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]w\fR\fR
+.ad
+.RS 13n
+.rt  
+英数字から構成されるワード 1 つ分だけカーソルを前方に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]W\fR\fR
+.ad
+.RS 13n
+.rt  
+ブランクのあとに続く次のワードの先頭にカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]e\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルをワードの終わりに移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]E\fR\fR
+.ad
+.RS 13n
+.rt  
+ブランクで区切られた現在のワードの終わりにカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]h\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ後方 (左) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][D\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 文字だけ後方 (左) に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]b\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを 1 ワードだけ後方に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]B\fR\fR
+.ad
+.RS 13n
+.rt  
+ブランクで区切られた直前のワードにカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]|\fR\fR
+.ad
+.RS 13n
+.rt  
+\fIcount\fR が示すカラムにカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]f\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の行で文字 \fIc\fR が次に現れる位置にカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]F\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の行で文字 \fIc\fR が前に現れる位置にカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]t\fR\fIC\fR\fR
+.ad
+.RS 13n
+.rt  
+\fBf\fR と \fBh\fR を連続して実行した場合と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]T\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+\fBF\fR と \fBl\fR を連続して実行した場合と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB];\fR\fR
+.ad
+.RS 13n
+.rt  
+直前の単一文字検索コマンドの \fBf\fR、\fBF\fR、\fBt\fR、または \fBT\fR を \fIcount\fR の数だけ繰り返します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB],\fR\fR
+.ad
+.RS 13n
+.rt  
+直前の単一文字検索コマンドを \fIcount\fR の数だけ逆方向で実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の先頭に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の先頭に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[H\fR\fR
+.ad
+.RS 13n
+.rt  
+行に含まれる最初のブランク以外の文字にカーソルを移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の末尾に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[Y\fR\fR
+.ad
+.RS 13n
+.rt  
+カーソルを行の末尾に移動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fR
+.ad
+.RS 13n
+.rt  
+現在の位置にある括弧記号 \fB(\fR、\fB)\fR、\fB{\fR、\fB}\fR、\fB[\fR、または \fB]\fR に対応する括弧記号にカーソルを移動します。この節で説明したどの文字の上にもカーソルが置かれていない場合は、いずれかの文字で最初に現れるものを行の残りから検索します。
+.RE
+
+.SS "検索編集コマンド"
+.sp
+.LP
+検索編集コマンドはコマンド履歴にアクセスします。
+.sp
+.LP
+次の検索編集コマンドがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]k\fR\fR
+.ad
+.RS 13n
+.rt  
+直前のコマンドを取り出します。\fBk\fR を入力するたびに、さらに前のコマンドにアクセスします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]-\fR\fR
+.ad
+.RS 13n
+.rt  
+直前のコマンドを取り出します。\fBk\fR を入力するたびに、さらに前のコマンドにアクセスします。
+.sp
+\fBk\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][A\fR\fR
+.ad
+.RS 13n
+.rt  
+直前のコマンドを取り出します。\fBk\fR を入力するたびに、さらに前のコマンドにアクセスします。
+.sp
+\fBk\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]j\fR\fR
+.ad
+.RS 13n
+.rt  
+次のコマンドを取り出します。\fBj\fR を入力するたびに、さらに次のコマンドにアクセスします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]+\fR\fR
+.ad
+.RS 13n
+.rt  
+次のコマンドを取り出します。\fBj\fR を入力するたびに、さらに次のコマンドにアクセスします。
+.sp
+\fBj\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][B\fR\fR
+.ad
+.RS 13n
+.rt  
+次のコマンドを取り出します。\fBj\fR を入力するたびに、さらに次のコマンドにアクセスします。
+.sp
+\fBj\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]G\fR\fR
+.ad
+.RS 13n
+.rt  
+コマンド番号 \fIcount\fR を取り出します。デフォルトでは、もっとも古いコマンド履歴を取り出します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/\fR\fIstring\fR\fR
+.ad
+.RS 13n
+.rt  
+履歴をさかのぼって、\fIstring\fR を含むコマンドを検索します。\fIstring\fR の終わりは復帰改行 (RETURN または NEWLINE) で示します。\fIstring\fR の先頭に \fB^\fR が付加されると、その文字列で始まるコマンドだけを検索します。\fIstring\fR が NULL の場合は、直前に指定された文字列を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fIstring\fR\fR
+.ad
+.RS 13n
+.rt  
+履歴を順方向に調べて、\fIstring\fR を含むコマンドを検索します。\fIstring\fR の終わりは復帰改行 (RETURN または NEWLINE) で示します。\fIstring\fR の先頭に \fB^\fR が付加されると、その文字列で始まるコマンドだけを検索します。\fIstring\fR が NULL の場合は、直前に指定された文字列を使用します。
+.sp
+\fI/\fR と同じですが、順方向に検索します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBn\fR\fR
+.ad
+.RS 13n
+.rt  
+直前の \fI/\fR または \fI?\fR コマンドで指定されたパターンと一致する次のパターンを逆方向に検索します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBN\fR\fR
+.ad
+.RS 13n
+.rt  
+直前の \fI/\fR または \fI?\fR で指定されたパターンと一致する次のパターンを順方向に検索します。
+.RE
+
+.SS "テキスト変更編集コマンド"
+.sp
+.LP
+次のコマンドは行を変更します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBa\fR\fR
+.ad
+.RS 19n
+.rt  
+入力モードに移行し、現在の文字のあとにテキストを入力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA\fR\fR
+.ad
+.RS 19n
+.rt  
+行の終わりにテキストを追加します。\fB$a\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]c\fR\fImotion\fR\fR
+.ad
+.br
+.na
+\fB\fBc[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+現在の文字から \fImotion\fR によりカーソルが移動する先までの文字を削除し、入力モードに移行します。\fImotion\fR が \fBc\fR の場合は、行全体を削除して入力モードに移行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBC\fR\fR
+.ad
+.RS 19n
+.rt  
+現在の文字から行の終わりまでを削除し、入力モードに移行します。\fBc$\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBcc\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]s\fR\fR
+.ad
+.RS 19n
+.rt  
+入力モードで、カーソルの下にある文字を置き換えます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD[\fR\fIcount\fR\fB]d\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+現在の文字から行の終わりまでを削除します。d$ と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBd[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+現在の文字から \fImotion\fR によりカーソルが移動する先までの文字を削除します。\fImotion\fR が d の場合は、行全体を削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 19n
+.rt  
+入力モードに移行し、現在の文字の前にテキストを入力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBI\fR\fR
+.ad
+.RS 19n
+.rt  
+行の先頭にテキストを挿入します。\fB0i\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]P\fR\fR
+.ad
+.RS 19n
+.rt  
+カーソルの前に、直前のテキスト変更を挿入します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]p\fR\fR
+.ad
+.RS 19n
+.rt  
+カーソルのあとに、直前のテキスト変更を挿入します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBR\fR\fR
+.ad
+.RS 19n
+.rt  
+入力モードに移行して、画面上の文字を重ね打ちした文字に置き換えます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]r\fR\fIc\fR\fR
+.ad
+.RS 19n
+.rt  
+現在のカーソル位置から始まる \fIcount\fR 個の文字を \fIc\fR に置き換え、カーソルの位置を進めます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]x\fR\fR
+.ad
+.RS 19n
+.rt  
+現在の文字を削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]X\fR\fR
+.ad
+.RS 19n
+.rt  
+直前の文字を削除します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR].\fR\fR
+.ad
+.RS 19n
+.rt  
+直前のテキスト変更コマンドを繰り返します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]~\fR\fR
+.ad
+.RS 19n
+.rt  
+現在のカーソル位置から始まる \fIcount\fR 個の文字を、大文字の場合は小文字に、小文字の場合は大文字に変換して、カーソルの位置を進めます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]_\fR\fR
+.ad
+.RS 19n
+.rt  
+直前のコマンドの \fIcount\fR 個のワードを付加し、入力モードに移行します。\fIcount\fR を省略すると、最後のワードを使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 19n
+.rt  
+\fB*\fR を現在のワードのあとに付加し、ファイル名を生成しようとします。一致するものが見つからない場合は、ベルを鳴らします。見つかった場合は、ワードを一致したパターンで置換し、入力モードに移行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 19n
+.rt  
+このマニュアルページで説明したコマンド名補完またはファイル名補完。
+.RE
+
+.SS "その他の編集コマンド"
+.sp
+.LP
+次のその他の編集コマンドがサポートされています。 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]y\fR\fImotion\fR\fR
+.ad
+.br
+.na
+\fB\fBy[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 18n
+.rt  
+現在の文字から \fImotion\fR によりカーソルが移動する先の文字までを退避します。退避した文字を削除用バッファーに入れます。テキストとカーソル位置は変更されません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fByy\fR\fR
+.ad
+.RS 18n
+.rt  
+現在の行を退避します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBY\fR\fR
+.ad
+.RS 18n
+.rt  
+現在のカーソル位置から行の末尾まで、現在の行を退避します。\fBy$\fR と同等です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBu\fR\fR
+.ad
+.RS 18n
+.rt  
+直前のテキスト変更コマンドを取り消します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBU\fR\fR
+.ad
+.RS 18n
+.rt  
+現在の行で実行されたテキスト変更コマンドをすべて取り消します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]V\fR\fR
+.ad
+.RS 18n
+.rt  
+コマンド
+.sp
+.in +2
+.nf
+hist -e ${VISUAL:-${EDITOR:-vi}} \fIcount\fR
+.fi
+.in -2
+.sp
+
+を入力バッファーに返します。\fIcount\fR を省略した場合、現在の行が使用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^L\fR\fR
+.ad
+.RS 18n
+.rt  
+改行を行い、現在の行を出力します。このコマンドは制御モードでのみ機能します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^J\fR\fR
+.ad
+.RS 18n
+.rt  
+復帰改行。モードに関係なく、現在の行を実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^M\fR\fR
+.ad
+.RS 18n
+.rt  
+復帰。モードに関係なく、現在の行を実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 18n
+.rt  
+コマンドの先頭文字が \fB#\fR であれば、その \fB#\fR および復帰改行に続くそれぞれの \fB#\fR を削除します。
+.sp
+先頭文字がほかの文字であれば、\fB#\fR をコマンドの各行の先頭に挿入後、行を送ります。 
+.sp
+このコマンドは、現在の行をコメントとして履歴に挿入する場合や、履歴ファイルに含まれる以前のコメント化されたコマンドをコメント解除する場合に便利です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]=\fR\fR
+.ad
+.RS 18n
+.rt  
+\fIcount\fR が指定されていない場合、このマニュアルページで説明するように、一致するコマンドまたはファイル名のリストを生成します。
+.sp
+指定されている場合は、現在カーソルが置かれているワードを、もっとも新しく生成したコマンドまたはファイルリストからの \fIcount\fR 項目に置き換えます。カーソルがワードの上にない場合は、現在のカーソル位置のあとに挿入されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB@\fR\fIletter\fR\fR
+.ad
+.RS 18n
+.rt  
+別名リストから、名前 \fIletter\fR の別名を検索します。この名前の別名が定義されている場合、処理用の入力待ち行列にその値を挿入します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^V\fR\fR
+.ad
+.RS 18n
+.rt  
+シェルのバージョンを表示します。
+.RE
+
+.SS "組み込みコマンド"
+.sp
+.LP
+次の単純コマンドは、シェルプロセス中で実行されます。入出力のリダイレクトが可能です。特に断りのないかぎり、出力はファイル記述子 \fB1\fR 上に書き込まれ、構文エラーがなければ終了ステータスは \fB0\fR です。\fB:\fR、\fBtrue\fR、\fBfalse\fR、\fBecho\fR、\fBnewgrp\fR、および \fBlogin\fR を除くすべての組み込みコマンドで、オプションの終わりを示す \fB--\fR を受け入れます。また、オプション \fB--man\fR を、マニュアルページを標準エラーに出力するように求める要求と解釈し、\fB-?\fR を、使用法に関するメッセージを標準エラーに出力するように求めるヘルプ要求と解釈します。
+.sp
+.LP
+1 つまたは 2 つの \fB++\fR 記号が先頭に付加されているコマンドは特殊組み込みコマンドであり、次のような特殊な処理を受けます。
+.RS +4
+.TP
+1.
+コマンドが完了しても、コマンドの直前の変数代入リストは引き続き有効です。
+.RE
+.RS +4
+.TP
+2.
+入出力のリダイレクトは変数代入後に行われます。
+.RE
+.RS +4
+.TP
+3.
+エラーが発生すると、それを含むスクリプトは中止されます。
+.RE
+.RS +4
+.TP
+4.
+これらは有効な関数名ではありません。
+.RE
+.RS +4
+.TP
+5.
+変数代入形式で、\fB++\fR から始まるコマンドに続くワードは、変数代入と同一の規則で展開されます。つまり、チルド置換は \fB=\fR 符号のあとに実行され、フィールド分割とファイル名生成は実行されません。
+.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ : [\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+パラメータの展開だけを行います。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ .\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIname\fR が \fBfunction\fR \fBname\fR 予約語構文で定義された関数である場合、この関数は、現在の環境で実行されます (\fIname()\fR 構文で定義されている場合と同様)。それ以外の場合で \fIname\fR がファイルを示しているときは、ファイルの全体が読み取られ、コマンドは現在のシェル環境で実行されます。PATH によって指定された検索パスを用いて、ファイルを含むディレクトリを探します。引数の \fIarg\fR が指定されている場合、. コマンドの処理中にこの引数が定位置パラメータになり、終了すると元の定位置パラメータが復元されます。引数を指定しないと定位置パラメータは変更されません。終了ステータスは、最後に実行されたコマンドの終了ステータスです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++ alias [\fR\fB-ptx\fR\fB] [\fR\fIname\fR\fB[ =\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBalias\fR 引数なしの場合、このコマンドは標準出力上に \fIname\fR\fB=\fR\fIvalue\fR という形式の別名のリストを表示します。\fB-p\fR オプションを指定すると、それぞれの別名の前に alias というワードが挿入されます。1 つまたは複数の引数が指定された場合、\fIvalue\fR が指定された \fIname\fR ごとに、\fIalias\fR が定義されます。\fIvalue\fR の末尾にスペースがあると、次のワードが別名置換指定かどうかをチェックします。廃止された \fB-t\fR オプションは、検索済みの別名を設定または一覧表示します。検索済み別名の値は、指定した \fIname\fR に対応する完全パス名になります。\fBPATH\fR の値を再設定するとこの値は未定義になりますが、別名は検索済みのままです。\fB-t\fR オプションを省略すると、\fIvalue\fR が指定されていない引数リスト内の各 \fIname\fR について、別名の名前と値を表示します。廃止された -x オプションは効果がありません。\fIname\fR が指定されているが、value は指定されておらず、\fIname\fR に対する別名も定義されていない場合は、終了ステータスは \fB0\fR 以外になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbg [\fR \fIjob\fR\fB\&...]\fR\fR
+.ad
+.sp .6
+.RS 4n
+このコマンドを使用できるのは、ジョブ制御をサポートするシステム上だけです。指定された各 \fIjob\fR をバックグラウンドで実行します。\fIjob\fR が省略された場合は、現在のジョブをバックグラウンドで実行します。\fIjob\fR の形式については、このマニュアルページの「ジョブ」節を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ break [\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBfor\fR ループ、\fBwhile\fR ループ、\fBuntil\fR ループ、または \fBselect\fR ループがあれば終了します。\fIn\fR を指定すると、\fIn\fR レベル分だけループを終了します。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbuiltin [\fR\fB-ds\fR \fB] [\fR\fB-f\fR \fIfile\fR\fB] [\fR\fIname ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIname\fR と \fB-f\fR オプションを指定しない場合、組み込みコマンドは標準出力に出力されます。\fB-s\fR オプションを指定すると、特殊組み込みコマンドだけが出力されます。それ以外の場合、それぞれの \fIname\fR は、組み込みコマンドの名前をベース名として持つパス名を表します。エントリポイントの関数名は、組み込みコマンド名の前に \fIb\fR を付けることによって決定されます。組み込みコマンド \fImycommand\fR に対する ISO C/C++ プロトタイプは \fBb\fR\fImycommand(int argc, char *argv[], void *context)\fR です。ここで、\fIargv\fR は \fIargc\fR 要素の配列であり、\fIcontext\fR は、\fB<ast/shell.h>\fR に記述された \fBShell_t\fR 構造体への省略可能なポインタです。特殊組み込みコマンドは、パス名にバインドしたり、削除したりできません。\fB-d\fR オプションを指定すると、それぞれの特殊組み込みコマンドが削除されます。動的読み込みをサポートするシステムでは、\fB-f\fR オプションは、組み込みコマンドのコードを含んだ共有ライブラリの名前を指定します。共有ライブラリの接頭辞または接尾辞 (それぞれシステムに応じて異なる)、あるいはその両方を省略できます。ライブラリが読み込まれると、そのシンボルを後続の \fBbuiltin\fR の呼び出しで使用できるようになります。複数のライブラリを指定するには、\fBbuiltin\fR コマンドを別個に呼び出します。ライブラリは、指定された順序とは逆の順序で検索されます。ライブラリが読み込まれると、ライブラリ内で \fBlib_init()\fR という名前の関数が検索され、\fB0\fR の引数を付けてこの関数が呼び出されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB] [\fR\fIarg\fR\fB]\fR\fR
+.ad
+.br
+.na
+\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB]\fR \fIold\fR \fInew\fR\fR
+.ad
+.sp .6
+.RS 4n
+このコマンドには 2 つの形式があります。 
+.sp
+第 1 の形式は、現在のディレクトリを \fIarg\fR に変更します。\fIarg\fR が \fB-\fR の場合、ディレクトリを直前のディレクトリに変更します。シェル変数 \fBHOME\fR の値がデフォルトの \fIarg\fR になります。\fBPWD\fR 変数は、現在のディレクトリに設定されます。シェル変数 \fBCDPATH\fR は、\fIarg\fR を含むディレクトリの検索パスを定義します。2 つのディレクトリ名は、コロン (\fB:\fR) で区切ります。デフォルトのパスは空の文字列です (現在のディレクトリを指定)。\fB\fR現在のディレクトリは空のパス名で指定します。このパス名は、等号の直後か、パスリスト内にある区切り文字のコロンの間に指定します。\fIarg\fR の先頭文字が \fB/\fR の場合、検索パスは使用しません。それ以外の場合は、パス中の各ディレクトリで \fIarg\fR を検索します。 
+.sp
+\fBcd\fR の第 2 の形式は、\fBPWD\fR 中の現在のディレクトリ名に含まれる \fIold\fR という文字列を \fInew\fR という文字列に置換し、この新規のディレクトリへ変更しようとします。デフォルトでは、ディレクトリ名を検索するときに、シンボリックリンク名は入力されたとおりに扱われます。これは、\fB-L\fR オプションと同等です。\fB-P\fR オプションを指定すると、ディレクトリを決定するときに、シンボリックリンクが解決されます。コマンド行の \fB-L\fR または \fB-P\fR の最後の指定によって、使用されるメソッドが決まります。\fBcd\fR コマンドは \fBrksh\fR では実行できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcommand\fR \fB[\fR\fB-pvVx\fR\fB]\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-v\fR または \fB-V\fR オプションを指定しない場合、\fIarg\fR で指定された引数で \fIname\fR が実行されます。 
+.sp
+\fB-p\fR オプションを指定すると、\fBPATH\fR の値で定義されたパスではなく、デフォルトのパスが検索されます。\fIname\fR を探すときに、関数は検索されません。さらに、\fIname\fR が特殊組み込みコマンドを指す場合、先頭にダガーが付いた特殊なプロパティーは考慮されません。たとえば、\fBredirect='command exec'\fR という定義済みの別名を使用すると、無効なリダイレクションが指定された場合にスクリプトが終了しません。 
+.sp
+\fB-x\fR オプションを指定すると、引数が多すぎるためにコマンドの実行が \fBerrno E2BIG\fR というエラーになる場合に、シェルは、各呼び出しで引数のサブセットを指定して、コマンド \fIname\fR を複数回呼び出します。複数の引数に展開する最初のワードの前の引数と、複数の引数に展開する最後のワードのあとの引数は、各呼び出しに渡されます。終了ステータスは呼び出しの最大終了ステータスです。 
+.sp
+\fB-v\fR オプションを指定した場合、\fBcommand\fR は、この節で説明する \fBwhence\fR 組み込みコマンドと同等になります。\fB-V\fR オプションを指定した場合、\fBcommand\fR は \fBwhence -v\fR と同じように機能します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+continue\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBfor\fR ループ、\fBwhile\fR ループ、\fBuntil\fR ループ、または \fBselect\fR ループの次の繰り返しを実行します。\fIn\fR を指定すると、\fIn\fR 番目のループから実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBdisown\fR \fB[\fR\fIjob...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+ログインシェルが終了するときに、シェルが、指定された各 \fIjob\fR、または \fIjob\fR が省略されている場合はすべての活動中のジョブに \fBHUP\fR シグナルを送信しません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBecho\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+最初の \fIarg\fR の先頭が \fB-\fR ではなく、どの引数にもバックスラッシュ (\fB\e\fR) が含まれていない場合、各引数をスペース文字で区切り、復帰改行で終了する形式で出力します。それ以外の場合は、\fBecho\fR の動作はシステムによって異なるため、この節で説明する \fBprint\fR または \fBprintf\fR を使用するようにしてください。使用法と説明については、\fBecho\fR(1) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+eval\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+引数をシェルへの入力として読み取り、生成されるコマンドを実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+exec\fR [\fB-c\fR] [\fB-a\fR \fIname ...\fR] \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIarg\fR を指定すると、このシェルの代わりに、引数で指定されたコマンドを (新規プロセスは生成せずに) 実行します。\fB-c\fR オプションを指定すると、exec の呼び出しに関連付けられた変数代入を適用する前に、環境がクリアされます。\fB-a\fR オプションを指定すると、最初の \fIarg\fR ではなく \fIname\fR が、新しいプロセスの \fBargv[0]\fR になります。入出力引数が指定可能で、現在のプロセスに影響を及ぼす場合があります。\fIarg\fR を指定しない場合は、ファイル記述子が、入出力リダイレクトリストの指定どおりに変更されることになります。この場合、この機能によりオープンされた \fB2\fR より大きい番号のファイル記述子は、別のプログラムを起動するとクローズされます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+exit\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルを、\fIn\fR が示す終了ステータスで終了させます。具体的には、指定した値の最下位 8 ビットが終了ステータスの値となります。\fIn\fR を省略すると、最後に実行されたコマンドの終了ステータスがシェルの終了ステータスになります。\fBignoreeof\fR オプションが有効になっているシェルを除き、ファイルの終わりを検出した場合もシェルが終了します。\fBset\fR を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++export\fR \fB[\fR\fB-p\fR\fB]\fR \fB[\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIname\fR を指定しない場合、エクスポート属性を持つ各変数の名前と値は、再入力可能な形式で値がクォートされて出力されます。\fB-p\fR オプションを指定すると、それぞれの変数の前に export というワードが挿入されます。それ以外の場合は、指定された \fIname\fR に、あとで実行されるコマンドの環境へ自動的にエクスポートされるようにマークが付きます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfalse\fR\fR
+.ad
+.sp .6
+.RS 4n
+何も行わず、\fB1\fR を返して終了します。\fBuntil\fR とともに使用すると無限ループになります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfg\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+このコマンドを使用できるのは、ジョブ制御をサポートするシステム上だけです。指定された各 \fIjob\fR を、指定された順序でフォアグラウンドで実行し、待機させます。job が指定されないと、現在のジョブをフォアグラウンドで実行します。\fIjob\fR の記述形式については、「ジョブ」を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetconf\fR \fB[\fR\fIname\fR \fB[\fR\fIpathname\fR\fB]]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIname\fR で指定された構成パラメータの現在の値を出力します。構成パラメータは、IEEE POSIX 1003.1 および IEEE POSIX 1003.2 標準で定義されます。\fBpathconf\fR(2) および \fBsysconf\fR(3C) を参照してください。
+.sp
+\fIpathname\fR 引数は、値がファイルシステムでの場所によって異なるパラメータで必要です。引数を指定しない場合、\fBgetconf\fR は、現在の構成パラメータの名前と値を出力します。パス名 \fB/\fR は、\fIpathname\fR を必要とする各パラメータで使用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetopts\fR \fB[\fR \fB-a\fR \fIname\fR\fB]\fR \fIoptstring\fR \fIvname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIarg\fR が正当なオプションを示しているかどうかをチェックします。\fIarg\fR を省略すると、定位置パラメータが使用されます。オプション引数は \fB+\fR または \fB-\fR で始まります。\fB+\fR や \fB-\fR 以外の文字で始まっているオプション、または引数が \fB--\fR である場合、オプションは終了します。\fB+\fR で始まっているオプションは、\fIoptstring\fR が \fB+\fR で始まっている場合にのみ認識されます。\fIoptstring\fR には、\fBgetopts\fR が認識する文字を記述します。文字のあとに \fB:\fR が続く場合、そのオプションには引数があるとみなされます。オプションと引数とはブランクで区切ることができます。オプション \fB-?\fR を指定すると、\fBgetopts\fR は、標準エラーに使用法に関するメッセージを生成します。\fB-a\fR オプションを使用すると、使用法に関するメッセージに使用する名前を指定できます。これはデフォルトで $0 です。\fBgetopts\fR は、呼び出されるごとに、次に見つかったオプション文字を変数 \fIvname\fR 内に格納します。\fIarg\fR が \fB+\fR で始まっている場合、オプション文字の前に \fB+\fR が付けられます。次の \fIarg\fR のインデックスは \fBOPTIND\fR に格納されます。オプション引数がある場合は \fBOPTARG\fR に格納されます。\fIoptstring\fR の先頭に : がある場合は、\fBgetopts\fR は無効なオプション文字を \fBOPTARG\fR に格納し、\fIvname\fR を \fB?\fR (未定義のオプションが指定された場合) または : (必要なオプション引数が省略されている場合) に設定します。\fBgetopts\fR はエラーメッセージを表示します。オプションがなくなると、終了ステータスは 0 以外になります。\fB\fR\fB:\fR、\fB+\fR、\fB-\fR、\fB?\fR、\fB[\fR、および \fB]\fR のオプションを指定する方法はありません。オプション \fB#\fR は、最初のオプションとしてのみ指定できます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBhist\fR \fB[\fR \fB-e\fR \fIename\fR\fB]\fR\fB[\fR\fB-nlr\fR\fB]\fR \fB[\fR \fIfirst\fR\fB[\fR\fIlast\fR \fB ] ]\fR\fR
+.ad
+.br
+.na
+\fB\fR
+.ad
+.br
+.na
+\fB\fBhist\fR \fB-s\fR \fB[\fR \fIold\fR\fB=\fR\fInew\fR \fB] [\fR \fIcommand\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+第 1 の形式では、端末から最近入力された \fBHISTSIZE\fR 個のコマンドの中から、\fIfirst\fR から \fIlast\fR までの範囲のコマンドを選択します。\fIfirst\fR と \fIlast\fR の両引数は、数値または文字列で指定できます。指定された文字列で始まる最新のコマンドを見つけるには、文字列を使用します。負の数値は、現在のコマンド番号からのオフセットとなります。-l オプションを指定すると、標準出力上にコマンドを一覧表示します。指定しないと、これらのキーボードコマンドの入ったファイル上で \fIename\fR というエディタプログラムを起動します。\fIename\fR を指定しない場合、変数 \fBHISTEDIT\fR の値が使用されます。\fBHISTEDIT\fR が設定されていない場合、\fBFCEDIT\fR (デフォルトは \fB/bin/ed\fR) がエディタとして使用されます。編集が完了すると、変更が保存されていれば、編集されたコマンドが実行されます。\fIlast\fR を指定しない場合、\fIfirst\fR と同一値に設定されます。\fIfirst\fR を指定しない場合、デフォルトは、編集については直前のコマンドに、一覧表示については \fB-16\fR になります。\fB-r\fR オプションはコマンドの順序を逆にします。\fB-n\fR オプションは一覧表示時にコマンド番号の出力を抑止します。第 2 の形式では、\fIcommand\fR は、この節で説明した \fIfirst\fR と解釈され、デフォルトで最後に実行されたコマンドに設定されます。\fIold\fR\fB=\fR\fInew\fR の省略可能な置換を行なったあとで、結果として得られるコマンドが実行されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBjobs\fR \fB-lnp\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+指定された各ジョブに関する情報を一覧表示します。\fIjob\fR 引数を省略すると、活動中のジョブすべてに関する情報を一覧表示します。\fB-l\fR オプションは、通常の情報に加えてプロセス ID も表示します。\fB-n\fR オプションは、前回通知を受けたあとに停止または終了したジョブだけを表示します。\fB-p\fR オプションは、プロセスグループだけを表示します。\fIjob\fR の記述形式については、「ジョブ」を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkill\fR \fB[\fR\fB-s\fR \fIsigname\fR\fB]\fR \fIjob ...\fR\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB[\fR\fB-n\fR \fIsignum\fR\fB]\fR \fI job ...\fR\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB-l\fR \fB[\fR\fIsig ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBTERM\fR (終了) シグナルまたは指定されたシグナルのいずれかを、指定されたジョブまたはプロセスに送信します。シグナルは、\fB-n\fR オプションの場合には番号で、\fB-s\fR オプションの場合には名前で指定されます。名前は、\fB<signal.h>\fR の定義から \fBSIG\fR という接頭辞を取り除いたものになります。ただし \fBSIGCLD\fR は \fBCHLD\fR という名前になります。下位互換性を確保するため、\fBn\fR および \fBs\fR を省略でき、番号または名前を \fB-\fR の直後に指定できます。送信するシグナルが \fBTERM\fR (終了) または \fBHUP\fR (ハングアップ) の場合、停止中のジョブまたはプロセスには \fBCONT\fR (継続) シグナルを送信します。\fIjob\fR という引数は、活動中のジョブではないプロセスのプロセス ID を指定することもできます。\fIjob\fR の記述形式については、「ジョブ」を参照してください。\fB\fR第 3 の形式の \fBkill -l\fR では、\fIsig\fR が指定されていない場合、シグナル名が一覧表示されます。それ以外の場合は、名前である \fIsig\fR ごとに、対応するシグナル番号が一覧表示され、番号である \fIsig\fR ごとに、\fIsig\fR の下位 8 ビットに対応するシグナル名が一覧表示されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBlet\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+各 \fIarg\fR は、評価の対象となる個々の算術式を表します。算術式の評価については、このマニュアルページの「算術評価」節を参照してください。\fB\fR終了ステータスは、最後の式の値が \fB0\fR 以外の場合は \fB0\fR で、0 の場合には \fB1\fR です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+newgrp\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBexec\fR \fB/bin/newgrp\fR \fIarg ...\fR と同機能です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprint\fR [\fB-Renprs\fR] \fB[\fR \fB-u\fR \fIunit\fR\fB] [\fR \fB-f\fR \fIformat\fR \fB] [\fR \fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+オプションを指定しない場合、または \fB-\fR や \fB--\fR のオプションを指定した場合、標準出力にそれぞれの \fIarg\fR が出力されます。\fB-f\fR オプションを指定すると、引数は、\fBprintf\fR の記述に従って出力されます。この場合、\fBe\fR、\fBn\fR、\fBr\fR、\fBR\fR オプションが無視されます。それ以外の場合は、\fB-R\fR または \fB-r\fR が指定されていないかぎり、次のエスケープ規則が適用されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\a\fR\fR
+.ad
+.RS 8n
+.rt  
+警告文字 (\fBASCII\fR 07)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\b\fR\fR
+.ad
+.RS 8n
+.rt  
+バックスペース文字 (\fBASCII\fR 010)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ec\fR\fR
+.ad
+.RS 8n
+.rt  
+print は、引数をこれ以上処理せず、復帰改行を追加せずに終了します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\f\fR\fR
+.ad
+.RS 8n
+.rt  
+用紙送り文字 (\fBASCII\fR 014)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\n\fR\fR
+.ad
+.RS 8n
+.rt  
+復帰改行文字 (\fBASCII\fR 012)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\r\fR\fR
+.ad
+.RS 8n
+.rt  
+復帰文字 (\fBASCII\fR 015)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\t\fR\fR
+.ad
+.RS 8n
+.rt  
+タブ文字 (\fBASCII\fR 011)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\v\fR\fR
+.ad
+.RS 8n
+.rt  
+垂直タブ文字 (\fBASCII\fR 013)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eE\fR\fR
+.ad
+.RS 8n
+.rt  
+エスケープ文字 (\fBASCII\fR 033)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\e\fR\fR
+.ad
+.RS 8n
+.rt  
+バックスラッシュ文字 \fB\e\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e0\fR\fIx\fR\fR
+.ad
+.RS 8n
+.rt  
+\fIx\fR で指定された 1、2、または 3 桁の 8 進数文字列で定義された文字
+.RE
+
+\fB-R\fR オプションは、\fB-n\fR を除く後続の引数およびオプションすべてを表示します。\fB-e\fR を指定すると、エスケープ規則が適用されます。これがデフォルトの動作です。前の \fB-r\fR の効果を逆転させます。\fB-p\fR オプションを指定すると、引数は、標準出力ではなく \fB|&\fR で生成されたプロセスのパイプに書き込まれます。\fB-s\fR オプションを指定すると、引数は、標準出力ではなく履歴ファイルに書き込まれます。\fB-u\fR オプションを使用すると、出力を格納する 1 桁のファイル記述子ユニット番号 \fIunit\fR を指定できます。デフォルト値は \fB1\fR です。\fB-n\fR オプションを指定した場合、復帰改行は出力に追加されません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprintf\fR \fIformat\fR\fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+引数 \fIarg\fR は、書式文字列 \fIformat\fR に関連付けられた \fBANSI-C\fR 書式設定規則に従って、標準出力に出力されます。引数の数が書式指定の数を超えた場合、書式文字列が、残りの引数の書式設定に再使用されます。次の拡張機能も使用できます。\fB%s\fR の代わりに \fB%b\fR 書式を使用すると、対応する \fIarg\fR 内のエスケープシーケンスを \fBprint\fR の記述に従って展開できます。\fB%B\fR オプションを指定すると、各引数が変数名として扱われ、変数のバイナリ値が出力されます。これは、b の属性を備えた変数に非常に役立ちます。\fB%s\fR の書式の代わりに \fB%H\fR を使用すると、\fBHTML\fR および \fBXML\fR では特殊文字である \fIarg\fR 内の文字を、エンティティー名として出力できます。\fB%s\fR の書式の代わりに \fB%P\fR を使用すると、\fIarg\fR を拡張正規表現として解釈し、シェルパターンとして出力できます。\fB%s\fR の書式の代わりに \fB%R\fR を使用すると、\fIarg\fR をシェルパターンとして解釈し、拡張正規表現として出力できます。\fB%s\fR の書式の代わりに \fB%q\fR を使用すると、結果として得られる文字列を、シェルへの再入力に使用できるような形式にクォートできます。\fB%(\fR\fIdate-format\fR\fB)T\fR の書式を使用すると、引数を日付/時刻文字列として扱い、\fBdate\fR(1) コマンドで定義されている \fIdate-format\fR に従って日付/時刻を書式設定できます。\fB%Z\fR の書式は値が 0 のバイトを出力します。%d の書式の精度フィールドのあとには、. と出力の底を続けることができます。この場合、\fB#\fR フラグ文字を指定することにより、底となる数字が前に置かれるようになります。\fB\fR\fI\fR\fB#\fR フラグを、出力の底なしで \fBd\fR 指定子とともに使用すると、単位を示す \fBk\fR \fBM\fR \fBG\fR \fBT\fR \fBP\fR \fBE\fR のいずれかの接尾辞とともに、出力が 1000 の累乗の単位で表示されます。\fB#\fR フラグを、i 指定子とともに使用すると、単位を示す \fBKi\fR \fBMi\fR \fBGi\fR \fBTi\fR \fBPi\fR \fBEi\fR のいずれかの接尾辞とともに、出力が \fB1024\fR の累乗の単位で表示されます。指定したフィールド幅内で出力が中央になるように調整する \fB=\fR フラグが追加されています。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpwd\fR [\fB-LP\fR]\fR
+.ad
+.sp .6
+.RS 4n
+現在の作業ディレクトリの値を出力します。\fB-L\fR オプションはデフォルトです。現在のディレクトリの論理名を出力します。\fB-P\fR オプションが指定された場合、すべてのシンボリックリンクが名前から解決されます。コマンド行の \fB-L\fR または \fB-P\fR の最後の指定によって、使用されるメソッドが決まります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBread\fR \fB[\fR\fB-Aprs\fR\fB] [\fR\fB-d\fR \fIdelim\fR\fB] [\fR \fB-n\fR \fIn\fR\fB] [[\fR \fB-N\fR \fIn\fR\fB ] [[\fR\fB-t\fR \fItimeout\fR\fB] [\fR\fB-u\fR \fIunit\fR\fB] [\fR\fIvname\fR\fB?\fR\fIprompt\fR\fB] [\fR \fIvname ...\fR \fB ]\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルの入力メカニズムです。1 つの行を読み取り、IFS が示す文字を、区切り文字として使用して、行の内容をいくつかのフィールドに分割します。エスケープ文字 \fB\e\fR は、次の文字の特別な意味または行の継続に関する意味を取り除くために使用します。\fB-d\fR オプションを指定すると、読み取りは復帰改行ではなく \fIdelim\fR の最初の文字まで続けられます。\fB\fR\fB-n\fR オプションを指定すると、行全体ではなく、最高で \fIn\fR バイトが読み取られますが、低速デバイスから読み取る場合には、何らかの文字を読み取ったらすぐに返ります。\fB-N\fR オプションを指定すると、ファイルの終わりにならないかぎり、または \fB-t\fR オプションのために読み取りがタイムアウトしないかぎり、正確に \fIn\fR バイトを読み取ります。\fB-r\fR で指定する raw モードでは、\fB\e\fR が持つこの特殊な意味は無視されます。第 1 フィールドを 1 番目の \fIvname\fR に、第 2 フィールドを 2 番目の \fIvname\fR にという順番で割り当てていき、余ったフィールドがあれば最後の \fIvname\fR に割り当てます。\fIvname\fR にバイナリ属性があり、\fB-n\fR または \fB-N\fR が指定された場合、読み取られたバイトは、直接変数に格納されます。-v が指定された場合、端末装置から読み取るときに、1 番目の \fIvname\fR の値がデフォルト値として使用されます。\fB-A\fR オプションを指定すると、変数 \fIvname\fR が設定解除され、読み取られた各フィールドは、インデックス付き配列 \fIvname\fR の連続した要素に格納されます。\fB-p\fR オプションは、シェルが \fB|&\fR を使用して生成したプロセスの入力パイプから入力行を取り出します。\fB-s\fR オプションは、入力をコマンドとして履歴ファイルに保存します。\fB-u\fR オプションは、読み取り元となるファイル記述子番号を 1 桁の数値 \fIunit\fR で指定します。ファイル記述子は、\fBexec\fR という特殊組み込みコマンドで開くことができます。ユニット \fIn\fR のデフォルト値は \fB0\fR です。\fB-t\fR オプションは、端末またはパイプから読み取るときに、秒数でタイムアウトを指定します。\fIvname\fR を省略すると、REPLY の値をデフォルトとして使用します。\fI\fR\fB-p\fR オプションが指定されていてファイルの終わりを検出すると、このプロセスをクリアし別のプロセスを作成可能にします。最初の引数が \fB?\fR を含んでいると、シェルが対話型のとき、このワードの残りを標準エラーに対するプロンプトとして使用します。ファイルの終わりに到達するか、読み取りがタイムアウトしないかぎり、終了ステータスは \fB0\fR です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++readonly\fR \fB[\fR\fB-p\fR\fB] [\fR \fIvname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIvname\fR を指定しない場合、読み取り専用属性を持つ各変数の名前と値は、再入力可能な形式で値がクォートされて出力されます。\fB-p\fR オプションを指定すると、それぞれの変数の前に \fBreadonly\fR というワードが挿入されます。それ以外の場合は、指定された \fIvname\fR は読み取り専用としてマークされ、これらの名前は、以降の代入で変更できなくなります。\fB\fR 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+return\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェル関数またはスクリプトを、\fIn\fR で指定された終了ステータスで呼び出し側スクリプトに戻します。具体的には、指定した値の最下位 8 ビットが終了ステータスの値となります。\fBn\fR を省略すると、戻りステータスは最後に実行されたコマンドの戻りステータスになります。関数やスクリプトの外で return を呼び出すと、exit と同じ動作を行います。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+set [ \(+-BCGabefhkmnoprstuvx] [\(+-o [\fR \fIoption\fR \fB] ] ... [ \(+-A\fR \fIvname\fR\fB]\fR \fB[\fR\fIarg...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBset\fR コマンドには、次のオプションを設定できます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.sp .6
+.RS 4n
+定義される後続の変数すべてを自動的にエクスポートします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.sp .6
+.RS 4n
+配列の代入。変数 \fIvname\fR の設定を解除し、\fIarg\fR リストから順々に値を代入します。\fB+A\fR を使用すると、最初に変数 \fIvname\fR の設定解除は行いません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR\fR
+.ad
+.sp .6
+.RS 4n
+バックグラウンドジョブの状態が変更されたときに、次のプロンプトを待機せずに、すぐにジョブ完了メッセージを出力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-B\fR\fR
+.ad
+.sp .6
+.RS 4n
+中括弧パターンフィールドの生成を有効にします。これはデフォルトの動作です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-C\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルのリダイレクト (\fB>\fR) によって既存のファイルが上書きされるのを防ぎます。作成されたファイルは、\fBO_EXCL\fR モードで開かれます。これが有効なときにファイルを切り捨てるには、\fB>|\fR が必要です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR\fR
+.ad
+.sp .6
+.RS 4n
+コマンドの終了ステータスが \fB0\fR でない場合、\fBERR\fR トラップ (設定されていれば) を実行し、終了します。このモードは、プロファイル読み取り時は無効です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.sp .6
+.RS 4n
+ファイル名を生成しないようにします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-G\fR\fR
+.ad
+.sp .6
+.RS 4n
+ファイル名生成に使用した場合に、パターン \fB**\fR 単独で、ファイルおよび 0 個以上のディレクトリおよびサブディレクトリに一致します。\fB/\fR を続けると、ディレクトリおよびサブディレクトリだけが一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR\fR
+.ad
+.sp .6
+.RS 4n
+各コマンドは、最初に検出された時点で、検索済み別名になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR\fR
+.ad
+.sp .6
+.RS 4n
+廃止。コマンド名に先行するものだけでなく、すべての変数代入引数をコマンドの環境に格納します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR\fR
+.ad
+.sp .6
+.RS 4n
+バックグラウンドジョブを個別のプロセスグループで実行し、完了時にメッセージを 1 行表示します。バックグラウンドジョブの終了ステータスは完了メッセージで報告されます。ジョブ制御を備えたシステムでは、このオプションは対話型シェルに対して自動的に有効になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.sp .6
+.RS 4n
+コマンドを読み取り、構文エラーがないかチェックします。実行は行いません。対話型シェルに対しては無視されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR\fR
+.ad
+.sp .6
+.RS 4n
+オプション名が指定されていない場合、オプションとその現在の設定のリストが、標準出力に書き込まれます。\fB+\fR を付けて呼び出された場合、シェルに再入力して設定を復元できる形式で、オプションが書き込まれます。このオプションを繰り返して、複数のオプションを有効または無効にすることができます。
+.sp
+このフラグのあとに指定する引数は、次のいずれかのオプション名です。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBallexport\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-a\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbgnice\fR \fR
+.ad
+.sp .6
+.RS 4n
+バックグラウンドジョブをすべて低い優先度で実行します。これはデフォルトモードです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbraceexpand\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-B\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBemacs\fR\fR
+.ad
+.sp .6
+.RS 4n
+コマンド入力用に、\fBemacs\fR 形式のインラインエディタを起動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBerrexit\fR \fR
+.ad
+.sp .6
+.RS 4n
+\fB-e\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBglobstar\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-G\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgmacs\fR\fR
+.ad
+.sp .6
+.RS 4n
+コマンド入力用に、\fBgmacs\fR 形式のインラインエディタを起動します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBignoreeof\fR\fR
+.ad
+.sp .6
+.RS 4n
+ファイルの終わりを検出してもシェルは終了しません。終了させるには \fBexit\fR コマンドを使用する必要があります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkeyword\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-k\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmarkdirs\fR \fR
+.ad
+.sp .6
+.RS 4n
+ファイル名生成によって生成されるディレクトリ名には、すべて最後に / を付加します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmonitor\fR \fR
+.ad
+.sp .6
+.RS 4n
+\fB-m\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmultiline\fR\fR
+.ad
+.sp .6
+.RS 4n
+組み込みエディタで、行の長さが画面の幅を超える場合に複数の行を使用します。これはすべての端末で機能するわけではありません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoclobber\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-C\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoexec\fR \fR
+.ad
+.sp .6
+.RS 4n
+\fB-n\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoglob\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-f\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnolog\fR\fR
+.ad
+.sp .6
+.RS 4n
+履歴ファイルに関数定義を保存しません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnotify\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-b\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnounset\fR \fR
+.ad
+.sp .6
+.RS 4n
+\fB-u\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpipefail\fR\fR
+.ad
+.sp .6
+.RS 4n
+パイプラインのすべてのコンポーネントが完了するまで、パイプラインは完了しません。戻り値は、最後に失敗した 0 以外のコマンドの値か、コマンドが失敗しなかった場合は 0 です。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprivileged\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-p\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBshowme\fR\fR
+.ad
+.sp .6
+.RS 4n
+有効にした場合、セミコロン (\fB;\fR) が前に付いた単純コマンドまたはパイプラインは、\fBxtrace\fR オプションが有効になっている場合と同様に表示されますが、実行されません。それ以外の場合、前に付いた \fB;\fR は無視されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrackall\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-h\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBverbose\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-v\fR と同じです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBvi\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBvi\fR 形式のインラインエディタの挿入モードになり、033 というエスケープ文字を押すまで継続されます。これにより制御モードになります。Return で行を送信します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBviraw\fR\fR
+.ad
+.sp .6
+.RS 4n
+各文字を \fBvi\fR モードで入力されたときと同様に処理します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBxtrace\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-x\fR と同じです。 
+.sp
+オプション名を指定しないと、現在のオプション設定を表示します。
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB$HOME/.profile\fR ファイルを処理しないようにし、\fBENV\fR ファイルの代わりに \fB/etc/suid_profile\fR ファイルを使用します。このモードは、実効ユーザー ID (実効グループ ID) が実ユーザー ID (実グループ ID) と等しくないときには必ず有効になります。\fB\fR\fB\fR\fB\fR\fB\fRこのモードを無効にすると、実効ユーザー ID が実ユーザー ID に、実効グループ ID が実グループ ID にそれぞれ設定されます。\fB\fR\fB\fR\fB\fR\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.sp .6
+.RS 4n
+制限付きシェルを有効にします。このオプションは、一度設定すると設定解除できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.sp .6
+.RS 4n
+定位置パラメータを辞書編集方式の順にソートします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.sp .6
+.RS 4n
+廃止。1 つのコマンドを読み取り、実行し、終了します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.sp .6
+.RS 4n
+置換を行う際に、設定されていないパラメータをエラーとして扱います。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルへの入力行の読み取り時に、その内容を表示出力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.sp .6
+.RS 4n
+コマンドおよび引数の実行時に、その内容を表示出力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB--\fR\fR
+.ad
+.sp .6
+.RS 4n
+どのオプションも変更しません。これは、\fB$1\fR を\fB-\fR で始まる値に設定する際に便利です。このオプションのあとに引数がない場合、定位置パラメータが設定解除されます。
+.RE
+
+廃止された機能として、最初の \fIarg\fR が - である場合は、\fB-x\fR および \fB-v\fR オプションが無効になり、次の \fIarg\fR が最初の引数として扱われます。\fB-\fR の代わりに \fB+\fR を使用すると、これらのオプションは無効になります。これらのオプションはシェル起動時にも使用できます。現在のオプションセットは、\fB$-\fR で見つけられます。\fB-A\fR を指定しないかぎり、残りの引数は定位置パラメータとなり、\fB$1 $2 .... に順番に割り当てられます。\fR引数を 1 つも指定しない場合には、すべての変数の名前と値が標準出力に出力されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+shift\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB$\fR\fIn\fR\fB+1 ...\fR からの定位置パラメータの名前は、\fB$1 ...\fR に変更されます。デフォルトの \fIn\fR は \fB1\fR です。パラメータ \fIn\fR に指定できる値は、評価結果が \fB$#\fR 以下の負でない数になる算術式です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+trap\fR \fB-p\fR \fB[\fR\fIaction\fR\fB]\fR \fB[\fR\fIsig\fR\fB] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-p\fR オプションを指定すると、引数として指定された、各トラップに関連付けられているトラップアクションが、適切にクォートされて出力されます。それ以外の場合は、\fIaction\fR は、シェルがシグナル \fIsig\fR を受け取ったときに、\fBeval\fR への引数である場合と同様に処理されます。各 \fIsig\fR は、数値またはシグナルの名前です。trap コマンドは、シグナル番号の順序で実行されます。現在のシェルへの入力時に無視されたシグナルにトラップを設定しようとしても無効となります。\fIaction\fR を省略して、最初の \fIsig\fR が数値である場合、または \fIaction\fR が \fB-\fR である場合は、各 \fIsig\fR 用のトラップが元の値に再設定されます。\fIaction\fR が NULL 文字列の場合、シェルおよびシェルが呼び出したコマンドは、このシグナルを無視します。\fIsig\fR が \fBERR\fR の場合は、コマンドが \fB0\fR 以外の終了ステータスで終わると必ず \fIaction\fR が実行されます。\fIsig\fR が \fBDEBUG\fR の場合は、各コマンドの前に \fIaction\fR が実行されます。\fIaction\fR が実行されているとき、変数 \fB\&.sh.command\fR には現在のコマンド行の内容が含まれます。\fIsig\fR が \fB0\fR または \fBEXIT\fR であり、\fBfunction\fR \fIname\fR 構文で定義されたある関数の内部で trap 文が実行された場合、コマンド \fIaction\fR は関数の完了後に実行されます。\fIsig\fR が \fB0\fR または \fBEXIT\fR であり、trap が関数の外側で設定されている場合、コマンド \fIaction\fR はシェルの終了時に実行されます。\fIsig\fR が \fBKEYBD\fR である場合、\fBemacs\fR、\fBgmacs\fR、または \fBvi\fR モードのときにキーが読み取られると必ず、\fIaction\fR が実行されます。引数なしの \fBtrap\fR コマンドは、コマンドの一覧をおのおのが対応しているシグナル番号とともに表示します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrue\fR\fR
+.ad
+.sp .6
+.RS 4n
+何も行わず、\fB0\fR を返して終了します。while とともに使用すると無限ループになります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++typeset [\(+-AHflabnprtux ] [ \(+-EFLRZi[\fR\fIn\fR\fB] ] [\fR \fIvname\fR\fB[=\fR\fIvalue\fR \fB] ]\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェル変数と関数の属性と値を設定します。\fBfunction\fR \fIname\fR 構文で定義された関数内部で呼び出されると、変数 \fIvname\fR の新しいインスタンスが作成され、関数の完了時に変数の値と型が復元されます。 
+.sp
+\fB-\fR の代わりに \fB+\fR を使用すると、これらのオプションは無効になります。\fIvname\fR 引数が指定されていない場合、変数の \fIvname\fR (および必要な場合は \fIvalue\fR) のリストが出力されます。\fB-\fR の代わりに \fB+\fR を使用すると、値は出力されません。\fB-p\fR オプションを指定すると、オプションの名前ではなく \fBtypeset\fR とオプション文字が、それぞれの名前の前に出力されます。\fB-p\fR 以外のオプションを指定した場合は、指定されたすべてのオプションを持つ変数だけが出力されます。それ以外の場合、\fIvname\fR および属性を持つすべての変数の \fIattributes\fR が出力されます。
+.sp
+このコマンドには、次の属性を指定できます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 7n
+.rt  
+\fIvname\fR をインデックス付き配列として宣言します。複合変数の代入を除き、これは省略可能です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.RS 7n
+.rt  
+\fIvname\fR を連想配列として宣言します。添字は、算術式ではなく文字列です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR\fR
+.ad
+.RS 7n
+.rt  
+変数には、何バイトのデータでも保持できます。データはテキストにすることもバイナリにすることもできます。値は、データの \fBbase64\fR エンコーディングによって表されます。\fB-Z\fR も指定した場合、バッファー内のデータのサイズ (バイト数) は、\fB-Z\fR に関連付けられたサイズで決められます。代入された \fBbase64\fR 文字列がこのデータサイズを超えた場合、切り捨てられます。それ以外の場合は、値が 0 であるバイトが入力されます。データの \fBbase64\fR エンコーディングではなく、このバッファー内の実際のデータを出力するには、\fBprintf\fR の書式である \fB%B\fR を使用できます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-E\fR\fR
+.ad
+.RS 7n
+.rt  
+\fIvname\fR を倍精度浮動小数点数として宣言します。\fIn\fR が \fB0\fR 以外の場合、\fIvname\fR の展開時に使用される有効数字の桁数を定義します。それ以外の場合は、10 桁の有効数字が使用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 7n
+.rt  
+名前は、変数名ではなく関数名を指します。代入は行われません。このオプションとともに指定できるほかのオプションは \fB-t\fR、\fB-u\fR、および \fB-x\fR だけです。\fB-t\fR オプションは、この関数の実行トレースを有効にします。\fB-u\fR フラグは、この関数に「未定義」を示すマークを付けます。関数が参照されると、関数定義を見つけるために \fBFPATH\fR 変数が検索されます。\fB-f\fR 以外のオプションを指定しない場合は、関数定義が標準出力上に表示されます。\fB+f\fR を指定した場合、関数名のあとに、この関数が定義されたファイル (ある場合) の行番号とパス名を示したシェルコメントが記された行が表示されます。
+.sp
+\fB-f\fR では、\fB-i\fR 属性を指定できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-F\fR \fR
+.ad
+.RS 7n
+.rt  
+\fIvname\fR を倍精度浮動小数点数として宣言します。\fIn\fR が \fB0\fR 以外の場合、\fIvname\fR の展開時に使用される小数点以下の位数を定義します。それ以外の場合は、小数点以下 10 位が使用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.RS 7n
+.rt  
+このオプションは、UNIX 以外のマシン上で、UNIX とホスト名ファイルとのマッピング情報を提供します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 7n
+.rt  
+\fIvname\fR を内部で整数を表す値として宣言します。代入の右側は、整数に代入する場合、算術式として評価されます。\fIn\fR が \fB0\fR 以外であればその値を底として定義します。0 の場合、出力の底は 10 です。
+.sp
+\fB-i\fR 属性は、\fB-R\fR、\fB-L\fR、\fB-Z\fR、または \fB-f\fR と同時に指定できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-l\fR\fR
+.ad
+.RS 7n
+.rt  
+大文字をすべて小文字に変換します。大文字オプションの \fB-u\fR は無効になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-L\fR\fR
+.ad
+.RS 7n
+.rt  
+左詰めを行い、先行する空白文字を \fIvalue\fR から取り除きます。\fIn\fR は、\fB0\fR 以外であればフィールドの幅を定義します。0 の場合、フィールドの幅は最初に代入される値の幅で決定されます。変数に値を代入したとき、フィールド幅より短ければ右側にブランクが詰められ、長ければ切り捨てられます。\fB-R\fR オプションは無効になります。
+.sp
+\fB-L\fR では、\fB-i\fR 属性を指定できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 7n
+.rt  
+変数 \fIvname\fR の値で名前が定義されている変数への参照として、\fIvname\fR を宣言します。これは通常、名前が引数として渡された関数内部の変数を参照するために使用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-R\fR\fR
+.ad
+.RS 7n
+.rt  
+右詰めを行い、先行する空白文字を挿入します。\fIn\fR は、\fB0\fR 以外であればフィールドの幅を定義します。0 の場合、フィールドの幅は最初に代入される値の幅で決定されます。変数に値を代入したとき、フィールド幅より短ければ左側にブランクが詰められ、長ければ終端が切り捨てられます。\fB-L\fR オプションは無効になります。
+.sp
+\fB-R\fR では、\fB-i\fR 属性を指定できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 7n
+.rt  
+指定された \fIvname\fR は読み取り専用としてマークされ、これらの名前は、以降の代入で変更できなくなります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 7n
+.rt  
+変数にタグを付けます。タグはユーザーが定義可能で、 シェルに対して特別の意味を持ちません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.RS 7n
+.rt  
+小文字をすべて大文字に変換します。小文字オプションの \fB-l\fR は無効になります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 7n
+.rt  
+指定された \fIvname\fR に対し、あとで実行されるコマンドの環境へ自動的にエクスポートされるようにマークを付けます。名前に . が含まれる変数は、エクスポートできません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-Z\fR\fR
+.ad
+.RS 7n
+.rt  
+最初の、空白文字でない文字が数字で、かつ \fB-L\fR オプションが設定されていない場合、右詰めを行い先頭に 0 を詰めます。\fB-L\fR オプションも設定されている場合は、先頭の 0 を削除します。\fIn\fR は、\fB0\fR 以外であればフィールドの幅を定義します。0 の場合、フィールドの幅は最初に代入される値の幅で決定されます。
+.sp
+\fB-Z\fR では、\fB-i\fR 属性を指定できません。
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBulimit [\fR\fB-HSacdfmnpstv\fR\fB] [\fR \fIlimit\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+リソース制限値を設定または表示します。システムによっては、次に挙げたすべての資源の制限をサポートしていないこともあります。\fIlimit\fR を指定すると、指定したリソースに対して制限値が設定されます。\fIlimit\fR の値は、各リソースに指定された単位の数値、または unlimited という値です。複数のリソースを指定すると、値の前に制限するリソース名と単位とが表示されます。
+.sp
+オプションをすべて省略すると、\fB-f\fR が指定されたものとみなします。
+.sp
+次に、使用可能なリソース制限値を示します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+現在のリソース制限値をすべて表示します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 6n
+.rt  
+コアダンプのサイズをブロック (512 バイト) 単位で表します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR\fR
+.ad
+.RS 6n
+.rt  
+データ領域のサイズを K バイト単位で表します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+現在のプロセスまたは子プロセスが書き込めるファイルのサイズをブロック (512 バイト) 単位で表します。読み込むファイルのサイズに制限はありません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.RS 6n
+.rt  
+指定したリソースに対して強い制限値を設定します。
+.sp
+強い制限値は、いったん設定したらあとで値を上げることはできません。
+.sp
+\fB-H\fR も \fB-S\fR も省略すると、指定した制限値が強い制限と弱い制限の両方に適用されます。\fIlimit\fR 引数を省略すると、現在のリソース制限値が表示されます。このとき、\fB-H\fR が指定された場合を除き、表示されるのは弱い制限値です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR\fR
+.ad
+.RS 6n
+.rt  
+物理メモリーのサイズを K バイト単位で表します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+ファイル記述子数に 1 を加えた値を表します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+.rt  
+パイプバッファリングのブロック (512 バイト) の数を表します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 6n
+.rt  
+スタック領域のサイズを K バイト単位で表します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-S\fR\fR
+.ad
+.RS 6n
+.rt  
+指定したリソースに対して弱い制限値を設定します。
+.sp
+弱い制限値は、強い制限値を超えない範囲で値を上げることが可能です。 
+.sp
+\fB-H\fR も \fB-S\fR も省略すると、指定した制限値が強い制限と弱い制限の両方に適用されます。\fIlimit\fR 引数を省略すると、現在のリソース制限値が表示されます。このとき、\fB-H\fR が指定された場合を除き、表示されるのは弱い制限値です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+各プロセスが CPU を使用する秒数を表します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.RS 6n
+.rt  
+仮想記憶のサイズを K バイト単位で表します。
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBumask\fR \fB[\fR\fB-S\fR\fB]\fR\fB[\fR\fImask\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+ユーザーファイルの作成時のマスクを \fImask\fR 引数が示す値に設定します。\fImask\fR には、\fBchmod\fR(1) で説明する記号値または 8 進数を指定できます。 
+.sp
+記号値を指定すると、新しい \fBumask\fR 値は、\fImask\fR を直前の \fBumask\fR 値の補数に適用した結果の補数になります。\fImask\fR 引数を省略すると、マスクの現在の値を表示します。\fB-S\fR オプションを指定すると、モードは記号値として出力されます。それ以外の場合は、マスクは 8 進数で出力されます。 
+.sp
+\fBumask\fR(2) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+unalias\fR \fB[\fR\fB-a\fR\fB]\fR \fIname\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIname\fR のリストで指定された別名を別名リストから削除します。\fB-a\fR オプションを指定すると、すべての別名が設定解除されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+unset\fR \fB[\fR\fB-fnv\fR\fB]\fR \fIvname\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIvname\fR のリストで指定された変数の設定を解除します。つまり、それらの変数の値と属性を消去します。読み取り専用の変数は設定を解除できません。\fB-f\fR オプションが設定されていると、名前は関数名を表します。\fB-v\fR オプションが設定されていると、名前は変数名を指します。\fB-f\fR オプションは \fB-v\fR を上書きします。\fB-n\fR が設定され、\fIname\fR が名前参照である場合、\fIname\fR が参照する変数ではなく、name の設定が解除されます。デフォルトは \fB-v\fR です。\fBLINENO\fR、\fBMAILCHECK\fR、\fBOPTARG\fR、\fBOPTIND\fR、\fBRANDOM\fR、\fBSECONDS\fR、\fBTMOUT\fR、および \fB_\fR の設定を解除すると、これらの変数の特殊な意味が削除されます。あとでこれらの変数に値を代入しても、特殊な意味はないままです。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwait\fR \fB[\fR\fIjob\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+指定されたジョブの終了を待ち、その終了ステータスを報告します。\fIjob\fR を指定しないと、現在実行中のすべての子プロセスを待ちます。このコマンドの終了ステータスは、\fIjob\fR を指定した場合は、待機する対象の最後のプロセスの終了ステータスです。それ以外は 0 になります。\fIjob\fR の記述形式については、「ジョブ」を参照してください。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhence\fR \fB[\fR\fB-afpv\fR\fB]\fR \fIname ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+各 \fIname\fR ごとに、コマンド名として使用される場合にどのように解釈されるかを指示します。\fB-v\fR オプションを指定すると、より詳細に表示されます。\fB-f\fR オプションを指定すると、関数を検索しません。\fB-p\fR オプションを指定すると、コマンド名が別名、関数、または予約語である場合でも \fIname\fR のパスが検索されます。\fB-a\fR オプションは、-v オプションと似ていますが、指定した名前の解釈がすべて報告される点が異なります。
+.RE
+
+.SS "呼び出し"
+.sp
+.LP
+シェルを \fBexec\fR(2) で呼び出し、0 番目の引数 (\fB$0\fR) の最初の文字が \fB-\fR である場合は、シェルをログインシェルとみなし、\fB/etc/profile\fR からコマンドを読み取ります。次に、現在のディレクトリ内に .\fBprofile\fR が存在するか、または \fB$HOME/.profile\fR がある場合は、そのいずれかのファイルからコマンドを読み取ります。次に、対話型シェルの場合、コマンドは最初に \fB/etc/ksh.kshrc\fR から読み取られ、続いて環境変数 \fBENV\fR の値に対してパラメータ展開、コマンド置換、および算術置換を実行することによって指定された名前のファイルが存在する場合はこのファイルから読み取られます。\fB-s\fR オプションが存在せず、\fIarg\fR と、\fIarg\fR の名前のファイルが存在する場合、このスクリプトを読み取って実行します。それ以外の場合は、最初の \fIarg\fR に \fB/\fR が含まれなければ、最初の \fIarg\fR に対してパス検索を実行し、実行するスクリプトの名前を判定します。\fIarg\fR が示すスクリプトには実行権が必要で、\fBsetuid\fR と \fBsetgid\fR の設定は無視されます。パス上でスクリプトが見つからない場合、\fIarg\fR は組み込みコマンドまたは組み込み関数の名前を示しているものとして処理されます。 
+.sp
+.LP
+続いてコマンドが記述に従って読み取られ、次のオプションがシェルの起動時にシェルによって解釈されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-c\fR オプションを指定すると、最初の \fIarg\fR からコマンドを読み取ります。残りの引数は、\fB0\fR で始まる定位置パラメータになります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB$\fR が前に付いた二重引用符で囲まれている文字列の一覧が標準出力に出力され、シェルが終了します。この文字列セットは、ロケールが C や POSIX でない場合、各国語への変換の対象になります。コマンドは実行されません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-i\fR オプションが指定された場合、またはシェル入出力が端末に接続されている場合 (\fBtcgetattr\fR(3C) を参照)、このシェルは対話型になります。この場合、\fBkill 0\fR が対話型シェルを終了しないように \fBTERM\fR を無視し、wait が割り込み可能になるように \fBINTR\fR を捕らえ、無視します。いずれの場合も、シェルは \fBQUIT\fR を無視します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-R\fR \fIfilename\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-R\fR \fIfilename\fR オプションは、別のユーティリティーで変数およびコマンドの定義および参照の検索に使用できる相互参照データベースを生成するために使用されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-r\fR オプションを指定すると、シェルは制限付きシェルになります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-s\fR オプションが存在する場合、または引数が残っていない場合は、標準入力からコマンドを読み取ります。「特殊コマンド」に記述されているコマンドの出力を除くシェル出力は、ファイル記述子 2 に書き込まれます。\fB\fR
+.RE
+
+.sp
+.LP
+ほかのオプションと引数については、\fBset\fR コマンドの箇所で説明されています。最初の引数としての省略可能な \fB-\fR は無視されます。
+.SS "\fBrksh\fR のみ"
+.sp
+.LP
+\fBrksh\fR は、標準シェルより機能が制限されたログイン名や実行環境を設定するために使用します。
+.sp
+.LP
+\fBrksh\fR の機能は、次の動作ができない点を除いて \fBksh\fR と同じです。
+.RS +4
+.TP
+.ie t \(bu
+.el o
+制限されたオプションの設定解除。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+ディレクトリの変更。\fBcd\fR(1) を参照してください。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBSHELL\fR、\fBENV\fR、\fBFPATH\fR、または \fBPATH\fR の値または属性の設定と設定解除。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB/\fR を含むパス名またはコマンド名の指定。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+出力先のリダイレクト (\fB>\fR、\fB>\fR\fB|\fR、\fB<>\fR、および\fB>>\fR)。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+組み込みコマンドの追加または削除。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBcommand\fR \fB-p\fR を使用したコマンドの呼び出し。
+.RE
+.sp
+.LP
+これらの制限は、.\fBprofile\fR ファイルと \fBENV\fR ファイルの解釈後に有効となります。
+.sp
+.LP
+実行するコマンドがシェル手続きである場合、\fBrksh\fR は \fBksh\fR を呼び出してコマンドを実行します。したがって、利用できるコマンドの種類には制限がありますが、一般ユーザーは標準シェルの全機能を利用できるシェル手続きを使用できます。この方式では、一般ユーザーが同じディレクトリにおいて書き込み権と実行権を持っていないことを想定しています。これらの規則の実際の効果は、.\fBprofile\fR の作成者が確実な設定処理を実行してユーザーを適切な (おそらく、ログインディレクトリ以外の) ディレクトリに置くことにより、ユーザーの動作を完全に制御できるという点にあります。システム管理者は、多くの場合、\fBrksh\fR で安全に起動できるコマンドのディレクトリ (たとえば、\fB/usr/rbin\fR) を設定します。 
+.SH 使用法
+.sp
+.LP
+ファイルが 2G バイト (2^31 バイト) 以上ある場合の \fBksh\fR と \fBrksh\fR の動作については、\fBlargefile\fR(5) を参照してください。
+.SH 終了ステータス
+.sp
+.LP
+次の終了値が返されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0 以外\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルで、構文エラーなどのエラーを検出したときに、\fB0\fR 以外を返します。
+.sp
+シェルを非対話型で使用している場合、シェルファイルの実行は中止されます。ただし、エラーがサブシェル内部で発生した場合は、サブシェルが中止されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fI最後に実行されたコマンドの終了ステータス\fR\fR
+.ad
+.sp .6
+.RS 4n
+最後に実行されたコマンドの終了ステータスを返します。
+.sp
+シェルが検出する実行時エラーは、コマンド名または関数名、およびエラー状態を表示することによって報告されます。エラーが発生した行の番号が 1 より大きい場合は、コマンド名または関数名のあとに角括弧 (\fB[]\fR) で囲んだ行番号も表示します。
+.sp
+詳細は、\fBksh exit\fR コマンドを参照してください。
+.RE
+
+.SH ファイル
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+システム初期化ファイル。ログインシェルに対して実行されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/ksh.kshrc\fR\fR
+.ad
+.sp .6
+.RS 4n
+システム全体の起動ファイル。対話型シェルに対して実行されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$HOME/.profile\fR \fR
+.ad
+.sp .6
+.RS 4n
+個人用初期化ファイル。\fB/etc/profile\fR のあとでログインシェルに対して実行されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$HOME/.kshrc\fR\fR
+.ad
+.sp .6
+.RS 4n
+デフォルトの個人用初期化ファイル。\fBENV\fR が設定されていない場合、対話型シェルに対して \fB/etc/ksh.kshrc\fR のあとで実行されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/suid-profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+代替初期化ファイル。実ユーザー (グループ) ID と実効ユーザー (グループ) ID が一致しない場合、個人用初期化ファイルの代わりに実行されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/dev/null\fR\fR
+.ad
+.sp .6
+.RS 4n
+NULL デバイス。
+.RE
+
+.SH 著者
+.sp
+.LP
+David Korn、\[email protected]\fR
+.SH 属性
+.sp
+.LP
+属性についての詳細は、\fBattributes\fR(5) を参照してください。
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性タイプ属性値
+_
+使用条件system/core-os
+_
+インタフェースの安定性下記を参照。
+.TE
+
+.sp
+.LP
+スクリプト型インタフェースは「不確実」です。環境変数、\fB\&.paths\fR 機能、および編集モードは「流動的」です。
+.SH 関連項目
+.sp
+.LP
+\fBcat\fR(1), \fBcd\fR(1), \fBchmod\fR(1), \fBcut\fR(1), \fBdate\fR(1), \fBegrep\fR(1), \fBecho\fR(1), \fBegrep\fR(1), \fBenv\fR(1), \fBfgrep\fR(1), \fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1), \fBprintf\fR(1), \fBshell_builtins\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBvi\fR(1), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBpathconf\fR(2), \fBpipe\fR(2), \fBsysconf\fR(3C), \fBulimit\fR(2), \fBumask\fR(2), \fBrand\fR(3C), \fBtcgetattr\fR(3C), \fBwait\fR(3C), \fBa.out\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
+.sp
+.LP
+『\fIThe New KornShell Command and Programming Language\fR』、Bolsky, Morris I.、Korn, David G. 共著、PrenticeHall 発行、1995 年
+.sp
+.LP
+『\fIPOSIX-Part 2: Shell and Utilities, IEEE Std 1003.2-1992, ISO/IEC 9945-2\fR』、IEEE、1993 年。
+.SH 注意事項
+.sp
+.LP
+\fBksh\fR スクリプトは、将来の \fBksh\fR への拡張との衝突を避けるため、ISO C99、C++、および JAVA 言語の予約キーワードで使用される名前空間外でシェル関数名を選択するようにしてください。
+.sp
+.LP
+あるコマンドを実行し、そのあとで同一名のコマンドが、検索パスにおいて元のコマンドがあるディレクトリの前に位置するディレクトリにインストールされた場合、シェルは元のコマンドの方を実行し続けます。\fB\fR新しい方のコマンドを実行するには、alias コマンドの \fB-t\fR オプションを使用してください。
+.sp
+.LP
+非常に古いシェルスクリプトの中には、パイプ文字 (\fB|\fR) の同義語としてキャレット (\fB^\fR) を使用するものがあります。
+.sp
+.LP
+複合コマンドの中に \fBhist\fR 組み込みコマンドを指定すると、すべてのコマンドが履歴ファイルから削除されます。
+.sp
+.LP
+\fB\&.\fR\fIfile\fR という組み込みコマンドは、コマンドの実行前にファイル全体を読み取ります。ファイル内の \fBalias\fR コマンドと \fBunalias\fR コマンドは、ファイル内に定義されたどのコマンドにも適用されません。
+.sp
+.LP
+ジョブがフォアグラウンドプロセスを待っている間は、トラップは処理されません。このため、\fBCHLD\fR に対するトラップはフォアグラウンドジョブが終了するまで実行されません。
+.sp
+.LP
+コンマが一部のロケールで小数点と解釈されないようにするために、算術式では、コンマ演算子のあとにスペース文字を残しておくことをお勧めします。 
+.sp
+.LP
+ほかのオペレーティングシステムに移植可能な \fB\&.paths\fR ファイルの作成には、いくつかの制限がある可能性があります。
+.sp
+.LP
+システムが 64 ビットの命令セットをサポートしている場合、\fB/bin/ksh\fR は 64 ビットバージョンの \fBksh\fR を実行します。
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/ksh.1.zh_CN.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,6235 @@
+'\" te
+.\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2009, 2011, Oracle and/or its affiliates. 保留所有权利。
+.TH ksh 1 "2011 年 7 月 9 日" "SunOS 5.11" "用户命令"
+.SH 名称
+ksh, ksh93, rksh \- Korn Shell,一种标准和受限的命令与编程语言
+.SH 用法概要
+.LP
+.nf
+\fBksh\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [ \fB\(+-o\fR \fIoption\fR] ...
+       [-] [\fIarg\fR ...]
+.fi
+
+.LP
+.nf
+\fBrksh\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [\fB\(+-o\fR \fIoption\fR] ...
+       [-] [\fIarg\fR ...]
+.fi
+
+.SH 描述
+.sp
+.LP
+\fBksh\fR 是一种执行从终端或文件读取的命令的命令与编程语言。\fBrksh\fR 是命令解释程序 \fBksh\fR 的受限版本。\fBrksh\fR 用于设置登录名和执行环境,其功能比标准 shell 的功能更受约束。
+.sp
+.LP
+有关此 shell 的参数的含义,请参见\fB调用\fR。
+.SS "定义"
+.sp
+.LP
+\fI元字符\fR定义为下列字符之一:
+.sp
+.in +2
+.nf
+; & ( ) | < > NEWLINE SPACE TAB
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+\fI空白\fR为\fB制表符\fR或\fB空格\fR。 
+.sp
+.LP
+\fI标识符\fR是以字母或下划线开头的字母、数字或下划线的序列。标识符用作\fI变量名称\fR的组成部分。 
+.sp
+.LP
+\fIvname\fR 是由句点 (\fB\&.\fR) 分隔的一个或多个标识符的序列,并且可选择性地在此序列前面添加一个句点 (\fB\&.\fR)。\fIvname\fR 用作函数和变量名称。 
+.sp
+.LP
+\fI单词\fR是当前语言环境定义的字符集合中的\fI字符\fR的序列(不包括不带引号的\fI元字符\fR)。
+.sp
+.LP
+\fI命令\fR是 shell 语言的语法中的字符序列。shell 读取各个命令,并直接执行或通过调用单独的实用程序执行所需操作。内置命令是由 shell 自身执行且未创建单独的进程的命令。某些命令用作内置命令的原因仅仅是出于方便,这些命令不在本手册页的论述范围内。本手册页记录了对 shell 环境造成负面影响的内置命令以及在执行路径搜索前发现的内置命令(请参见\fB执行\fR)。出于历史原因,其中的某些内置命令的行为不同于其他内置命令的行为,这些命令称为特殊内置命令。
+.SS "Commands(命令)"
+.sp
+.LP
+\fI简单命令\fR是一个变量赋值的列表(请参见\fB变量赋值\fR),或是一个可在其前面添加变量赋值列表的以\fI空白\fR分隔的单词序列。请参见本手册页的\fB环境\fR部分。
+.sp
+.LP
+第一个单词指定要执行的命令的名称。除非在此节中指定,否则其余单词将作为参数传递到调用的命令。命令名称作为参数 0 传递。请参见 \fBexec\fR(2)。简单命令的\fI值\fR即为其退出状态。如果简单命令正常终止,其值为 \fB0\fR-\fB255\fR。如果简单命令异常终止,其值为 \fB256+\fR\fIsignum\fR。与退出状态对应的信号的名称可通过 kill 内置实用程序的 \fB-l\fR 选项获取。 
+.sp
+.LP
+\fI管道\fR是由 \fB|\fR 分隔的一个或多个命令的序列。 每个命令(最后一个命令除外)的标准输出都通过 \fBpipe\fR(2) 连接到下一命令的标准输入。每个命令(可能除最后一个命令以外)都作为单独的进程运行。shell 等待最后一个命令终止。除非启用了 \fBpipefail\fR 选项,否则管道的退出状态即为最后一个命令的退出状态。每个管道前面都可以添加保留字 \fB!\fR。如果最后一个命令的退出状态为\fB非零\fR,此操作会导致管道的退出状态变为 \fB0\fR;如果最后一个命令的退出状态为 \fB0\fR,则会导致管道的退出状态变为 \fB1\fR。
+.sp
+.LP
+\fI列表\fR是由 \fB;、&、|&、&& 或 |\fR 分隔的一个或多个管道的序列,并且该序列可以选择性地以 \fB;、&\fR 或 \fB|&\fR 结束。在这五个符号中,\fB;、&\fR 和 \fB|& \fR的优先级相同,这些符号的优先级低于 \fB&&\fR 和 \fB||\fR 的优先级。同时,符号 \fB&&\fR 和 \fB||\fR 也具有相同的优先级。 
+.sp
+.LP
+分号 (\fB;\fR) 导致按顺序执行前面的管道。和符号 (\fB&\fR) 导致异步执行前面的管道,也即,shell \fI不\fR会等待该管道完成。符号 \fB |&\fR 导致异步执行前面的管道,并建立一个到父 shell 的双向管道。通过向命令应用重定向运算符 \fB<&\fR 和 \fB >&\fR 以及 \fBarg p\fR,并通过使用内置命令 \fBread\fR 和 \fBprint\fR 的 \fB-p\fR 选项,父 shell 可以写入和读取派生的管道的标准输入和输出。符号 \fB&&\fR (\fB||\fR) 导致仅当前面的管道返回零(\fB非零\fR)值时才会执行该符号后面的\fI列表\fR。\fI列表\fR中可显示一个或多个换行符(而非分号)来分隔命令。如果\fI列表\fR的第一个\fI管道\fR的第一个\fI项\fR是一个并非以重定向开头且未出现在 \fBwhile\fR、\fBuntil\fR 或 \fBif\fR \fI列表\fR中的简单命令,则可以在此项前面添加一个分号。除非使用 \fBset\fR 内置命令按照说明启用 \fBshowme\fR 选项,否则将忽略此分号。
+.sp
+.LP
+\fI命令\fR要么是一个简单命令,要么是以下列表中的命令之一。除非另行说明,否则命令返回的值即为该命令中执行的最后一个简单命令的值。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfor\fR \fIvname\fR \fB[ in\fR \fIword\fR \fB\&... ] ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+每次执行 \fBfor\fR 命令时,\fIvname\fR 都会设置为从 \fBin\fR \fIword\fR 列表获取的下一个 \fIword\fR。如果省略了 \fBin\fR \fIword ...\fR,\fBfor\fR 命令针对每个位置参数执行一次 \fBdo\fR \fIlist\fR,这些位置参数从 1 开始设置。当此列表中没有任何其他单词时,执行随即结束。请参见\fB参数扩展\fR。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(( [\fR\fIexpr1\fR\fB] ; [\fR\fIexpr2\fR] ; [\fIexpr3\fR\fB] )) ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+首先计算算术表达式 \fIexpr1\fR。反复计算算术表达式 \fIexpr2\fR,直到其计算结果为\fB零\fR为止;如果计算结果为\fB非零\fR,则会执行 \fIlist\fR,并计算算术表达式 \fIexpr3\fR。如果省略了任何表达式,该表达式按照计算结果为 \fB1\fR 的方式运行。请参见\fB算术计算\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBselect\fR \fIvname\fR [ in \fIword\fR \fB\&... ] ;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBselect\fR 命令在标准错误(文件描述符 2)中输出一组 \fIword\fR,每个 word 前面均带有一个数字。如果省略了 \fBin\fR \fIword...\fR,则改用从 \fB1\fR 开始的位置参数。请参见\fB参数扩展\fR。输出 \fBPS3\fR 提示,并从标准输入中读取一个行。如果此行包含列出的某个 \fIword\fR 的数字,那么变量 \fIvname\fR 的值设置为与该数字对应的 \fIword\fR。如果此行为空,则会重新输出选择列表。否则,变量 \fIvname\fR 的值设置为 \fBnull\fR。从标准输入读取的行的内容保存在变量 \fBREPLY\fR 中。在遇到中断符或 \fBEOF\fR 之前,系统会针对每个选择执行 \fIlist\fR。如果通过执行 \fIlist\fR 将 \fBREPLY\fR 变量设置为 \fBnull\fR,则会输出选择列表,然后为下一选择显示 \fBPS3\fR 提示。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcase\fR \fIword\fR \fBin [ [(]\fR \fIpattern\fR \fB[ |\fR \fIpattern\fR \fB] ... )\fR \fIlist\fR \fB;; ] ... esac\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBcase\fR 命令执行与 \fIword\fR 匹配的第一个 \fIpattern\fR 的关联 \fIlist\fR。模式的格式与用于生成文件名的格式相同。请参见\fB文件名生成\fR。 
+.sp
+\fB;;\fR 运算符导致终止执行 \fBcase\fR。如果使用 \fB;&\fR 取代 \fB;;\fR,则会执行下一个后续列表(如果有)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBif\fR \fIlist\fR \fB;then\fR \fIlist\fR \fB[ ;elif\fR \fIlist\fR \fB;then\fR \fIlist\fR ] \fB\&... [ ;else\fR \fIlist\fR \fB ]\fR \fB;fi\fR\fR
+.ad
+.sp .6
+.RS 4n
+执行 \fBif\fR 后面的 \fIlist\fR,并且如果返回\fB零\fR退出状态,则执行第一个 \fBthen\fR 后面的 \fIlist\fR。否则执行 \fBelif\fR 后面的 \fIlist\fR,如果其值为\fB零\fR,则执行下一个 \fBthen\fR 后面的 \fIlist\fR。如果执行每个连续的 \fBelif\fR \fIlist\fR 失败,则会执行 \fBelse\fR \fIlist\fR。如果 \fBif\fR \fIlist\fR 具有\fB非零\fR退出状态,并且没有 \fBelse\fR \fIlist\fR,\fBif\fR 命令会返回\fB零\fR退出状态。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhile\fR \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.br
+.na
+\fBuntil \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBwhile\fR 命令反复执行 while \fIlist\fR,并且如果此列表中的最后一个命令的退出状态为零,则会执行\fBdo\fR \fIlist\fR,否则循环将终止。如果未执行 \fBdo\fR \fIlist\fR 中的命令,\fBwhile\fR 命令将返回\fB零\fR退出状态,并且可使用 \fBuntil\fR 替换 \fBwhile\fR,以便对循环终止测试求反。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB((\fR\fI表达式\fR\fB))\fR\fR
+.ad
+.sp .6
+.RS 4n
+使用本手册页中介绍的算术计算规则计算 \fIexpression\fR。如果算术表达式的值为\fB非零\fR,退出状态为 \fB0\fR。否则,退出状态为 \fB1\fR。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fIlist\fR\fB;)\fR\fR
+.ad
+.sp .6
+.RS 4n
+在单独的环境中执行 list。如果需要两个相邻的左括号以便进行嵌套,必须插入一个空格以免作为算术命令计算(如本部分所属)。
+.sp
+完全执行 \fIlist\fR。与元字符不同的是,\fB(\fR 和 \fB)\fR 以及 \fB{\fR 和 \fB}\fR 是\fI保留字\fR,它们必须出现在行开头或 \fB;\fR 之后才能识别。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[[\fR \fI表达式\fR \fB]]\fR\fR
+.ad
+.sp .6
+.RS 4n
+计算 \fIexpression\fR 并在 \fIexpression\fR 为 True 时返回\fB零\fR退出状态。有关 \fIexpression\fR 的说明,请参见\fB条件表达式\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfunction\fR \fIvarname\fR \fB{\fR \fIlist\fR \fB;}\fR\fR
+.ad
+.br
+.na
+\fB\fIvarname\fR \fB() {\fR \fIlist\fR \fB;}\fR\fR
+.ad
+.sp .6
+.RS 4n
+定义 \fIvarname\fR 引用的函数。其 \fIvarname\fR 包含 \fB\&.\fR 的函数称为规程函数,并且最后一个 \fB\&.\fR 前面的 \fIvarname\fR 部分必须引用现有变量。 
+.sp
+函数主体是 \fB{\fR 和 \fB}\fR 之间的命令的 \fIlist\fR。此外,使用函数 \fIvarname\fR 语法定义的函数还可用作 \fB\&.\fR 特殊内置命令的参数,以便获取使用 \fIvarname\fR\fB()\fR 语法定义它的等效行为。请参见\fB函数\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtime [\fR \fIpipeline\fR \fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果省略了 \fIpipeline\fR,则会在标准错误中输出当前 shell 和已完成的子进程的用户和系统时间。否则执行 \fIpipeline\fR,并在标准错误中输出已用时间以及用户和系统时间。\fBTIMEFORMAT\fR 变量可设置为格式字符串,用于指定时间信息的显示方式。有关 \fBTIMEFORMAT\fR 变量的说明,请参见 \fBShell 变量\fR。 
+.RE
+
+.sp
+.LP
+下列保留字仅作为命令的第一个字且未带引号时才能识别为保留字: 
+.br
+.in +2
+\fBcase\fR
+.in -2
+.br
+.in +2
+\fBdo\fR
+.in -2
+.br
+.in +2
+\fBdone\fR
+.in -2
+.br
+.in +2
+\fBelse\fR
+.in -2
+.br
+.in +2
+\fBelif\fR
+.in -2
+.br
+.in +2
+\fBesac\fR
+.in -2
+.br
+.in +2
+\fBfor\fR
+.in -2
+.br
+.in +2
+\fBfi\fR
+.in -2
+.br
+.in +2
+\fBfunction\fR
+.in -2
+.br
+.in +2
+\fBif\fR
+.in -2
+.br
+.in +2
+\fBselect\fR
+.in -2
+.br
+.in +2
+\fBthen\fR
+.in -2
+.br
+.in +2
+\fBtime\fR
+.in -2
+.br
+.in +2
+\fBuntil\fR
+.in -2
+.br
+.in +2
+\fBwhile\fR
+.in -2
+.br
+.in +2
+\fB{ }\fR
+.in -2
+.br
+.in +2
+\fB[[ ]]\fR
+.in -2
+.br
+.in +2
+\fB!\fR
+.in -2
+.SS "变量赋值"
+.sp
+.LP
+一个或多个变量赋值可启动简单命令,也可用作 \fBtypeset\fR、\fBexport\fR 或 \fBreadonly\fR 特殊内置命令的参数。\fI赋值\fR语法格式如下所示:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIvarname\fR\fB=\fR\fIword\fR\fR
+.ad
+.br
+.na
+\fB\fIvarname\fR\fB[\fR\fIword\fR\fB]=\fR\fIword\fR\fR
+.ad
+.sp .6
+.RS 4n
+禁止在 \fIvarname\fR 和 \fB=\fR 之间或者 \fB=\fR 和 \fIword\fR 之间使用空格。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIvarname\fR\fB=(\fR\fIassignlist\fR\fB)\fR\fR
+.ad
+.sp .6
+.RS 4n
+禁止在 \fIvarname\fR 和 \fB=\fR 之间使用空格。\fIassignlist\fR 可以为下列值之一:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIword ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+索引数组赋值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIword\fR\fB]=\fR\fIword ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+关联数组赋值。如果带有 \fBtypeset\fR \fB-a\fR 前缀,则改为创建索引数组。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fI赋值 ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+复合变量赋值。这会创建一个带有子变量的复合变量 \fIvarname\fR,子变量的格式为 \fIvarname.name\fR,其中 \fIname\fR 是赋值的名称部分。\fIvarname\fR 的值包含所有赋值元素。同时,对 \fIvarname\fR 的子变量进行的其他赋值也会显示为 \fIvarname\fR 的值的一部分。如果未指定 \fIassignment\fR,\fIvarname\fR 则为允许定义后续子元素的复合变量。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtypeset [\fR\fIoptions\fR] \fIassignment\fR \fB\&...\fR\fR
+.ad
+.sp .6
+.RS 4n
+嵌套变量赋值。通过用 \fB;\fR 分隔每个赋值,可以指定多个赋值。前一个值将在赋值之前取消设置。
+.RE
+
+此外,可以使用 \fB+=\fR 替换 \fB=\fR 以表示添加或附加到前一个值。如果将 \fB+=\fR 应用到算术类型,\fIword\fR 将作为算术表达式计算,并添加到当前值。如果应用到字符串变量,则会将 \fIword\fR 定义的值附加到当前值。对于复合赋值,不会取消设置前一个值,并且只要类型兼容,新值便会附加到当前值。 
+.RE
+
+.SS "Comments(注释)"
+.sp
+.LP
+以 \fB#\fR 开头的单词将导致注释掉或忽略该单词以及换行符之前的所有后续字符。
+.SS "别名设置"
+.sp
+.LP
+如果为各个命令的第一个单词定义了别名,则会使用别名文本替换此单词。别名由任意数目的字符组成,其中不包括元字符、引号字符、文件扩展字符、参数扩展字符、命令替换字符以及 \fB=\fR。替换字符串可包含任何有效的 shell 脚本,其中包括在\fB命令\fR部分中列出的元字符。除正在替换的所有文本以外,将对被替换文本中的各个命令的第一个单词的别名进行测试。如果别名值的最后一个字符为空白,还会检查此别名后的单词以便进行别名替换。 
+.sp
+.LP
+别名可用于重新定义内置命令,但不能用于重新定义在\fB命令\fR部分中列出的保留字。使用 alias 命令可以创建并列出别名,使用 \fBunalias\fR 命令可以删除别名。
+.sp
+.LP
+别名设置在读取脚本时执行,而不是在执行脚本时执行。为使别名生效,必须在读取引用该别名的命令之前执行 \fBalias\fR 定义命令。下列别名已编译到 shell 中,但是可以取消设置或重新定义这些别名:
+.sp
+.in +2
+.nf
+autoload='typeset -fu'
+command='command '
+fc=hist
+float='typeset -lE'
+functions='typeset -f'
+hash='alias -t --'
+history='hist -l'
+integer='typeset -li'
+nameref='typeset -n'
+nohup='nohup '
+r='hist -s'
+redirect='command exec'
+source='command .'
+stop='kill -s STOP'
+suspend='kill -s STOP $$'
+times='{ { time;} 2>&1;}'
+type='whence -v'
+.fi
+.in -2
+.sp
+
+.SS "波浪号替换"
+.sp
+.LP
+执行别名替换之后,系统将检查每个单词,查看此单词是否以不带引号的波浪号 (\fB~\fR) 开头。要进行波浪号替换,\fIword\fR 还会引用参数扩展的 \fIword\fR 部分。请参见\fB参数扩展\fR。 
+.sp
+.LP
+如果满足此条件,则会检查 \fB/\fR 前的单词,确定它是否与口令数据库中的用户名相匹配。如果找到匹配项,\fB~\fR 及匹配的登录名将替换为匹配用户的登录目录。如果未找到匹配项,原始文本将保留不变。单独的 \fB~\fR 或位于 \fB/\fR 之前的 ~ 替换为 \fB$HOME\fR。后跟有 \fB+\fR 或 \fB-\fR 的 \fB~\fR 分别替换为 \fB$PWD\fR 和 \fB$OLDPWD\fR 的值。
+.sp
+.LP
+此外,当赋值的值以 \fB~\fR 开头以及当 \fB~\fR 显示在冒号 (\fB:\fR) 之后时,扩展\fI变量赋值\fR时会尝试替换波浪号。同时,\fB~\fR 登录名还会以 \fB:\fR 结束。
+.SS "命令替换"
+.sp
+.LP
+前面带有美元符号 (\fB$\fR) 或一对重音符 (\fB``\fR) 的括号所包含的命令的标准输出可用作单词的一部分或整个单词。尾随的换行符将被删除。在第二种格式(已过时)中,在执行命令之前将处理引号中的字符串,以便替换为特殊引号字符。请参见\fB引用\fR。 
+.sp
+.LP
+命令替换 \fB$(cat file)\fR 可替换为速度更快的等效 \fB$(<file)\fR。命令替换 \fB$(\fR\fIn\fR\fB<#)\fR 扩展至文件描述符 \fIn\fR 的当前字节偏移。
+.SS "算术替换"
+.sp
+.LP
+前面带有美元符号的双括号所包含的算术表达式 (\fB$((\fR\fIarithmetic_expression\fR\fB))\fR) 替换为双括号中的算术表达式的值。
+.SS "进程替换"
+.sp
+.LP
+仅在支持使用 \fB/dev/fd\fR 目录命名打开文件的 UNIX 操作系统版本上提供进程替换。 
+.sp
+.LP
+\fB<(\fR\fIlist\fR\fB)\fR 或 \fB>(\fR\fIlist\fR\fB)\fR 格式的每个命令参数都会运行异步连接到 \fB/dev/fd\fR 中的某个文件的进程 \fIlist\fR。此文件的名称即为该命令的参数。如果选择采用 \fB>\fR 的格式,在此文件中写入会为 \fIlist\fR 提供输入。如果采用 \fB<\fR,作为参数传递的文件则包含 \fIlist\fR 进程的输出。 
+.sp
+.LP
+例如,
+.sp
+.in +2
+.nf
+paste <(cut -f1 \fIfile1\fR) <(cut -f3 \fIfile2\fR) | tee \e
+     >(\fIprocess1\fR) >(\fIprocess2\fR)
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+分别对文件 \fIfile1\fR 和 \fIfile2\fR 中的字段 1 和 3 执行 \fBcut\fR 操作,将结果 \fBpaste\fR 在一起,并将其发送到进程 \fIprocess1\fR 和 \fIprocess2\fR。该命令还会向标准输出显示此结果。作为参数传递给命令的文件为 UNIX \fBpipe\fR(2)。需要对此文件执行 \fBlseek\fR(2) 的程序无法运行。 
+.SS "参数扩展"
+.sp
+.LP
+参数是一个变量、一个或多个数字或 \fB*\fR、\fB@\fR、\fB#\fR、\fB?\fR、\fB-\fR、\fB$\fR 和 \fB!\fR 中的任意字符。变量通过 \fIvname\fR 表示。要创建其 \fIvname\fR 包含 \fB\&.\fR 的变量,必须已存在一个如下变量:其 \fBvname\fR 在最后一个 . 之前包括所有内容。变量具有一个值以及零个或多个属性。通过使用 \fBtypeset\fR 特殊内置命令,可以为变量分配值和属性。后文介绍了 shell 支持的属性以及 \fBtypeset\fR 特殊内置命令。导出的变量向环境传递值和属性。 
+.sp
+.LP
+此 shell 支持索引数组和关联数组。数组变量的元素由下标引用。索引数组的下标通过 \fB[\fR 和 \fB]\fR 之间的算术表达式表示(请参见\fB算术计算\fR)。使用 \fBset -A\fR \fIvname value ...\fR 为索引数组分配值。所有下标的值必须介于范围 \fB0\fR 至 \fB1,048,575\fR 之间。索引数组不需要声明。对带有有效下标的变量的任何引用都是合法的,并且会根据需要创建数组。 
+.sp
+.LP
+关联数组使用 \fBtypeset\fR 的 \fB-A\fR 选项创建。关联数组的下标通过包含在 \fB[\fR 和 \fB]\fR 之间的字符串表示。 
+.sp
+.LP
+引用不带下标的任何数组与引用带有下标 \fB0\fR 的数组等效。
+.sp
+.LP
+变量的值可通过以下命令分配:
+.sp
+.in +2
+.nf
+\fIvname\fR=\fIvalue\fR [\fIvname\fR=\fIvalue\fR] ...
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+或
+.sp
+.in +2
+.nf
+\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR [\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR] ...
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+禁止在 \fB=\fR 前后使用空格。\fInameref\fR 是一个引用其他变量的变量。\fInameref\fR 使用 \fBtypeset\fR 的 \fB-n\fR 属性创建。执行 \fBtypeset\fR 命令时的变量值成为使用 \fInameref\fR 变量时引用的变量。\fInameref\fR 的名称不能包含点 (\fI\&.\fR)。如果变量或函数名称包含 \fB\&.\fR,并且第一个 \fB\&.\fR 前的名称部分与 \fInameref\fR 的名称匹配,通过将 \fInameref\fR 部分替换为 \fInameref\fR 引用的变量名称可以获取引用的变量。如果将 \fInameref\fR 用作 \fBfor\fR 循环的索引,则会为列表中的每一项建立一个名称引用。\fInameref\fR 提供了一种在函数中引用变量的方便方法,该变量的名称作为参数传递给函数。例如,如果变量名称作为第一个参数传递给函数,该函数中的命令
+.sp
+.in +2
+.nf
+ typeset -n var=$1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+导致将 \fIvar\fR 的引用和赋值作为其名称已传递给函数的变量的引用和赋值。如果为 \fIvname\fR 设置了浮点值属性 \fB-E\fR 或 \fB-F\fR 或者整数属性 \fB-i\fR,该 \fIvalue\fR 则受算术计算的约束,如本手册页所述。位置参数是通过数字表示的参数,可使用 \fBset\fR 特殊内置命令向这些参数分配值。当调用 shell 时,参数 \fB$0\fR 从参数零开始设置。字符 \fB$\fR 用于引入可替换的参数。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+此 shell 读取从 \fB${\fR 到匹配的 \fB}\fR 之间的所有字符,并将其作为同一个单词的一部分,即使此部分包含花括号或元字符。该参数的值(如果有)将被替换。当 \fIparameter\fR 后跟有不会作为其名称的一部分解释的字母、数字或下划线时,当变量名称包含 \fB\&.\fR 时或者当变量带有下标时,都需要使用花括号。如果 \fIparameter\fR 是一个或多个数字,该参数则为位置参数。包含多个数字的位置参数必须包含在花括号中。如果 \fIparameter\fR 是 \fB*\fR 或 \fB@\fR,则会替换从 \fB$1\fR 开始的所有位置参数,并使用字段分隔符分隔这些参数。如果使用带有下标 \fB*\fR 或 \fB@\fR 的数组 \fIvname\fR,则会替换每个元素的值,并使用 \fBIFS\fR 的值的第一个字符分隔这些值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${#\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果 \fIparameter\fR 为 \fB*\fR 或 \fB@\fR,则会替换位置参数的数字。否则替换 \fIparameter\fR 的值的长度。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${#\fR\fIvname\fR\fB[*]}\fR\fR
+.ad
+.br
+.na
+\fB\fB${#\fR\fIvname\fR\fB[@]}\fR\fR
+.ad
+.sp .6
+.RS 4n
+替换数组 \fIvname\fR 中的元素数目。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIvname\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+扩展至 \fIvname\fR 引用的变量的名称。除非 \fIvname\fR 为名称引用,否则为 \fIvname\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIvname\fR\fB[\fR\fIsubscript\fR\fB]}\fR\fR
+.ad
+.sp .6
+.RS 4n
+除非 \fIsubscript\fR 为 \fB*\fR 或 \fB@\fR,否则扩展至下标的名称。当 \fIsubscript\fR 为 \fB*\fR 时,生成 \fIvname\fR 的数组下标的列表。对于不是数组的变量,如果设置了该变量,则值为 \fB0\fR。否则为 \fBnull\fR。当 \fIsubscript\fR 为 \fB@\fR 时,该命令与 \fB$ {\fR\fIvname\fR\fB[\fR\fI *\fR\fB]}\fR 相同,除非用于双引号中,此时,每个数组下标将生成一个单独的参数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${!\fR\fIprefix\fR\fB*}\fR\fR
+.ad
+.sp .6
+.RS 4n
+扩展至其名称以 \fIprefix\fR 开头的变量的名称。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:-\fR\fIword\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果 \fIparameter\fR 已设置且不为 Null,则替换其值。否则替换 \fIword\fR。
+.sp
+除非将 \fIword\fR 用作被替换的字符串,否则不会计算它的值。 
+.sp
+在下面的示例中,仅当 \fBd\fR 未设置或者为 NULL 时,才会执行 \fBpwd\fR:
+.sp
+.in +2
+.nf
+print ${d:-$(pwd)}
+.fi
+.in -2
+.sp
+
+如果表达式中省略了冒号 (\fB:\fR),此 shell 仅检查是否设置了 \fIparameter\fR。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR:\fIlength\fR}\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+扩展至 \fIparameter\fR 的值的以下部分:从作为算术表达式扩展偏移量所确定的字符开始(从 \fB0\fR 开始算起),并且该部分包含的字符数由 \fIlength\fR 定义的算术表达式确定。 
+.sp
+在第二种格式中,使用相应值的剩余部分。负偏移量从 \fIparameter\fR 末尾开始往后计数。
+.sp
+减号前需要一个或多个空白,以免此 shell 将此运算符解释为 \fB:-\fR。如果 parameter 为 \fB*\fR 或 \fB@\fR,或者为 \fB*\fR 或 \fB@\fR 索引的数组名称,\fIoffset\fR 和 \fIlength\fR 分别表示数组索引和元素数目。相对于索引数组的最高下标而言,采用的负 \fIoffset\fR 比此最高下标大 1。未指定关联数组的顺序。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB#\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB##\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果 shell \fIpattern\fR 与 \fIparameter\fR 的值的开头匹配,此扩展的值即为删除了匹配部分的 \fIparameter\fR 的值。否则会替换此 \fIparameter\fR 的值。在第一种格式中,删除了最小匹配 \fIpattern\fR,在第二种格式中,删除了最大匹配 \fIpattern\fR。如果 \fIparameter\fR 为 \fB@\fR、\fB*\fR,或者为带有下标 \fB@\fR 或 \fB*\fR 的数组变量,则会依次对每个元素应用求子串操作。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB%\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB%%\fR\fIpattern\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果 shell \fIpattern\fR 与 \fIparameter\fR 的值的末尾匹配,此扩展的值即为删除了匹配部分的 parameter 的值。否则会替换 \fIparameter\fR 值。在第一种格式中,删除了最小匹配 pattern,在第二种格式中,删除了最大匹配 pattern。如果 parameter 为 \fB@\fR、\fB*\fR,或者为带有下标 \fB@\fR 或 \fB*\fR 的数组变量,则会依次对每个元素应用求子串操作。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB/\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB//\fR\fI pattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB/#\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.br
+.na
+\fB\fB${\fR\fIparameter\fR\fB/%\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
+.ad
+.sp .6
+.RS 4n
+扩展 \fIparameter\fR,并使用指定 \fIstring\fR 替换 \fIpattern\fR 的最长匹配项。\fIstring\fR 中的 \fB\e\fR\fIn\fR 的每个匹配项都替换为与第 \fIn\fR\fB\fR 个子模式匹配的 \fIparameter\fR 部分。 
+.sp
+如果 \fIstring\fR 为 null,则会删除 \fIpattern\fR,并且可省略 string 前面的 \fB/\fR。如果 \fIparameter\fR 为 \fB@\fR、\fB*\fR,或者为带有下标 \fB@\fR 或 \fB*\fR 的数组变量,则会依次对每个元素应用替换操作。此种情况下,将针对每个元素重新计算 \fIword\fR 的 \fIstring\fR 部分。
+.sp
+在第一种格式中,仅替换 \fIpattern\fR 的第一个匹配项。 
+.sp
+在第二种格式中,\fIpattern\fR 的每个匹配项都将替换为指定 \fIstring\fR。 
+.sp
+第三种格式将模式匹配限制为 \fIstring\fR 的开头。 
+.sp
+第四种格式将模式匹配限制为 \fIstring\fR 的末尾。 
+.RE
+
+.sp
+.LP
+shell 自动设置下列参数:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 19n
+.rt  
+位置参数的数目(以十进制表示)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 19n
+.rt  
+在调用时或通过 \fBset\fR 命令向 shell 提供的选项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 19n
+.rt  
+执行的最后一个命令所返回的十进制值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 19n
+.rt  
+此 shell 的进程数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB_\fR\fR
+.ad
+.RS 19n
+.rt  
+一开始时,\fB_\fR 的值是在环境中传递时所执行的 shell 或脚本的绝对路径名。然后会为该值分配上一命令的最后一个参数。 
+.sp
+对于异步命令,未设置此参数。此参数还可用于保存查看邮件时的匹配 \fBMAIL\fR 文件的名称。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR\fR
+.ad
+.RS 19n
+.rt  
+调用的最后一个后台命令的进程数或使用 \fBbg\fR 内置命令放置到后台的最新作业。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.command\fR\fR
+.ad
+.RS 19n
+.rt  
+当处理 \fBDEBUG\fR 陷阱时,此变量包含即将运行的最新命令行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edchar\fR\fR
+.ad
+.RS 19n
+.rt  
+此变量包含处理 \fBKEYBD\fR 陷阱时已输入的键盘字符(如果第一个字符为 ESC、\fBASCII 033\fR,则为字符序列)的值。如果在陷阱操作中更改了此值,则会使用新值替换导致此陷阱的键(或键序)。请参见本手册页的\fB键绑定\fR部分。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edcol\fR\fR
+.ad
+.RS 19n
+.rt  
+执行最新的 \fBKEYBD\fR 陷阱时光标所在的字符位置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edmode\fR\fR
+.ad
+.RS 19n
+.rt  
+当在 \fBvi\fR 插入模式下处理 \fBKEYBD\fR 陷阱时,该值设置为 ESC。否则,当处理 \fBKEYBD\fR 陷阱时,\fB\&.sh.edmode\fR 为 null。请参见本手册页的 \fBvi 编辑模式\fR部分。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.edtext\fR\fR
+.ad
+.RS 19n
+.rt  
+执行最新的 \fBKEYBD\fR 陷阱时输入缓冲区中的字符。如果未在处理 \fBKEYBD\fR 陷阱,该值则为 null。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.file\fR\fR
+.ad
+.RS 19n
+.rt  
+包含当前命令的文件的路径名。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.fun\fR\fR
+.ad
+.RS 19n
+.rt  
+正在执行的当前函数的名称。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.match\fR\fR
+.ad
+.RS 19n
+.rt  
+将最新匹配项及子模式匹配项存储在匹配的条件模式匹配项以及使用运算符 \fB#\fR、\fB%\fR 或 \fB/\fR 的变量扩展之后的索引数组。第 \fB0\fR 个元素存储完整匹配项,第 \fIi\fR 个元素存储第 \fIi\fR 个子匹配项。当为扩展的变量分配了新值时,\fB\&.sh.match\fR 变量将取消设置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.name\fR\fR
+.ad
+.RS 19n
+.rt  
+设置为调用规程函数时的变量的名称。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.subscript\fR\fR
+.ad
+.RS 19n
+.rt  
+设置为调用规程函数时的变量的名称下标。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.subshell\fR\fR
+.ad
+.RS 19n
+.rt  
+子 shell 和命令替换的当前深度。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.value\fR\fR
+.ad
+.RS 19n
+.rt  
+设置为调用 set 或 append 规程函数时的变量的值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.sh.version\fR\fR
+.ad
+.RS 19n
+.rt  
+设置为标识此 shell 的版本的值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLINENO\fR\fR
+.ad
+.RS 19n
+.rt  
+正在执行的脚本或函数中的当前行号。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOLDPWD\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBcd\fR 命令设置的早期工作目录。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOPTARG\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBgetopts\fR 内置命令处理的最后一个选项参数的值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBOPTIND\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBgetopts\fR 内置命令处理的最后一个选项参数的索引。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPPID\fR\fR
+.ad
+.RS 19n
+.rt  
+shell 的父级的进程数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPWD\fR\fR
+.ad
+.RS 19n
+.rt  
+\fBcd\fR 命令设置的当前工作目录。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRANDOM\fR\fR
+.ad
+.RS 19n
+.rt  
+每次引用此变量时,将生成一个在 \fB0\fR 和 \fB32767\fR 之间统一分布的随机整数。通过为 \fBRANDOM\fR 分配一个数值,可以初始化随机数字的序列。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBREPLY\fR\fR
+.ad
+.RS 19n
+.rt  
+如果未提供参数,此变量则由 \fBselect\fR 语句和 \fBread\fR 内置命令设置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSECONDS\fR\fR
+.ad
+.RS 19n
+.rt  
+每次引用此变量时,将返回自调用 shell 以来所经过的秒数。如果为此变量分配了一个值,引用时返回的值即为此分配的值以及自分配以来所经过的秒数。
+.RE
+
+.sp
+.LP
+shell 使用下列变量:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCDPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+定义 \fBcd\fR 命令的搜索路径。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCOLUMNS\fR\fR
+.ad
+.RS 14n
+.rt  
+定义 shell 编辑模式的编辑窗口以及用于输出选择列表的编辑窗口的宽度。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDITOR\fR\fR
+.ad
+.RS 14n
+.rt  
+如果未设置 \fBVISUAL\fR 变量,则会按照 \fBVISUAL\fR 的说明针对模式检查此变量的值,并启用相应的编辑选项。 
+.sp
+请参见本手册页\fB特殊命令\fR部分中的 \fBset\fR 命令。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENV\fR\fR
+.ad
+.RS 14n
+.rt  
+对相应值执行参数扩展、命令替换和算术替换,以便生成调用 shell 时所执行的脚本的路径名。此文件通常用于别名和函数定义。缺省值为 \fB$HOME/.kshrc\fR。 
+.sp
+请参见本手册页的\fB调用\fR部分。
+.sp
+shell 不会设置 \fBENV\fR。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFCEDIT\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBhist\fR 命令的缺省编辑器名称的已过时名称。如果设置了 \fBHISTEDIT\fR,则不会使用 \fBFCEDIT\fR。
+.sp
+shell 指定 \fBFCEDIT\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFIGNORE\fR\fR
+.ad
+.RS 14n
+.rt  
+定义执行文件名匹配时忽略的文件名集的模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+函数定义的搜索路径。当引用具有 \fB-u\fR 属性的函数时,以及当未找到命令时,系统会在此路径中的目录内搜索其名称与此函数或命令相同的文件。 如果找到名称与此命令对应的可执行文件,则会在当前环境中读取和执行此文件。与 \fBPATH\fR 不同的是,必须明确使用句点 (\fB\&.\fR)(而非相邻冒号 (\fB:\fR) 字符,或者起始或结束冒号 (\fB:\fR))表示当前目录。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTCMD\fR\fR
+.ad
+.RS 14n
+.rt  
+历史文件中的当前命令的数目。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTEDIT\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBhist\fR 命令的缺省编辑器的名称。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTFILE\fR\fR
+.ad
+.RS 14n
+.rt  
+如果在调用 shell 时设置了此变量,此变量的值即为存储命令历史所使用的文件的路径名。请参见本手册页的\fB重新输入命令\fR部分。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHISTSIZE\fR\fR
+.ad
+.RS 14n
+.rt  
+如果在调用 shell 时设置了此变量,此 shell 可访问的以前输入的命令的数目则大于或等于此数目。缺省值为 \fB512\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHOME\fR\fR
+.ad
+.RS 14n
+.rt  
+\fBcd\fR 命令的缺省参数(起始目录)。
+.sp
+shell 不会设置 \fBHOME\fR。\fBHOME\fR 由 \fBlogin\fR(1) 设置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIFS\fR\fR
+.ad
+.RS 14n
+.rt  
+内部字段分隔符,通常为空格、制表符和换行符,这些分隔符用于分隔命令替换或参数扩展的结果,还可用于通过内置命令 read 分隔字段。\fBIFS\fR 变量的第一个字符用于分隔参数以便进行 \fB"$*"\fR 替换。请参见本手册页的\fB引用\fR部分。 
+.sp
+要分隔的字符串中出现的、未包含在 \fBissspace\fR 字符类中的每个 \fBIFS\fR 字符以及包含在 \fBissspace\fR 字符类中的 \fBIFS\fR 中的任何相邻字符均可用于分隔字段。IFS 中包含在 \fBissspace\fR 字符类中的一个或多个字符可用于分隔字段。此外,如果 \fBIFS\fR 中连续显示同一 \fBissspace\fR 字符,则会按照此字符不包含在 \fBissspace\fR 类中的方式来处理此字符,因此,如果 \fBIFS\fR 包含两个制表符,两个相邻制表符可分隔一个 null 字段。
+.sp
+shell 指定 \fBIFS\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLANG\fR\fR
+.ad
+.RS 14n
+.rt  
+对于并非使用以 \fBLC_\fR 或 \fBLANG\fR 开头的变量专门选择的任何类别,此变量确定这些类别的语言环境类别。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_ALL\fR\fR
+.ad
+.RS 14n
+.rt  
+此变量覆盖 \fBLANG\fR 变量以及任何其他 \fBLC_\fR 变量的值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_COLLATE\fR\fR
+.ad
+.RS 14n
+.rt  
+此变量确定字符整理信息的语言环境类别。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_CTYPE\fR\fR
+.ad
+.RS 14n
+.rt  
+此变量确定字符处理函数的语言环境类别。它确定用于模式匹配的字符类。请参见本手册页的\fB文件名生成\fR部分。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLC_NUMERIC\fR\fR
+.ad
+.RS 14n
+.rt  
+此变量确定小数点字符的语言环境类别。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBLINES\fR\fR
+.ad
+.RS 14n
+.rt  
+如果设置了此变量,则使用此变量的值确定列长度以便输出选择列表。选择列表纵向输出,直到填充了大约 2/3 的 \fBLINES\fR 行为止。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAIL\fR\fR
+.ad
+.RS 14n
+.rt  
+如果此变量设置为邮件文件的名称,\fB并且\fR未设置 \fBMAILPATH\fR 变量,shell 则会在指定文件中通知用户已收到邮件。
+.sp
+shell 不会设置 \fBMAIL\fR。在某些系统中,\fBMAIL\fR 由 \fBlogin\fR(1) 设置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILCHECK\fR\fR
+.ad
+.RS 14n
+.rt  
+指定 shell 检查 \fBMAILPATH\fR 或 \fBMAIL\fR 变量指定的所有文件的修改时间更改的频率(秒)。缺省值为 \fB600\fR 秒。经过此时间后,shell 会在发出下一提示前进行检查。
+.sp
+shell 指定 \fBMAILCHECK\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+以冒号 (\fB:\fR) 分隔的文件名列表。如果设置了此变量,shell 会通知用户在最后 \fBMAILCHECK\fR 秒内对指定文件所做的任何修改。每个文件名后面都可以带有 \fB?\fR 以及输出的消息。此消息会进行参数扩展、命令替换和算术替换,并将变量 \fB$_\fR 定义为已发生更改的文件的名称。缺省消息为\fB在 $_ 中您有一个邮件\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPATH\fR\fR
+.ad
+.RS 14n
+.rt  
+命令的搜索路径。除非在 \fB\&.profile\fR 中,否则用户无法在 \fBrksh\fR 下执行时更改 \fBPATH\fR。请参见本手册页的\fB执行\fR部分。
+.sp
+shell 指定 \fBPATH\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS1\fR\fR
+.ad
+.RS 14n
+.rt  
+扩展此变量的值,以便进行参数扩展、命令替换和算术替换,从而定义主提示字符串,缺省情况下,主提示字符串为 \fB$\fR。主提示字符串中的字符 \fB!\fR 替换为命令编号。当输出提示字符串时,出现的两个连续 \fB!\fR 可生成一个 \fB!\fR。请参见本手册页的\fB重新输入命令\fR部分。
+.sp
+shell 指定 \fBPS1\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS2\fR\fR
+.ad
+.RS 14n
+.rt  
+辅助提示字符串,缺省情况下为 \fB>\fR。
+.sp
+shell 指定 \fBPS2\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS3\fR\fR
+.ad
+.RS 14n
+.rt  
+在选择循环中使用的选择提示字符串,缺省情况下为 \fB#?\fR。
+.sp
+shell 指定 \fBPS3\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS4\fR\fR
+.ad
+.RS 14n
+.rt  
+扩展此变量的值,以便进行参数计算、命令替换和算术替换,并且此变量的值会在每一行前面放置一个执行跟踪。缺省情况下,\fBPS4\fR 为 \fB+\fR。如果取消设置 \fBPS4\fR,执行跟踪提示同样为 \fB+\fR。
+.sp
+shell 指定 \fBPS4\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHELL\fR\fR
+.ad
+.RS 14n
+.rt  
+在环境中保存 shell 的路径名。如果此变量的根基名称在调用时为 \fBrsh\fR、\fBrksh\fR、\fBrksh\fR 或 \fBkrsh\fR,此 shell 即受限制。
+.sp
+shell 不会设置 \fBSHELL\fR。在某些系统中,\fBSHELL\fR 由 \fBlogin\fR(1) 设置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBTIMEFORMAT\fR\fR
+.ad
+.RS 14n
+.rt  
+此参数的值用作格式字符串,指定带有 \fBtime\fR 保留字前缀的管道的时间信息的显示方式。\fB%\fR 字符引入扩展为时间值或其他信息的格式序列。 
+.sp
+格式序列及其含义如下所示。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%%\fR\fR
+.ad
+.sp .6
+.RS 4n
+字符 \fB%\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]R\fR\fR
+.ad
+.sp .6
+.RS 4n
+已用时间(秒)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]U\fR\fR
+.ad
+.sp .6
+.RS 4n
+在用户模式下所用的 CPU 秒数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%[\fIp\fR][l]S\fR\fR
+.ad
+.sp .6
+.RS 4n
+在系统模式下所用的 CPU 秒数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%P\fR\fR
+.ad
+.sp .6
+.RS 4n
+CPU 百分比,计算公式为 \fB(U + S)/R\fR。
+.RE
+
+花括号表示可选部分。可选 \fIp\fR 是一个用于指定\fI精度\fR(即小数点后面的小数位数)的数字。值为 \fB0\fR 导致不会输出小数点或小数。最多可显示小数点后面的三个数位。大于 \fB3\fR 的 \fIp\fR 值视为 \fB3\fR。如果未指定 \fIp\fR,则使用值 \fB3\fR。
+.sp
+可选 \fBl\fR 指定较长的格式,其中包括小时(如果大于零)、分钟和秒钟,并且格式为 \fIHHhMMmSS.FFs\fR。\fIp\fR 的值确定是否包含小数。
+.sp
+所有其他字符在输出时都不会发生任何更改,并且会添加一个尾随的换行符。如果取消设置,则使用缺省值 \fB$'\nreal\t%2lR\nuser\t%2lU\nsys%2lS'\fR。如果值为 null,则不会显示时间信息。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBTMOUT\fR\fR
+.ad
+.RS 14n
+.rt  
+如果设置为大于零的值,\fBTMOUT\fR 即为 \fBread\fR 内置命令的缺省超时值。如果输入来自于终端,\fBselect\fR 复合命令则会在 \fBTMOUT\fR 秒后终止。否则,当从终端读取时,如果未在规定的秒数内输入某个行,shell 将终止。可以为 shell 编译此值的最大限制,不能超过此最大限制。
+.sp
+shell 指定 \fBTMOUT\fR 的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBVISUAL\fR\fR
+.ad
+.RS 14n
+.rt  
+如果此变量的值与模式 \fB*[Vv][Ii]*\fR 匹配,则会启用 \fBvi\fR 选项。请参见\fB特殊命令\fR。如果此值与模式 \fB*gmacs*\fR 匹配,则会启用 \fBgmacs\fR 选项。如果此值与模式 \fB*macs*\fR 匹配,则会启用 \fBemacs\fR 选项。\fBVISUAL\fR 的值会覆盖 \fBEDITOR\fR 的值。
+.RE
+
+.SS "字段分隔"
+.sp
+.LP
+执行参数扩展和命令替换之后,系统将扫描替换结果中的字段分隔符(即位于 \fBIFS\fR 中的字段分隔符),并在找到此类字符的位置将结果分隔为不同字段。系统将保留显式 null 字段(\fB""\fR 或 \fB\&''\fR),并删除隐式 null 字段,这些字段是由没有任何值的参数或没有任何输出的命令替换所生成的。
+.sp
+.LP
+如果设置了 \fBbraceexpand\fR (\fB-B\fR) 选项,则会检查由 \fBIFS\fR 生成的每个字段,以查看它们是否包含一个或多个花括号模式。有效花括号模式包括:\fB{*\fR,\fB*}\fR、\fB{\fR\fI l1\fR\fB\&..\fR\fIl2\fR\fB}\fR、\fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR\fB}\fR、\fB{\fR\fIn1\fR\fB\&..\fR\fIn2\fR\fB %\fR\fIfmt\fR\fB}、{\fR\fIn1\fR\fB\&..\fR\fI n2\fR \fB\&..\fR\fIn3\fR\fB}\fR 或 \fB{\fR\fIn1\fR\fB\&..\fR\fI n2\fR \fB\&..\fR\fIn3\fR\fB%\fR\fIfmt\fR\fB}\fR,其中 \fB*\fR 表示任意字符,\fIl1\fR、\fIl2\fR 表示字母,\fIn1\fR、\fIn2\fR、\fIn3\fR 表示带符号的数字,\fIfmt\fR 表示 \fBprintf\fR 使用的指定格式。在每种情况下,通过将 \fB{\fR 前的字符放置在 \fB{\fR 和 \fB}\fR 之间的字符所生成的每个字符串之前,并将 } 后的字符附加到此类字符串之后来创建字段。系统将检查生成的字段,查看这些字段是否包含任何花括号模式。
+.sp
+.LP
+在第一种格式中,将为 \fB{\fR 和 \fB,\fR、\fB,\fR 和 \fB,\fR 以及 , 和 \fB}\fR 之间的每个字符串创建一个字段。\fB*\fR 表示的字符串可包含不带引号的匹配的嵌入式 { 和 }。否则,必须引用带有 \fB*\fR 的每个 \fB{\fR 和 \fB}\fR。
+.sp
+.LP
+在第二种格式中,\fIl1\fR 和 \fIl2\fR 在 C 语言环境中必须同时为大写字母或小写字母字符。在此种情况下,将为从 \fIl1\fR 到 \fIl2\fR 的每个字符创建一个字段。
+.sp
+.LP
+在其余的格式中,将为从 \fIn1\fR 开始的每个数字创建一个字段。此操作将持续进行,直到达到 \fIn2\fR 并使 \fIn1\fR 递增 \fIn3\fR 为止。如果 \fIn1\fR\fB<=\fR\fIn2\fR,在未指定 \fIn3\fR 的情况下的行为就像 \fIn3\fR 为 1 一样,否则则像 n3 为 \fB-1\fR 一样。在指定了 \fB%\fR\fIfmt\fR 的格式中,可指定所有格式标志、宽度和精度,并且 \fIfmt\fR 可以任何说明符 \fBcdiouxX\fR 结尾。例如,\fB{a,z}{1..5..3%02d}{b..c}x\fR 扩展为 8 个字段,即 \fBa01bx、a01cx、a04bx、a04cx、z01bx、z01cx、z04bx\fR 和 \fBz4cx\fR。
+.SS "文件名生成"
+.sp
+.LP
+分隔之后,除非设置了 \fB-f\fR 选项,否则将扫描每个字段,以查看是否包含字符 \fB*\fR、\fB?\fR、\fB(\fR 和 \fB[\fR。如果显示其中的某个字符,则会将单词视为模式。 
+.sp
+.LP
+包含任何模式字符的每个文件名组件都会替换为与该目录中的模式相匹配的按字典顺序排序的名称集合。如果未找到与此模式匹配的文件名,该文件名组件将保持不变,除非此模式带有 \fB~(N)\fR 前缀,此种情况下,将删除此文件名组件。如果设置了 \fBFIGNORE\fR,当生成匹配的文件名时,将忽略与 \fBFIGNORE\fR 的值定义的模式相匹配的每个文件名组件。此外,还会忽略名称 \fB\&.\fR 和 \fB ..\fR。如果未设置 \fBFIGNORE\fR,则会忽略每个文件名组件开头的字符 \fB\&.\fR,除非与此组件对应的模式的第一个字符为字符 \fB\&.\fR 自身。对于模式匹配的其他使用情况,不会对 \fB/\fR 和 \fB\&.\fR 进行特殊处理。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 11n
+.rt  
+匹配任何字符串,包括 null 字符串。当用于文件名扩展时,如果启用了 \fBglobstar\fR 选项,单独的两个相邻 \fB*\fR 匹配所有文件和零个或多个目录及子目录。如果两个相邻 \fB*\fR 后跟有一个 \fB/\fR,则仅匹配目录和子目录。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 11n
+.rt  
+匹配任何单个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB[\fB\&...\fR]\fR
+.ad
+.RS 11n
+.rt  
+匹配包括的任何一个字符。使用 \fB-\fR 分隔的一对字符将在词汇上匹配这对字符之间的任何字符,包括这对字符。如果左 \fB[\fR 后面的第一个字符为 \fB!\fR,则匹配任何不包括的字符。通过将 \fB-\fR 作为第一个或最后一个字符,可以将其包含在字符集合中。在 \fB[\fR 和 \fB]\fR 中,可使用语法 \fB[:\fR\fIclass\fR\fB:]\fR 指定字符类,其中 \fIclass\fR 表示按 \fBANSI-C\fR 标准定义的下列类之一:
+.sp
+.in +2
+.nf
+\fIalnum alpha blank cntrl digit graph\fR
+\fIlower print punct space upper\fR
+\fIword xdigit\fR
+.fi
+.in -2
+.sp
+
+\fIword\fR 等效于 \fIalnum\fR 和字符 \fB_\fR。在 \fB[\fR 和 \fB]\fR 中,可使用语法 \fB[=\fR\fIc\fR\fB=]\fR 指定等效类,这会匹配主整理权重(根据当前语言环境定义)与字符 \fIc\fR 相同的所有字符。在 \fB[\fR 和 \fB]\fR 中,[\fI\&.symbol.\fR] 匹配整理符号 \fIsymbol\fR。
+.RE
+
+.sp
+.LP
+\fIpattern-list\fR 是使用 \fB&\fR 或 \fB|\fR 彼此分隔的一个或多个模式的列表。 \fB&\fR 表示必须匹配所有模式,而 \fB|\fR 要求仅匹配一个模式。复合模式可以由下列一个或多个子模式组成:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+选择性地匹配任何指定模式之一。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+匹配出现的零个或多个指定模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+匹配出现的一个或多个指定模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+匹配出现的 \fIn\fR 个指定模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR\fIm\fR\fB,\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+匹配出现的 \fIm\fR 到 \fIn\fR 个指定模式。如果省略了 \fIm\fR,则使用 \fB0\fR。如果省略了 \fIn\fR,则至少匹配出现的 \fIm\fR 个指定模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB@(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+与某个指定模式完全匹配。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!(\fR\fIpattern-list\fR\fB)\fR\fR
+.ad
+.RS 22n
+.rt  
+与除某个指定模式以外的所有内容匹配。
+.RE
+
+.sp
+.LP
+缺省情况下,每个模式或子模式匹配最长的字符串,此字符串可能与生成最长的完整匹配项相一致。如果可能有多个匹配项,则选择起始位置离字符串开头最近的匹配项。但是,对于每个复合模式,可以在 \fB(\fR 前面插入一个 \fB-\fR,以便使用指定 \fIpattern-list\fR 的最短匹配项。
+.sp
+.LP
+如果 \fIpattern-list\fR 包含在括号中,则会以特殊方式处理反斜杠字符 \fB\e\fR,即使它位于字符类中也是如此。所有 \fBANSI-C\fR 转义符均可识别,并且与指定字符匹配。此外,还可识别下列转义序列:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ed\fR\fR
+.ad
+.RS 7n
+.rt  
+匹配数字类中的任意字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eD\fR\fR
+.ad
+.RS 7n
+.rt  
+匹配数字类中不包括的任意字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\es\fR\fR
+.ad
+.RS 7n
+.rt  
+匹配空格类中的任意字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eS\fR\fR
+.ad
+.RS 7n
+.rt  
+匹配空格类中不包括的任意字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ew\fR\fR
+.ad
+.RS 7n
+.rt  
+匹配单词类中的任意字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eW\fR\fR
+.ad
+.RS 7n
+.rt  
+匹配单词类中不包括的任意字符。
+.RE
+
+.sp
+.LP
+格式为 \fB%(\fR\fIpattern-pairs\fR\fB)\fR 的模式是可用于匹配嵌套字符表达式的子模式。每个 \fIpattern-pair\fR 都是一个包含两个字符的序列,该序列不能包含 \fB&\fR 或 \fB|\fR。第一个 \fIpattern-pair\fR 指定匹配项的起始字符和结束字符。每个后续 \fIpattern-pair\fR 表示在计算起始字符和结束字符匹配项数目时跳过的嵌套组的起始字符和结束字符。如果 \fIpattern-pair\fR 的第一个字符是除下列字符以外的字母数字,则行为是未指定的:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD\fR\fR
+.ad
+.RS 5n
+.rt  
+导致结束字符在未找到匹配项的情况下终止对此模式的搜索。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE\fR\fR
+.ad
+.RS 5n
+.rt  
+导致将结束字符解释为转义符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBL\fR\fR
+.ad
+.RS 5n
+.rt  
+导致将结束字符解释为引号字符,从而导致在查找匹配项时忽略所有字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBQ\fR\fR
+.ad
+.RS 5n
+.rt  
+导致将结束字符解释为引号字符,从而导致在查找匹配项时忽略除任何转义符以外的所有字符。
+.RE
+
+.sp
+.LP
+\fB%({}Q"E\e)\fR 匹配从 \fB{\fR 开始的字符,直到找到匹配的 \fB}\fR 为止(位于双引号字符串中或前面带有转义符 \fB\e\fR 的任何 \fB{\fR 或 \fB}\fR 不会计算在内)。如果没有 \fB{}\fR,此模式则与任何 C 语言字符串匹配。
+.sp
+.LP
+复合模式中的每个子模式都根据 \fB(\fR 在此模式中的位置从 \fB1\fR 开始进行编号。序列 \fB\e\fR\fIn\fR(其中 \fIn\fR 表示一个数字,并且 \fB\e\fR\fI n\fR 位于第 \fIn\fR 个子模式之后)匹配与子模式自身相同的字符串。
+.sp
+.LP
+模式可包含 \fB~(\fR\fIoptions\fR\fB:\fR\fIpattern-list\fR\fB)\fR 格式的子模式,其中可省略 \fIoptions\fR 或 \fB:\fR\fIpattern-list\fR。与其他复合模式不同的是,这些子模式不会计算在带有编号的子模式之内。如果存在 \fIoptions\fR,则可以包括下列一个或多个字符:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+\fR\fR
+.ad
+.RS 5n
+.rt  
+启用下列选项。这是缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 5n
+.rt  
+禁用下列选项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE\fR\fR
+.ad
+.RS 5n
+.rt  
+模式的提示使用扩展的正则表达式语法,例如,\fBegrep\fR(1) 命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF\fR\fR
+.ad
+.RS 5n
+.rt  
+模式的提示使用 \fBfgrep\fR(1) 表达式语法。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBg\fR\fR
+.ad
+.RS 5n
+.rt  
+归档最长匹配项(最长一致)。 
+.sp
+这是缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBG\fR\fR
+.ad
+.RS 5n
+.rt  
+模式的提示使用基本正则表达式语法,例如,\fBgrep\fR(1) 命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 5n
+.rt  
+将匹配项视为不区分大小写。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBK\fR\fR
+.ad
+.RS 5n
+.rt  
+模式的提示使用 shell 模式语法。 
+.sp
+这是缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBl\fR\fR
+.ad
+.RS 5n
+.rt  
+将模式固定在左侧。 
+.sp
+这是 \fBK\fR 样式模式的缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBN\fR\fR
+.ad
+.RS 5n
+.rt  
+忽略此字符。但是,如果该字符是第一个字母,用于生成文件名,并且没有匹配项,则文件模式将扩展为空字符串。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBr\fR\fR
+.ad
+.RS 5n
+.rt  
+将模式固定在右侧。 
+.sp
+这是 \fBK\fR 样式模式的缺省值。
+.RE
+
+.sp
+.LP
+如果同时指定了 \fIoptions\fR 和 \fB:\fR\fIpattern-list\fR,这些选项仅适用于 \fIpattern-list\fR。否则,这些选项将保持有效,直到由后续 \fB~(...)\fR 禁用或位于含有 \fB~(...)\fR 的子模式的末尾为止。
+.SS "引用"
+.sp
+.LP
+\fB定义\fR中列出的每个元字符都对 shell 具有特殊意义。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBg\fR\fR
+.ad
+.RS 5n
+.rt  
+归档最长匹配项(最长一致)。这是缺省值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 5n
+.rt  
+将匹配项视为不区分大小写。 
+.RE
+
+.sp
+.LP
+如果同时指定了 \fIoptions\fR 和 \fB:\fR\fIpattern-list\fR,这些选项仅适用于 \fIpattern-list\fR。否则,这些选项将保持有效,直到由后续 \fB~(...)\fR 禁用或位于含有 \fB~(...)\fR 的子模式的末尾为止。
+.sp
+.LP
+本手册页\fB定义\fR部分中列出的每个元字符都对 shell 具有特殊意义,并且会导致单词结束(除非这些元字符带有引号)。通过在字符前面添加一个反斜杠 (\fB\e\fR),可以引用此字符,即,使此字符代表其自身。\fB\e\fR换行符对将被删除。前面没有 \fB$\fR 的单引号对 (\fB\&''\fR) 中包含的所有字符将被引起来。单引号无法显示在单引号中。如果单引号前面带有不带引号的 \fB$\fR,单引号中的字符串将作为 \fBANSI-C\fR 字符串处理,但下列字符串除外:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e0\fR\fR
+.ad
+.RS 19n
+.rt  
+导致忽略字符串的提示。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ec\fR\fIx\fR\fR
+.ad
+.RS 19n
+.rt  
+扩展至字符 CTRL-x。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eC\fR[\fB\&.\fR\fIname\fR\fB\&.\fR]\fR
+.ad
+.RS 19n
+.rt  
+扩展至整理元素 \fIname\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ee\fR\fR
+.ad
+.RS 19n
+.rt  
+等效于转义符 (\fBASCII\fR 033)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eE\fR\fR
+.ad
+.RS 19n
+.rt  
+等效于转义符 (\fBASCII\fR 033)。
+.RE
+
+.sp
+.LP
+参数和命令替换在双引号 (\fB""\fR) 中执行,并且 \fB\e\fR 引用字符 \fB\e\fR、\fB`\fR、\fB"\fR 和 \fB$\fR。在 \fBC\fR 或 \fBPOSIX\fR 语言环境中,将忽略带有双引号的字符串前面的 \fB$\fR,在其他语言环境中,这可能导致将此字符串替换为语言环境特定的字符串。当未带有引号时,或者当用作变量赋值的值或文件名时,\fB$*\fR 的含义与 \fB$@\fR 相同。但是,当用作命令参数时,\fB"$*"\fR 等效于 \fB"$1\fId\fR$2\fId\fR..."\fR,其中 \fId\fR 表示 IFS 变量的第一个字符,而 \fB"$@"\fR 等效于 \fB"$1" "$2" ....\fR在重音符引号 (\fB``\fR) 中,\fB\\fR 引用字符 \fB\e\fR、\fB`\fR 和 \fB$\fR。如果重音符引号出现在双引号中,\fB\e\fR 还会引用字符 \fB"\fR。
+.sp
+.LP
+通过引用保留字的任何字符,可以删除保留字或别名的特殊意义。函数名称或内置命令名称的识别方式无法通过引用它们来进行更改。
+.SS "算术计算"
+.sp
+.LP
+此 shell 通过执行算术计算来进行算术替换,以便计算算术命令、索引数组下标以及内置命令 \fBshift\fR 和 \fBlet\fR 的参数。此外,还会对内置命令 printf 的参数操作数执行算术计算,该命令与格式操作数中的数字格式说明符相对应。请参见 \fBprintf\fR(1)。使用双精度浮点运算或长整型双精度浮点数对提供此数据类型的系统执行计算。浮点常量遵循 \fBANSI-C\fR 编程语言浮点约定。整数常量遵循 \fBANSI-C\fR 编程语言整数常量约定,但只能识别单字节字符常量,而不能识别字符强制类型转换。常量可以采用 \fB[\fR\fIbase#\fR\fB]\fR\fIn\fR 格式,其中 \fIbase\fR 是介于 2 到 64 之间的表示算术基的十进制数字,\fIn\fR 是该基中的数字。大于 \fB9\fR 的数字分别通过小写字母、大写字母、\fB@\fR 和 \fB_\fR 表示。对于小于或等于 \fB36\fR 的基,可以交替使用大写和小写字符。
+.sp
+.LP
+算术表达式使用与 C 语言相同的表达式语法、优先级和关联。所有适用于浮点值的 C 语言运算符均可使用。此外,运算符 \fB**\fR 可用于求幂。同乘法相比,它具有较高的优先级,并且会保留关联性。如果算术变量或子表达式的值可表示为长整数,则可以执行所有 C 语言整数算术运算。算术表达式中的名称可引用变量,而不必使用参数扩展语法。引用变量时,该变量的值将作为算术表达式计算。 
+.sp
+.LP
+C 数学库包含的下列任何数学库函数均可在算术表达式中使用:
+.sp
+.in +2
+.nf
+abs acos acosh asin asinh atan atan2 atanh cbrt 
+copysign cos cosh erf erfc exp exp2 expm1 fabs
+fdim finite floor fma fmax fmod hypot ilogb 
+int isinf isnan lgamma log log2 logb 
+nearbyint nextafter nexttoward pow remainder
+rint round sin sinh sqrt tan tanh tgamma trunc
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+使用 \fBtypeset\fR 特殊内置命令的 \fB-E [\fR\fIn\fR\fB]\fR 或 \fB-F [\fR\fIn\fR\fB]\fR 选项可以指定作为双精度浮点数的\fI变量\fR的内部表示。\fB-E\fR 选项导致在扩展值时使用科学记数法表示此值的扩展。可选选项参数 \fIn\fR 定义重要数字的数目。\fB-F\fR 选项导致在扩展时将扩展表示为十进制浮点数。此种情况下,可选选项参数 \fIn\fR 定义小数点后面的小数位数。
+.sp
+.LP
+使用 \fBtypeset\fR 特殊内置命令的 \fB-i\fR \fB[\fR\fIn\fR\fB]\fR 选项可以指定\fI变量\fR的内部整数表示。可选选项参数 \fIn\fR 指定扩展变量时使用的算术基。如果未指定算术基,则使用基 10。
+.sp
+.LP
+使用 \fB-E\fR、\fB-F\fR 或 \fB-i\fR 选项对变量的每个赋值的值执行算术计算。向整数类型的变量分配浮点数会导致截断小数部分。 
+.SS "提示"
+.sp
+.LP
+当交互使用时,shell 在扩展 \fBPS1\fR 以便进行参数扩展、命令替换和算术替换之后通过 PS1 的值进行提示,然后再读取命令。此外,提示中的每个 \fB!\fR 都会替换为命令编号。A \fB!!\fR才能在提示中放置 \fB!\fR。如果在任何时间键入了换行符,并且需要进行更多输入才能完成命令,则会发出辅助提示,即 \fBPS2\fR 的值。
+.SS "条件表达式"
+.sp
+.LP
+\fB条件表达式\fR与 \fB[[\fR 复合命令配合使用,以便测试文件属性和比较字符串。不会对 \fB[[\fR 和 \fB]]\fR 之间的单词执行字段分隔和文件名生成。
+.sp
+.LP
+每个表达式均可由下面的一个或多个一元表达式或二元表达式构成:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在)。
+.sp
+此选项与 \fB-e\fR 相同。此选项已过时。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为块特殊文件)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为字符特殊文件)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为目录)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为普通文件)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-g\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且设置了其 \fBsetgid\fR 位)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-G\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在,并且其组与此进程的有效组 ID 匹配)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为符号链接)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且设置了其 sticky 位)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-L\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为符号链接)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR \fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIstring\fR 的长度为\fB非零\fR)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-N\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在,并且修改时间大于上次访问时间)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIoption\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果已启用名为 \fIoption\fR 的选项)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fI?option\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果名为 \fIoption\fR 的选项为有效选项名称)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-O\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在,并且归此进程的有效用户 ID 所有)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为 \fBFIFO\fR 特殊文件或管道)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在,并且可供当前进程读取)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且其大小大于零)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-S\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且为套接字)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR \fIfildes\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果文件描述符编号 \fIfildes\fR 已打开且与终端设备相关联)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在且设置了其 \fBsetuid\fR 位)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-w\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在,并且可供当前进程写入)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR \fIfile\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile\fR 存在,并且可供当前进程执行)。如果 \fIfile\fR 存在且为目录,并且如果当前进程有权在此目录中搜索,则为 True。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-z\fR \fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIstring\fR 的长度为零)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-ef\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile1\fR 和 \fIfile2\fR 存在,并且引用同一文件)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-nt\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile1\fR 存在且 \fIfile2\fR 不存在,或者 \fIfile1\fR 比 \fIfile2\fR 更新)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile1\fR \fB-ot\fR \fIfile2\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIfile2\fR 存在且 \fIfile1\fR 不存在,或者 \fIfile1\fR 比 \fIfile2\fR 更旧)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIstring\fR 不为 null)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB==\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIstring\fR 与 \fIpattern\fR 匹配)。可引用 \fIpattern\fR 的任何部分,以将其作为字符串匹配。成功匹配 \fIpattern\fR 后,\fB\&.sh.match\fR 数组变量将包含匹配项和子模式匹配项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB=\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+与 \fB==\fR 相同,但已过时。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB!=\fR \fIpattern\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIstring\fR 与 \fIpattern\fR 不匹配)。如果 \fIstring\fR 与 \fIpattern\fR 匹配,\fB\&.sh.match\fR 数组变量将包含匹配项和子模式匹配项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring\fR \fB=~\fR \fIere\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果 \fIstring\fR 与模式 \fB~(E)\fR\fIere\fR 匹配,其中 \fIere\fR 是扩展的正则表达式)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring1\fR \fB<\fR \fIstring2\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果根据字符的 \fBASCII\fR 值,\fIstring1\fR 位于 \fIstring2\fR 之前)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstring1\fR \fB>\fR \fIstring2\fR\fR
+.ad
+.RS 21n
+.rt  
+True(如果根据字符的 \fBASCII\fR 值,\fIstring1\fR 位于 \fIstring2\fR 之后)。
+.RE
+
+.sp
+.LP
+在下列每个表达式中,如果 \fIfile\fR 格式为 \fB/dev/fd/\fR\fIn\fR(其中 \fIn\fR 为整数),测试则应用于描述符编号为 \fIn\fR 的打开文件。支持下列已过时的算术比较: 
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-eq\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True(如果 \fIexp1\fR 等于 \fIexp2\fR)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-ge\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True(如果 \fIexp1\fR 大于或等于 \fIexp2\fR)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-gt\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True(如果 \fIexp1\fR 大于 \fIexp2\fR)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-le\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True(如果 \fIexp1\fR 小于或等于 \fIexp2\fR)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-lt\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True(如果 \fIexp1\fR 小于 \fIexp2\fR)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexp1\fR \fB-ne\fR \fIexp2\fR\fR
+.ad
+.RS 17n
+.rt  
+True(如果 \fIexp1\fR 不等于 \fIexp2\fR)。
+.RE
+
+.sp
+.LP
+通过使用下列任何基元,可以使用这些基元构成复合表达式(这些基元按优先级的降序顺序列出):
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fI表达式\fR\fB)\fR\fR
+.ad
+.RS 30n
+.rt  
+True(如果 \fIexpression\fR 为 True)。用于对表达式进行分组。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR \fI表达式\fR\fR
+.ad
+.RS 30n
+.rt  
+True(如果 \fIexpression\fR 为 False)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexpression1\fR \fB&&\fR \fIexpression2\fR\fR
+.ad
+.RS 30n
+.rt  
+True(如果 \fIexpression1\fR 和 \fIexpression2\fR 均为 True)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIexpression1\fR \fB||\fR \fIexpression2\fR\fR
+.ad
+.RS 30n
+.rt  
+True(如果 \fIexpression1\fR 或 \fIexpression2\fR 为 True)。
+.RE
+
+.SS "输入和输出"
+.sp
+.LP
+执行命令之前,使用 shell 解释的特殊表示法可以重定向该命令的输入和输出。以下内容可显示在简单命令中的任意位置,也可以位于命令之前或之后,并且\fB不\fR会传递给调用的命令。除非此部分另行说明,否则在使用 \fIword\fR 或 \fIdigit\fR 之前执行命令替换、参数扩展和算术替换。仅当 shell 为交互式 shell 并且模式与某个文件匹配时,才会执行文件名生成。不会执行字段分隔。
+.sp
+.LP
+在下列每个重定向中,如果 \fIfile\fR 格式为 \fB/dev/sctp/\fR\fIhost\fR\fB/\fR\fIport\fR、\fB/dev/tcp/\fR\fIhost\fR\fB/\fR\fI port\fR 或 \fB/dev/udp/\fR\fIhost\fR\fB/\fR\fIport\fR(其中 \fIhost\fR 为主机名或主机地址,\fIport\fR 为名称指定的服务或整数端口号),重定向会尝试建立到相应套接字的 \fBtcp\fR、\fBsctp\fR 或 \fBudp\fR 连接。
+.sp
+.LP
+禁止在重定向运算符的字符之间使用中间空格。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+使用文件 \fIword\fR 作为标准输入(文件描述符 0)。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+使用文件 \fIword\fR 作为标准输出(文件描述符 1)。如果文件不存在,则会创建一个文件。如果文件存在,并且启用了 \fBnoclobber\fR 选项,则会导致错误。否则会将其截断为零长度。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>|\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+与 \fB>\fR 相同,但它会覆盖 \fBnoclobber\fR 选项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+使用文件 \fIword\fR 作为标准输出。如果文件存在,则会将输出附加到此文件(通过首先查找到文件结尾)。否则会创建文件。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<>\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+打开文件 \fIword\fR 以便作为标准输入读取和写入。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<\fR\fB[-]\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+读取在删除任何引用后与 \fIword\fR 相同的行之前或文件结尾之前的 shell 输入。不会对 \fIword\fR 执行参数替换、命令替换、算术替换或文件名生成。生成的名为 \fBhere-document\fR 的文档将成为标准输入。如果引用了 \fIword\fR 的任何字符,则不会对文档的字符进行任何解释。否则会执行参数扩展、命令替换和算术替换,忽略 \fB\e\fR换行符,并且必须使用 \fB\e\fR 引用字符 \fB\e\fR、\fB$\fR、\fB`\fR。如果将 \fB-\fR 附加到 \fB<<\fR,则会从 \fIword\fR 和文档删除所有前导制表符。如果将 \fB#\fR 附加到 \fB<<\fR,则会从文档的第一行中删除前导空格和制表符,并从其余行和 \fIword\fR 中最多删除等效的缩排。制表停止位置应每 8 列出现一次,以便确定缩排。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<<\fR\fIword\fR\fR
+.ad
+.RS 14n
+.rt  
+生成 here document 的简捷形式,在此简捷形式中,在执行任何参数扩展、命令替换和算术替换之后,\fIword\fR 将成为 here-document 的内容。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fR
+.ad
+.RS 14n
+.rt  
+从文件描述符 \fIdigit\fR 复制标准输入,类似地,对于标准输出,请使用 \fB>&\fR\fIdigit\fR。请参见 \fBdup\fR(2)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fB-\fR\fR
+.ad
+.RS 14n
+.rt  
+将 \fIdigit\fR 指定的文件描述符移至标准输入。类似地,对于标准输出,请使用 \fB>&\fR\fIdigit\fR\fB-\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&-\fR\fR
+.ad
+.RS 14n
+.rt  
+关闭标准输入。类似地,对于标准输出,请使用 \fB>&-\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&p\fR\fR
+.ad
+.RS 14n
+.rt  
+将协同进程的输入移至标准输入。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>&p\fR\fR
+.ad
+.RS 14n
+.rt  
+将协同进程的输出移至标准输出。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<#((\fR\fIexpr\fR\fB))\fR\fR
+.ad
+.RS 14n
+.rt  
+计算算术表达式 \fIexpr\fR,并将文件描述符 0 放置在离文件开头的字节数为生成的值的相应位置。当计算 \fIexpr\fR 时,变量 \fBCUR\fR 和 \fBEOF\fR 的计算结果分别为当前偏移和文件结尾偏移。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>#((\fR\fIexpr\fR\fB))\fR\fR
+.ad
+.RS 14n
+.rt  
+与 \fB<#\fR 相同,但应用于文件描述符 1。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<#\fR\fIpattern\fR\fR
+.ad
+.RS 14n
+.rt  
+向前查找到包含模式的下一行的开头。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<##\fR\fIpattern\fR\fR
+.ad
+.RS 14n
+.rt  
+与 \fB<#\fR 相同,但将跳过的文件部分复制到标准输出。
+.RE
+
+.sp
+.LP
+如果某个重定向运算符前面带有一个数字,并且没有任何中间空格,引用的文件描述符编号即为该数字(而非缺省值 0 或 1)指定的文件描述符编号。 如果除 \fB>&-\fR、\fB>#\fR 和 \fB<#\fR 格式以外的其他某个重定向运算符前面带有 \fB{\fR\fIvarname\fR\fB}\fR,且无中间空格,shell 则会选择 \fB> 10\fR 的文件描述符编号,并将其存储在变量 \fIvarname\fR 中。如果 \fB>&-\fR、任何 \fB>#\fR 及 \fB<#\fR 格式前面带有 \fB{\fR\fIvarname\fR\fB}\fR,\fIvarname\fR 的值定义要关闭或定位的文件描述符。例如:
+.sp
+.in +2
+.nf
+\&... 2>&1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+表示打开文件描述符 2 以便作为文件描述符 1 的副本写入,
+.sp
+.in +2
+.nf
+exec [\fIn\fR]<\fIfile\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+表示打开\fI文件\fR以便读取,并将文件描述符编号存储在变量 \fIn\fR 中。重定向的指定顺序至关重要。shell 根据评估时的(\fI文件描述符\fR、\fI文件\fR)关联来评估每个重定向。例如:
+.sp
+.in +2
+.nf
+\&... 1>\fIfname\fR 2>&1
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+首先将文件描述符 1 与文件 \fIfname\fR 关联。然后,它将文件描述符 2 与文件描述符 1 的关联文件(即 \fIfname\fR)相关联。如果颠倒重定向顺序,文件描述符 2 将与终端关联(假定文件描述符 1 已与此终端关联),文件描述符 1 将与文件 \fIfname\fR 关联。如果命令后跟有 \fB&\fR,并且作业控制处于非活动状态,该命令的缺省标准输入则为空文件 \fB/dev/null\fR。否则,命令执行环境包含调用根据输入和输出规范修改的 shell 的文件描述符。
+.SS "环境"
+.sp
+.LP
+\fI环境\fR是按照标准参数列表的相同传递方式传递给执行程序的名称-值对列表。请参见 \fBenviron\fR(5)。
+.sp
+.LP
+这些名称必须是\fI标识符\fR,值必须是字符串。shell 采用多种方式与环境交互。shell 在调用时扫描环境,为找到的每个名称创建一个变量,为变量指定相应值和属性,并将其标记为 \fBexport\fR。执行命令继承此环境。如果用户使用 \fBexport\fR 或 \fBtypeset\fR \fB-x\fR 命令修改了这些变量的值或创建了新的变量,这些变量将成为环境的一部分。因此,向任何执行命令显示的环境包括 shell 最初继承的所有名称-值对(当前 shell 可修改这些名称-值对的值)以及必须在 \fBexport\fR 或 \fBtypeset\fR \fB-x\fR 命令中说明的所有添加内容。通过在任何简单命令或函数前面添加一个或多个变量赋值作为前缀,可以扩展这些简单命令或函数的环境。变量赋值参数是\fI标识符\fR\fB=\fR\fI值\fR格式的单词。因此:
+.sp
+.in +2
+.nf
+TERM=450 cmd args
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+和 
+.sp
+.in +2
+.nf
+(export TERM; TERM=450; cmd args)
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+等效(就执行 \fIcmd\fR 而言,\fB内置命令\fR部分中列出的特殊内置命令除外,这些命令的前面带有一个剑形符号)。如果设置了已过时的 \fB-k\fR 选项,所有变量赋值参数都会放置到环境中,即使这些变量赋值参数出现在命令名称之后。 
+.sp
+.LP
+下面的示例首先输出 \fBa=b c\fR,然后输出 \fBc\fR:
+.sp
+.in +2
+.nf
+echo a=b c
+set -k
+echo a=b c
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+此功能旨在用于为早期 shell 版本编写的脚本,强烈建议不要将此功能用于新脚本中。
+.SS "函数"
+.sp
+.LP
+出于历史原因,定义函数有两种方法,即 \fBname()\fR 语法和 \fBfunction\fR \fBname\fR 语法。本手册页的\fB命令\fR部分介绍了这两种方法。 
+.sp
+.LP
+Shell 函数在内部读取和存储。别名在读取函数时解析。函数的执行方式与将参数作为位置参数传递的命令相似。有关详细信息,请参见本手册页的\fB执行\fR部分。
+.sp
+.LP
+根据 \fBfunction\fR \fBname\fR 语法定义并按照名称调用的函数与调用者在同一进程中执行,并与调用者共享所有文件和现有工作目录。调用者捕获的陷阱在函数中重置为其缺省操作。函数未捕获或忽略的陷阱条件导致该函数终止,并将此条件传递给调用者。函数完成之后,在 \fBEXIT\fR 时在函数内部设置的陷阱将在调用者的环境中执行。通常在调用程序和函数之间共享变量。但是,在函数中使用的 \fBtypeset\fR 特殊内置命令定义其作用域包括当前函数的局部变量。这些局部变量可以在调用之前传递给变量赋值列表中的调用函数,或者作为以名称引用形式传递的参数传递。函数中的错误将控制权返回给调用者。
+.sp
+.LP
+通过 \fB\&.\fR 特殊内置命令调用的使用 \fBname()\fR 语法定义的函数以及使用 \fBfunction\fR \fBname\fR 语法定义的函数在调用者的环境中执行,并且与调用者共享所有变量和陷阱。在执行这些函数的过程中出现的错误导致函数所在的脚本中止。
+.sp
+.LP
+特殊内置命令 \fBreturn\fR 用于从函数调用返回。
+.sp
+.LP
+使用 \fBtypeset\fR 特殊内置命令的 \fB-f\fR 或 \fB+f\fR 选项可以列出函数名称。使用 \fB-f\fR 还可以列出函数文本(如果可用)。使用 \fBunset\fR 特殊内置命令的 \fB-f\fR 选项可以取消定义函数。
+.sp
+.LP
+函数通常在 shell 执行 shell 脚本时取消设置。必须跨不同 shell 调用定义的函数应放置在目录中,并且 \fBFPATH\fR 变量应包含此目录的名称。也可以在 \fBENV\fR 文件中指定这些函数。
+.SS "规程函数"
+.sp
+.LP
+每个变量都可以关联有零个或多个规程函数。shell 最初了解规程名称 \fBget\fR、\fBset\fR、\fBappend\fR 和 \fBunset\fR,但是在大多数系统中,通过 \fBbuiltin\fR 内置实用程序提供的 C 编程接口扩展可以在运行时添加其他规程名称。如果为变量定义了 \fBget\fR 规程,则会在引用指定变量时调用此规程。如果为规程函数中的变量 \fB\&.sh.value\fR 分配了一个值,引用的变量的计算结果将为此值。如果为变量定义了 \fBset\fR 规程,则会在为指定变量分配值时调用此规程。如果为变量定义了 \fBappend\fR 规程,则会在将值附加到指定变量时调用此规程。在调用规程之前,为变量 \fB\&.sh.value\fR 指定该变量的值,在规程结束之后,为该变量分配 \fB\&.sh.value\fR 的值。如果在规程中\fB取消设置\fR .\fBsh.value\fR,该值将保持不变。如果为变量定义了 \fBunset\fR 规程,则会在取消设置指定变量时调用此规程。除非从此规程函数中显式取消设置变量,否则无法取消设置此变量。
+.sp
+.LP
+变量 \fB\&.sh.name\fR 包含调用了规程函数的变量的名称,\fB\&.sh.subscript\fR 是此变量的下标,\fB\&.sh.value\fR 包含在 \fBset\fR 规程函数中分配的值。对于 \fBset\fR 规程,更改 \fB\&.sh.value\fR 会更改分配的值。 
+.SS "作业"
+.sp
+.LP
+如果启用 \fBset\fR 命令的 monitor 选项,交互式 shell 会将作业与每个管道相关联。shell 保存当前作业的表,并使用 \fBjobs\fR 命令输出此表,然后为这些作业分配较小的整数。使用 \fB&\fR 异步启动作业时,shell 输出如下行:
+.sp
+.in +2
+.nf
+[1] 1234
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+这表示异步启动的作业的作业编号为 1,并且该作业具有一个(顶级)进程,其进程 ID 为 \fB1234\fR。
+.sp
+.LP
+如果您正在运行作业,并且希望停止此作业,按 Ctrl-z 可向当前作业发送一个 \fBSTOP\fR 信号。shell 通常会显示一则该作业已停止的消息,并且会显示其他提示。然后,您可以处理此作业的状态,使用 \fBbg\fR 命令将其放置到后台,或者运行某些其他命令,最后使用前台命令 \fBfg\fR 将其放回到前台。Ctrl-z 立即生效,并在键入时放弃暂挂输出和未读输入,因此它与中断相似。
+.sp
+.LP
+如果在后台运行的作业尝试从终端读取,则会停止该作业。通常允许后台作业生成输出,但是通过指定命令 \fBsttytostop\fR 可以禁用此功能。如果设置了此 \fBtty\fR 选项,后台作业将在尝试生成输出时停止,就像在尝试读取输入时停止一样。 
+.sp
+.LP
+在 shell 中引用作业有多种方法。根据作业的任何进程的进程 ID 或下列各项之一可以引用作业:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fInumber\fR\fR
+.ad
+.RS 12n
+.rt  
+带有指定编号的作业。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fIstring\fR\fR
+.ad
+.RS 12n
+.rt  
+命令行以\fI字符串\fR开头的所有作业。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%?\fR\fIstring\fR\fR
+.ad
+.RS 12n
+.rt  
+命令行包含\fI字符串\fR的所有作业。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%%\fR\fR
+.ad
+.RS 12n
+.rt  
+当前作业。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%+\fR\fR
+.ad
+.RS 12n
+.rt  
+等效于 \fB%%\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%-\fR\fR
+.ad
+.RS 12n
+.rt  
+以前的作业。
+.RE
+
+.sp
+.LP
+当进程更改状态时,shell 可立即获悉。当作业已被阻塞以致无法执行其他进程时,shell 通常会向您发送通知,但仅在输出提示前发送此通知。其目的是为了避免打扰您的工作。\fBset\fR 命令的通知选项导致 shell 在作业发生更改时立即输出这些作业更改消息。
+.sp
+.LP
+启用 \fBmonitor\fR 选项后,完成的每个后台作业都会触发为 \fBCHLD\fR 设置的所有陷阱。
+.sp
+.LP
+如果您尝试在作业正在运行或已停止时退出 shell,系统会向您发送\fB您已经停止(在运行)作业\fR警告。使用 \fBjobs\fR 命令可以查看这些作业。如果您立即尝试再次退出,shell 不会向您发出第二次警告,而会终止停止的作业。登录 shell 收到 \fBHUP\fR 信号后,它会将 \fBHUP\fR 信号发送到未使用 \fBdisown\fR 内置命令否认的每个作业。
+.SS "信号"
+.sp
+.LP
+如果调用的命令后跟有 \fB&\fR,并且 \fBmonitor\fR 选项处于非活动状态,则会忽略该命令的 \fBINT\fR 和 \fBQUIT\fR 信号。否则,信号具有 shell 从父级继承的值。请参见 \fBtrap\fR 内置命令。
+.SS "执行"
+.sp
+.LP
+每次读取命令时都会执行替换。如果命令名称与本手册页的\fB特殊内置命令\fR部分中的某个命令名称相匹配,则会在当前 shell 进程中执行此命令。接着,系统会检查此命令名称,查看其是否与某个用户定义函数匹配。如果匹配,则会保存位置参数,并将其重置为函数调用的参数。函数同样在当前 shell 进程中执行。函数完成或发出返回命令之后,系统将恢复位置参数列表。对于使用 \fBfunction\fR \fBname\fR 语法定义的函数,系统将执行在 \fBEXIT\fR 时在函数中设置的所有陷阱。函数的退出值即为执行的最后一个命令的值。如果命令名称不是特殊内置命令或用户定义函数,而是某个内置命令,则会在当前 shell 进程中执行此命令。
+.sp
+.LP
+shell 变量 \fBPATH\fR 定义此命令所在的目录的搜索路径。备用路径名称使用冒号 (\fB:\fR) 分隔。缺省路径为 \fB/bin:/usr/bin:\fR,并按此顺序指定 \fB/bin\fR、\fB/usr/bin\fR 和当前目录。可以使用两个或多个相邻冒号指定当前目录,也可以使用位于路径列表开头或末尾的一个冒号来指定当前目录。如果命令名称包含斜杠 (\fB/\fR),则不会使用搜索路径。否则,将在此路径的每个目录中搜索具有指定名称的可执行文件(不是目录)。如果找到此文件,并且如果 shell 确定存在与指定路径名对应的内置命令版本,则会在当前进程中调用此内置命令。如果找到此文件,并且此目录还包含在 \fBFPATH\fR 变量的值中,则会将此文件装载到当前 shell 环境,就像是 . 命令的参数一样(除非只扩展预设别名),并按照本手册页中的说明执行具有指定名称的函数。如果未找到此文件,但找到文件 \fB\&.paths\fR,并且此文件包含一个 \fBFPATH=\fR\fIpath\fR 格式的行,其中 \fIpath\fR 是现有目录,并且此目录包含具有指定名称的文件,那么,则会将此文件装载到当前 shell 环境,就像是 \fB\&.特殊\fR内置命令的参数一样,并执行具有指定名称的函数。否则,如果找到此文件,则会创建一个进程,并尝试使用 \fBexec\fR(2) 执行命令。
+.sp
+.LP
+找到可执行文件后,系统将在此可执行文件所在的目录中搜索名为 \fB\&.paths\fR 的文件。如果找到此文件,并且该文件包含一个 \fBBUILTIN_LIB=\fR\fIvalue\fR 格式的行,则会搜索根据 \fIvalue\fR 命名的库,就像是 \fBbuiltin -f\fR 的选项参数一样,并且如果此文件包含具有指定名称的内置命令,则会执行此内置命令,而不会执行具有此名称的命令。否则,如果找到此文件,并且该文件的第一行或第二行中包含一个 \fIname\fR\fB=\fR\fI value\fR 格式的行,则会通过将 \fIvalue\fR 指定的目录添加到目录列表开头来修改环境变量 \fIname\fR。如果 \fIvalue\fR 不是绝对目录,则会指定一个相对于可执行文件所在目录的目录。如果环境变量 \fIname\fR 不存在,则会将其添加到指定命令的环境列表中。
+.sp
+.LP
+如果此文件具有执行权限,但不是 \fBa.out\fR 文件,则假定此文件是含有 shell 命令的文件。系统会派生一个单独的 shell 来读取此文件。此种情况下,将删除所有非导出的变量。如果 shell 命令文件没有读取权限,并且/或者如果在此文件中设置了 \fBsetuid\fR 和 \fBsetgid\fR 位,此 shell 则会执行其作业为设置权限的代理,并执行此 shell,同时将此 shell 命令文件作为打开文件文件向下传递。带有括号的命令在子 shell 中执行,而不会删除非导出的变量。
+.SS "命令重新输入"
+.sp
+.LP
+从终端设备输入的最后一个 \fBHISTSIZE\fR(缺省值为 512)命令的文本保存在历史文件中。如果未设置 \fBHISTFILE\fR 变量或者如果此变量指定的文件无法写入,则会使用 \fB$HOME/.sh_history\fR。shell 可以访问使用同一名称 \fBHISTFILE\fR 的所有交互式 shell 的命令。内置命令 \fBhist\fR 用于列出或编辑此文件的某个部分。要编辑或列出的文件部分可以根据编号进行选择,或者通过指定此命令的第一个字符或前几个字符来进行选择。可以指定一个命令或一系列命令。如果未将编辑器程序指定为 \fBhist\fR 的参数,则会使用变量 \fBHISTEDIT\fR 的值。如果取消设置 \fBHISTEDIT\fR,则使用已过时的变量 \fBFCEDIT\fR。如果未定义 \fBFCEDIT\fR,则使用 \fB/bin/ed\fR。在退出编辑器时,除非您在未写入的情况下退出,否则将重新输出和执行已编辑的命令。\fB-s\fR 选项(以及已过时的版本中的编辑器名称 \fB -\fR)用于跳过编辑短语并重新执行此命令。此种情况下,在执行之前,可使用 \fIold\fR\fB=\fR\fInew\fR 格式的替换参数来修改命令。例如,使用 \fB\&'hist -s'\fR 的预设别名 \fBr\fR,键入 \fB`r bad=good c'\fR 将重新执行以字母 \fBc\fR 开头的最新命令,并将出现的第一个字符串 bad 替换为字符串 good。 
+.SS "内嵌编辑选项"
+.sp
+.LP
+通常,从终端设备输入的每个命令行在键入时仅后跟有一个换行符(回车或换行符)。如果已激活 \fBemacs\fR、\fBgmacs\fR 或 \fBvi\fR 选项,用户则可以编辑命令行。要进入这些编辑模式,请设置相应选项。每次向 \fBVISUAL\fR 或 \fBEDITOR\fR 变量分配一个以上述选项名称结尾的值时,都会自动选择编辑选项。
+.sp
+.LP
+编辑功能要求用户终端将回车作为无换行符的回车接受,并且空格必须覆写屏幕上的当前字符。
+.sp
+.LP
+除非启用 \fBmultiline\fR 选项,否则编辑模式会实现在当前行查看整个窗口的内容的概念。窗口宽度为 \fBCOLUMNS\fR 的值(如果定义),否则为 \fB80\fR。如果窗口宽度太小以致无法显示提示,并且至少保留了 8 列来输入相关输入,则会从左侧截断提示。如果此行长于窗口宽度减去 2 的值,则会在窗口末端显示一个标记以便通知用户。当光标移动并达到窗口边界时,该窗口会将光标放置在中间位置。如果该行向窗口右侧、左侧或两侧延伸,标记分别为 \fB>\fR、\fB<、*\fR。
+.sp
+.LP
+每种编辑模式下的搜索命令都可以提供对历史文件的访问。仅匹配字符串(而非模式),但字符串中的前导 \fB^\fR 将匹配范围限制为从行中的第一个字符开始。
+.sp
+.LP
+每种编辑模式都具有列出与部分输入的单词匹配的文件或命令的操作。如果对行中的第一个单词或者对 \fB;\fR、\fB|\fR、\fB&\fR 或 \fB(\fR 后的第一个单词应用此功能,并且此单词不以 \fB~\fR 开头或不包含 \fB/\fR,则会显示 \fBPATH\fR 变量定义的可与部分单词匹配的别名、函数和可执行命令的列表。否则显示与指定单词匹配的文件的列表。如果部分输入的单词不包含任何文件扩展字符,则会在生成这些列表之前附加一个 \fB*\fR。显示生成的列表之后,将重新绘制输入行。这些操作分别称为命令行列出和文件名列出操作。此外,还存在一些称为命令名称完成和文件名完成的其他操作,这些操作计算匹配命令或文件的列表,但不会输出此列表,而是用完整匹配项或部分匹配项替换当前单词。对于文件名完成操作,如果匹配项是唯一的,则会附加一个 \fB/\fR(如果该文件为目录)和空格(如果该文件不为目录)。否则会使用所有匹配文件的最长共同前缀替换此单词。对于命令名称完成,仅使用最后一个 \fB/\fR 后面的文件名部分来查找最长的命令前缀。如果只有一个名称与此前缀匹配,则会将此单词替换为此命令名称,并在后面添加一个空格。当对未生成唯一匹配项的完成操作使用\fB制表符\fR时,后续制表符将提供带有编号的匹配备用项的列表。通过输入后跟有制表符的选择编号,可以选择特定项。
+.SS "键绑定"
+.sp
+.LP
+\fBKEYBD\fR 陷阱可用于在键入键时拦截键,并更改 shell 实际看到的字符。当从终端读取时,将在输入每个字符(如果第一个字符为 ESC,则为字符序列)后执行此陷阱。
+.sp
+.LP
+变量 \fB\&.sh.edchar\fR 包含生成此陷阱的字符或字符序列。在陷阱操作中更改 \fB\&.sh.edchar\fR 的值将导致 shell 的行为就像新值(而非原始值)是从键盘输入的一样。变量 \fB\&.sh.edcol\fR 设置为输入时光标所在的输入列编号。当处于 \fBvi\fR 插入模式时,变量 \fB\&.sh.edmode\fR 设置为 \fBESC\fR,在其他情况下则设置为空。在分配给 \fB\&.sh.edchar\fR 的值前面添加 \fB${.sh.editmode}\fR 将导致 shell 更改为此控制模式(如果未处于此模式下)。
+.sp
+.LP
+对于作为编辑指令的参数输入的字符,或者当读取字符搜索的输入时,不会调用此陷阱。
+.SS "\fBemacs\fR 编辑模式"
+.sp
+.LP
+通过启用 \fBemacs\fR 或 \fBgmacs\fR 选项,可以进入此模式。这两种模式之间的唯一区别在于它们对 \fB^T\fR 的处理方式。要进行编辑,用户应将光标移至需要校正的位置,然后根据需要插入或删除字符或单词。所有编辑命令均为控制字符或转义序列。控制字符的表示法为后跟有字符的插入记号 (\fB^\fR)。
+.sp
+.LP
+例如,\fB^F\fR 是 Ctrl/F 的表示法。按住 Ctrl(控制)键并按下 \fBf\fR 可以输入 ^F。不按下 Shift 键。(表示法 \fB^?\fR 表示 Del(删除)键。)
+.sp
+.LP
+转义序列的表示法为后跟有字符的 \fBM-\fR。例如,通过先后按下 Esc (\fBASCII 033\fR) 和 \fBf\fR 可以输入 \fBM-f\fR(发音为 \fBMeta f\fR)。\fBM-F\fR 是后跟有 \fBF\fR 的 ESC 的表示法。
+.sp
+.LP
+所有编辑命令都可从行中的任意位置运行,而不仅限于行开头。除非另行说明,否则不会在编辑命令之后输入回车或换行符键。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^F\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向前(向右)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[C\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向前(向右)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-f\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向前移动一个单词。对于 \fBemacs\fR 编辑器而言,单词是仅由字母、数字和下划线组成的字符串。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^B\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向后(向左)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[D\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向后(向左)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-b\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向后移动一个单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^A\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至行开头。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[H\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至行开头。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^M\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至行尾。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[Y\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至行尾。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^]\fR\fIchar\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向前移动到当前行中的字符 \fIchar\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^]\fR\fIchar\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向后移动到当前行中的字符 \fIchar\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^X^X\fR\fR
+.ad
+.RS 13n
+.rt  
+交换光标和标记。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIerase\fR\fR
+.ad
+.RS 13n
+.rt  
+删除上一字符。用户定义的清除字符使用 \fBstty\fR(1) 命令定义,该字符通常为 \fB^H\fR 或 \fB#\fR。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIlnext\fR\fR
+.ad
+.RS 13n
+.rt  
+删除下一字符的编辑功能。用户定义的下一文本字符使用 \fBstty\fR(1) 命令定义,如果未定义此字符,则为 \fB^V\fR。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^D\fR\fR
+.ad
+.RS 13n
+.rt  
+删除当前字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-d\fR\fR
+.ad
+.RS 13n
+.rt  
+删除当前单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^H\fR\fR
+.ad
+.RS 13n
+.rt  
+元 Back Space 键。删除上一单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-h\fR\fR
+.ad
+.RS 13n
+.rt  
+删除上一单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^?\fR\fR
+.ad
+.RS 13n
+.rt  
+元 Del 键。删除上一单词。如果中断字符为 \fB^?\fR(缺省为 DEL),则不会运行此命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^T\fR\fR
+.ad
+.RS 13n
+.rt  
+在 \fBemacs\fR 模式下将当前字符与上一字符换位并向前移动光标。在 \fBgmacs\fR 模式下将前两个字符换位。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^C\fR\fR
+.ad
+.RS 13n
+.rt  
+大写当前字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-c\fR\fR
+.ad
+.RS 13n
+.rt  
+大写当前单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-l\fR\fR
+.ad
+.RS 13n
+.rt  
+将当前单词更改为小写字母。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^K\fR\fR
+.ad
+.RS 13n
+.rt  
+删除光标至行尾之间的内容。如果此命令前面带有一个其值小于当前光标位置的数字参数,则删除指定位置到光标之间的内容。如果此命令前面带有一个其值大于当前光标位置的数字参数,则删除光标到指定光标位置之间的内容。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^由 W\fR\fR
+.ad
+.RS 13n
+.rt  
+删除光标到标记之间的内容。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-p\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标到标记之间的区域推送到堆栈中。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIkill\fR\fR
+.ad
+.RS 13n
+.rt  
+删除整个当前行。用户定义的删除字符使用 \fBstty\fR(1) 命令定义,该字符通常为 \fB^G\fR 或 \fB@\fR。如果连续输入了两个删除字符,从此时起输入的所有删除字符都会导致一个换行符。当使用纸张终端时,此功能非常有用。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^Y\fR\fR
+.ad
+.RS 13n
+.rt  
+恢复从行中删除的上一项。在行中重新输出此项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^L\fR\fR
+.ad
+.RS 13n
+.rt  
+换行并输出当前行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^L\fR\fR
+.ad
+.RS 13n
+.rt  
+清除屏幕。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^@\fR\fR
+.ad
+.RS 13n
+.rt  
+空字符。设置标记。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIspace\fR\fR
+.ad
+.RS 13n
+.rt  
+元空格。设置标记。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^J\fR\fR
+.ad
+.RS 13n
+.rt  
+新行。执行当前行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^M\fR\fR
+.ad
+.RS 13n
+.rt  
+返回。执行当前行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOF\fR\fR
+.ad
+.RS 13n
+.rt  
+仅当当前行为空时,文件结尾字符(通常为 \fB^D\fR)才会作为\fB文件结尾\fR处理。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^P\fR\fR
+.ad
+.RS 13n
+.rt  
+获取上一命令。每次输入 \fB^P\fR 时,都会访问前面的上一命令。如果该命令不在多行命令的第一行中,则往回移动一行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[A\fR\fR
+.ad
+.RS 13n
+.rt  
+等效于 \fB^P\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-<\fR\fR
+.ad
+.RS 13n
+.rt  
+获取最早(最旧)的历史行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM->\fR\fR
+.ad
+.RS 13n
+.rt  
+获取最近(最新)的历史行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^N\fR\fR
+.ad
+.RS 13n
+.rt  
+获取下一命令行。每次输入 \fB^N\fR 时,都会访问后面的下一命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[B\fR\fR
+.ad
+.RS 13n
+.rt  
+等效于 \fB^N\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^R\fR\fIstring\fR\fR
+.ad
+.RS 13n
+.rt  
+颠倒含有 \fIstring\fR 的上一命令行的搜索历史。如果指定参数 0,搜索则为正向搜索。\fIstring\fR 以回车或换行符结束。如果 string 前面带有 \fB^\fR,匹配行必须以 \fIstring\fR 开头。如果省略了 \fIstring\fR,则会访问包含最新的 \fIstring\fR 的下一命令行。此种情况下,参数 0 将颠倒搜索方向。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^O\fR\fR
+.ad
+.RS 13n
+.rt  
+运行。执行当前行,获取历史文件中相对于当前行的下一行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIdigits\fR\fR
+.ad
+.RS 13n
+.rt  
+转义。定义数字参数。这些数字作为下一命令的参数。接受参数的命令包括:\fB^F\fR、\fB^B\fR、\fBERASE\fR、\fB^C\fR、\fB^D\fR、\fB^K\fR、\fB^R\fR、\fB^P\fR、\fB^N\fR、\fB^]\fR、\fBM-.\fR、\fBM-\fR、\fBM-^]\fR、\fBM-_\fR、\fBM-=\fR、\fBM-b\fR、\fBM-c\fR、\fBM-d\fR、\fBM-f\fR、\fBM-h\fR、\fBM-l\fR 和 \fBM-^H\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fR\fIletter\fR\fR
+.ad
+.RS 13n
+.rt  
+软键。根据名称 \fIletter\fR 在别名列表中搜索别名。如果定义了 \fIletter\fR 的名称,则在输入队列中插入其值。\fIletter\fR 不能是此部分中的元函数之一。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-[\fR\fIletter\fR\fR
+.ad
+.RS 13n
+.rt  
+软键。根据名称 \fIletter\fR 在别名列表中搜索别名。如果定义了此名称的别名,则在输入队列中插入其值。此命令可用于在许多终端上对功能键进行编程。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-.\fR\fR
+.ad
+.RS 13n
+.rt  
+在行中插入上一命令的最后一个单词。如果此命令前面带有一个数字参数,此参数的值确定要插入的单词,而不是最后一个单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-_\fR\fR
+.ad
+.RS 13n
+.rt  
+与 \fBM-.\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-*\fR\fR
+.ad
+.RS 13n
+.rt  
+尝试根据当前单词生成文件名。如果单词不与任何文件匹配或不包含任何特殊模式字符,则会附加一个星号。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-\fRESC\fR
+.ad
+.RS 13n
+.rt  
+按照本手册页中的说明执行命令或文件名完成操作。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^I\fRTAB\fR
+.ad
+.RS 13n
+.rt  
+尝试按照本手册页中的说明执行命令或文件名完成操作。如果发生部分完成,重复此操作的行为就像输入了 \fBM-=\fR 一样。如果未找到匹配项或者在空格后输入,则会插入一个制表符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-=\fR\fR
+.ad
+.RS 13n
+.rt  
+如果此命令前面没有数字参数,则会按照本手册页中的说明生成匹配的命令或文件名的列表。否则,光标下的单词将替换为与最近生成的命令或文件列表中的数字参数的值相对应的项。如果光标不在单词上方,则会插入此单词。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^U\fR\fR
+.ad
+.RS 13n
+.rt  
+将下一命令的参数乘以 \fB4\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 13n
+.rt  
+对下一字符进行转义。如果前面带有 \fB\e\fR,则可以在命令行或搜索字符串中输入编辑字符、用户的清除、删除和中断(通常为 \fB^?\fR)字符。\fB\e\fR 删除下一字符的编辑功能(如果有)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-^V\fR\fR
+.ad
+.RS 13n
+.rt  
+显示 shell 版本。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM-#\fR\fR
+.ad
+.RS 13n
+.rt  
+如果行不以 \fB#\fR 开头,则会在此行开头以及每个换行符后面插入一个 \fB#\fR,并输入此行。这会导致在历史文件中插入注释。如果行以 \fB#\fR 开头,则会删除 \fB#\fR,并删除每个换行符后面的一个 \fB#\fR。
+.RE
+
+.SS "\fBvi\fR 编辑模式"
+.sp
+.LP
+有两种键入模式。最初,当您输入命令时,您处于输入模式下。要进行编辑,用户应通过键入 ESC (033) 进入控制模式,将光标移至需要校正的位置,然后根据需要插入或删除字符或单词。大多数控制命令都接受命令前面的可选重复 \fIcount\fR。 
+.sp
+.LP
+当在大多数系统上处于 vi 模式时,如果速度为 1200 波特或更大值,并且命令包含任何控制字符,或者自输出提示以来所经过的时间不到 1 秒,则会在一开始时启用标准化处理,并重新回显命令。ESC 字符终止命令提示的标准化处理,然后用户可以修改命令行。此方案具有标准化处理以及对原始模式进行输入提示回显的优势。
+.sp
+.LP
+如果还设置了选项 \fBviraw\fR,终端始终会禁用标准化处理。对于不支持两种备用的行尾分隔符的系统,此模式是固有的,并且对某些终端可能会很有用。 
+.SS "输入编辑命令"
+.sp
+.LP
+缺省情况下,编辑器处于输入模式。
+.sp
+.LP
+支持下列输入编辑命令:
+.sp
+.ne 2
+.mk
+.na
+\fBERASE\fR
+.ad
+.RS 10n
+.rt  
+使用 \fBstty\fR 命令定义的用户定义清除字符,通常为 \fB^H\fR 或 \fB#\fR。删除上一字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^由 W\fR\fR
+.ad
+.RS 10n
+.rt  
+删除由空格分隔的上一单词。在某些系统上,可能需要使用 \fBviraw\fR 选项,此命令才能正常运行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBEOF\fR
+.ad
+.RS 10n
+.rt  
+除非设置了 \fBignoreeof\fR 选项,否则行的第一个字符将导致 shell 终止。否则,将忽略此字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIlnext\fR\fR
+.ad
+.RS 10n
+.rt  
+使用 \fBstty\fR(1) 定义的下一用户定义文本字符,如果未定义此字符,则为 \fB^V\fR。删除下一字符的编辑功能(如果有)。在某些系统上,可能需要使用 \fBviraw\fR 选项,此命令才能正常运行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 10n
+.rt  
+将下一 ERASE 或 KILL 字符转义。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^I\fR TAB\fR
+.ad
+.RS 10n
+.rt  
+尝试按照本手册页中的说明执行命令或文件名完成操作,并返回到输入模式。如果发生部分完成,重复此操作的行为就像从控制模式输入了 \fB=\fR 一样。如果未找到匹配项或者在空格后输入,则会插入一个制表符。
+.RE
+
+.SS "运动编辑命令"
+.sp
+.LP
+运动编辑命令可移动光标。
+.sp
+.LP
+支持下列运动编辑命令:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]l\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向前(向右)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][C\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向前(向右)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]w\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向前移动一个字母数字单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]W\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至空格后的下一个单词的开头。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]e\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至单词末尾。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]E\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至以当前空格分隔的单词的末尾。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]h\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向后(向左)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][D\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向后(向左)移动一个字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]b\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标向后移动一个单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]B\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至以空格分隔的上一单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]|\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至列 \fIcount\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]f\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+在当前行中查找下一字符 \fIc\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]F\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+在当前行中查找上一个字符 \fIc\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]t\fR\fIC\fR\fR
+.ad
+.RS 13n
+.rt  
+等效于 \fBf\fR 后跟 \fBh\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]T\fR\fIc\fR\fR
+.ad
+.RS 13n
+.rt  
+等效于 \fBF\fR 后跟 \fBl\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB];\fR\fR
+.ad
+.RS 13n
+.rt  
+重复最后一个单字符查找命令 \fIcount\fR 次:\fBf\fR、\fBF\fR, \fBt、\fR 或 \fBT\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB],\fR\fR
+.ad
+.RS 13n
+.rt  
+反向最后一个单字符查找命令 \fIcount\fR 次。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移到行首。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移到行首。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[H\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移到行中的第一个非空白字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至行尾。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[Y\fR\fR
+.ad
+.RS 13n
+.rt  
+将光标移至行尾。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR\fR
+.ad
+.RS 13n
+.rt  
+移动到对称的 \fB(\fR、\fB)\fR、\fB{\fR、\fB}\fR、\fB[\fR 或 \fB]\fR。如果光标不在本部分所述的任何一个字符上,将先在该行的剩余部分中搜索第一次出现的这些字符之一。
+.RE
+
+.SS "搜索编辑命令"
+.sp
+.LP
+搜索编辑命令可以访问您的命令历史记录。
+.sp
+.LP
+支持下列搜索编辑命令:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]k\fR\fR
+.ad
+.RS 14n
+.rt  
+获取上一命令。每次输入 \fBk\fR 时,都会访问之前的上一条命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]-\fR\fR
+.ad
+.RS 14n
+.rt  
+获取上一命令。每次输入 \fBk\fR 时,都会访问之前的上一条命令。
+.sp
+等效于 \fBk\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][A\fR\fR
+.ad
+.RS 14n
+.rt  
+获取上一命令。每次输入 \fBk\fR 时,都会访问之前的上一条命令。
+.sp
+等效于 \fBk\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]j\fR\fR
+.ad
+.RS 14n
+.rt  
+获取下一条命令。每次输入 \fBj\fR 时,都会访问以后的下一条命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]+\fR\fR
+.ad
+.RS 14n
+.rt  
+获取下一条命令。每次输入 \fBj\fR 时,都会访问以后的下一条命令。
+.sp
+等效于 \fBj\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB][B\fR\fR
+.ad
+.RS 14n
+.rt  
+获取下一条命令。每次输入 \fBj\fR 时,都会访问以后的下一条命令。
+.sp
+等效于 \fBj\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]G\fR\fR
+.ad
+.RS 14n
+.rt  
+获取命令编号 \fIcount\fR。缺省命令为最早的历史命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/\fR\fI字符串\fR\fR
+.ad
+.RS 14n
+.rt  
+在历史记录中向后搜索包含 \fIstring\fR 的上一条命令。\fIstring\fR 以回车或换行符结束。如果 string 前面带有 \fB^\fR,匹配行必须以 \fIstring\fR 开头。如果 \fIstring\fR 为空,则使用上一个字符串。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fI字符串\fR\fR
+.ad
+.RS 14n
+.rt  
+在历史记录中向前搜索包含 \fIstring\fR 的上一条命令。\fIstring\fR 以回车或换行符结束。如果 string 前面带有 \fB^\fR,匹配行必须以 \fIstring\fR 开头。如果 \fIstring\fR 为空,则使用上一个字符串。
+.sp
+除了搜索方向是向前外,其余均与 \fI/\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBn\fR\fR
+.ad
+.RS 14n
+.rt  
+向后搜索 \fI/\fR 或 \fI?\fR 命令的最后一个模式的下一个匹配项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBN\fR\fR
+.ad
+.RS 14n
+.rt  
+向前搜索 \fI/\fR 或 \fI?\fR 的最后一个模式的下一个匹配项。
+.RE
+
+.SS "文本修改编辑命令"
+.sp
+.LP
+以下命令可修改行:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBa\fR\fR
+.ad
+.RS 19n
+.rt  
+进入输入模式并在当前字符后输入文本。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA\fR\fR
+.ad
+.RS 19n
+.rt  
+将文本附加到行尾。等效于 \fB$a\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]c\fR\fImotion\fR\fR
+.ad
+.br
+.na
+\fB\fBc[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+从当前字符删除到 \fImotion\fR 将光标移动到的字符,并进入输入模式。如果 \fImotion\fR 为 \fBc\fR,将删除整行并进入输入模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBC\fR\fR
+.ad
+.RS 19n
+.rt  
+从当前字符删除到行尾并进入输入模式。等效于 \fBc$\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS\fR\fR
+.ad
+.RS 19n
+.rt  
+等效于 \fBcc\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]s\fR\fR
+.ad
+.RS 19n
+.rt  
+在输入模式中替换光标下方的字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD[\fR\fIcount\fR\fB]d\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+从当前字符删除到行尾。等效于 d$。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBd[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 19n
+.rt  
+从当前字符删除到 \fImotion\fR 将移动到的字符。如果 \fImotion\fR 为 d,将删除整行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 19n
+.rt  
+进入输入模式并在当前字符前插入文本。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBI\fR\fR
+.ad
+.RS 19n
+.rt  
+在行首之前插入文本。等效于 \fB0i\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]P\fR\fR
+.ad
+.RS 19n
+.rt  
+在光标之前放置以前修改的文本。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]p\fR\fR
+.ad
+.RS 19n
+.rt  
+在光标之后放置以前修改的文本。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBR\fR\fR
+.ad
+.RS 19n
+.rt  
+进入输入模式并将屏幕上的字符替换为您以覆盖方式键入的字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]r\fR\fIc\fR\fR
+.ad
+.RS 19n
+.rt  
+将从当前光标位置开始的 \fIcount\fR 个字符替换为 \fIc\fR,并向前移动光标。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]x\fR\fR
+.ad
+.RS 19n
+.rt  
+删除当前字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]X\fR\fR
+.ad
+.RS 19n
+.rt  
+删除前面的字符。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR].\fR\fR
+.ad
+.RS 19n
+.rt  
+重复上一条文本修改命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]~\fR\fR
+.ad
+.RS 19n
+.rt  
+转换从当前光标位置开始的 \fIcount\fR 个字符的大小写,并向前移动光标。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fIcount\fR]_\fR\fR
+.ad
+.RS 19n
+.rt  
+促使附加上一条命令中的 \fIcount\fR 单词并进入输入模式。如果省略 \fIcount\fR,则使用最后一个单词。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 19n
+.rt  
+促使 \fB*\fR 附加到当前的单词并尝试生成文件名。如果未找到匹配项,则会发出铃声。否则,将该单词替换为匹配模式并进入输入模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\fR\fR
+.ad
+.RS 19n
+.rt  
+按照本手册页中的说明执行命令或文件名完成操作。
+.RE
+
+.SS "其他编辑命令"
+.sp
+.LP
+支持下列其他编辑命令: 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]y\fR\fImotion\fR\fR
+.ad
+.br
+.na
+\fB\fBy[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
+.ad
+.RS 18n
+.rt  
+将当前字符到 \fImotion\fR 将光标移动到的字符全部移出。将移出的字符放在删除缓冲区中。文本和光标位置保持不变。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fByy\fR\fR
+.ad
+.RS 18n
+.rt  
+移出当前行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBY\fR\fR
+.ad
+.RS 18n
+.rt  
+移出从当前的光标位置直到行尾的当前行。等效于 \fBy$\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBu\fR\fR
+.ad
+.RS 18n
+.rt  
+撤消最后一个文本修改命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBU\fR\fR
+.ad
+.RS 18n
+.rt  
+撤消对当前行执行的所有文本修改命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]V\fR\fR
+.ad
+.RS 18n
+.rt  
+返回以下命令:
+.sp
+.in +2
+.nf
+hist -e ${VISUAL:-${EDITOR:-vi}} \fIcount\fR
+.fi
+.in -2
+.sp
+
+该命令位于输入缓冲区中。如果省略 \fIcount\fR,则使用当前行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^L\fR\fR
+.ad
+.RS 18n
+.rt  
+换行并输出当前行。该命令仅在控制模式下使用。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^J\fR\fR
+.ad
+.RS 18n
+.rt  
+新行。无论处于什么模式下,都执行当前行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^M\fR\fR
+.ad
+.RS 18n
+.rt  
+返回。无论处于什么模式下,都执行当前行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 18n
+.rt  
+如果该命令的第一个字符是 \fB#\fR,则删除该 \fB#\fR 及换行符之后的每个 \fB#\fR。
+.sp
+否则,在该命令的每行前面插入 \fB#\fR 之后发送该行。 
+.sp
+该命令非常有用,可以将当前行作为注释插入历史记录中,以及取消注释历史文件中以前带有注释的命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIcount\fR\fB]=\fR\fR
+.ad
+.RS 18n
+.rt  
+如果未指定 \fIcount\fR,则生成本手册页中所述的匹配命令或文件名的列表。
+.sp
+否则,将当前光标位置的单词替换为最近生成的命令或文件列表中的 \fIcount\fR 项。如果光标未停留在单词上,则会在当前光标位置之后插入该项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB@\fR\fIletter\fR\fR
+.ad
+.RS 18n
+.rt  
+在别名列表中按名称 \fIletter\fR 搜索别名。如果该名称的别名已经定义,则在输入队列中插入其值以进行处理。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB^A\fR\fR
+.ad
+.RS 18n
+.rt  
+显示 shell 的版本。
+.RE
+
+.SS "内置命令"
+.sp
+.LP
+以下的简单命令将在 shell 进程中执行。允许输入和输出重定向。除非另有说明,否则输出将写入在文件描述符 \fB1\fR 中,并且退出状态(如果没有语法错误)为 \fB0\fR。除了 \fB :\fR、\fBtrue\fR、\fBfalse\fR、\fBecho\fR、\fBnewgrp\fR 和 \fBlogin\fR 外,其他所有的内置命令都接受 \fB--\fR 以指示选项结束。它们还可以将选项 \fB--man\fR 解释为在标准错误中显示手册页的请求,以及将 \fB-?\fR 解释为在标准错误中输出用法消息的帮助请求。
+.sp
+.LP
+前面添加了一个或两个 \fB++\fR 符号的命令是特殊的内置命令,将通过以下方式进行特殊处理:
+.RS +4
+.TP
+1.
+命令完成时,该命令前面的变量赋值列表仍然有效。
+.RE
+.RS +4
+.TP
+2.
+在变量赋值之后处理 I/O 重定向。
+.RE
+.RS +4
+.TP
+3.
+脚本中包含的错误会导致其中止。
+.RE
+.RS +4
+.TP
+4.
+它们不是有效的函数名称。
+.RE
+.RS +4
+.TP
+5.
+对于跟在前面添加了 \fB++\fR 的命令之后且格式为变量赋值格式的单词,将通过与变量赋值相同的规则进行扩展。这意味着将在 \fB=\fR 符号之后执行波浪号替换,并且不执行字段分割和文件名生成。
+.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ : [\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+该命令仅扩展参数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ .\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果 \fIname\fR 是一个通过 \fBfunction\fR \fBname\fR 保留字语法定义的函数,则会在当前环境中执行该函数(就好像它是通过 \fIname()\fR 语法定义的一样)。否则,如果 \fIname\fR 表示一个文件,则会读取整个文件并在当前的 shell 环境中执行命令。通过 PATH 指定的搜索路径用于查找包含该文件的目录。如果指定了任何参数 \fIarg\fR,则在处理 . 命令时这些参数将变为位置参数,并在完成时恢复原始的位置参数。否则,位置参数保持不变。退出状态是最后执行的命令的退出状态。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++ alias [\fR\fB-ptx\fR\fB] [\fR\fIname\fR\fB[ =\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+不包含参数的 \fBalias\fR 可在标准输出中以 \fIname\fR\fB=\fR\fIvalue\fR 的格式输出别名列表。可通过 \fB-p\fR 选项在每个名称之前插入单词 alias。如果指定一个或多个参数,将为已指定其 \fIvalue\fR 的每个 \fIname\fR 定义 \fIalias\fR。可通过 \fIvalue\fR 中的结尾空格选中下一个单词进行别名替换。过时的 \fB-t\fR 选项用于设置和列出被跟踪的别名。被跟踪别名的值是与指定的 \fIname\fR 对应的完整路径名。如果 \fBPATH\fR 的值重置但别名仍被跟踪,被跟踪别名的值将变成未定义的值。如果没有 \fB-t\fR 选项,则对于参数列表中没有为其指定 \fIvalue\fR 的每个 \fIname\fR,都将输出别名的名称和值。过时的 -x 选项没有作用。如果指定了 \fIname\fR,但没有提供值,也没有为 \fIname\fR 定义别名,则退出状态为\fB非零\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbg [\fR \fIjob\fR\fB\&...]\fR\fR
+.ad
+.sp .6
+.RS 4n
+该命令仅适用于支持作业控制的系统。将指定的每个 \fIjob\fR 放入后台。如果未指定 \fIjob\fR,则将当前作业放入后台。请参见本手册页的 \fBJobs\fR 部分了解 \fIjob\fR 格式的说明。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+ break [\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+从封闭的 \fBfor\fR、\fBwhile\fR、\fBuntil\fR 或 \fBselect\fR 循环(如果有)中退出。如果指定了 \fIn\fR,则分成 \fIn\fR 个级别。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbuiltin [\fR\fB-ds\fR \fB] [\fR\fB-f\fR \fIfile\fR\fB] [\fR\fIname ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果未指定 \fIname\fR 和 \fB-f\fR 选项,将在标准输出中输出内置名称。\fB-s\fR 选项仅输出特殊的内置名称。否则,每个 \fIname\fR 都代表其基名为内置名称的路径名。入口点函数名称通过在内置名称前面加上 \fIb\fR 确定。内置命令 \fImycommand\fR 的 ISO C/C++ 样例为 \fBb\fR\fImycommand(int argc, char *argv[], void *context)\fR,其中 \fIargv\fR 是 \fIargc\fR 元素的数组,\fIcontext\fR 是指向如 \fB<ast/shell.h>\fR 中所述的 \fBShell_t\fR 结构的可选指针。不能将特殊内置名称绑定到路径名或删除。\fB-d\fR 选项可删除所指定的每个内置名称。在支持动态装载的系统上,\fB-f\fR 选项可命名包含内置名称代码的共享库。可以省略共享库的前缀和/或后缀,具体取决于系统。装载某个库之后,其符号将可用于 \fBbuiltin\fR 的后续调用。可通过单独调用 \fBbuiltin\fR 命令指定多个库。按指定库时的反向顺序搜索库。装载某个库之后,该库将在名称为 \fBlib_init()\fR 的库中查找函数,并将此函数与参数 \fB0\fR 一起调用。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB] [\fR\fIarg\fR\fB]\fR\fR
+.ad
+.br
+.na
+\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB]\fR \fIold\fR \fInew\fR\fR
+.ad
+.sp .6
+.RS 4n
+该命令具有两种形式。 
+.sp
+在第一种形式中,它将当前目录更改为 \fIarg\fR。如果 \fIarg\fR 为 \fB-\fR,目录将被更改为以前的目录。shell 变量 \fBHOME\fR 是缺省的 \fIarg\fR。变量 \fBPWD\fR 被设置为当前目录。shell 变量 \fBCDPATH\fR 定义包含 \fIarg\fR 的目录的搜索路径。备用路径名称使用冒号 (\fB:\fR) 分隔。缺省路径是 \fBNULL\fR(指定当前目录)。当前目录是通过空路径名指定的,可以直接显示在等号之后或显示在路径列表中任何其他位置的冒号分界符之间。如果 \fIarg\fR 以 \fB/\fR 开头,则不使用搜索路径。否则,将搜索路径中每个目录的 \fIarg\fR。 
+.sp
+\fBcd\fR 的第二种形式在当前目录名称 \fBPWD\fR 中用字符串 \fInew\fR 替换字符串 \fIold\fR,并尝试更改为此新目录。缺省情况下,在查找目录名称时会按字面意思处理符号链接名称。这等效于 \fB-L\fR 选项。可通过 \fB-P\fR 选项在确定目录时解析符号链接。命令行中的 \fB-L\fR 或 \fB-P\fR 的最后一个实例可确定使用的方法。不能通过 \fBrksh\fR 执行 \fBcd\fR 命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcommand\fR \fB[\fR\fB-pvVx\fR\fB]\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果没有 \fB-v\fR 或 \fB-V\fR 选项,则通过由 \fIarg\fR 指定的参数执行 \fIname\fR。 
+.sp
+可通过 \fB-p\fR 选项搜索缺省路径,而不是 \fBPATH\fR 的值指定的路径。查找 \fIname\fR 时不会搜索函数。此外,如果 \fIname\fR 表示特殊内置名称,将忽略与前导剑形符号关联的任何特殊属性。例如,预定义别名 \fBredirect='command exec'\fR 可在指定的重定向无效时阻止脚本终止。 
+.sp
+在带有 \fB-x\fR 选项的情况下,如果由于参数过多会导致命令执行失败(\fBerrno E2BIG\fR),shell 将多次调用命令 \fIname\fR,且每次调用时包含部分参数。每次调用时,将会传递在扩展到多个参数的第一个单词之前以及在扩展到多个参数的最后一个单词之后出现的参数。退出状态为最大调用退出状态。 
+.sp
+在带有 \fB-v\fR 选项的情况下,\fBcommand\fR 等效于本部分中所述的内置 \fBwhence\fR 命令。\fB-V\fR 选项使 \fBcommand\fR 的作用相当于 \fBwhence -v\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+continue\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+继续执行封闭的 \fBfor\fR、\fBwhile\fR、\fBuntil\fR 或 \fBselect\fR 循环的下一次重复。如果指定了 \fIn\fR,则从第 \fIn\fR 次封闭循环继续执行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBdisown\fR \fB[\fR\fIjob...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+促使该 shell 在登录 shell 终止时不将 \fBHUP\fR 信号发送至指定的每个 \fIjob\fR,或不发送至所有活动作业(如果省略 \fIjob\fR)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBecho\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果第一个 \fIarg\fR 不以 \fB-\fR 开头,并且所有的参数均不包含反斜杠 (\fB\e\fR),则会输出其所有参数,并用空格隔开以及换行符终止。否则,\fBecho\fR 的行为与系统相关,并且应使用本部分中所述的 \fBprint\fR 或 \fBprintf\fR。请参见 \fBecho\fR(1) 了解用法和说明。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+eval\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+将这些参数作为输入读取到 shell 并执行生成的命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+exec\fR [\fB-c\fR] [\fB-a\fR \fIname ...\fR] \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果指定了 \fIarg\fR,将执行这些参数指定的命令而不是此 shell,同时不创建新进程。可通过 \fB-c\fR 选项在应用与 exec 调用关联的变量赋值之前清除环境。可通过 \fB-a\fR 选项将 \fIname\fR(而不是第一个 \fIarg\fR)变成新进程的 \fBargv[0]\fR。输入参数与输出参数可以显示并影响当前进程。如果未指定 \fIarg\fR,则该命令的作用是修改输入/输出重定向列表所指定的文件描述符。在这种情况下,任何通过该机制打开的 \fB2\fR 以上的文件描述符编号将在调用其他程序时关闭。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+exit\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+促使 shell 退出,退出状态由 \fIn\fR 指定。该值是指定状态的最低有效 8 位。如果省略 \fIn\fR,则退出状态为最后执行的命令的退出状态。此外,也可通过文件结尾使 shell 退出,但启用了 \fBignoreeof\fR 选项的 shell 除外。请参见 \fBset\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++export\fR \fB[\fR\fB-p\fR\fB]\fR \fB[\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果未指定 \fIname\fR,将输出具有导出属性的每个变量的名称和值,并且以能够重新输入的方式将值括起来。可通过 \fB-p\fR 选项在每个名称之前插入单词 export。否则,将对指定的 \fIname\fR 添加标记以自动导出到后续执行的命令的环境中。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfalse\fR\fR
+.ad
+.sp .6
+.RS 4n
+不执行任何操作,退出 \fB1\fR。与 \fBuntil\fR 结合使用以实现死循环。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfg\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+该命令仅适用于支持作业控制的系统。将指定的每个 \fIjob\fR 放入前台并按指定顺序等待。否则,将当前作业放入前台。请参见 \fBJobs\fR 了解 \fIjob\fR 格式的说明。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetconf\fR \fB[\fR\fIname\fR \fB[\fR\fIpathname\fR\fB]]\fR\fR
+.ad
+.sp .6
+.RS 4n
+输出 \fIname\fR 指定的配置参数的当前值。配置参数是通过 IEEE POSIX 1003.1 和 IEEE POSIX 1003.2 标准定义的。请参见 \fBpathconf\fR(2) 和 \fBsysconf\fR(3C)。
+.sp
+其值取决于文件系统中的位置的参数需要 \fIpathname\fR 参数。如果未指定参数,\fBgetconf\fR 将输出当前配置参数的名称和值。对需要 \fIpathname\fR 的每个参数使用路径名 \fB/\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetopts\fR \fB[\fR \fB-a\fR \fIname\fR\fB]\fR \fIoptstring\fR \fIvname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+检查 \fIarg\fR 是否具有合法选项。如果省略了 \fIarg\fR,则会使用位置参数。选项参数以 \fB+\fR 或 \fB-\fR 开始。不是以 \fB+\fR 或 \fB -\fR 开始的选项或者参数 \fB--\fR 会终止选项。当 \fIoptstring\fR 以 \fB+\fR 开始时,仅识别以 \fB+\fR 开始的选项。\fIoptstring\fR 包含 \fBgetopts\fR 可识别的字母。如果字母后面跟有一个 \fB:\fR,则该选项需要有一个参数。选项与参数之间可以用空格隔开。选项 \fB-?\fR 促使 \fBgetopts\fR 在标准错误输出中生成用法消息。\fB-a\fR 选项可用于指定用法消息使用的名称,缺省情况下为 $0。每次调用时,\fBgetopts\fR 都将它找到的下一个选项字母放在变量 \fIvname\fR 内。如果 \fIarg\fR 以 \fB+\fR 开始,会在选项字母前面加上 \fB+\fR。下一个 \fIarg\fR 的索引存储在 \fBOPTIND\fR 中。选项参数(如果有)存储在 \fBOPTARG\fR 中。\fIoptstring\fR 中的前导 : 促使 \fBgetopts\fR 将无效选项的字母存储在 \fBOPTARG\fR 中,并在缺少所需的选项参数时针对未知选项和 to: 将 \fIvname\fR 设置为 \fB?\fR。其他情况下,\fBgetopts\fR 将显示一条错误消息。如果没有更多选项,则退出状态是\fB非零的\fR。无法指定以下任何选项:\fB:\fR、\fB+\fR、\fB-\fR、\fB?\fR、\fB[\fR 和 \fB]\fR。只能将 \fB#\fR 选项指定为第一个选项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBhist\fR \fB[\fR \fB-e\fR \fIename\fR\fB]\fR\fB[\fR\fB-nlr\fR\fB]\fR \fB[\fR \fIfirst\fR\fB[\fR\fIlast\fR \fB ] ]\fR\fR
+.ad
+.br
+.na
+\fB\fR
+.ad
+.br
+.na
+\fB\fBhist\fR \fB-s\fR \fB[\fR \fIold\fR\fB=\fR\fInew\fR \fB] [\fR \fIcommand\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+在第一种形式中,从 \fIfirst\fR 到 \fIlast\fR 的命令范围是从在终端键入的最后的 \fBHISTSIZE\fR 命令中选择的。参数 \fIfirst\fR 和 \fIlast\fR 可以指定为数字或字符串。字符串用于从指定字符串开始查找最近的命令。负数用作到当前命令数的偏移。如果选择 -l 选项,命令将列在标准输出中。否则,在包含这些键盘命令的文件中调用编辑器程序 \fIename\fR。如果未提供 \fIename\fR,将使用变量 \fBHISTEDIT\fR 的值。如果未设置 \fBHISTEDIT\fR,将 \fBFCEDIT\fR(缺省为 \fB /bin/ed\fR)用作编辑器。编辑完成后,如果更改已经保存,将执行编辑后的命令。如果未指定 \fIlast\fR,将它设置为 \fIfirst\fR。如果未指定 \fIfirst\fR,针对编辑和列举的缺省值分别为上一条命令和 \fB-16\fR。选项 \fB-r\fR 颠倒命令顺序,选项 \fB-n\fR 在列举时隐藏命令数。在第二种形式中,将 \fIcommand\fR 解释为本部分中所述的 \fIfirst\fR,缺省为最后执行的命令。在执行可选替代 \fIold\fR\fB=\fR\fInew\fR 之后执行生成的命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBjobs\fR \fB-lnp\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+列出有关每个指定作业或(如果省略 \fIjob\fR)所有活动作业的信息。除普通信息外,\fB-l\fR 还列出进程 ID。\fB-n\fR 选项仅显示自上次通知起已停止或退出的作业。可通过 \fB-p\fR 选项只列出进程组。请参见 \fBJobs\fR 了解 \fIjob\fR 格式的说明。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkill\fR \fB[\fR\fB-s\fR \fIsigname\fR\fB]\fR \fIjob ...\fR\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB[\fR\fB-n\fR \fIsignum\fR\fB]\fR \fI job ...\fR\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB-l\fR \fB[\fR\fIsig ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+向指定作业或进程发送 \fBTERM\fR(终端)信号或指定信号。通过具有 \fB-n\fR 选项的数字或具有 \fB-s\fR 选项的名称指定信号(如 \fB<signal.h\fR> 中指定,除去前缀 `\fBSIG\fR,除非将 \fBSIGCLD\fR 命名为 \fBCHLD\fR)。为实现向后兼容,可以省略 \fBn\fR 和 \fBs\fR,将数字或名称紧跟 \fB-\fR 之后。如果已发送的信号是 \fBTERM\fR(终端)或 \fBHUP\fR(挂断),在作业或进程停止时将其作为 \fBCONT\fR(继续)信号发送。参数 \fIjob\fR 可以是不属于某个活动作业的进程的进程 ID。请参见 \fBJobs\fR 了解 \fIjob\fR 格式的说明。在第三种形式 \fBkill -l\fR 中,如果未指定 \fIsig\fR,将列出信号名称。否则,对于作为名称的每个 \fIsig\fR,将列出相应的信号编号。对于作为编号的每个 \fIsig\fR,将列出与 \fIsig\fR 的最低有效 8 位对应的信号名称。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBlet\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+每个 \fIarg\fR 都是一个可求值的独立算术表达式。请参见本手册页的 \fBArithmetic Evaluation\fR 部分,了解算术表达式求值的说明。如果最后一个表达式的值是\fB非零\fR,则退出状态为 \fB0\fR,否则为 \fB1\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+newgrp\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+等效于 \fBexec\fR \fB/bin/newgrp\fR \fIarg ...\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprint\fR [\fB-Renprs\fR] \fB[\fR \fB-u\fR \fIunit\fR\fB] [\fR \fB-f\fR \fIformat\fR \fB] [\fR \fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果没有选项或者具有选项 \fB-\fR 或 \fB--\fR,将在标准输出中输出每个 \fIarg\fR。可通过 \fB-f\fR 选项按 \fBprintf\fR 所述输出参数。在这种情况下,忽略任何 \fBe\fR、\fBn\fR、\fBr\fR 或 \fBR\fR 选项。除非指定 \fB-R\fR 或 \fB-r,\fR,否则应用以下转义约定:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ea\fR\fR
+.ad
+.RS 8n
+.rt  
+警报字符 (\fBASCII\fR 07)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eb\fR\fR
+.ad
+.RS 8n
+.rt  
+退格字符 (\fBASCII\fR 010)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ec\fR\fR
+.ad
+.RS 8n
+.rt  
+使输出终止,而不处理更多参数,且不添加换行符
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ef\fR\fR
+.ad
+.RS 8n
+.rt  
+换页字符 (\fBASCII\fR 014)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\en\fR\fR
+.ad
+.RS 8n
+.rt  
+换行符 (\fBASCII\fR 012)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\er\fR\fR
+.ad
+.RS 8n
+.rt  
+RETURN 字符 (\fBASCII\fR 015)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\et\fR\fR
+.ad
+.RS 8n
+.rt  
+TAB 字符 (\fBASCII\fR 011)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\ev\fR\fR
+.ad
+.RS 8n
+.rt  
+垂直 TAB 字符 (\fBASCII\fR 013)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\eE\fR\fR
+.ad
+.RS 8n
+.rt  
+转义符 (\fBASCII\fR 033)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e\e\fR\fR
+.ad
+.RS 8n
+.rt  
+反斜杠字符 \fB\e\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\e0\fR\fIx\fR\fR
+.ad
+.RS 8n
+.rt  
+通过 \fIx\fR 指定的 1、2 或 3 位八进制字符串定义的字符
+.RE
+
+\fB-R\fR 选项输出除 \fB-n\fR 之外的所有后续参数和选项。可通过 \fB-e\fR 应用转义约定,这是缺省行为。它颠倒早先 \fB-r\fR 的效果。可通过 \fB-p\fR 选项将参数写入到通过 \fB|&\fR 产生的进程管道中,而不是标准输出中。可通过 \fB-s\fR 选项将参数写入到历史文件中而不是标准输出中。\fB-u\fR 选项可用于指定输出所在的一位文件描述符单元编号 \fIunit\fR。缺省值为 \fB1\fR。如果使用 \fB-n\fR 选项,则不会将换行符添加到输出中。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprintf\fR \fIformat\fR\fB[\fR\fIarg ...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+根据与格式字符串 \fIformat\fR 关联的 \fBANSI-C\fR 格式化规则,在标准输出中输出参数 \fIarg\fR。如果参数的数目超过格式指定的数目,将重用该格式字符串格式化剩余的参数。还可以使用以下表达式:可以用 \fB%b\fR 格式代替 \fB%s\fR 以按照 \fBprint\fR 中的说明扩展对应 \fIarg\fR 中的转义序列。可通过 \fB%B\fR 选项将每个参数作为变量名称处理并输出变量的二进制值。这对于具有属性 b 的变量非常有用。可以用 \fB%H\fR 格式代替 \fB%s\fR,以便将 \fIarg\fR 中对 \fBHTML\fR 和 \fBXML\fR 特殊的字符作为它们的实体名称输出。可以用 \fB%P\fR 格式代替 \fB%s\fR,以便将 \fIarg\fR 解释为扩展的正则表达式并作为 shell 模式输出。可以用 \fB%R\fR 格式代替 \fB%s\fR,以便将 \fIarg\fR 解释为 shell 模式并作为扩展的正则表达式输出。可以用 \fB%q\fR 格式代替 \fB%\fR,以便通过可重新输入到 shell 的方式引用生成的字符串。\fB%(\fR\fIdate-format\fR\fB)T\fR 格式可用于将参数作为日期/时间字符串来处理并根据为 \fBdate\fR(1) 命令定义的 \fIdate-format\fR 格式化日期/时间。\fB%Z\fR 格式可输出其值为 0 的字节。%d 格式的精度字段可以后跟 a . 和输出基数。在这种情况下,可通过 \fB#\fR 标志字符使 \fBbase\fR\fI#\fR 前置。\fB#\fR 标志与 \fBd\fR 说明符一起使用但没有输出基数时,使输出以千分位显示,后缀 \fBk\fR \fBM\fR \fBG\fR \fBT\fR \fBP\fR \fBE\fR 中的其中一个表示单位。\fB#\fR 标志与 i 说明符一起使用时,使输出以 \fB1024\fR 显示,后缀 \fBKi\fR \fBMi\fR \fBGi\fR \fBTi\fR \fBPi\fR \fBEi\fR 中的其中一个表示单位。已添加 \fB=\fR 标志以使输出在指定的字段宽度内居中。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpwd\fR [\fB-LP\fR]\fR
+.ad
+.sp .6
+.RS 4n
+输出当前工作目录的值。\fB-L\fR 选项为缺省选项,用于输出当前目录的逻辑名称。如果指定了 \fB-P\fR 选项,将基于该名称解析所有的符号链接。命令行中的 \fB-L\fR 或 \fB-P\fR 的最后一个实例可确定使用的方法。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBread\fR \fB[\fR\fB-Aprs\fR\fB] [\fR\fB-d\fR \fIdelim\fR\fB] [\fR \fB-n\fR \fIn\fR\fB] [[\fR \fB-N\fR \fIn\fR\fB ] [[\fR\fB-t\fR \fItimeout\fR\fB] [\fR\fB-u\fR \fIunit\fR\fB] [\fR\fIvname\fR\fB?\fR\fIprompt\fR\fB] [\fR \fIvname ...\fR \fB ]\fR\fR
+.ad
+.sp .6
+.RS 4n
+shell 输入机制。读取一行并使用 IFS 中的字符作为分隔符将该行分为多个字段。转义符 \fB\e\fR 用于去除下一个字符和续行符的任何特殊含义。可通过 \fB-d\fR 选项将读取延续到 \fIdelim\fR(而不是\fB换行符\fR)的第一个字符。可通过 \fB-n\fR 选项最多只读取 \fIn\fR 字节而不是整行,但在从速度较慢的设备中读取时,只要已读取任何字符即将其返回。可通过 \fB-N\fR 选项恰好读取 \fIn\fR 字节,除非到达文件结尾或因设置了 \fB-t\fR 选项而导致读取超时。在原始模式下 (\fB-r\fR),不特殊处理 \fB\e\fR 字符。第一个字段分配给第一个 \fIvname\fR,第二个字段分配给第二个 \fIvname\fR,以此类推,剩余的字段分配给最后一个 \fIvname\fR。如果 \fIvname\fR 具有二进制属性并且已指定 \fB-n\fR 或 \fB-N\fR,读取的字节将直接存储在变量中。如果已指定 -v,将第一个 \fIvname\fR 的值用作从终端设备读取时的缺省值。可通过 \fB-A\fR 选项取消设置变量 \fIvname\fR,并使读取的每个字段存储在索引数组 \fIvname\fR 的连续元素中。通过 \fB-p\fR 选项,使用 \fB|&\fR 从 shell 产生的进程输入管道中获取输入行。如果存在 \fB-s\fR 选项,将输入另存为历史文件中的命令。选项 \fB-u\fR 可用于指定从中读取的一位文件描述符单元 \fIunit\fR。可以通过特殊的内置命令 \fBexec\fR 打开文件描述符。单元 \fIn\fR 的缺省值是 \fB0\fR。选项 \fB-t\fR 用于指定从终端或管道读取时以秒为单位的超时。如果省略 \fIvname\fR,则 REPLY 将用作缺省的 \fIvname\fR。具有 \fB-p\fR 选项的文件结尾可清除该进程,这样可以生成其他进程。如果第一个参数包含 \fB?\fR,则当 shell 为交互式 shell 时,该单词的剩余部分将用作标准错误输出中的提示。除非到达文件结尾或读取超时,否则退出状态为 \fB0\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++readonly\fR \fB[\fR\fB-p\fR\fB] [\fR \fIvname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果未指定 \fIvname\fR,将输出具有只读属性的每个变量的名称和值,并且以能够重新输入的方式将值括起来。通过 \fB-p\fR 选项将单词 \fBreadonly\fR 插入在每个变量之前。否则,将对指定的 \fIvname\fR 标记 \fBreadonly\fR,且不能通过后续赋值更改这些名称。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+return\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+使 shell 函数或脚本返回到具有 \fIn\fR 指定的退出状态的调用脚本。该值是指定状态的最低有效 8 位。如果省略 \fBn\fR,则返回状态为最后执行的命令的返回状态。如果调用的返回不在函数或脚本中,则与退出的行为相同。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+set [ \(+-BCGabefhkmnoprstuvx] [\(+-o [\fR \fIoption\fR \fB] ] ... [ \(+-A\fR \fIvname\fR\fB]\fR \fB[\fR\fIarg...\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBset\fR 命令支持以下选项:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.sp .6
+.RS 4n
+自动导出已定义的所有后续变量。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.sp .6
+.RS 4n
+数组赋值。取消设置变量 \fIvname\fR,并按顺序从 \fIarg\fR 列表中赋值。如果使用 \fB+A\fR,则首先不取消设置变量 \fIvname\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR\fR
+.ad
+.sp .6
+.RS 4n
+一旦后台作业更改状态,即输出作业完成消息,而不是等待下一提示。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-B\fR\fR
+.ad
+.sp .6
+.RS 4n
+启用大括号模式字段生成。这是缺省行为。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-C\fR\fR
+.ad
+.sp .6
+.RS 4n
+阻止重定向 (\fB>\fR) 截断现有文件。通过 \fBO_EXCL\fR 模式打开已创建的文件。要求 \fB>|\fR 在启用时截断文件。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果命令具有\fB非零\fR退出状态,则执行 \fBERR\fR 捕获(如果已设置)并退出。该模式在读取配置文件时被禁用。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.sp .6
+.RS 4n
+禁用文件名生成。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-G\fR\fR
+.ad
+.sp .6
+.RS 4n
+在用于文件名生成时,使模式 \fB**\fR 本身与文件及零个或多个目录和子目录匹配。如果后跟 \fB/\fR,则仅匹配目录和子目录。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR\fR
+.ad
+.sp .6
+.RS 4n
+每个命令在第一次遇到时将成为被跟踪别名。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR\fR
+.ad
+.sp .6
+.RS 4n
+已过时。将所有的变量赋值参数放在命令的环境中,而不仅仅是命令名称前面的参数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR\fR
+.ad
+.sp .6
+.RS 4n
+后台作业在单独的进程组中运行,并在完成时输出一行。在完成消息中报告后台作业的退出状态。在具有作业控制的系统上,为交互式 shell 自动启用该选项。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.sp .6
+.RS 4n
+读取命令并检查其中是否存在语法错误,但不执行这些命令。 对于交互式 shell,忽略此命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR\fR
+.ad
+.sp .6
+.RS 4n
+如果未提供选项名称,则会将选项及其当前设置的列表写入到标准输出。当与 \fB+\fR 一起调用此命令时,这些选项将以可重新输入到 shell 的格式写入,以便恢复相应设置。重复此选项可以启用或禁用多个选项。
+.sp
+下列参数可以是下列选项名称之一:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBallexport\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-a\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbgnice\fR\fR
+.ad
+.sp .6
+.RS 4n
+以较低的优先级运行所有后台作业。这是缺省模式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbraceexpand\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-\fRB 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBemacs\fR\fR
+.ad
+.sp .6
+.RS 4n
+使您进入 \fBemacs\fR 样式的内嵌编辑器以便输入命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBerrexit\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-e\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBglobstar\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-G\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgmacs\fR\fR
+.ad
+.sp .6
+.RS 4n
+使您进入 \fBgmacs\fR 样式的内嵌编辑器以便输入命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBignoreeof\fR\fR
+.ad
+.sp .6
+.RS 4n
+此 shell 不会在文件结尾退出。必须使用 \fBexit\fR 命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkeyword\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-k\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmarkdirs\fR\fR
+.ad
+.sp .6
+.RS 4n
+文件名生成操作生成的所有目录名称都附加有尾随 /。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmonitor\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-m\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmultiline\fR\fR
+.ad
+.sp .6
+.RS 4n
+对于长于屏幕宽度的行,内置编辑器在屏幕上使用多个行。这可能不适用于所有终端。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoclobber\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-C\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoexec\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-n\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnoglob\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-f\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnolog\fR\fR
+.ad
+.sp .6
+.RS 4n
+不会在历史文件中保存函数定义。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnotify\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-b\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnounset\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-u\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpipefail\fR\fR
+.ad
+.sp .6
+.RS 4n
+管道将在所有管道组件完成后完成,并且返回值为失败的最后一个\fB非零\fR命令的值,如果没有任何命令失败,则为零。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBprivileged\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-p\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBshowme\fR\fR
+.ad
+.sp .6
+.RS 4n
+启用此命令后,将显示前面带有分号 (\fB;\fR) 的简单命令或管道,就像启用了 \fBxtrace\fR 选项但未执行此选项一样。否则,将忽略前导 \fB;\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrackall\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-h\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBverbose\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-v\fR 相同。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBvi\fR\fR
+.ad
+.sp .6
+.RS 4n
+使您进入 \fBvi\fR 样式的内嵌编辑器的插入模式,直到您键入转义符 033 为止。这会使您进入控制模式。回车可发送此行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBviraw\fR\fR
+.ad
+.sp .6
+.RS 4n
+各个字符在 \fBvi\fR 模式下键入时处理。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBxtrace\fR\fR
+.ad
+.sp .6
+.RS 4n
+与 \fB-x\fR 相同。 
+.sp
+如果未提供选项名称,则输出当前选项设置。
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.sp .6
+.RS 4n
+禁用对\fB$HOME/.profile\fR 文件的处理,并使用文件 \fB/etc/suid_profile\fR(而非 \fBENV\fR 文件)。当有效 \fBuid\fR (\fBgid\fR) 不等于实际 \fBuid\fR (\fBgid\fR) 时,将启用此模式。禁用此模式会导致将有效 \fBuid\fR 和 \fBgid\fR 设置为实际 \fBuid\fR 和 \fBgid\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.sp .6
+.RS 4n
+启用受限 shell。此选项一旦设置便不能取消设置。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.sp .6
+.RS 4n
+按字典顺序对位置参数进行排序。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.sp .6
+.RS 4n
+已过时。读取和执行一个命令后退出。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.sp .6
+.RS 4n
+替换时将 \fBunset\fR 参数视为错误。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.sp .6
+.RS 4n
+在读取 shell 输入行时输出这些行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.sp .6
+.RS 4n
+在执行命令及其参数时输出这些命令及其参数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB--\fR\fR
+.ad
+.sp .6
+.RS 4n
+不更改任何选项。在将 \fB$1\fR 设置为以 \fB-\fR 开头的值时,此命令非常有用。如果此选项后没有任何参数,则取消设置位置参数。
+.RE
+
+作为一项已过时的功能,如果第一个 \fIarg\fR 为 -,则会禁用 \fB-x\fR 和 \fB-v\fR 选项,并将下一个 \fIarg\fR 视为第一个参数。使用 \fB+\fR(而非 \fB-\fR)将导致禁用这些选项。此外,还可以在调用 shell 时使用这些选项。当前选项集可在 \fB$-\fR 中找到。除非指定了 \fB-A\fR,否则其余参数均为位置参数,并按照 \fB$1 $2 ... 的顺序进行分配。\fR如果未指定参数,则在标准输出中输出所有变量的名称和值。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+shift\fR \fB[\fR\fIn\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB$\fR\fIn\fR\fB+1 ...\fR 中的位置参数重命名为 \fB$1 ...\fR,缺省的 \fIn\fR 为 \fB1\fR。参数 \fIn\fR 可以为任何算术表达式,此算术表达式的计算结果为小于或等于 \fB$#\fR 的非负数字。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+trap\fR \fB-p\fR \fB[\fR\fIaction\fR\fB]\fR \fB[\fR\fIsig\fR\fB] ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fB-p\fR 选项导致输出与参数指定的每个陷阱相关联的陷阱操作,并进行相应引用。否则,当 shell 接收信号 \fIsig\fR 时,则会处理 \fIaction\fR,就像它是 \fBeval\fR 的参数一样。可以以编号或信号名称的形式指定每个 \fIsig\fR。陷阱命令按照信号编号的顺序执行。尝试对输入到当前 shell 时忽略的信号设置陷阱将不起作用。如果省略了 \fIaction\fR,并且第一个 \fIsig\fR 为编号,或者如果 \fIaction\fR 为 \fB-\fR,则会将每个 \fIsig\fR 的陷阱重置为其原始值。如果 \fIaction\fR 为空字符串,shell 及其调用的命令将忽略此信号。如果 \fIsig\fR 为 \fBERR\fR,当命令的退出状态为\fB非零\fR时,将执行 \fIaction\fR。如果 \fIsig\fR 为 \fBDEBUG\fR,则会在每个命令之前执行 \fIaction\fR。当运行 \fIaction\fR 时,变量 \fB\&.sh.command\fR 包含当前命令行的内容。如果 \fIsig\fR 为 \fB0\fR 或 \fBEXIT\fR,并且在使用 \fBfunction\fR \fIname\fR 语法定义的函数主体内执行陷阱语句,则会在此函数完成后执行命令 \fIaction\fR。对于在任何函数外部设置的陷阱,如果 \fIsig\fR 为 \fB0\fR 或 \fBEXIT\fR,则会在退出时从 shell 执行命令 \fIaction\fR。如果 \fIsig\fR 为 \fBKEYBD\fR,则会在 \fBemacs\fR、\fBgmacs\fR 或 \fBvi\fR 模式下读取键时执行 \fIaction\fR。不带参数的 \fBtrap\fR 命令输出与各信号编号关联的命令的列表。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrue\fR\fR
+.ad
+.sp .6
+.RS 4n
+不执行任何操作,退出 \fB0\fR。与 while 一起用于无限循环。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB++typeset [\(+-AHflabnprtux ] [ \(+-EFLRZi[\fR\fIn\fR\fB] ] [\fR \fIvname\fR\fB[=\fR\fIvalue\fR \fB] ]\fR\fR
+.ad
+.sp .6
+.RS 4n
+设置 shell 变量和函数的属性及值。当在使用 \fBfunction\fR \fIname\fR 语法定义的函数内部调用时,将创建一个新的 \fIvname\fR 变量实例,并在此函数完成时恢复变量的值和类型。 
+.sp
+使用 \fB+\fR(而非 \fB-\fR)将导致禁用这些选项。如果未指定 \fIvname\fR 参数,则输出变量的 \fIvname\fR(以及可选 \fIvalue\fR)的列表。使用 \fB+\fR(而非 \fB-\fR)可防止输出值。\fB-p\fR 选项导致在每个名称(而非选项名称)之前输出后跟有选项字母的 \fBtypeset\fR。如果指定了除 \fB-p\fR 以外的任何选项,则仅输出具有所有指定选项的变量。否则输出具有属性的所有变量的 \fIvname\fR 和 \fIattributes\fR。
+.sp
+可以指定下列属性列表:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+将 \fIvname\fR 声明为索引数组。这是可选属性(除非用于复合变量赋值)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.RS 6n
+.rt  
+将 \fIvname\fR 声明为关联数组。下标是字符串,而不是算术表达式。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR\fR
+.ad
+.RS 6n
+.rt  
+此变量可保存任意字节数目的数据。数据可以是文本或二进制数据。此变量的值通过数据的 \fBbase64\fR 编码表示。如果还指定了 \fB-Z\fR,缓冲区中的数据大小(以字节为单位)则由与 \fB-Z\fR 关联的大小确定。如果分配的 \fBbase64\fR 字符串导致生成更多数据,则会截断此数据。否则,则会使用值为零的字节填充此数据。\fBprintf\fR 格式 \fB%B\fR 可用于输出此缓冲区中的实际数据,而非数据的 \fBbase64\fR 编码。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-E\fR\fR
+.ad
+.RS 6n
+.rt  
+将 \fIvname\fR 声明为双精度浮点数。如果 \fIn\fR 为\fB非零\fR,则定义扩展 \fIvname\fR 时使用的有效数字的数目。否则使用 10 个有效数字。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+这些名称引用函数名称,而非变量名称。不会进行赋值,其他有效选项仅包括 \fB-t\fR、\fB-u\fR 和 \fB-x\fR。\fB-t\fR 选项对此函数启用执行跟踪。\fB-u\fR 选项导致将此函数标记为未定义。搜索 \fBFPATH\fR 变量,以便在引用函数时查找函数定义。如果指定了除 \fB-f\fR 以外的选项,则会在标准输出中显示函数定义。如果指定了 \fB+f\fR,则会显示一个行,此行包含后跟有一条 shell 注释的函数名称,此注释包含行号以及定义此函数所在的文件的路径名(如果有)。
+.sp
+\fB-i\fR 属性无法与 \fB-f\fR 一起指定。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-F\fR\fR
+.ad
+.RS 6n
+.rt  
+将 \fIvname\fR 声明为双精度浮点数。如果 \fIn\fR 为\fB非零\fR,则定义扩展 \fIvname\fR 时使用的小数点后面的小数位数。否则使用小数点后面的 10 个小数位数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.RS 6n
+.rt  
+此选项提供非 UNIX 计算机上的 UNIX 到主机名文件的映射。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 6n
+.rt  
+将要在内部表示的 \fIvname\fR 声明为整数。当指定为整数时,赋值右侧将作为算术表达式计算。如果 \fIn\fR 为\fB非零\fR,则会定义输出算术基数,否则输出基数为 10。
+.sp
+\fB-i\fR 属性不能与 \fB-R\fR、\fB-L\fR、\fB-Z\fR 或 \fB-f\fR 一起指定。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-l\fR\fR
+.ad
+.RS 6n
+.rt  
+所有大写字符都将转换为小写字符。禁用大写字母选项 \fB-u\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-L\fR\fR
+.ad
+.RS 6n
+.rt  
+向左调整 \fIvalue\fR,并删除其中的前导空格。如果 \fIn\fR 为\fB非零\fR,则定义字段宽度,否则根据第一个赋值的值的宽度确定字段宽度。如果为此变量赋值,则会根据需要使用空格填充此值的右侧或者截断此值,使其适合此字段。禁用 \fB-R\fR 选项。
+.sp
+\fB-i\fR 属性无法与 \fB-L\fR 一起指定。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+将 \fIvname\fR 声明为对某个变量的引用,此变量的名称根据变量 \fIvname\fR 的值定义。这通常用于引用函数中其名称作为参数传递的变量。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-R\fR\fR
+.ad
+.RS 6n
+.rt  
+向右调整,并使用前导空格填充。如果 \fIn\fR 为\fB非零\fR,则定义字段宽度,否则根据第一个赋值的值的宽度确定字段宽度。如果重新为此变量赋值,则会使用空格填充此字段的左侧,或者截断此字段的末尾。禁用 \fB-L\fR 选项。
+.sp
+\fB-i\fR 属性无法与 \fB-R\fR 一起指定。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 6n
+.rt  
+指定 \fIvname\fR 标记为只读,后续赋值不能更改这些名称。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+标记变量。用户可以定义标记,对 shell 而言,这些标记没有任何特殊意义。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.RS 6n
+.rt  
+所有小写字符都将转换为大写字符。禁用小写字母选项 \fB-l\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+标记指定 \fIvname\fR,以便自动导出到随后执行的命令的环境。无法导出其名称包含 . 的变量。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-Z\fR\fR
+.ad
+.RS 6n
+.rt  
+如果第一个非空字符为数字,并且未设置 \fB-L\fR 选项,则会向右调整,并使用前导零进行填充。如果同时设置了 \fB-L\fR 选项,则删除前导零。如果 \fIn\fR 为\fB非零\fR,则定义字段宽度,否则根据第一个赋值的值的宽度确定字段宽度。
+.sp
+\fB-i\fR 属性无法与 \fB-Z\fR 一起指定。
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBulimit [\fR\fB-HSacdfmnpstv\fR\fB] [\fR \fIlimit\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+设置或显示资源限制。许多系统都不支持一个或多个这些限制。如果指定了 \fIlimit\fR,则会设置指定资源的限制。\fIlimit\fR 的值可以是一个数字(采用随各资源指定的单位为单位),也可以为值 unlimited。如果指定了多种资源,则会在值之前输出限制名称及单位。
+.sp
+如果未指定任何选项,则采用 \fB-f\fR。
+.sp
+下面列出了一些可用的资源限制:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+列出当前的所有资源限制。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 6n
+.rt  
+核心转储大小中的 512 字节块的数目。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR\fR
+.ad
+.RS 6n
+.rt  
+数据区域大小中的千字节数目。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+当前进程或子进程可写入的文件中的 512 字节块的数目(可以读取任意大小的文件)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.RS 6n
+.rt  
+指定指定资源的硬限制。
+.sp
+硬限制一旦设置便不能增加。
+.sp
+如果未指定 \fB-H\fR 和 \fB-S\fR 选项,此限制同时适用于两个选项。如果省略了 \fIlimit\fR,则会输出当前资源限制。此种情况下,除非指定 \fB-H\fR,否则将输出软限制。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR\fR
+.ad
+.RS 6n
+.rt  
+物理内存大小中的千字节数目。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+文件描述符数目加 1。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+.rt  
+用于管道缓冲的 512 字节块的数目。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 6n
+.rt  
+堆栈区域大小中的千字节数目。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-S\fR\fR
+.ad
+.RS 6n
+.rt  
+指定指定资源的软限制。
+.sp
+软限制最多可增加至硬限制的值。 
+.sp
+如果未指定 \fB-H\fR 和 \fB-S\fR 选项,此限制同时适用于两个选项。如果省略了 \fIlimit\fR,则会输出当前资源限制。此种情况下,除非指定 \fB-H\fR,否则将输出软限制。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+各进程使用的 CPU 秒数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.RS 6n
+.rt  
+用于虚拟内存的千字节数目。
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBumask\fR \fB[\fR\fB-S\fR\fB]\fR\fB[\fR\fImask\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+用户文件创建掩码设置为 \fImask\fR。\fImask\fR 可以是八进制数字或符号值,如 \fBchmod\fR(1) 所述。 
+.sp
+如果指定了符号值,新 \fBumask\fR 值即为对以前的 \fBumask\fR 值的补数应用 \fImask\fR 的结果的补数。如果省略了 \fImask\fR,则会输出掩码的当前值。\fB-S\fR 选项导致将模式输出为符号值。否则输出八进制掩码。 
+.sp
+请参见 \fBumask\fR(2)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+unalias\fR \fB[\fR\fB-a\fR\fB]\fR \fIname\fR\fR
+.ad
+.sp .6
+.RS 4n
+从别名列表中删除 \fIname\fR 列表指定的别名。\fB-a\fR 选项导致取消设置所有别名。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB+unset\fR \fB[\fR\fB-fnv\fR\fB]\fR \fIvname\fR\fR
+.ad
+.sp .6
+.RS 4n
+未分配 \fIvname\fR 列表指定的变量,即,已清除这些变量的值和属性。无法取消设置只读变量。如果设置了 \fB-f\fR 选项,名称则引用函数名称。如果设置了 \fB-v\fR 选项,名称则引用变量名称。\fB-f\fR 选项可覆盖 \fB-v\fR。如果设置了 \fB-n\fR,并且 \fIname\fR 为名称引用,则会取消设置 \fIname\fR(而非其引用的变量)。缺省值等效于 \fB-v\fR。取消设置 \fBLINENO\fR、\fBMAILCHECK\fR、\fBOPTARG\fR、\fBOPTIND\fR、\fBRANDOM\fR、\fBSECONDS\fR、\fBTMOUT\fR 和 \fB_\fR 将删除其特殊含义,即使在随后对这些变量赋值也是如此。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwait\fR \fB[\fR\fIjob\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+等待指定作业,并报告其终止状态。如果未指定 \fIjob\fR,则等待当前处于活动状态的所有子进程。如果指定了 \fIjob\fR,此命令的退出状态即为等待的最后一个进程的退出状态;否则为零。请参见 \fBJobs\fR 了解 \fIjob\fR 格式的说明。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhence\fR \fB[\fR\fB-afpv\fR\fB]\fR \fIname ...\fR\fR
+.ad
+.sp .6
+.RS 4n
+对于每个 \fIname\fR,此命令指示将其用作命令名称时的解释方式。\fB-v\fR 选项生成更详细的报告。\fB-f\fR 选项跳过函数搜索。即使名称为别名、函数或保留字,\fB-p\fR 选项也会针对 \fIname\fR 进行路径搜索。\fB-a\fR 选项与 -v 选项相似,但前者导致报告指定名称的所有解释。
+.RE
+
+.SS "调用"
+.sp
+.LP
+如果使用 \fBexec\fR(2) 调用 shell,并且参数的第一个字符 0 (\fB$0\fR) 为 \fB-\fR,则假定此 shell 为登录 shell,并从 \fB/etc/profile\fR 读取命令,然后从当前目录的 .\fBprofile\fR 或 \fB$HOME/.profile\fR 中读取命令(如果存在任何一个文件)。接着,对于交互式 shell,首先从 \fB/etc/ksh.kshrc\fR 读取命令,然后从通过对环境变量 \fBENV\fR 的值执行参数扩展、命令替换和算术替换进行命名的文件中读取命令(如果存在此文件)。如果 \fB-s\fR 选项不存在,并且存在 \fIarg\fR 以及名为 \fIarg\fR 的文件,则会读取和执行此脚本。否则,如果第一个 \fIarg\fR 不包含 \fB/\fR,则会对第一个 \fIarg\fR 执行路径搜索,以便确定要执行的脚本的名称。脚本 \fIarg\fR 必须具有执行权限,并且忽略任何 \fBsetuid\fR 和 \fBsetgid\fR 设置。如果未在此路径中找到脚本,则会处理 \fIarg\fR,就像指定了内置命令或函数一样。 
+.sp
+.LP
+然后按照说明读取命令,并且 shell 会在调用时解释下列选项:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 15n
+.rt  
+如果存在 \fB-c\fR 选项,则从第一个 \fIarg\fR 读取命令。其余所有参数都将成为从 \fB0\fR 开始的位置参数。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR\fR
+.ad
+.RS 15n
+.rt  
+标准输出中将输出前面带有 \fB$\fR 且包含在双引号中的所有字符串的列表,并且 shell 退出。当语言环境不是 C 或 POSIX 时,此组字符串则会转换为相应语言。不会执行任何命令。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 15n
+.rt  
+如果存在 \fB-i\fR 选项,或者如果将 shell 输入和输出附加到终端(根据 \fBtcgetattr\fR(3C) 的指示),此 shell 则为交互式 shell。此种情况下,将忽略 \fBTERM\fR(因此,\fBkill 0\fR 不会中止交互式 shell),并捕获和忽略 \fBINTR\fR(因此,可以中断等待)。在所有情况下,shell 将忽略 \fBQUIT\fR。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-R\fR \fIfilename\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-R\fR \fIfilename\fR 选项用于生成交叉引用数据库,此数据库可供单独的实用程序用于查找变量和命令的定义及引用。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 15n
+.rt  
+如果存在 \fB-r\fR 选项,shell 则为受限 shell。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 15n
+.rt  
+如果存在 \fB-s\fR 选项,或者如果未保留任何参数,则从标准输入读取命令。Shell 输出(列出的\fB特殊命令\fR的输出除外)写入到文件描述符 2。
+.RE
+
+.sp
+.LP
+其余选项和参数在 \fBset\fR 命令下说明。忽略作为第一个参数的可选 \fB-\fR。
+.SS "仅适用于 \fBrksh\fR"
+.sp
+.LP
+\fBrksh\fR 用于设置登录名和执行环境,其功能比标准 shell 的功能更受约束。
+.sp
+.LP
+\fBrksh\fR 的操作与 \fBksh\fR 的操作相同,但前者不允许以下操作:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+取消设置受限选项
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+更改目录。请参见 \fBcd\fR(1)。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+设置或取消设置 \fBSHELL\fR、\fBENV\fR、\fBFPATH\fR 或 \fBPATH\fR 的值或属性
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+指定包含 \fB/\fR 的路径或命令名称。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+重定向输出(\fB>\fR、\fB>\fR\fB|\fR、\fB<>\fR 和 \fB>>\fR)。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+添加或删除内置命令。
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+使用 \fBcommand\fR \fB-p\fR 调用命令。
+.RE
+.sp
+.LP
+在解释 .\fBprofile\fR 和 \fBENV\fR 文件后强制这些限制。
+.sp
+.LP
+如果发现要执行的命令为 shell 过程,\fBrksh\fR 则会调用 \fBksh\fR 来执行此命令。因此,可以向最终用户提供有权访问标准 shell 的完整功能的 shell 过程,并强制有限的命令菜单。此方案假定最终用户没有同一目录的写入和执行权限。这些规则的实际结果是,通过执行保证的设置操作,并将用户保留在适当的目录(可能不是登录目录)中,.\fBprofile\fR 的写入者具有用户操作的完整控制权。系统管理员通常设置可由 \fBrksh\fR 安全调用的命令目录(例如,\fB/usr/rbin\fR)。 
+.SH 用法
+.sp
+.LP
+有关在遇到大小大于或等于 2 GB(2^31 字节)的文件时 \fBksh\fR 和 \fBrksh\fR 的行为的说明,请参见 \fBlargefile\fR(5)。
+.SH 退出状态
+.sp
+.LP
+将返回以下退出值:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB非零\fR\fR
+.ad
+.sp .6
+.RS 4n
+当 shell 检测到错误(如语法错误)时,返回\fB非零\fR。
+.sp
+如果以非交互方式使用 shell,除非子 shell 中出现错误(此种情况下将放弃子 shell),否则会放弃执行此 shell 文件。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fI执行的最后一个命令的退出状态\fR\fR
+.ad
+.sp .6
+.RS 4n
+返回执行的最后一个命令的退出状态。
+.sp
+通过输出命令或函数名称以及错误状态,报告 shell 检测到的运行时错误。如果出现错误的行号大于 1,则还会在命令或函数名称后面的方括号 (\fB[]\fR) 中输出此行号。
+.sp
+有关其他详细信息,请参见 \fBksh exit\fR 命令。
+.RE
+
+.SH 文件
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+系统初始化文件,针对 login shell 执行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/ksh.kshrc\fR\fR
+.ad
+.sp .6
+.RS 4n
+系统级启动文件,针对交互式 shell 执行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$HOME/.profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+专用初始化文件,在 \fB/etc/profile\fR 后针对登录 shell 执行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$HOME/.kshrc\fR\fR
+.ad
+.sp .6
+.RS 4n
+缺省专用初始化文件,当未设置 \fBENV\fR 时,在 \fB/etc/ksh.kshrc\fR 后针对交互式 shell 执行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/etc/suid-profile\fR\fR
+.ad
+.sp .6
+.RS 4n
+备用初始化文件,在实际和有效用户或组 ID 不匹配时代替专用初始化文件执行。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB/dev/null\fR\fR
+.ad
+.sp .6
+.RS 4n
+空设备。
+.RE
+
+.SH 作者
+.sp
+.LP
+David Korn,\[email protected]\fR
+.SH 属性
+.sp
+.LP
+有关下列属性的描述,请参见 \fBattributes\fR(5):
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性类型属性值
+_
+可用性system/core-os
+_
+接口稳定性参见下文。
+.TE
+
+.sp
+.LP
+脚本接口是 "Uncommitted"(未确定)。环境变量、\fB\&.paths\fR 功能以及编辑模式是 Volatile(可变)接口。
+.SH 另请参见
+.sp
+.LP
+\fBcat\fR(1)、\fBcd\fR(1)、\fBchmod\fR(1)、\fBcut\fR(1)、\fBdate\fR(1)、\fBegrep\fR(1)、\fBecho\fR(1)、\fBegrep\fR(1)、\fBenv\fR(1)、\fBfgrep\fR(1)、\fBgrep\fR(1)、\fBlogin\fR(1)、\fBnewgrp\fR(1)、\fBpaste\fR(1)、\fBprintf\fR(1)、\fBshell_builtins\fR(1)、\fBstty\fR(1)、\fBtest\fR(1)、\fBumask\fR(1)、\fBvi\fR(1)、\fBdup\fR(2)、\fBexec\fR(2)、\fBfork\fR(2)、\fBioctl\fR(2)、\fBlseek\fR(2)、\fBpathconf\fR(2)、\fBpipe\fR(2)、\fBsysconf\fR(3C)、\fBulimit\fR(2)、\fBumask\fR(2)、\fBrand\fR(3C)、\fBtcgetattr\fR(3C)、\fBwait\fR(3C)、\fBa.out\fR(4)、\fBprofile\fR(4)、\fBattributes\fR(5)、\fBenviron\fR(5)、\fBlargefile\fR(5)、\fBstandards\fR(5)
+.sp
+.LP
+由 Bolsky, Morris I. 和 Korn, David G. 合住的\fIThe New K rnS ell Comma d and P ogr mming Langu ge\fR,Prentice Hall 出版,1995。
+.sp
+.LP
+\fIPOSIX-Part 2: Shell and Utilities, IEEE Std 1003.2-1992, ISO/IEC 9945-2\fR, IEEE, 1993.
+.SH 附注
+.sp
+.LP
+\fBksh\fR 脚本应选择 ISO C99、C++ 和 JAVA 语言的保留字所使用的名称空间之外的 shell 函数名称,以免与 \fBksh\fR 的将来改进冲突。
+.sp
+.LP
+如果执行命令,并在搜索路径中原始命令所在目录之前的目录中安装同名命令,shell 会继续\fB执行\fR原始命令。使用 alias 命令的 \fB-t\fR 选项可以更正此情况。
+.sp
+.LP
+某些很早的 shell 脚本包含插入记号 (\fB^\fR),并将其用作管道字符 (\fB|\fR) 的同义词。
+.sp
+.LP
+在复合命令中使用 \fBhist\fR 内置命令会导致 whole 命令从历史文件中消失。
+.sp
+.LP
+内置命令 \fB\&.\fR \fIfile\fR 在执行任何命令之前读取整个文件。文件中的 \fBalias\fR 和 \fBunalias\fR 命令不适用于该文件中定义的所有命令。
+.sp
+.LP
+当作业正在等待前台进程时,不会处理陷阱。因此,在前台作业终止之前,不会执行 \fBCHLD\fR 中的陷阱。
+.sp
+.LP
+最好在算术表达式中的逗号运算符后保留一个空格,以免在特定语言环境中将逗号解释为小数点字符。 
+.sp
+.LP
+创建 \fB\&.paths\fR 文件可能存在一些限制,该文件可移植到其他操作系统中。
+.sp
+.LP
+如果系统支持 64 位指令集,\fB/bin/ksh\fR 将执行 \fBksh\fR 的 64 位版本。
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/ksh93.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/ksh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/ksh93.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/ksh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/ksh93.1.zh_CN.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/ksh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/msgcc.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,234 @@
+'\" te
+.\" Copyright (c) 2000-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2007, Sun Microsystems, Inc.
+.TH msgcc 1 "9 Oct 2007" "SunOS 5.11" "User Commands"
+.SH NAME
+msgcc \- C language message catalog compiler
+.SH SYNOPSIS
+.LP
+.nf
+\fBmsgcc\fR [\fB-M-\fR\fIoption\fR] [\fBcc-options\fR\fIoption\fR] \fIfile...\fR
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBmsgcc\fR is a C language message catalog compiler. It accepts \fBcc\fR style options and arguments. 
+.sp
+.LP
+A \fBmsgcpp\fR(1) \fB\&.mso\fR file is generated for each input \fB\&.c\fR file. If the \fB-c\fR option is not specified then a \fBgencat\fR(1) format .\fBmsg\fR file is generated from the input \fB\&.mso\fR and \fB\&.msg\fR files. If \fB-c\fR is not specified then a \fB\&.msg\fR suffix is appended to the \fB-o\fR file if it doesn't already have a suffix. The default output is \fBa.out.msg\fR if \fB-c\fR and \fB-o\fR are not specified.
+.sp
+.LP
+If \fB-M-new\fR is not specified then messages are merged with those in the pre-existing \fB-o\fR file.
+.SH OPTIONS
+.sp
+.LP
+The following options are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIcc-options\fR\fR
+.ad
+.RS 14n
+.rt  
+Specify \fBcc\fR style options and arguments.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-M-\fR\fIoption\fR\fR
+.ad
+.RS 14n
+.rt  
+Set a \fBmsgcc\fR option. 
+.sp
+Specify option as one of the following:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBmkmsgs\fR\fR
+.ad
+.RS 18n
+.rt  
+The \fB-o\fR file is assumed to be in \fBmkmsgs\fR(1) format.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnew\fR\fR
+.ad
+.RS 18n
+.rt  
+Create a new \fB-o\fR file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpreserve\fR\fR
+.ad
+.RS 18n
+.rt  
+Messages in the \fB-o\fR file that are not in new \fB\&.msg\fR file arguments are preserved. The default is to either reuse the message numbers with new message text that is similar to the old or to delete the message text, leaving an unused message number.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBset=\fR\fInumber\fR\fR
+.ad
+.RS 18n
+.rt  
+Set the message set number to \fInumber\fR. The default is \fB1\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBsimilar=\fR\fInumber\fR\fR
+.ad
+.RS 18n
+.rt  
+The message text similarity message threshold. The similarity measure between old and new message text is:
+.sp
+.in +2
+.nf
+100*(2*gzip(\fIold\fR+\fInew\fR)\e
+     /(gzip(\fIold\fR)+gzip(\fInew\fR))-1)
+.fi
+.in -2
+.sp
+
+where \fBgzip(\fR\fIx\fR\fB)\fR is the size of text \fIx\fR when compressed by \fBgzip\fR. The default threshold is \fB$__similar__$.A\fR threshold of \fB0\fR turns off message replacement, but unused old messages are still deleted. Use \fB-M-preserve\fR to preserve all old messages.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBverbose\fR\fR
+.ad
+.RS 18n
+.rt  
+Trace similar message replacements on the standard error.
+.RE
+
+.RE
+
+.SH OPERANDS
+.sp
+.LP
+The following operands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfile\fR\fR
+.ad
+.RS 8n
+.rt  
+Specifies the name of the file on which \fBmsgcc\fR operates. 
+.RE
+
+.SH EXIT STATUS
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+Successful completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+An error occurred.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRUsing \fBmsgcc\fR
+.sp
+.LP
+The following example uses \fBmsgcc\fR to extract localizable strings from the file \fBhello.c\fR, marked using \fBERROR_dictionary()\fR, writes them to the file \fBhello.mso\fR, and creates a \fBgencat\fR format \fBxxx.msg\fR file:
+
+.sp
+.in +2
+.nf
+example% cat hello.c
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * dummy macro to avoid including
+ * libast headers
+ */
+#define ERROR_dictionary(x) x
+
+int main(int ac, char *av[])
+{
+        puts( ERROR_dictionary("hello world") );
+        return( EXIT_SUCCESS );
+}
+
+example% msgcc -o xxx -D__STDC__ -D__i386 hello.c 
+
+example% cat hello.mso
+str "hello world"
+
+example% cat xxx.msg
+$ xxx message catalog
+$translation msgcc 2007-09-25
+$set 1
+$quote "
+1 "hello world"
+.fi
+.in -2
+.sp
+
+.SH AUTHORS
+.sp
+.LP
+Glenn Fowler, \[email protected]\fR
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitydeveloper/astdev
+_
+Interface StabilityVolatile
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBcpp\fR(1), \fBgencat\fR(1), \fBmkmsgs\fR(1), \fBmsggen\fR(1), \fBmsgcpp\fR(1), \fBmsgcvt\fR(1), \fBattributes\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/msgcpp.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,873 @@
+'\" te
+.\" Copyright (c) 1986-2006 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2007, Sun Microsystems, Inc.
+.TH msgcpp 1 "9 Oct 2007" "SunOS 5.11" "User Commands"
+.SH NAME
+msgcpp \- C language message catalog preprocessor
+.SH SYNOPSIS
+.LP
+.nf
+\fBmsgcpp\fR [\fB-ACEHMPVX\fR] [\fB-D\fR \fIname\fR[\fB=\fR\fIvalue\fR]] [\fB-I\fR \fIdirectory\fR] [\fB-U\fR \fIname\fR] 
+ [\fB-T\fR[\fIlength\fR]] [\fB-Y\fR \fIdirectory\fR] [\fIinput\fR [\fIoutput\fR] ]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBmsgcpp\fR is a C language message catalog preprocessor. It accepts \fBcpp\fR(1) style options and arguments. \fBmsgcpp\fR preprocesses an input C source file and emits keyed lines to the output, usually for further processing by\fBmsgcc\fR(1). \fBmsgcc\fR output is in the \fBgencat\fR(1) syntax. Candidate message text is determined by arguments to the last \fB<error.h>\fR and \fB<option.h>\fR functions. The \fBmsgcpp\fR keyed output lines are:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcmd\fR \fIcommand\fR\fR
+.ad
+.RS 19n
+.rt  
+\fIcommand\fR is a candidate for \fB--??keys\fR option string generation. This is triggered by \fBb_command(int argc\fR, in the input.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBdef\fR \fIname string\fR\fR
+.ad
+.RS 19n
+.rt  
+\fIname\fR is a candidate variable with \fIstring\fR value string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBstr\fR \fIstring\fR\fR
+.ad
+.RS 19n
+.rt  
+\fIstring\fR should be entered into the catalog.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBvar\fR \fIname\fR\fR
+.ad
+.RS 19n
+.rt  
+If \fBdef\fR \fIname\fR occurs then its string value should be entered into the catalog.
+.RE
+
+.sp
+.LP
+The input source file is preprocessed with the \fBpp:allpossible\fR option on. This enables non-C semantics. All source should first be compiled error-free with a real compiler before running \fBmsgcpp\fR. The following changes are enabled for the top level files. Included file behavior is not affected.
+.RS +4
+.TP
+1.
+All \fB#if\fR, \fB#ifdef\fR and \fB#ifndef\fR branches are enabled.
+.RE
+.RS +4
+.TP
+2.
+The first definition for a macro is retained, even when subsequent \fB#define\fR statements would normally redefine the macro. \fB#undef\fR must be used to redefine a macro.
+.RE
+.RS +4
+.TP
+3.
+Macro calls with an improper number of arguments are silently ignored.
+.RE
+.RS +4
+.TP
+4.
+\fB#include\fR on non-existent headers are silently ignored.
+.RE
+.RS +4
+.TP
+5.
+Invalid C source characters are silently ignored.
+.RE
+.sp
+.LP
+\fBmsgcat.h\fR is included if it exists. This file may contain macro definitions for functions that translate string arguments. If \fBfoo\fR is a function that translates its string arguments then include the line \fB#define foo _TRANSLATE_\fR in \fBmsgcat.h\fR, or specify the option \fB-Dfoo=_TRANSLATE_\fR. If \fBbar\fR is a function that translates string arguments if the first argument is \fBstderr\fR, then use either \fB#define bar _STDIO_\fR or \fB-Dbar=_STDIO_\fR. 
+.sp
+.LP
+The macro \fB_BLD_msgcat\fR is defined to be \fB1\fR. As an alternative to \fBmsgcat.h\fR, \fB_TRANSLATE_\fR definitions could be placed inside \fB#ifdef _BLD_msgcat ... #endif\fR. 
+.SH OPTIONS
+.sp
+.LP
+The following options are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.br
+.na
+\fB\fB--assert=\fR\fIassertion\fR\fR
+.ad
+.RS 25n
+.rt  
+Enter the assertion using \fB#assert\fR for system V compatibility.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-C\fR\fR
+.ad
+.br
+.na
+\fB\fB--comments\fR\fR
+.ad
+.RS 25n
+.rt  
+Pass comments to the output. 
+.sp
+Comments are omitted by default.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR\fR
+.ad
+.br
+.na
+\fB\fB--define=\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]\fR\fR
+.ad
+.RS 25n
+.rt  
+Define the macro \fIname\fR to have \fIvalue\fR. This is the only portable way to pass options through \fBcc\fR to \fBcpp\fR(1). 
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fB=\fR\fIvalue\fR is omitted, \fIvalue\fR is assumed to be \fB1\fR .
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIname\fR begins with \fB:\fR, then it is interpreted as a \fBlibpp\fR \fB#pragma pp\fR: statement.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIname\fR begins with \fB%\fR, it is interpreted as a \fBlibpp\fR \fB#\fR directive statement.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If name begins with a \fB-\fR or a \fB+\fR, it is interpreted as a \fBlibpp\fR option.
+.sp
+\fB-\fR turns the option on, \fB+\fR turns it off.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Most options have a \fB#pragma\fR counterpart that is listed with the option definition.
+.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-C\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:compatibility\fR\fR
+.ad
+.sp .6
+.RS 4n
+Preprocess for K&R C compatibility.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-D\fR\fIlevel\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:debug level\fR \fIlevel\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the debug trace level. 
+.sp
+Specify \fIlevel\fR as a number greater than or equal to \fB0\fR. Higher levels produce more output. Levels higher than \fB3\fR can only be enabled in the \fB-g\fR compiled versions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-F\fR\fIname\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the main input file name to \fIname\fR. This only affects the error messages and the line sync output.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-H\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:hosted\fR\fR
+.ad
+.sp .6
+.RS 4n
+All directories are hosted. Compatibility warning messages from the hosted directory headers are suppressed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-I\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:cdir\fR\fR
+.ad
+.sp .6
+.RS 4n
+All directories contain C headers. This option is only used only with \fB-D-+\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-K\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:keyargs\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable the non-standard \fIname\fR\fB=\fR\fIvalue\fR macro argument mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-L\fR\fB[\fR\fIid\fR\fB]\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:lineid [\fR\fIid\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Set the line sync directive id to \fIid\fR. If \fIid\fR is not specified, set to null.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-M\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:nomultiple\fR\fR
+.ad
+.sp .6
+.RS 4n
+Disable multiple include detection.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-P\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:passthrough\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable the non-standard passthrough mode. This can be useful for processing non-C input.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-Q\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:dump\fR\fR
+.ad
+.sp .6
+.RS 4n
+Dump macro definitions to the output so that the output may be passed through \fBcpp\fR again. This is used for generating precompiled headers.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-R\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:transition\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable the transition preprocessing mode. This is used for compilers that cannot make up their semantics between K&R and ISO C.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-S\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:strict\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable strict preprocessing semantics and warnings. This works with any mode (compatibility, transition, or the default ISO).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-T\fR\fItest\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:test\fR \fItest\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable implementation specific test code according to \fItest\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-W\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:warn\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable pedantic warnings in non-hosted files.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-X\fR\fB[cc]\fR\fR
+.ad
+.br
+.na
+\fB\fB\fR\fR
+.ad
+.sp .6
+.RS 4n
+Preprocess for the \fBcc\fR compiler, which must be an executable path or an executable on \fB$PATH\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-Z\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:pool\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable pool mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-d\fR\fR
+.ad
+.sp .6
+.RS 4n
+List canonicalized \fB#define\fR statements for non-predefined macros in the output.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-m\fR\fR
+.ad
+.sp .6
+.RS 4n
+List canonicalized \fB#define\fR statements for all macros. All other output is disabled.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D-+\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:plusplus\fR\fR
+.ad
+.sp .6
+.RS 4n
+Preprocess for the C++ dialect.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-E\fR\fR
+.ad
+.br
+.na
+\fB\fB--preprocess\fR\fR
+.ad
+.RS 25n
+.rt  
+Ignored; for compatibility with very old compilers.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.br
+.na
+\fB\fB--include-reference\fR\fR
+.ad
+.RS 25n
+.rt  
+Emit \fB#include\fR file paths on the standard error, one per line, indented to show nesting.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I\fR\fR
+.ad
+.br
+.na
+\fB\fB--include[=\fR\fIdirectory\fR\fB]\fR\fR
+.ad
+.RS 25n
+.rt  
+Append directory to the list of directories searched for \fB#include\fR files. 
+.sp
+If directory is \fB-\fR: 
+.RS +4
+.TP
+1.
+\fB-I\fR directories before \fB-I-\fR are searched only for \fB"..."\fR include files
+.RE
+.RS +4
+.TP
+2.
+\fB-I\fR directories after \fB-I-\fR are searched for \fB"..."\fR and \fB<"...">\fR include files
+.RE
+.RS +4
+.TP
+3.
+the directory \fB\&.\fR is searched only if it is explicitly specified by an \fB-I\fR option
+.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-C\fR\fIdirectory\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:cdir directory\fR\fR
+.ad
+.sp .6
+.RS 4n
+Mark \fIdirectory\fR as a C header directory. This option is used with \fBpp:plusplus\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-D[\fR\fIfile\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Read the default \fBprobe\fR definitions from \fIfile\fR, or ignore the default definitions if \fIfile\fR is omitted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-H\fR\fIdirectory\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:hostdir\fR \fIdirectory\fR\fR
+.ad
+.sp .6
+.RS 4n
+Mark directory as a hosted directory. Headers from hosted directories have compatibility warnings disabled.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-I\fR\fIheader\fR\fR
+.ad
+.br
+.na
+\fB\fBpp:ignore\fR \fIheader\fR\fR
+.ad
+.sp .6
+.RS 4n
+Add \fIheader\fR to the list of ignored headers.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-M\fR\fIfile\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIfile\fR contains a sequence of header \fB[= "map" ]\fR lines, where header is either \fB<name>\fR or \fB"name"\fR, and \fB"map"\fR is an explicit binding for header. header is ignored \fBif = "map"\fR is omitted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-R\fR\fIfile\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include \fIfile\fR but do not emit text or line syncs.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-S\fR\fIdirectory\fR\fR
+.ad
+.sp .6
+.RS 4n
+Add \fIdirectory\fR to the default standard include directory list.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I-T\fR\fIfile\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include \fIfile\fR and emit text to the output file. The option value can be omitted.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-M\fR\fR
+.ad
+.br
+.na
+\fB\fB--dependencies\fR\fR
+.ad
+.RS 25n
+.rt  
+Generate \fBmake\fR(1S) dependencies. This option is not needed with \fBnmake\fR. 
+.sp
+The \fB-M\fR option can be followed by optional flags to change the dependency output styles. 
+.sp
+The following optional flags are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD\fR\fR
+.ad
+.RS 5n
+.rt  
+Generate dependencies in a separate \fB\&.d\fR file. Preprocessed output is still written to output, or the standard output if output is omitted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBG\fR\fR
+.ad
+.RS 5n
+.rt  
+Also generate missing dependencies.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBM\fR\fR
+.ad
+.RS 5n
+.rt  
+Only generate local header dependencies. Hosted headers are omitted. Hosted headers are determined by the \fB-I-H\fR option and the -\fB-pp:hosted\fR and \fBpp:hostdir pragmas\fR. No special distinction is made between the \fB""\fR and \fB<>\fR include styles.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-P\fR\fR
+.ad
+.br
+.na
+\fB\fB--sync\fR\fR
+.ad
+.RS 25n
+.rt  
+Emit line syncs.
+.sp
+Line sync is turned on by default. \fB-P\fR means \fB--nosync\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-T\fR\fB[\fR\fIlength\fR\fB]\fR\fR
+.ad
+.RS 25n
+.rt  
+If not \fBgcc\fR, truncate identifiers to \fIlength\fR characters for compatibility with old AT&T compilers.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-U\fR\fR
+.ad
+.br
+.na
+\fB\fB--undefine=\fR\fIname\fR\fR
+.ad
+.RS 25n
+.rt  
+Remove the definition for the macro \fIname\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-V\fR\fR
+.ad
+.br
+.na
+\fB\fB--version\fR\fR
+.ad
+.RS 25n
+.rt  
+Emit the \fBlibpp\fR version.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-X\fR\fR
+.ad
+.br
+.na
+\fB\fB--argmode\fR\fR
+.ad
+.RS 25n
+.rt  
+Enable \fIname\fR\fB=\fR\fIvalue\fR macro arguments for \fBeasel\fR compatibility.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-Y\fR\fR
+.ad
+.br
+.na
+\fB\fB--standard=\fR\fIdirectory\fR\fR
+.ad
+.RS 25n
+.rt  
+Add \fIdirectory\fR to the list searched for \fB#include <...>\fR files.
+.RE
+
+.SH OPERANDS
+.sp
+.LP
+The following operands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIinput\fR\fR
+.ad
+.RS 10n
+.rt  
+Specifies C source file to preprocess.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIoutput\fR\fR
+.ad
+.RS 10n
+.rt  
+Specifies output file.
+.RE
+
+.SH EXIT STATUS
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+Successful completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+An error occurred.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRUsing \fBmsgcpp\fR to Extract Localizable Strings
+.sp
+.LP
+The following example uses \fBmsgcpp\fR to extract localizable strings from the file \fBhello.c\fR, marked using the \fBERROR_dictionary()\fR, and writes them to the file \fBhello.mso\fR: 
+
+.sp
+.in +2
+.nf
+example% cat hello.c
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * dummy macro to avoid including
+ * libast headers
+ */
+#define ERROR_dictionary(x) x
+
+int main(int ac, char *av[])
+{
+    puts( ERROR_dictionary("hello world") );
+    puts( ERROR_dictionary("hello all") );
+    return( EXIT_SUCCESS );
+ }
+
+example% msgcpp -D__STDC__ -D__i386 hello.c hello.mso
+
+example% cat hello.mso
+str "hello world"
+str "hello all"
+.fi
+.in -2
+.sp
+
+.SH AUTHORS
+.sp
+.LP
+Glenn Fowler, \[email protected]\fR
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitydeveloper/astdev
+_
+Interface StabilityVolatile 
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBcpp\fR(1), \fBgencat\fR(1), \fBmsgcc\fR(1), \fBmsgcvt\fR(1), \fBmsggen\fR(1), \fBmake\fR(1S), \fBattributes\fR(5)
+.sp
+.LP
+Kernighan, Brian W. and Ritchie, Dennis M., \fIThe C Programming Language\fR, Prentice Hall, 1988.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/msgcvt.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,133 @@
+'\" te
+.\" Copyright (c) 2000-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+.TH msgcvt 1 "26 Apr 2010" "SunOS 5.11" "User Commands"
+.SH NAME
+msgcvt \- convert message file to and from HTML
+.SH SYNOPSIS
+.LP
+.nf
+\fBmsgcvt\fR [\fB-hmr\fR]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBmsgcvt\fR reads a \fBgencat\fR(1) format file on the standard input and converts it to \fBHTML\fR on the standard output. The input file must contain the control statement \fB$quote "\fR and use the \fB"\fR character to quote message text. The output is in a form suitable for automatic translation by web sites such as http://babelfish.yahoo.com\&.
+.SH OPTIONS
+.sp
+.LP
+The following options are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR\fR
+.ad
+.br
+.na
+\fB\fB--html\fR\fR
+.ad
+.RS 10n
+.rt  
+Generate \fBHTML\fR from \fBgencat\fR(1) input. 
+.sp
+This is the default.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR\fR
+.ad
+.br
+.na
+\fB\fB--msg\fR\fR
+.ad
+.RS 10n
+.rt  
+Generate a \fBgencat\fR(1) message file from (presumably translated) \fBHTML\fR. Wide characters are UTF-8 encoded.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.br
+.na
+\fB\fB--raw\fR\fR
+.ad
+.RS 10n
+.rt  
+The message file is raw message text, one message per line, with no quoting or line numbering.
+.RE
+
+.SH EXIT STATUS
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+Successful completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+One or more specified jobs does not exist.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRGenerating a \fBgencat\fR Message Catalog File
+.sp
+.LP
+The following example generates a \fBgencat\fR(1) message catalog file from an HTML file:
+
+.sp
+.in +2
+.nf
+example% cat example.html | msgcvt -m > examplecat
+.fi
+.in -2
+.sp
+
+.SH AUTHORS
+.sp
+.LP
+Glenn Fowler, \[email protected]\fR
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitydeveloper/astdev
+_
+Interface StabilityVolatile 
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBgencat\fR(1), \fBmsgcc\fR(1), \fBmsggen\fR(1), \fBattributes\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/msggen.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,373 @@
+'\" te
+.\" Copyright (c) 2000-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2007, Sun Microsystems, Inc.
+.TH msggen 1 "9 Oct 2007" "SunOS 5.11" "User Commands"
+.SH NAME
+msggen \- generate a machine independent formatted message catalog
+.SH SYNOPSIS
+.LP
+.nf
+\fBmsggen\fR [\fB-fls\fR] \fIcatfile\fR [\fImsgfile\fR]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBmsggen\fR merges the message text source file \fImsgfile\fR into a machine independent formatted message catalog \fIcatfile\fR. The file \fIcatfile\fR is created if it does not already exist. If \fIcatfile\fR does exist, its messages are included in the new \fIcatfile\fR. If set and message numbers collide, the new message text defined in \fImsgfile\fR replaces the old message text currently contained in \fIcatfile\fR. 
+.sp
+.LP
+Non-ASCII characters must be UTF-8 encoded. \fBiconv\fR(1) can be used to convert to/from UTF-8.
+.SH OPTIONS
+.sp
+.LP
+The following options are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.br
+.na
+\fB\fB--format\fR\fR
+.ad
+.RS 12n
+.rt  
+List the \fBprintf\fR(3C) format signature for each message in \fIcatfile\fR. A format signature is one line containing one character for each format specification:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBc\fR\fR
+.ad
+.RS 5n
+.rt  
+char
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBd\fR\fR
+.ad
+.RS 5n
+.rt  
+double
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBD\fR\fR
+.ad
+.RS 5n
+.rt  
+long double
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBf\fR\fR
+.ad
+.RS 5n
+.rt  
+float
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBh\fR\fR
+.ad
+.RS 5n
+.rt  
+short
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBi\fR\fR
+.ad
+.RS 5n
+.rt  
+int
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBj\fR\fR
+.ad
+.RS 5n
+.rt  
+long long
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBl\fR\fR
+.ad
+.RS 5n
+.rt  
+long
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBp\fR\fR
+.ad
+.RS 5n
+.rt  
+void*
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBs\fR\fR
+.ad
+.RS 5n
+.rt  
+string
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBt\fR\fR
+.ad
+.RS 5n
+.rt  
+ptrdiff_t
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBz\fR\fR
+.ad
+.RS 5n
+.rt  
+size_t
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 5n
+.rt  
+unknown
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-l\fR\fR
+.ad
+.br
+.na
+\fB\fB--list\fR\fR
+.ad
+.RS 12n
+.rt  
+List \fIcatfile\fR in UTF-8 msgfile form.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.br
+.na
+\fB\fB--set\fR\fR
+.ad
+.RS 12n
+.rt  
+Convert the \fIcatfile\fR to a message set number and print the number on the standard output.
+.RE
+
+.SH OPERANDS
+.sp
+.LP
+The following operands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIcatfile\fR\fR
+.ad
+.RS 11n
+.rt  
+Machine independent formatted message catalog file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fImsgfile\fR\fR
+.ad
+.RS 11n
+.rt  
+Message text source file.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Message text source files are in \fBgencat\fR(1) format, defined as follows. The fields of a message text source line are separated by a single blank character. Any other blank characters are considered to be part of the subsequent field. The \fBNL_*\fR constants are defined in one or both of \fB<limits.h>\fR and \fB<nl_types.h>\fR\&.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR \fIcomment\fR\fR
+.ad
+.sp .6
+.RS 4n
+A line beginning with a \fB$\fR followed by a blank character is treated as a comment.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$delset\fR \fIn comment\fR\fR
+.ad
+.sp .6
+.RS 4n
+This line deletes message set \fIn\fR from an existing message catalog. \fIn\fR denotes the set number \fB[1, NL_SETMAX]\fR. Any text following the set number is treated as a comment.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$quote\fR \fIc\fR\fR
+.ad
+.sp .6
+.RS 4n
+This line specifies an optional quote character \fIc\fR, which can be used to surround message-text so that trailing spaces or empty messages are visible in a message source line. By default, or if an empty \fB$quote\fR directive is supplied, no quoting of message-text is recognized.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$set\fR \fIn comment\fR\fR
+.ad
+.sp .6
+.RS 4n
+This line specifies the set identifier of the following messages until the next \fB$set\fR or end-of-file (\fBEOF\fR) appears. \fIn\fR denotes the set identifier, which is defined as a number in the range \fB[1, NL_SETMAX]\fR. Set numbers need not be contiguous. Any text following the set identifier is treated as a comment. If no \fB$set\fR directive is specified in a message text source file, all messages are located in message set 1.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$translation\fR \fIidentification YYYY-MM-DD\fR\fB[,...]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Append translation information to the message catalog header. Only the newest date for a given identification is retained in the catalog. Multiple translation lines are combined into a single, comma-separated list.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBm\fR \fImessage-text\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBm\fR denotes the message identifier, which is defined as a number in the range \fB[1, NL_MSGMAX]\fR. The message-text is stored in the message catalogue with the set identifier specified by the last \fB$set\fR directive, and with message identifier \fBm\fR. If the message-text is empty, and a blank character field separator is present, an empty string is stored in the message catalogue. If a message source line has a message number, but neither a field separator nor message-text, the existing message with that number (if any) is deleted from the catalogue. Message identifiers need not be contiguous. There are no \fImessage-text\fR length restrictions.
+.RE
+
+.SH EXIT STATUS
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+Successful completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+One or more specified jobs does not exist.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRUsing \fBmsggen\fR
+.sp
+.LP
+The following example generates a message catalog \fBxxx\fR from the message file \fBxxx.msg\fR:
+
+.sp
+.in +2
+.nf
+example% msggen xxx xxx.msg
+.fi
+.in -2
+.sp
+
+.SH AUTHORS
+.sp
+.LP
+Glenn Fowler, \[email protected]\fR
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitydeveloper/astdev
+_
+Interface StabilityVolatile
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBgencat\fR(1), \fBiconv\fR(1), \fBmsgcc\fR(1), \fBprintf\fR(3C), \fBattributes\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/msgget.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,142 @@
+'\" te
+.\" Copyright (c) 2000-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2007, Sun Microsystems, Inc.
+.TH msgget 1 "9 Oct 2007" "SunOS 5.11" "User Commands"
+.SH NAME
+msgget \- get a message from a message catalog
+.SH SYNOPSIS
+.LP
+.nf
+\fBmsgget\fR \fIlocale\fR [\fIcommand\fR\fB:\fR]\fIcatalog\fR [\fIset\fR.]\fInumber\fR [\fItext\fR]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBmsgget\fR gets the message corresponding to the parameters. See \fBOPERANDS\fR. 
+.SH OPERANDS
+.sp
+.LP
+The following operands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIcatalog\fR\fR
+.ad
+.RS 16n
+.rt  
+Specifies the message catalog name. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIcommand\fR\fR
+.ad
+.RS 16n
+.rt  
+Specifies command-specific message.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIlocale\fR\fR
+.ad
+.RS 16n
+.rt  
+Specifies the locale. If \fIlocale\fR is \fB-\fR then the current locale is used. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR\fIset\fR\fB].\fR\fInumber\fR\fR
+.ad
+.RS 16n
+.rt  
+Identifies the message by message number and an optional message set. If specified as \fB-\fR , the message set and number are determined by looking up text in the corresponding C locale message catalog. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fItext\fR\fR
+.ad
+.RS 16n
+.rt  
+Specifies the text of the message to be output upon error.
+.RE
+
+.SH EXIT STATUS
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+Successful completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+An error occurred.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRGetting a Message in the Current Locale
+.sp
+.LP
+The following example gets \fBmsg 1\fR in the current locale from message catalog \fBhello\fR:
+
+.sp
+.in +2
+.nf
+example% msgget - hello 1
+hello world
+.fi
+.in -2
+.sp
+
+.SH AUTHORS
+.sp
+.LP
+Glenn Fowler, \[email protected]\fR
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitydeveloper/astdev
+_
+Interface StabilityVolatile
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBiconv\fR(1), \fBmsgcc\fR(1), \fBmsggen\fR(1), \fBattributes\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/popd.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/cd.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/popd.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/cd.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/pushd.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/cd.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/pushd.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/cd.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/rksh.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/ksh93.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/rksh.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/ksh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/rksh.1.zh_CN.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1 @@
+.so man1/ksh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/sh.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1732 @@
+'\" te
+.\" Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\"  Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at  http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.  This notice shall appear on any product containing this material. 
+.TH sh 1 "12 Jul 2011" "SunOS 5.11" "User Commands"
+.SH NAME
+sh, jsh \- standard and job control shell and command interpreter
+.SH SYNOPSIS
+.LP
+.nf
+\fB/usr/bin/sh\fR  [\fB-acefhiknprstuvx\fR] [\fIargument\fR]...
+.fi
+
+.LP
+.nf
+\fB/usr/xpg4/bin/sh\fR  [\(+- abCefhikmnoprstuvx]
+     [\(+- o \fIoption\fR]... [\fB-c\fR \fIstring\fR] [\fIarg\fR]...
+.fi
+
+.LP
+.nf
+\fB/usr/bin/jsh\fR  [\fB-acefhiknprstuvx\fR] [\fIargument\fR]...
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fB/usr/bin/sh\fR utility is a command programming language that executes commands read from a terminal or a file.
+.sp
+.LP
+The \fB/usr/xpg4/bin/sh\fR utility is a standards compliant shell. This utility provides all the functionality of \fBksh88\fR(1), except in cases discussed in \fBksh88\fR(1) where differences in behavior exist.
+.sp
+.LP
+The \fBjsh\fR utility is an interface to the shell that provides all of the functionality of \fBsh\fR and enables job control (see \fBJob Control\fR section below).
+.sp
+.LP
+Arguments to the shell are listed in the \fBInvocation\fR section below.
+.SS "Definitions"
+.sp
+.LP
+A \fIblank\fR is a tab or a space. A \fIname\fR is a sequence of \fBASCII\fR letters, digits, or underscores, beginning with a letter or an underscore. A \fIparameter\fR is a name, a digit, or any of the characters \fB*\fR, \fB@\fR, \fB#\fR, \fB?\fR, \fB\(mi\fR, \fB$\fR, and \fB!\fR.
+.SH USAGE
+.SS "Commands"
+.sp
+.LP
+A \fIsimple-command\fR is a sequence of non-blank \fIword\fRs separated by \fIblank\fRs. The first \fIword\fR specifies the name of the command to be executed. Except as specified below, the remaining \fIword\fRs are passed as arguments to the invoked command. The command name is passed as argument 0 (see \fBexec\fR(2)). The \fIvalue\fR of a \fIsimple-command\fR is its exit status if it terminates normally, or (octal) \fB200\fR+\fIstatus\fR if it terminates abnormally. See \fBsignal.h\fR(3HEAD) for a list of status values.
+.sp
+.LP
+A \fIpipeline\fR is a sequence of one or more \fIcommand\fRs separated by \fB|\fR. The standard output of each \fIcommand\fR but the last is connected by a \fBpipe\fR(2) to the standard input of the next \fIcommand\fR. Each \fIcommand\fR is run as a separate process. The shell waits for the last \fIcommand\fR to terminate. The exit status of a \fIpipeline\fR is the exit status of the last command in the \fIpipeline\fR.
+.sp
+.LP
+A \fIlist\fR is a sequence of one or more \fIpipeline\fRs separated by \fB;\fR, \fB&\fR, \fB&&\fR, or \fB|\||\fR, and optionally terminated by \fB;\fR or \fB&\fR\&. Of these four symbols, \fB;\fR and \fB&\fR have equal precedence, which is lower than that of \fB&&\fR and \fB|\||\fR. The symbols \fB&&\fR and \fB|\||\fR also have equal precedence. A semicolon (\fB;\fR) causes sequential execution of the preceding \fIpipeline\fR, that is, the shell waits for the \fIpipeline\fR to finish before executing any commands following the semicolon. An ampersand (\fB&\fR) causes asynchronous execution of the preceding pipeline, that is, the shell does \fBnot\fR wait for that pipeline to finish. The symbol \fB&&\fR (\|\fB|\||\fR) causes the \fIlist\fR following it to be executed only if the preceding pipeline returns a zero (non-zero) exit status. An arbitrary number of newlines can appear in a \fIlist\fR, instead of semicolons, to delimit commands.
+.sp
+.LP
+A \fIcommand\fR is either a \fIsimple-command\fR or one of the following. Unless otherwise stated, the value returned by a command is that of the last \fIsimple-command\fR executed in the command.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfor\fR \fIname\fR [ \fBin\fR \fIword\fR .\|.\|. ] \fBdo\fR \fIlist\fR \fBdone\fR\fR
+.ad
+.sp .6
+.RS 4n
+Each time a \fBfor\fR command is executed, \fIname\fR is set to the next \fIword\fR taken from the \fBin\fR \fIword\fR list. If \fBin\fR \fIword\fR .\|.\|. is omitted, then the \fBfor\fR command executes the \fBdo\fR \fIlist\fR once for each positional parameter that is set (see \fBParameter Substitution\fR section below). Execution ends when there are no more words in the list.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcase\fR \fIword\fR \fBin\fR [ \fIpattern\fR [ | \fIpattern\fR ] \fB)\fR \fIlist\fR \fB;\|;\fR ] .\|.\|.  \fBesac\fR\fR
+.ad
+.sp .6
+.RS 4n
+A \fBcase\fR command executes the \fIlist\fR associated with the first \fIpattern\fR that matches \fIword\fR. The form of the patterns is the same as that used for file-name generation (see \fBFile Name Generation\fR section), except that a slash, a leading dot, or a dot immediately following a slash need not be matched explicitly.
+.RE
+
+.sp
+.LP
+\fBif\fR \fIlist\fR \fB; then\fR \fIlist\fR \fBelif\fR \fIlist\fR \fB; then\fR \fIlist\fR \fB;\fR ] .\|.\|. [ \fBelse\fR \fIlist\fR \fB;\fR ] \fBfi\fR
+.sp
+.LP
+The \fIlist\fR following \fBif\fR is executed and, if it returns a zero exit status, the \fIlist\fR following the first \fBthen\fR is executed. Otherwise, the \fIlist\fR following \fBelif\fR is executed and, if its value is zero, the \fIlist\fR following the next \fBthen\fR is executed. Failing that, the \fBelse\fR \fIlist\fR is executed. If no \fBelse\fR \fIlist\fR or \fBthen\fR \fIlist\fR is executed, then the \fBif\fR command returns a zero exit status.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhile\fR \fIlist\fR \fBdo\fR \fIlist\fR \fBdone\fR\fR
+.ad
+.RS 27n
+.rt  
+A \fBwhile\fR command repeatedly executes the \fBwhile\fR \fIlist\fR and, if the exit status of the last command in the list is zero, executes the \fBdo\fR \fIlist\fR; otherwise the loop terminates. If no commands in the \fBdo\fR \fIlist\fR are executed, then the \fBwhile\fR command returns a zero exit status; \fBuntil\fR can be used in place of \fBwhile\fR to negate the loop termination test.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fIlist\fR\fB)\fR\fR
+.ad
+.RS 27n
+.rt  
+Execute \fIlist\fR in a sub-shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR \fIlist\fR\fB;}\fR\fR
+.ad
+.RS 27n
+.rt  
+\fIlist\fR is executed in the current (that is, parent) shell. The \fB{\fR must be followed by a space.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIname\fR \fB(\|) {\fR \fIlist\fR\fB;}\fR\fR
+.ad
+.RS 27n
+.rt  
+Define a function which is referenced by \fIname\fR. The body of the function is the \fIlist\fR of commands between \fB{\fR and \fB}\fR. The \fB{\fR must be followed by a space. Execution of functions is described below (see \fBExecution\fR section). The \fB{\fR and \fB}\fR are unnecessary if the body of the function is a \fIcommand\fR as defined above, under \fBCommands\fR.
+.RE
+
+.sp
+.LP
+The following words are only recognized as the first word of a command and when not quoted:
+.sp
+.LP
+\fBif  then  else  elif  fi  case  esac  for  while  until  do  done  {  }\fR
+.SS "Comments Lines"
+.sp
+.LP
+A word beginning with \fB#\fR causes that word and all the following characters up to a newline to be ignored.
+.SS "Command Substitution"
+.sp
+.LP
+The shell reads commands from the string between two grave accents (\fB``\fR) and the standard output from these commands can be used as all or part of a word. Trailing newlines from the standard output are removed.
+.sp
+.LP
+No interpretation is done on the string before the string is read, except to remove backslashes (\fB\e\fR) used to escape other characters. Backslashes can be used to escape a grave accent (\fB`\fR) or another backslash (\fB\e\fR) and are removed before the command string is read. Escaping grave accents allows nested command substitution. If the command substitution lies within a pair of double quotes (\fB" .\|.\|.\|` .\|.\|.\|` .\|.\|.\| "\fR), a backslash used to escape a double quote (\fB\e"\fR) is removed. Otherwise, it is left intact.
+.sp
+.LP
+If a backslash is used to escape a newline character (\fB\enewline\fR), both the backslash and the newline are removed (see the later section on \fBQuoting\fR). In addition, backslashes used to escape dollar signs (\fB\e$\fR) are removed. Since no parameter substitution is done on the command string before it is read, inserting a backslash to escape a dollar sign has no effect. Backslashes that precede characters other than \fB\e\fR, \fB`\fR, \fB"\fR, \fBnewline\fR, and \fB$\fR are left intact when the command string is read.
+.SS "Parameter Substitution"
+.sp
+.LP
+The character \fB$\fR is used to introduce substitutable \fIparameter\fRs. There are two types of parameters, positional and keyword. If \fIparameter\fR is a digit, it is a positional parameter. Positional parameters can be assigned values by \fBset\fR. Keyword parameters (also known as variables) can be assigned values by writing:
+.sp
+.LP
+\fIname\fR\fB=\fR\fIvalue\fR [ \fIname\fR\fB=\fR\fIvalue\fR ] .\|.\|.
+.sp
+.LP
+Pattern-matching is not performed on \fIvalue\fR. There cannot be a function and a variable with the same \fIname\fR.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+The value, if any, of the parameter is substituted. The braces are required only when \fIparameter\fR is followed by a letter, digit, or underscore that is not to be interpreted as part of its name. If \fIparameter\fR is \fB*\fR or \fB@\fR, all the positional parameters, starting with \fB$1\fR, are substituted (separated by spaces). Parameter \fB$0\fR is set from argument zero when the shell is invoked.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\(mi\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+Use Default Values. If \fIparameter\fR is unset or null, the expansion of \fIword\fR is substituted; otherwise, the value of \fIparameter\fR is substituted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:=\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+Assign Default Values. If \fIparameter\fR is unset or null, the expansion of \fIword\fR is assigned to \fIparameter\fR. In all cases, the final value of \fIparameter\fR is substituted. Only variables, not positional parameters or special parameters, can be assigned in this way.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:?\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+If \fIparameter\fR is set and is non-null, substitute its value; otherwise, print \fIword\fR and exit from the shell. If \fIword\fR is omitted, the message "parameter null or not set" is printed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:+\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+If \fIparameter\fR is set and is non-null, substitute \fIword\fR; otherwise substitute nothing.
+.RE
+
+.sp
+.LP
+In the above, \fIword\fR is not evaluated unless it is to be used as the substituted string, so that, in the following example, \fBpwd\fR is executed only if \fBd\fR is not set or is null:
+.sp
+.in +2
+.nf
+\fBecho  ${d:\(mi`pwd`}\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+If the colon (\fB:\fR) is omitted from the above expressions, the shell only checks whether \fIparameter\fR is set or not.
+.sp
+.LP
+The following parameters are automatically set by the shell.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 8n
+.rt  
+The number of positional parameters in decimal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\(mi\fR\fR
+.ad
+.RS 8n
+.rt  
+Flags supplied to the shell on invocation or by the \fBset\fR command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 8n
+.rt  
+The decimal value returned by the last synchronously executed command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 8n
+.rt  
+The process number of this shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR\fR
+.ad
+.RS 8n
+.rt  
+The process number of the last background command invoked.
+.RE
+
+.sp
+.LP
+The following parameters are used by the shell. The parameters in this section are also referred to as environment variables.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHOME\fR\fR
+.ad
+.RS 13n
+.rt  
+The default argument (home directory) for the \fBcd\fR command, set to the user's login directory by \fBlogin\fR(1) from the password file (see \fBpasswd\fR(4)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPATH\fR\fR
+.ad
+.RS 13n
+.rt  
+The search path for commands (see \fBExecution\fR section below).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCDPATH\fR\fR
+.ad
+.RS 13n
+.rt  
+The search path for the \fBcd\fR command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAIL\fR\fR
+.ad
+.RS 13n
+.rt  
+If this parameter is set to the name of a mail file \fIand\fR the \fBMAILPATH\fR  parameter is not set, the shell informs the user of the arrival of mail in the specified file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILCHECK\fR\fR
+.ad
+.RS 13n
+.rt  
+This parameter specifies how often (in seconds) the shell checks for the arrival of mail in the files specified by the \fBMAILPATH\fR or \fBMAIL\fR parameters. The default value is \fB600\fR seconds (10 minutes). If set to 0, the shell checks before each prompt.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILPATH\fR\fR
+.ad
+.RS 13n
+.rt  
+A colon-separated list of file names. If this parameter is set, the shell informs the user of the arrival of mail in any of the specified files. Each file name can be followed by % and a message that is e printed when the modification time changes. The default message is, \fByou have mail\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS1\fR\fR
+.ad
+.RS 13n
+.rt  
+Primary prompt string, by default " $ \|".
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS2\fR\fR
+.ad
+.RS 13n
+.rt  
+Secondary prompt string, by default " > \|".
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIFS\fR\fR
+.ad
+.RS 13n
+.rt  
+Internal field separators, normally \fBspace\fR, \fBtab\fR, and \fBnewline\fR (see \fBBlank Interpretation\fR section).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHACCT\fR\fR
+.ad
+.RS 13n
+.rt  
+If this parameter is set to the name of a file writable by the user, the shell writes an accounting record in the file for each shell procedure executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHELL\fR\fR
+.ad
+.RS 13n
+.rt  
+When the shell is invoked, it scans the environment (see \fBEnvironment\fR section below) for this name.
+.RE
+
+.sp
+.LP
+See \fBenviron\fR(5) for descriptions of the following environment variables that affect the execution of \fBsh\fR: \fBLC_CTYPE\fR and \fBLC_MESSAGES\fR.
+.sp
+.LP
+The shell gives default values to \fBPATH\fR, \fBPS1\fR, \fBPS2\fR, \fBMAILCHECK\fR, and \fBIFS\fR. Default values for \fBHOME\fR and \fBMAIL\fR are set by \fBlogin\fR(1).
+.SS "Blank Interpretation"
+.sp
+.LP
+After parameter and command substitution, the results of substitution are scanned for internal field separator characters (those found in \fBIFS\fR) and split into distinct arguments where such characters are found. Explicit null arguments (\fB""\fR or \fB\&''\fR) are retained. Implicit null arguments (those resulting from \fIparameter\fRs that have no values) are removed.
+.SS "Input/Output Redirection"
+.sp
+.LP
+A command's input and output can be redirected using a special notation interpreted by the shell. The following can appear anywhere in a \fIsimple-command\fR or can precede or follow a \fIcommand\fR and are \fBnot\fR passed on as arguments to the invoked command. \fBNote:\fR Parameter and command substitution occurs before \fIword\fR or \fIdigit\fR is used.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<\fR\fIword\fR\fR
+.ad
+.RS 16n
+.rt  
+Use file \fIword\fR as standard input (file descriptor 0).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>\fR\fIword\fR\fR
+.ad
+.RS 16n
+.rt  
+Use file \fIword\fR as standard output (file descriptor 1). If the file does not exist, it is created; otherwise, it is truncated to zero length.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>>\fR\fIword\fR\fR
+.ad
+.RS 16n
+.rt  
+Use file \fIword\fR as standard output. If the file exists, output is appended to it by first seeking to the \fBEOF\fR. Otherwise, the file is created.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<\|>\fR\fIword\fR\fR
+.ad
+.RS 16n
+.rt  
+Open file \fIword\fR for reading and writing as standard input.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<\fR[\fB\(mi\fR]\fIword\fR\fR
+.ad
+.RS 16n
+.rt  
+After parameter and command substitution is done on \fIword\fR, the shell input is read up to the first line that literally matches the resulting \fIword\fR, or to an \fBEOF\fR. If, however, the hyphen (\fB\(mi\fR) is appended to \fB<<\fR:
+.RS +4
+.TP
+1.
+leading tabs are stripped from \fIword\fR before the shell input is read (but after parameter and command substitution is done on \fIword\fR);
+.RE
+.RS +4
+.TP
+2.
+leading tabs are stripped from the shell input as it is read and before each line is compared with \fIword\fR; and
+.RE
+.RS +4
+.TP
+3.
+shell input is read up to the first line that literally matches the resulting \fIword\fR, or to an \fBEOF\fR.
+.RE
+If any character of \fIword\fR is quoted (see \fBQuoting\fR section later), no additional processing is done to the shell input. If no characters of \fIword\fR are quoted:
+.RS +4
+.TP
+1.
+parameter and command substitution occurs;
+.RE
+.RS +4
+.TP
+2.
+(escaped) \fB\enewline\fRs are removed; and
+.RE
+.RS +4
+.TP
+3.
+\fB\e\fR must be used to quote the characters \fB\e\fR, \fB$\fR, and \fB`\fR.
+.RE
+The resulting document becomes the standard input.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fR
+.ad
+.RS 16n
+.rt  
+Use the file associated with file descriptor \fIdigit\fR as standard input. Similarly for the standard output using \fB>&\fR\fIdigit\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\(mi\fR\fR
+.ad
+.RS 16n
+.rt  
+The standard input is closed. Similarly for the standard output using \fB>&\(mi\fR.
+.RE
+
+.sp
+.LP
+If any of the above is preceded by a digit, the file descriptor which is associated with the file is that specified by the digit (instead of the default \fB0\fR or \fB1\fR). For example:
+.sp
+.in +2
+.nf
+\fB\&... 2>&1\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+associates file descriptor 2 with the file currently associated with file descriptor 1.
+.sp
+.LP
+The order in which redirections are specified is significant. The shell evaluates redirections left-to-right. For example:
+.sp
+.in +2
+.nf
+\fB\&... 1>\fIxxx\fR 2>&1\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+first associates file descriptor 1 with file \fIxxx\fR. It associates file descriptor 2 with the file associated with file descriptor 1 (that is, \fIxxx\fR). If the order of redirections were reversed, file descriptor 2 would be associated with the terminal (assuming file descriptor 1 had been) and file descriptor 1 would be associated with file \fIxxx\fR.
+.sp
+.LP
+Using the terminology introduced on the first page, under \fBCommands\fR, if a \fIcommand\fR is composed of several \fIsimple commands\fR, redirection is evaluated for the entire \fIcommand\fR before it is evaluated for each \fIsimple command\fR. That is, the shell evaluates redirection for the entire \fIlist\fR, then each \fIpipeline\fR within the \fIlist\fR, then each \fIcommand\fR within each \fIpipeline\fR, then each \fIlist\fR within each \fIcommand\fR.
+.sp
+.LP
+If a command is followed by \fB&\fR, the default standard input for the command is the empty file, \fB/dev/null\fR. Otherwise, the environment for the execution of a command contains the file descriptors of the invoking shell as modified by input/output specifications.
+.SS "File Name Generation"
+.sp
+.LP
+Before a command is executed, each command \fIword\fR is scanned for the characters \fB*\fR, \fB?\fR, and \fB[\fR. If one of these characters appears the word is regarded as a \fIpattern\fR. The word is replaced with alphabetically sorted file names that match the pattern. If no file name is found that matches the pattern, the word is left unchanged. The character \fB\&.\fR at the start of a file name or immediately following a \fB/\fR, as well as the character \fB/\fR itself, must be matched explicitly.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 13n
+.rt  
+Matches any string, including the null string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 13n
+.rt  
+Matches any single character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR.\|.\|.\fB]\fR\fR
+.ad
+.RS 13n
+.rt  
+Matches any one of the enclosed characters. A pair of characters separated by \fB\(mi\fR matches any character lexically between the pair, inclusive. If the first character following the opening \fB[\fR is a \fB!\fR, any character not enclosed is matched.
+.RE
+
+.sp
+.LP
+Notice that all quoted characters (see below) must be matched explicitly in a filename.
+.SS "Quoting"
+.sp
+.LP
+The following characters have a special meaning to the shell and cause termination of a word unless quoted:
+.sp
+.LP
+\fB;  &  (  )  |  ^  <  >  newline  space  tab\fR
+.sp
+.LP
+A character can be \fIquoted\fR (that is, made to stand for itself) by preceding it with a backslash (\fB\e\fR) or inserting it between a pair of quote marks (\fB\|'\|'\fR or \fB""\fR). During processing, the shell can quote certain characters to prevent them from taking on a special meaning. Backslashes used to quote a single character are removed from the word before the command is executed. The pair \fB\enewline\fR is removed from a word before command and parameter substitution.
+.sp
+.LP
+All characters enclosed between a pair of single quote marks (\fB\|'\|'\fR), except a single quote, are quoted by the shell. Backslash has no special meaning inside a pair of single quotes. A single quote can be quoted inside a pair of double quote marks (for example, \fB"\|'"\fR), but a single quote can not be quoted inside a pair of single quotes.
+.sp
+.LP
+Inside a pair of double quote marks (\fB""\fR), parameter and command substitution occurs and the shell quotes the results to avoid blank interpretation and file name generation. If \fB$*\fR is within a pair of double quotes, the positional parameters are substituted and quoted, separated by quoted spaces (\fB"$1 \|$2\fR \|.\|.\|.\fB"\fR). However, if \fB$@\fR is within a pair of double quotes, the positional parameters are substituted and quoted, separated by unquoted spaces (\fB"$1"\|"$2"\fR \| .\|.\|. ). \fB\e\fR quotes the characters \fB\e\fR, \fB`\fR, \fB,\fR (comma), and \fB$\fR. The pair \fB\enewline\fR is removed before parameter and command substitution. If a backslash precedes characters other than \fB\e\fR, \fB`\fR, \fB,\fR (comma), \fB$\fR, and newline, then the backslash itself is quoted by the shell.
+.SS "Prompting"
+.sp
+.LP
+When used interactively, the shell prompts with the value of \fBPS1\fR before reading a command. If at any time a newline is typed and further input is needed to complete a command, the secondary prompt (that is, the value of \fBPS2\fR) is issued.
+.SS "Environment"
+.sp
+.LP
+The \fIenvironment\fR (see \fBenviron\fR(5)) is a list of name-value pairs that is passed to an executed program in the same way as a normal argument list. The shell interacts with the environment in several ways. On invocation, the shell scans the environment and creates a parameter for each name found, giving it the corresponding value. If the user modifies the value of any of these parameters or creates new parameters, none of these affects the environment unless the \fBexport\fR command is used to bind the shell's parameter to the environment (see also \fBset\fR \fB-a\fR). A parameter can be removed from the environment with the \fBunset\fR command. The environment seen by any executed command is thus composed of any unmodified name-value pairs originally inherited by the shell, minus any pairs removed by \fBunset\fR, plus any modifications or additions, all of which must be noted in \fBexport\fR commands.
+.sp
+.LP
+The environment for any \fIsimple-command\fR can be augmented by prefixing it with one or more assignments to parameters. Thus:
+.sp
+.in +2
+.nf
+\fBTERM=450  \fIcommand\fR\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+and
+.sp
+.in +2
+.nf
+\fB(export TERM; TERM=450;   \fIcommand\fR\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+are equivalent as far as the execution of \fIcommand\fR is concerned if \fIcommand\fR is not a Special Command. If \fIcommand\fR is a Special Command, then
+.sp
+.in +2
+.nf
+\fBTERM=450   \fIcommand\fR\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+modifies the \fBTERM\fR variable in the current shell.
+.sp
+.LP
+If the \fB-k\fR flag is set, \fIall\fR keyword arguments are placed in the environment, even if they occur after the command name. The following example first prints \fBa=b c\fR and \fBc\fR:
+.sp
+.in +2
+.nf
+\fBecho a=b  c
+
+a=b  c
+
+set  \(mik
+
+echo a=b  c
+
+c\fR
+.fi
+.in -2
+.sp
+
+.SS "Signals"
+.sp
+.LP
+The \fBINTERRUPT\fR and \fBQUIT\fR signals for an invoked command are ignored if the command is followed by \fB&\fR\&. Otherwise, signals have the values inherited by the shell from its parent, with the exception of signal 11 (but see also the \fBtrap\fR command below).
+.SS "Execution"
+.sp
+.LP
+Each time a command is executed, the command substitution, parameter substitution, blank interpretation, input/output redirection, and filename generation listed above are carried out. If the command name matches the name of a defined function, the function is executed in the shell process (note how this differs from the execution of shell script files, which require a sub-shell for invocation). If the command name does not match the name of a defined function, but matches one of the \fBSpecial Commands\fR listed below, it is executed in the shell process.
+.sp
+.LP
+The positional parameters \fB$1\fR, \fB$2\fR, .\|.\|. are set to the arguments of the function. If the command name matches neither a \fBSpecial Command\fR nor the name of a defined function, a new process is created and an attempt is made to execute the command via \fBexec\fR(2).
+.sp
+.LP
+The shell parameter \fBPATH\fR defines the search path for the directory containing the command. Alternative directory names are separated by a colon (\fB:\fR). The default path is \fB/usr/bin\fR. The current directory is specified by a null path name, which can appear immediately after the equal sign, between two colon delimiters anywhere in the path list, or at the end of the path list. If the command name contains a \fB/\fR the search path is not used. Otherwise, each directory in the path is searched for an executable file. If the file has execute permission but is not an \fBa.out\fR file, it is assumed to be a file containing shell commands. A sub-shell is spawned to read it. A parenthesized command is also executed in a sub-shell.
+.sp
+.LP
+The location in the search path where a command was found is remembered by the shell (to help avoid unnecessary \fIexec\fRs later). If the command was found in a relative directory, its location must be re-determined whenever the current directory changes. The shell forgets all remembered locations whenever the \fBPATH\fR variable is changed or the \fBhash\fR \fB-r\fR command is executed (see below).
+.SS "Special Commands"
+.sp
+.LP
+Input/output redirection is now permitted for these commands. File descriptor 1 is the default output location. When Job Control is enabled, additional \fBSpecial Commands\fR are added to the shell's environment (see \fBJob Control\fR section below).
+.sp
+.ne 2
+.mk
+.na
+\fB\fB:\fR\fR
+.ad
+.sp .6
+.RS 4n
+No effect; the command does nothing. A zero exit code is returned.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.\|\fR \fIfilename\fR\fR
+.ad
+.sp .6
+.RS 4n
+Read and execute commands from \fIfilename\fR and return. The search path specified by \fBPATH\fR is used to find the directory containing \fIfilename\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+When Job Control is enabled, the \fBbg\fR command is added to the user's environment to manipulate jobs. Resumes the execution of a stopped job in the background. If \fB%\fR\fIjobid\fR is omitted the current job is assumed. (See \fBJob Control\fR section below for more detail.)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbreak\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+Exit from the enclosing \fBfor\fR or \fBwhile\fR loop, if any. If \fIn\fR is specified, break \fIn\fR levels.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcd\fR [ \fIargument\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+Change the current directory to \fIargument\fR. The shell parameter \fBHOME\fR is the default \fIargument\fR. The shell parameter \fBCDPATH\fR defines the search path for the directory containing \fIargument\fR. Alternative directory names are separated by a colon (\fB:\fR). The default path is \fB<null>\fR (specifying the current directory). \fBNote:\fR The current directory is specified by a null path name, which can appear immediately after the equal sign or between the colon delimiters anywhere else in the path list. If \fIargument\fR begins with a \fB/\fR the search path is not used. Otherwise, each directory in the path is searched for \fIargument\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBchdir\fR [ \fIdir\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+\fBchdir\fR changes the shell's working directory to directory \fIdir\fR. If no argument is given, change to the home directory of the user. If \fIdir\fR is a relative pathname not found in the current directory, check for it in those directories listed in the \fBCDPATH\fR variable. If \fIdir\fR is the name of a shell variable whose value starts with a \fB/\fR, change to the directory named by that value.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcontinue\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+Resume the next iteration of the enclosing \fBfor\fR or \fBwhile\fR loop. If \fIn\fR is specified, resume at the \fIn\fR-th enclosing loop.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBecho\fR [ \fIarguments\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+The words in \fIarguments\fR are written to the shell's standard output, separated by space characters. See \fBecho\fR(1) for fuller usage and description.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBeval\fR [ \fIargument\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+The arguments are read as input to the shell and the resulting command(s) executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBexec\fR [ \fIargument\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+The command specified by the arguments is executed in place of this shell without creating a new process. Input/output arguments can appear and, if no other arguments are given, cause the shell input/output to be modified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBexit\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+Causes the calling shell or shell script to exit with the exit status specified by \fIn\fR. If \fIn\fR is omitted the exit status is that of the last command executed (an \fBEOF\fR also causes the shell to exit.)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBexport\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+The given \fIname\fRs are marked for automatic export to the \fIenvironment\fR of subsequently executed commands. If no arguments are given, variable names that have been marked for export during the current shell's execution are listed. (Variable names exported from a parent shell are listed only if they have been exported again during the current shell's execution.) Function names are \fBnot\fR exported.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+When Job Control is enabled, the \fBfg\fR command is added to the user's environment to manipulate jobs. This command resumes the execution of a stopped job in the foreground and also moves an executing background job into the foreground. If \fB%\fR\fIjobid\fR is omitted, the current job is assumed. (See \fBJob Control\fR section below for more detail.)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetopts\fR\fR
+.ad
+.sp .6
+.RS 4n
+Use in shell scripts to support command syntax standards (see \fBIntro\fR(1)). This command parses positional parameters and checks for legal options. See \fBgetoptcvt\fR(1) for usage and description.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBhash\fR [ \fB-r\fR ] [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+For each \fIname\fR, the location in the search path of the command specified by \fIname\fR is determined and remembered by the shell. The \fB-r\fR option causes the shell to forget all remembered locations. If no arguments are given, information about remembered commands is presented. \fIHits\fR is the number of times a command has been invoked by the shell process. \fICost\fR is a measure of the work required to locate a command in the search path. If a command is found in a "relative" directory in the search path, after changing to that directory, the stored location of that command is recalculated. Commands for which this are done are indicated by an asterisk (\fB*\fR) adjacent to the \fIhits\fR information. \fICost\fR is incremented when the recalculation is done.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBjobs\fR [\fB\fR\fB-p\fR\fB|\fR\fB-l\fR] [\fB%\fR\fIjobid ...\fR]\fR
+.ad
+.br
+.na
+\fB\fBjobs\fR \fB-x\fR \fIcommand\fR [\fIarguments\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Reports all jobs that are stopped or executing in the background. If \fB%\fR\fIjobid\fR is omitted, all jobs that are stopped or running in the background are reported. (See \fBJob Control\fR section below for more detail.)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkill\fR [ \fB-\fR\fIsig\fR ] \fB%\fR\fIjob\fR .\|.\|.\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB-l\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sends either the \fBTERM\fR (terminate) signal or the specified signal to the specified jobs or processes. Signals are either given by number or by names (as given in \fBsignal.h\fR(3HEAD) stripped of the prefix "SIG" with the exception that \fBSIGCHD\fR is named \fBCHLD\fR). If the signal being sent is \fBTERM\fR (terminate) or \fBHUP\fR (hangup), then the job or process is sent a \fBCONT\fR (continue) signal if it is stopped. The argument \fIjob\fR can be the process id of a process that is not a member of one of the active jobs. See \fBJob Control\fR section below for a description of the format of \fIjob\fR. In the second form, \fBkill\fR \fB-l\fR, the signal numbers and names are listed. (See \fBkill\fR(1)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBlogin\fR [ \fIargument\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+Equivalent to `\fBexec\fR \fBlogin\fR \fIargument\fR.\|.\|.\|.' See \fBlogin\fR(1) for usage and description.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnewgrp\fR [ \fIargument\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+Equivalent to \fBexec\fR \fBnewgrp\fR \fIargument\fR. See \fBnewgrp\fR(1) for usage and description.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpwd\fR\fR
+.ad
+.sp .6
+.RS 4n
+Print the current working directory. See \fBpwd\fR(1) for usage and description.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBread\fR \fIname\fR .\|.\|.\fR
+.ad
+.sp .6
+.RS 4n
+One line is read from the standard input and, using the internal field separator, \fBIFS\fR (normally space or tab), to delimit word boundaries, the first word is assigned to the first \fIname\fR, the second word to the second \fIname\fR, and so forth, with leftover words assigned to the last \fIname\fR. Lines can be continued using \fB\enewline\fR\&. Characters other than \fBnewline\fR can be quoted by preceding them with a backslash. These backslashes are removed before words are assigned to \fInames\fR, and no interpretation is done on the character that follows the backslash. The return code is \fB0\fR, unless an \fBEOF\fR is encountered.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBreadonly\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+The given \fIname\fRs are marked \fBreadonly\fR and the values of the these \fIname\fRs can not be changed by subsequent assignment. If no arguments are given, a list of all \fBreadonly\fR names is printed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBreturn\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+Causes a function to exit with the return value specified by \fIn\fR. If \fIn\fR is omitted, the return status is that of the last command executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBset\fR [ \fB-aefhkntuvx\fR [ \fIargument\fR .\|.\|. ] ]\fR
+.ad
+.sp .6
+.RS 4n
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+Mark variables which are modified or created for export.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR\fR
+.ad
+.RS 6n
+.rt  
+Exit immediately if a command exits with a non-zero exit status.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+Disable file name generation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR\fR
+.ad
+.RS 6n
+.rt  
+Locate and remember function commands as functions are defined (function commands are normally located when the function is executed).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR\fR
+.ad
+.RS 6n
+.rt  
+All keyword arguments are placed in the environment for a command, not just those that precede the command name.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+Read commands but do not execute them.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+Exit after reading and executing one command.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.RS 6n
+.rt  
+Treat unset variables as an error when substituting.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.RS 6n
+.rt  
+Print shell input lines as they are read.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+Print commands and their arguments as they are executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 6n
+.rt  
+Do not change any of the flags; useful in setting \fB$1\fR to \fB\(mi\fR\&.
+.RE
+
+Using \fB+\fR rather than \fB\(mi\fR causes these flags to be turned off. These flags can also be used upon invocation of the shell. The current set of flags can be found in \fB$\(mi\fR. The remaining arguments are positional parameters and are assigned, in order, to \fB$1\fR, \fB$2\fR, .\|.\|. If no arguments are given, the values of all names are printed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBshift\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+The positional parameters from \fB$\fR\fIn\fR\fB+1\fR .\|.\|. are renamed \fB$1\fR .\|.\|. . If \fIn\fR is not given, it is assumed to be 1.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBstop\fR \fIpid .\|.\|.\fR\fR
+.ad
+.sp .6
+.RS 4n
+Halt execution of the process number \fIpid\fR. (see \fBps\fR(1)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBsuspend\fR\fR
+.ad
+.sp .6
+.RS 4n
+Stops the execution of the current shell (but not if it is the login shell).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtest\fR\fR
+.ad
+.sp .6
+.RS 4n
+Evaluate conditional expressions. See \fBtest\fR(1) for usage and description.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtimes\fR\fR
+.ad
+.sp .6
+.RS 4n
+Print the accumulated user and system times for processes run from the shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrap\fR [ \fIargument\fR \fIn\fR [ \fIn2\fR .\|.\|. ]]\fR
+.ad
+.sp .6
+.RS 4n
+The command \fIargument\fR is to be read and executed when the shell receives numeric or symbolic signal(s) (\fIn\fR). (\fBNote:\fR \fIargument\fR is scanned once when the trap is set and once when the trap is taken.) Trap commands are executed in order of signal number or corresponding symbolic names. Any attempt to set a trap on a signal that was ignored on entry to the current shell is ineffective. An attempt to trap on signal 11 (memory fault) produces an error. If \fIargument\fR is absent, all trap(s) \fIn\fR are reset to their original values. If \fIargument\fR is the null string, this signal is ignored by the shell and by the commands it invokes. If \fIn\fR is 0, the command \fIargument\fR is executed on exit from the shell. The \fBtrap\fR command with no arguments prints a list of commands associated with each signal number.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtype\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+For each \fIname\fR, indicate how it would be interpreted if used as a command name.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBulimit\fR [ [\fB-HS\fR] [\fB-a\fR | \fB-cdfnstv\fR] ]\fR
+.ad
+.br
+.na
+\fB\fBulimit\fR [ [\fB-HS\fR] [\fB-c\fR | \fB-d\fR | \fB-f\fR | \fB-n\fR | \fB-s\fR | \fB-t\fR | \fB-v\fR] ] \fBlimit\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBulimit\fR prints or sets hard or soft resource limits. These limits are described in \fBgetrlimit\fR(2).
+.sp
+If \fIlimit\fR is not present, \fBulimit\fR prints the specified limits. Any number of limits can be printed at one time. The \fB-a\fR option prints all limits.
+.sp
+If \fIlimit\fR is present, \fBulimit\fR sets the specified limit to \fIlimit\fR. The string \fBunlimited\fR requests that the current limit, if any, be removed. Any user can set a soft limit  to any value less than or equal to  the hard limit. Any user can lower a hard limit.  Only a  user with appropriate privileges can raise or remove a hard limit.  See \fBgetrlimit\fR(2).
+.sp
+The \fB-H\fR option specifies a hard limit. The \fB-S\fR option specifies a soft limit. If neither option is specified, \fBulimit\fR sets both limits and print the soft limit.
+.sp
+The following options specify the resource whose limits are to be printed or set. If no option is specified, the file size limit is printed or set.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 6n
+.rt  
+maximum core file size (in 512-byte blocks)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR\fR
+.ad
+.RS 6n
+.rt  
+maximum size of data segment or heap (in kbytes)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+maximum file size (in 512-byte blocks)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+maximum file descriptor plus 1
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 6n
+.rt  
+maximum size of stack segment (in kbytes)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+maximum CPU time (in seconds)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.RS 6n
+.rt  
+maximum size of virtual memory (in kbytes)
+.RE
+
+Run the \fBsysdef\fR(1M) command to obtain the maximum possible limits for your system. The values reported are in hexadecimal, but can be translated into decimal numbers using the \fBbc\fR(1) utility. See \fBswap\fR(1M).)
+.sp
+As an example of \fBulimit\fR, to limit the size of a core file dump to 0 Megabytes, type the following:
+.sp
+.in +2
+.nf
+\fBulimit -c 0\fR
+.fi
+.in -2
+.sp
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBumask\fR [ \fInnn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+The user file-creation mask is set to \fInnn\fR (see \fBumask\fR(1)). If \fInnn\fR is omitted, the current value of the mask is printed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBunset\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+For each \fIname\fR, remove the corresponding variable or function value. The variables \fBPATH\fR, \fBPS1\fR, \fBPS2\fR, \fBMAILCHECK\fR, and \fBIFS\fR cannot be unset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwait\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+Wait for your background process whose process id is \fIn\fR and report its termination status. If \fIn\fR is omitted, all your shell's currently active background processes are waited for and the return code is zero.
+.RE
+
+.SS "Invocation"
+.sp
+.LP
+If the shell is invoked through \fBexec\fR(2) and the first character of argument zero is \fB\(mi\fR, commands are initially read from \fB/etc/profile\fR and from \fB$HOME/.profile\fR, if such files exist. Thereafter, commands are read as described below, which is also the case when the shell is invoked as \fB/usr/bin/sh\fR. The flags below are interpreted by the shell on invocation only. \fBNote:\fR Unless the \fB-c\fR or \fB-s\fR flag is specified, the first argument is assumed to be the name of a file containing commands, and the remaining arguments are passed as positional parameters to that command file:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fI\| string\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-c\fR flag is present commands are read from \fIstring\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-i\fR flag is present or if the shell input and output are attached to a terminal, this shell is \fBinteractive\fR. In this case, TERMINATE is ignored (so that \fBkill 0\fR does not kill an interactive shell) and INTERRUPT is caught and ignored (so that \fBwait\fR is interruptible). In all cases, QUIT is ignored by the shell.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-p\fR flag is present, the shell does not set the effective user and group IDs to the real user and group IDs.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-r\fR flag is present the shell is a restricted shell (see \fBrsh\fR(1M)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 15n
+.rt  
+If the \fB-s\fR flag is present or if no arguments remain, commands are read from the standard input. Any remaining arguments specify the positional parameters. Shell output (except for \fBSpecial Commands\fR) is written to file descriptor 2.
+.RE
+
+.sp
+.LP
+The remaining flags and arguments are described under the \fBset\fR command above.
+.SS "Job Control (jsh)"
+.sp
+.LP
+When the shell is invoked as \fBjsh\fR, Job Control is enabled in addition to all of the functionality described previously for \fBsh\fR. Typically, Job Control is enabled for the interactive shell only. Non-interactive shells typically do not benefit from the added functionality of Job Control.
+.sp
+.LP
+With Job Control enabled, every command or pipeline the user enters at the terminal is called a \fIjob\fR. All jobs exist in one of the following states: foreground, background, or stopped. These terms are defined as follows:
+.RS +4
+.TP
+1.
+A job in the foreground has read and write access to the controlling terminal.
+.RE
+.RS +4
+.TP
+2.
+A job in the background is denied read access and has conditional write access to the controlling terminal (see \fBstty\fR(1)).
+.RE
+.RS +4
+.TP
+3.
+A stopped job is a job that has been placed in a suspended state, usually as a result of a \fBSIGTSTP\fR signal (see \fBsignal.h\fR(3HEAD)).
+.RE
+.sp
+.LP
+Every job that the shell starts is assigned a positive integer, called a \fIjob number\fR which is tracked by the shell and is used as an identifier to indicate a specific job. Additionally, the shell keeps track of the \fIcurrent\fR and \fIprevious\fR jobs. The \fIcurrent job\fR is the most recent job to be started or restarted. The \fIprevious job\fR is the first non-current job.
+.sp
+.LP
+The acceptable syntax for a Job Identifier is of the form:
+.sp
+.LP
+\fB%\fR\fIjobid\fR
+.sp
+.LP
+where \fIjobid\fR can be specified in any of the following formats:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR or \fB+\fR\fR
+.ad
+.RS 13n
+.rt  
+For the current job.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\(mi\fR\fR
+.ad
+.RS 13n
+.rt  
+For the previous job.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fI<string>\fR\fR
+.ad
+.RS 13n
+.rt  
+Specify the job for which the command line uniquely contains \fIstring\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIn\fR\fR
+.ad
+.RS 13n
+.rt  
+For job number \fIn\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIpref\fR\fR
+.ad
+.RS 13n
+.rt  
+Where \fIpref\fR is a unique prefix of the command name. For example, if the command \fBls\fR \fB-l\fR \fIname\fR were running in the background, it could be referred to as \fB%ls\fR. \fIpref\fR cannot contain blanks unless it is quoted.
+.RE
+
+.sp
+.LP
+When Job Control is enabled, the following commands are added to the user's environment to manipulate jobs:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Resumes the execution of a stopped job in the background. If \fB%\fR\fIjobid\fR is omitted the current job is assumed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Resumes the execution of a stopped job in the foreground, also moves an executing background job into the foreground. If \fB%\fR\fIjobid\fR is omitted the current job is assumed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBjobs\fR [\fB-p\fR|\fB-l\fR] [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.br
+.na
+\fB\fBjobs\fR \fB-x\fR \fBcommand\fR [\fIarguments\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Reports all jobs that are stopped or executing in the background. If \fB%\fR\fIjobid\fR is omitted, all jobs that are stopped or running in the background is reported. The following options modify/enhance the output of \fBjobs\fR: 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-l\fR\fR
+.ad
+.RS 6n
+.rt  
+Report the process group ID and working directory of the jobs.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+.rt  
+Report only the process group ID of the jobs.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+Replace any \fIjobid\fR found in \fIcommand\fR or \fIarguments\fR with the corresponding process group ID, and then execute \fIcommand\fR passing it \fIarguments\fR.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkill\fR [ \fB-signal\fR ] \fB%\fR\fIjobid\fR\fR
+.ad
+.sp .6
+.RS 4n
+Builtin version of \fBkill\fR to provide the functionality of the \fBkill\fR command for processes identified with a \fIjobid\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBstop\fR \fB%\fR\fIjobid .\|.\|.\fR\fR
+.ad
+.sp .6
+.RS 4n
+Stops the execution of a background job(s).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBsuspend\fR\fR
+.ad
+.sp .6
+.RS 4n
+Stops the execution of the current shell (but not if it is the login shell).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwait\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+\fBwait\fR builtin accepts a job identifier. If \fB%\fR\fIjobid\fR is omitted \fBwait\fR behaves as described above under \fBSpecial Commands\fR.
+.RE
+
+.SS "Large File Behavior"
+.sp
+.LP
+See \fBlargefile\fR(5) for the description of the behavior of \fBsh\fR and \fBjsh\fR when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
+.SH EXIT STATUS
+.sp
+.LP
+Errors detected by the shell, such as syntax errors, cause the shell to return a non-zero exit status. If the shell is being used non-interactively execution of the shell file is abandoned. Otherwise, the shell returns the exit status of the last command executed (see also the \fBexit\fR command above).
+.SS "jsh Only"
+.sp
+.LP
+If the shell is invoked as \fBjsh\fR and an attempt is made to exit the shell while there are stopped jobs, the shell issues one warning:
+.sp
+.LP
+\fBThere are stopped jobs.\fR
+.sp
+.LP
+This is the only message. If another exit attempt is made, and there are still stopped jobs they are sent a \fBSIGHUP\fR signal from the kernel and the shell is exited.
+.SH FILES
+.sp
+.LP
+\fB$HOME/.profile\fR
+.sp
+.LP
+\fB/dev/null\fR
+.sp
+.LP
+\fB/etc/profile\fR
+.sp
+.LP
+\fB/tmp/sh*\fR
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.SS "/usr/bin/sh, /usr/bin/jsh"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitysystem/core-os
+_
+CSIEnabled
+.TE
+
+.SS "/usr/xpg4/bin/sh"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitysystem/core-os
+_
+CSIEnabled
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(1), \fBbc\fR(1), \fBecho\fR(1), \fBgetoptcvt\fR(1), \fBkill\fR(1), \fBksh88\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpfsh\fR(1), \fBpfexec\fR(1), \fBps\fR(1), \fBpwd\fR(1), \fBset\fR(1), \fBshell_builtins\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBwait\fR(1), \fBrsh\fR(1M), \fBsu\fR(1M), \fBswap\fR(1M), \fBsysdef\fR(1M), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBgetrlimit\fR(2), \fBpipe\fR(2), \fBulimit\fR(2), \fBsetlocale\fR(3C), \fBsignal.h\fR(3HEAD), \fBpasswd\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBXPG4\fR(5)
+.SH WARNINGS
+.sp
+.LP
+The use of \fBsetuid\fR shell scripts is \fBstrongly\fR discouraged.
+.SH NOTES
+.sp
+.LP
+Words used for filenames in input/output redirection are not interpreted for filename generation (see \fBFile Name Generation\fR section above). For example, \fBcat file1 >a*\fR createsa file named \fBa*\fR.
+.sp
+.LP
+Because commands in pipelines are run as separate processes, variables set in a pipeline have no effect on the parent shell.
+.sp
+.LP
+If the input or the output of a \fBwhile\fR or \fBuntil\fR loop is redirected, the commands in the loop are run in a sub-shell, and variables set or changed there have no effect on the parent process:
+.sp
+.in +2
+.nf
+   lastline=
+   while read line
+   do
+
+           lastline=$line
+   done < /etc/passwd
+   echo "lastline=$lastline"       # lastline is empty!
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+In these cases, the input or output can be redirected by using \fBexec\fR, as in the following example:
+.sp
+.in +2
+.nf
+   # Save standard input (file descriptor 0) as file
+   # descriptor 3, and redirect standard input from the file
+   /etc/passwd:
+
+   exec 3<&0               # save standard input as fd 3
+   exec </etc/passwd       # redirect input from file
+
+   lastline=
+   while read line
+   do
+           lastline=$line
+   done
+
+   exec 0<&3               # restore standard input
+   exec 3<&-               # close file descriptor 3
+   echo "$lastline"        # lastline
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+If you get the error message, "\fBcannot fork, too many processes\fR", try using the \fBwait\fR(1) command to clean up your background processes. If this doesn't help, the system process table is probably full or you have too many active foreground processes. There is a limit to the number of process ids associated with your login, and to the number the system can keep track of.
+.sp
+.LP
+Only the last process in a pipeline can be waited for.
+.sp
+.LP
+If a command is executed, and a command with the same name is installed in a directory in the search path before the directory where the original command was found, the shell continues to \fBexec\fR the original command. Use the \fBhash\fR command to correct this situation.
+.sp
+.LP
+The Bourne shell has a limitation on the effective \fBUID\fR for a process. If this \fBUID\fR is less than 100 (and not equal to the real UID of the process), then the \fBUID\fR is reset to the real UID of the process.
+.sp
+.LP
+Because the shell implements both foreground and background jobs in the same process group, they all receive the same signals, which can lead to unexpected behavior. It is, therefore, recommended that other job control shells be used, especially in an interactive environment.
+.sp
+.LP
+When the shell executes a shell script that attempts to execute a non-existent command interpreter, the shell returns an erroneous diagnostic message that the shell script file does not exist.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/sh.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,1732 @@
+'\" te
+.\" Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\"  Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. 
+.TH sh 1 "2011 年 7 月 12 日" "SunOS 5.11" "ユーザーコマンド"
+.SH 名前
+sh, jsh \- 標準シェルとジョブ制御シェルおよびコマンドインタプリタ
+.SH 形式
+.LP
+.nf
+\fB/usr/bin/sh\fR  [\fB-acefhiknprstuvx\fR] [\fIargument\fR]...
+.fi
+
+.LP
+.nf
+\fB/usr/xpg4/bin/sh\fR  [\(+- abCefhikmnoprstuvx]
+     [\(+- o \fIoption\fR]... [\fB-c\fR \fIstring\fR] [\fIarg\fR]...
+.fi
+
+.LP
+.nf
+\fB/usr/bin/jsh\fR  [\fB-acefhiknprstuvx\fR] [\fIargument\fR]...
+.fi
+
+.SH 機能説明
+.sp
+.LP
+\fB/usr/bin/sh\fR ユーティリティは、端末またはファイルから読み取られたコマンドを 実行するコマンドおよびプログラミング言語です。
+.sp
+.LP
+\fB/usr/xpg4/bin/sh\fR ユーティリティーは標準に準拠したシェルです。このユーティリティーは \fBksh88\fR(1) のすべての機能を提供します。ただし、\fBksh\fR(1) で説明しているように、動作が異なる場合を除きます。
+.sp
+.LP
+\fBjsh\fR ユーティリティーは、\fBsh\fR のすべての機能を備えた、かつジョブ制御を可能にするシェルへのインタフェースです (下記の「ジョブ制御」を参照)。\fB\fR
+.sp
+.LP
+シェルへの引数については、後述の「呼び出し」にリストされています。\fB\fR
+.SS "定義"
+.sp
+.LP
+ブランク (\fIblank\fR) はタブ (tab) またはスペース (space) です。名前 (\fIname\fR) は \fBASCII\fR 英文字、数字、または下線の並びで、先頭文字は英文字または下線です。パラメータ ( \fIparameter\fR) は、名前、複数、または \fB*\fR、\fB@\fR、\fB#\fR、\fB?\fR、\fB-\fR、\fB$\fR、\fB!\fR などの文字のいずれかです。
+.SH 使用法
+.SS "コマンド (Commands)"
+.sp
+.LP
+単純コマンド (\fIsimple-command\fR) は、ブランクで区切られた、ブランクでないワードの並びです。先頭のワードは、実行するコマンド名を指定します。\fI\fR\fI\fR\fI\fR残りのワードは、次に述べる場合を除き、呼び出されたコマンドに引数として渡されます。\fI\fRコマンド名は引数 0 として渡されます (\fBexec\fR(2) を参照)。単純コマンドの値 (\fIvalue\fR) は、正常終了した場合は終了ステータス、異常終了した場合は \fB200\fR+\fIstatus\fR (8 進数) です。\fI\fRステータス値の一覧表については、\fBsignal.h\fR(3HEAD) を参照してください。
+.sp
+.LP
+パイプライン (\fIpipeline\fR) は、パイプ (\fB|\fR) で区切られた 1 つ以上のコマンドの並びです。\fI\fR最後のコマンドを除き、各コマンドの標準出力は \fBpipe\fR(2) によってその次のコマンドの標準入力と結合されます。\fI\fR\fI\fR各コマンドは、別々のプロセスとして実行されます。\fI\fRシェルは最後のコマンドが終了するのを待ちます。\fI\fR最後のコマンドの終了ステータスがパイプライン全体の終了ステータスとなります。\fI\fR\fI\fR
+.sp
+.LP
+リスト (\fIlist\fR) は、\fB;\fR、\fB&\fR、\fB&&\fR、または \fB|\||\fR で区切られた 1 つ以上のパイプラインの並びです。その並びの終わりに \fB;\fR または \fB&\fR を記述することもできます。\fI\fRこれら 4 つの記号の中で、\fB;\fR と \fB&\fR の優先度は同じで、\fB&&\fR と \fB|\||\fR の優先度より低くなります。\fB&&\fR と \fB|\||\fR の優先度は同じです。セミコロン (\fB;\fR) によって、直前のパイプラインが順次実行されます。つまりシェルはパイプラインが終了するのを待ってから、セミコロンの後のコマンドを実行します。\fI\fR\fI\fRアンパサンド記号 (\fB&\fR) によって、直前のパイプラインが非同期的に実行されます。つまりシェルはパイプラインが終了するのを待ちません。\fB\fR\fB&&\fR という記号は、直前のパイプラインの終了ステータスが 0 の場合にだけ、後続のリストを実行するものです。反対に (\|\fB|\||\fR) は、終了ステータスが 0 以外の場合にだけ、後続のリストを実行します。\fI\fRコマンドの区切りとして、セミコロンの代わりに任意の数の復帰改行を \fIlist\fR に指定できます。
+.sp
+.LP
+コマンド (\fIcommand\fR) は、単純コマンドまたは次のいずれかです。\fI\fR特に断わりのないかぎり、コマンドが返す値は、そのコマンド中で最後に実行された単純コマンドの値です。\fI\fR
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfor\fR \fIname\fR [ \fBin\fR \fIword\fR .\|.\|. ] \fBdo\fR \fIlist\fR \fBdone\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBfor\fR コマンドが実行されるたびに、\fIname\fR は \fBin\fR \fIword\fR リストから次に得られる \fIword\fR に設定されます。If \fBin\fR \fIword\fR .\|.\|. を省略すると、\fBfor\fR コマンドは、設定された各定位値パラメータに対して、\fBdo\fR \fIlist\fR を 1 回実行します (後述の「パラメータ置換」を参照)。\fB\fRリストの word がなくなると、実行は終了します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcase\fR \fIword\fR \fBin\fR [ \fIpattern\fR [ | \fIpattern\fR ] \fB)\fR \fIlist\fR \fB;\|;\fR ] .\|.\|. \fBesac\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBcase\fR コマンドは、\fIword\fR に一致する最初の \fIpattern\fR に対応した \fIlist\fR を実行します。パターンの形式は、ファイル名生成に使用される形式と同じです (「ファイル名の生成」の節を参照)。ただしスラッシュ、先行するドット、およびスラッシュ直後のドットは、明示的に一致しなくてもかまいません。\fB\fR
+.RE
+
+.sp
+.LP
+\fBif\fR \fIlist\fR \fB; then\fR \fIlist\fR \fBelif\fR \fIlist\fR \fB; then\fR \fIlist\fR \fB;\fR ] .\|.\|. [ \fBelse\fR \fI list\fR \fB;\fR ] \fBfi\fR
+.sp
+.LP
+\fIif\fR の後の \fBlist\fR を実行後、\fIlist\fR が 0 の終了ステータスを返すと、最初の \fBthen\fR の後の list を実行します。それ以外の場合、\fBelif\fR の後の \fIlist\fR を実行します。この値が 0 の場合、次の \fBthen\fR の後の \fIlist\fR を実行します。これが失敗すると、\fBelse\fR \fIlist\fR を実行します。\fBelse\fR \fIlist\fR も \fBthen\fR \fIlist\fR も実行しない場合、\fBif\fR コマンドは 0 の終了ステータスを返します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwhile\fR \fIlist\fR \fBdo\fR \fIlist\fR \fBdone\fR\fR
+.ad
+.RS 27n
+.rt  
+\fBwhile\fR コマンドは、\fBwhile\fR \fIlist\fR を繰り返し実行し、list 中の最後のコマンドの終了ステータスが 0 の場合、\fBdo\fR \fIlist\fR を実行します。それ以外の場合、ループは終了します。\fBdo\fR \fIlist\fR 中のコマンドを実行しない場合、\fBwhile\fR コマンドは 0 の終了ステータスを返します。ループ終了条件の判定を逆にするには、\fBwhile\fR の代わりに \fBuntil\fR を使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB(\fR\fIlist\fR\fB)\fR\fR
+.ad
+.RS 27n
+.rt  
+サブシェル内の \fIlist\fR の実行
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB{\fR \fIlist\fR\fB;}\fR\fR
+.ad
+.RS 27n
+.rt  
+現在の (つまり、親) シェル内での \fIlist\fR の実行。記号 \fB{\fR の後にはスペースが必要です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIname\fR \fB(\|) {\fR \fIlist\fR\fB;}\fR\fR
+.ad
+.RS 27n
+.rt  
+\fIname\fR が参照する関数を定義します。\fB{\fR と \fB}\fR の間のコマンド群 (\fIlist\fR) が関数の本体となります (後述の「関数」参照)。記号 \fB{\fR の後にはスペースが必要です。関数の実行については「実行」の節で後述します。\fB\fR関数の本体が、前述の「コマンド」の節で定義したようなコマンドの場合、\fB{\fR および \fB}\fR は必要ではありません。\fI\fR\fB\fR
+.RE
+
+.sp
+.LP
+下記のワードは、コマンドの最初に現れたとき、およびクォートされずに記述されたときに認識されます。
+.sp
+.LP
+\fBif then else elif fi case esac for while until do done { }\fR
+.SS "注釈行"
+.sp
+.LP
+\fB#\fR でワードを始めると、そのワードおよび以降の 復帰改行までの文字がすべて無視されます。
+.SS "コマンド置換"
+.sp
+.LP
+シェルは、2 つの逆引用符 (\fB``\fR) で囲まれた文字列からコマンドを読み取ります。これらのコマンドからの標準出力は、ワードの一部または全体として使用できます。標準出力上で最後につく復帰改行は削除されます。
+.sp
+.LP
+文字列は、読み取られる前にはいっさい解釈されません。ただし例外として、文字のエスケープに使用されるバックスラッシュ (\fB\e\fR) の削除だけは行われます。バックスラッシュは、逆引用符 (\fB`\fR) または別のバックスラッシュ (\fB\e\fR) をエスケープするためにも使用され、コマンド文字列の読み取り前に削除されます。逆引用符をエスケープすることにより、コマンド置換のネストが可能になります。コマンド置換が、一対の二重引用符に囲まれている場合 (\fB" .\|.\|.\|` .\|.\|.\|` .\|.\|.\| "\fR)、二重引用符 (\fB\e"\fR) をエスケープするために使用されたバックスラッシュが削除されます。その他の場合は、変更がないままです。
+.sp
+.LP
+復帰改行文字のエスケープにバックスラッシュを用いた場合は (\fB\enewline\fR)、バックスラッシュと復帰改行の両方が削除されます (後述の「クォート」の節の後半を参照)。\fB\fRさらに、ドル記号 (\fB\e$\fR) をエスケープしているバックスラッシュも削除されます。コマンド文字列に対するパラメータの置換は 読み取り前には行われないので、バックスラッシュでドル記号をエスケープしようとしても 無意味です。\fB\e\fR、\fB`\fR、\fB"\fR、復帰改行 (\fBnewline\fR)、および \fB$\fR 以外の文字の前に付くバックスラッシュは、コマンド文字列の読み取り時にもそのまま残ります。
+.SS "パラメータ置換"
+.sp
+.LP
+文字 \fB$\fR は、置換可能なパラメータ (\fIparameter\fR) を示します。パラメータには、定位置パラメータとキーワードパラメータの 2 種類があります。パラメータが数字の場合、これは定位置パラメータです。\fI\fR定位置パラメータには、\fBset\fR によって値を割り当てることができます。キーワードパラメータ (変数とも呼ばれる) には、次の記述により値を代入することもできます。
+.sp
+.LP
+\fIname\fR\fB=\fR\fIvalue\fR [ \fIname\fR\fB=\fR\fIvalue\fR ] .\|.\|.
+.sp
+.LP
+\fIvalue\fR に対しては、パターンマッチングは行われません。同じ \fIname\fR を持つ関数と変数が存在することはできません。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+パラメータの値 ( もしあれば ) は置換されます。中括弧が必要となるのは、パラメータの後に、その名前の一部として解釈すべきでない文字、数字、または下線を指定するときだけです。\fI\fR\fIparameter\fR が \fB*\fR または \fB@\fR の場合、\fB$1\fR で始まる定位値パラメータはすべて (スペースで区切られて) 置換されます。パラメータ \fB$0\fR は、シェルが呼び出されたときに、引数 0 から設定されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:\(mi\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+デフォルト値の使用。\fIparameter\fR が未設定または NULL の場合は、\fIword\fR の展開結果に置換されます。それ以外の場合は、\fIparameter\fR の値に置換されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:=\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+デフォルト値の割り当て。\fIparameter\fR が未設定または NULL の場合は、\fIword\fR の展開結果が \fIparameter\fR に割り当てられます。どのような場合でも、\fIparameter\fR の最終的な値に置換されます。この割り当て方法は変数だけに使用可能で、定位置パラメータや特殊パラメータには使用できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:?\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+\fIparameter\fR が NULL 以外の値に設定されている場合、その値に置き換えられます。その他の場合、\fIword\fR を出力しシェルを終了します。\fIword\fR を省略すると、メッセージ "parameter null or not set" が出力されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB${\fR\fIparameter\fR\fB:+\fR\fIword\fR\fB}\fR\fR
+.ad
+.RS 25n
+.rt  
+\fIparameter\fR が NULL 以外の値に設定されている場合、\fIword\fR に置き換えられます。その他の場合は置換を行いません。
+.RE
+
+.sp
+.LP
+前述にあるように、\fIword\fR は、代入用文字列として使用する場合にだけ評価されます。たとえば次の例では、\fBpwd\fR が実行されるのは、\fBd\fR が設定されていないかあるいは NULL に設定されている場合だけです。
+.sp
+.in +2
+.nf
+\fBecho  ${d:\(mi`pwd`}\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+前述の式からコロン (\fB:\fR) を省略すると、シェルは \fIparameter\fR が設定されているかどうかだけをチェックします。
+.sp
+.LP
+次のパラメータは、シェルが自動的に設定します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB#\fR\fR
+.ad
+.RS 8n
+.rt  
+定位置パラメータ数 (10 進数 )
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\(mi\fR\fR
+.ad
+.RS 8n
+.rt  
+呼び出し時にまたは \fBset\fR コマンドによってシェルに与えられたフラグ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 8n
+.rt  
+最後に同期実行されたコマンドが返した 10 進数
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB$\fR\fR
+.ad
+.RS 8n
+.rt  
+このシェルのプロセス番号
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB!\fR\fR
+.ad
+.RS 8n
+.rt  
+最後に呼び出されたバックグラウンドコマンドのプロセス番号
+.RE
+
+.sp
+.LP
+次のパラメータはシェルによって使用されます。このセクションのパラメータは、環境変数とも呼ばれます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBHOME\fR\fR
+.ad
+.RS 13n
+.rt  
+\fBcd\fR コマンドのデフォルト引数 (ホームディレクトリ)。\fBlogin\fR(1) によって、パスワードファイルから ユーザーのログインディレクトリに設定されます (\fBpasswd\fR(4) を参照)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPATH\fR\fR
+.ad
+.RS 13n
+.rt  
+コマンド用検索パス (後述の「実行」を参照)。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBCDPATH\fR\fR
+.ad
+.RS 13n
+.rt  
+\fBcd\fR コマンドの検索パスを指定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAIL\fR\fR
+.ad
+.RS 13n
+.rt  
+このパラメータにメールファイルの名前がセットされていて、かつ \fBMAILPATH\fR パラメータが設定されていない場合、シェルは指定されたファイルにメールが到着するとユーザーに通知します。\fI\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILCHECK\fR\fR
+.ad
+.RS 13n
+.rt  
+このパラメータは、\fBMAILPATH\fR または \fBMAIL\fR パラメータで指定されたファイルへメールが到着したか否かを、シェルが何秒ごとにチェックするかを指定します。デフォルト値は \fB600\fR 秒 (10 分) です。0 が設定された場合、シェルは各プロンプトを出す前にチェックを行います。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAILPATH\fR\fR
+.ad
+.RS 13n
+.rt  
+コロン (:) で区切ったファイル名のリスト。このパラメータが設定されると、指定されたいずれかのファイルにメールが到着するたびに、シェルはユーザーに通知します。各ファイル名の後には、% および更新時刻の変更時に出力されるメッセージを指定できます。デフォルトのメッセージは \fByou have mail\fR です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS1\fR\fR
+.ad
+.RS 13n
+.rt  
+1 次プロンプト文字列。デフォルトは " $ \|" です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPS2\fR\fR
+.ad
+.RS 13n
+.rt  
+2 次プロンプト文字列。デフォルトは " > \|" です。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIFS\fR\fR
+.ad
+.RS 13n
+.rt  
+内部フィールドセパレータ。通常はスペース、タブ、および復帰改行です (「ブランクの解釈」を参照)。\fB\fR\fB\fR\fB\fR\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHACCT\fR\fR
+.ad
+.RS 13n
+.rt  
+このパラメータにユーザーが書き込み可能なファイル名が設定された場合、シェルは、実行された各シェルプロシージャーごとのアカウンティングレコードをこのファイルに書き込みます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHELL\fR\fR
+.ad
+.RS 13n
+.rt  
+シェルは、呼び出されると、このパラメータが示す名前が環境中に存在するかを確かめます (「環境」の節を参照)。\fB\fR
+.RE
+
+.sp
+.LP
+\fBsh\fR の実行に影響を与える次の環境変数についての詳細は、\fBenviron\fR(5) を参照してください。\fBLC_CTYPE\fR および \fBLC_MESSAGES\fR。
+.sp
+.LP
+シェルは、\fBPATH\fR、\fBPS1\fR、\fBPS2\fR、\fBMAILCHECK\fR、および \fBIFS\fR にデフォルト値を割り当てます。\fBHOME\fR および \fBMAIL\fR のデフォルト値は \fBlogin\fR(1) で設定します。
+.SS "ブランクの解釈"
+.sp
+.LP
+パラメータとコマンドの置換後、置換の結果内でフィールドセパレータ文字 (\fBIFS\fR で発見されるもの) を検索し、その文字が現れた位置で分割します。分割された各々が引数となります。明示的な NULL 引数 (\fB""\fR または \fB\&''\fR) は保持されます。暗示的な NULL 引数 (値を持たないパラメータにより生ずるもの) は削除されます。\fI\fR
+.SS "入出力のリダイレクト"
+.sp
+.LP
+シェルが解釈する特殊表記法によって、入出力をリダイレクションできます。以下は、単純コマンド内の任意の位置およびコマンドの前後に指定することができ、起動されたコマンドには引数として引き渡されません。\fI\fR\fI\fR\fB\fR\fB注: \fR \fIword\fR または \fIdigit\fR を使用する前にコマンドとパラメータの置換が発生します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<\fR\fIword\fR\fR
+.ad
+.RS 13n
+.rt  
+\fIword\fR というファイルを標準入力 ( ファイル記述子 0) として使用します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>\fR\fIword\fR\fR
+.ad
+.RS 13n
+.rt  
+\fIword\fR というファイルを標準出力 ( ファイル記述子 1) として使用します。ファイルが存在しない場合は作成します。ファイルが存在していれば、ファイルの長さを 0 にします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>>\fR\fIword\fR\fR
+.ad
+.RS 13n
+.rt  
+\fIword\fR というファイルを標準出力として使用します。ファイルが存在する場合、(\fBEOF\fR までシークしたあと) そのファイルに出力を追加します。そうでない場合は、ファイルを作成します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<\|>\fR\fIword\fR\fR
+.ad
+.RS 13n
+.rt  
+\fIword\fR というファイルを標準入力として読み書き用に開きます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<<\fR[\fB-\fR]\fIword\fR\fR
+.ad
+.RS 13n
+.rt  
+\fIword\fR に対するパラメータおよびコマンド置換が行われた後、その結果得られた \fIword\fR と文字どおり一致する最初の行が現れるまで、または \fBEOF\fR に達するまでシェルへの入力が読み取られます。ただし \fB<<\fR に \fB\(mi\fR が付加されて指定された場合は、以下のようになります。
+.RS +4
+.TP
+1.
+まず、シェルへの入力の読み取り前に (ただしパラメータとコマンドの置換後) 、先行するタブを \fIword\fR から取り除きます。\fI\fR
+.RE
+.RS +4
+.TP
+2.
+読み取ったシェルへの入力の各行を \fIword\fR と比較する前に、その行から先行するタブを取り除きます。そして、
+.RE
+.RS +4
+.TP
+3.
+その結果得られた \fIword\fR と文字どおり一致する最初の行が現れるまで、または \fBEOF\fR に達するまでシェルへの入力が読み取られます。
+.RE
+\fIword\fR 中のいずれかの文字がクォートされている場合 (後述の「クォート」を参照) 、シェルへの入力に対して追加処理は行われません。\fB\fR\fIword\fR 中のどの文字もクォートされていない場合は、以下のようになります。
+.RS +4
+.TP
+1.
+まずパラメータとコマンドの置換を実施します。
+.RE
+.RS +4
+.TP
+2.
+エスケープされた復帰改行 ( \fB\enewline\fR ) を削除します。
+.RE
+.RS +4
+.TP
+3.
+文字 \fB\e\fR、\fB$\fR、および \fB`\fR に対しては、\fB\e\fR を使ってクォートしなければなりません。
+.RE
+その結果得られるドキュメントが標準入力となります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&\fR\fIdigit\fR\fR
+.ad
+.RS 13n
+.rt  
+ファイル記述子 \fIdigit\fR に対応するファイルを標準入力として使用します。同様に、標準出力の使用には \fB>&\fR\fIdigit\fR を指定します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB<&-\fR\fR
+.ad
+.RS 13n
+.rt  
+標準入力をクローズします。同様に、標準出力については \fB>&\(mi\fR を使用します。
+.RE
+
+.sp
+.LP
+前述のいずれかの前に数字が付く場合、その値が (デフォルトの \fB0\fR または \fB1\fR の代わりに) 該当ファイルに対応したファイル記述子となります。例: 
+.sp
+.in +2
+.nf
+\fB\&... 2>&1\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+この例では、現在ファイル記述子 1 に関連しているファイルに、ファイル記述子 2 を関連付けます。
+.sp
+.LP
+リダイレクションを指定する場合、記述する順序が重要になります。シェルは、リダイレクション記述を左から右へ評価します。例: 
+.sp
+.in +2
+.nf
+\fB\&... 1>\fIxxx\fR 2>&1\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+前述の例では、まず \fIxxx\fR というファイルにファイル記述子 1 を関連付けます。次に、ファイル記述子 1 に関連するファイル ( つまり \fIxxx\fR) に、ファイル記述子 2 を関連付けます。リダイレクションの向きが逆であれば、まずファイル記述子 2 を端末に関連付け (ファイルを記述子 1 が既に端末に関連付けられているとみなし)、次にファイル記述子 1 をファイル \fIxxx\fR に関連付けます。
+.sp
+.LP
+最初のページの「コマンド」の節で述べた用語を使って説明すると、次のようになります。コマンドが複数の単純コマンドで構成される場合、リダイレクションは、個々の単純コマンドに対して行う前に、コマンド全体に対して評価されます。\fB\fR\fI\fR\fI\fR\fI\fR\fI\fRすなわち、シェルはまずリスト全体に対してリダイレクションを評価し、次にリスト内の各パイプラインに対して評価し、次にパイプライン内の各コマンドに対して評価し、最後にコマンド内の各単純コマンドに対して評価します。\fI\fR\fI\fR\fI\fR\fI\fR\fI\fR\fI\fR\fI\fR
+.sp
+.LP
+コマンドの後に \fB&\fR を指定すると、コマンドにおけるデフォルトの標準入力は \fB/dev/null\fR という空ファイルになります。その他の場合、コマンドを実行するための環境には、起動側シェルのファイル記述子 ( 入出力指定で変更可能 ) が含まれます。
+.SS "ファイル名の生成"
+.sp
+.LP
+コマンド実行に先立ち、各コマンドワードは、\fB*\fR、\fB?\fR、および \fB[\fR を含んでいないかチェックされます。\fI\fRこれらの文字のいずれかがあると、そのワードはパターンとみなされます。\fI\fRこのワードは、パターンと一致する、辞書編集方式の順にソートされたファイル名に置換されます。パターンと一致するファイル名が見つからない場合、ワードは変更されません。ファイル名の先頭のピリオド (\fB\&.\fR) または スラッシュ (\fB/\fR) 直後のピリオドは、明示的に一致しなければなりません (後者の場合はスラッシュ自体をも含む)。\fB\fR
+.sp
+.ne 2
+.mk
+.na
+\fB\fB*\fR\fR
+.ad
+.RS 13n
+.rt  
+NULL 文字列を含め、任意の文字列と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fR
+.ad
+.RS 13n
+.rt  
+任意の単一文字と一致します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB[\fR.\|.\|.\fB]\fR\fR
+.ad
+.RS 13n
+.rt  
+括弧内のいずれか 1 文字を表します。2 つの 文字を \fB-\fR で区切ると、その間にある任意の文字 (その 2 つの文字も含む) に一致します。先頭の \fB[\fR の次の文字が \fB!\fR である場合、[ ] で囲まれていない任意の文字と一致します。
+.RE
+
+.sp
+.LP
+クォートされているすべての文字 ( 下記「クォート」を参照 ) は、ファイル名において明示的に一致しなければなりませんので、ご注意ください。
+.SS "クォート"
+.sp
+.LP
+次の文字はシェルに対しては特別な意味を持ち、クォートしない ( 後述の説明を参照 ) 限り ワードの終わりを表します。
+.sp
+.LP
+\fB;  &  (  )  |  ^  <  >\fR  復帰改行  スペース  タブ
+.sp
+.LP
+これらの文字をクォートする、つまり文字自身を表すには、文字の前にバックスラッシュ (\fB\e\fR) を付けるか、または一対の引用符 (\fB\|'\|'\fR または \fB""\fR) で囲みます。\fI\fR処理中、シェルは、特定の文字をクォートして、それらが特別の意味を持たないようにすることができます。単一の文字をクォートするのに用いるバックスラッシュは、コマンド実行前にワードから取り除かれます。\fB\e\fR と復帰改行との組み合せは、コマンドとパラメータの置換前にワードから取り除かれます。
+.sp
+.LP
+一対の単一引用符 (\fB\|'\|'\fR) で囲まれたすべての文字 ( ただし単一引用符は除く ) は、シェルによってクォートされます。バックスラッシュは、一対の単一引用符で囲まれていれば特殊な意味を持ちません。単一引用符は、一対の二重引用符で囲めばクォートされますが (例 \fB"\|'"\fR)、一対の単一引用符で囲んでもクォートされません。
+.sp
+.LP
+一対の二重引用符 (\fB""\fR) の中では、パラメータとコマンドの置換が実施され、シェルは、その結果をクォートして、ブランクの解釈とファイル名の生成が行われないようにします。\fB$*\fR が一組の二重引用符で囲まれている場合、定位置パラメータは置換され、クォートされ、クォートされたスペースで分けられます (\fB"$1 \|$2\fR \|. \|.\|.\fB"\fR). しかし \fB$@\fR が一組の二重引用符で囲まれている場合は、定位置パラメータは置換され、クォートされ、クォートされていないスペースで分けられます (\fB"$1"\|"$2" \fR \| .\|.\|. )。\fB\e\fR は \fB\e\fR、\fB`\fR、\fB"\fR、\fB,\fR (コンマ)、$ といった文字をクォートします。\fB\e\fR と復帰改行との組み合せは、コマンドとパラメータの置換前にワードから取り除かれます。バックスラッシュが \fB\e\fR、\fB`\fR、\fB"\fR、\fB,\fR (コンマ)、$、および 復帰改行以外の文字の前に付く場合は、バックスラッシュ自体がシェルによってクォートされます。
+.SS "プロンプト"
+.sp
+.LP
+シェルは、対話的に使用すると、コマンドを読み取る前に \fBPS1\fR の値によるプロンプトを発行します。復帰改行を入力したあとで、コマンドを完了するためにさらに入力が必要な場合は、2 次プロンプト (\fBPS2\fR の値 ) が出力されます。
+.SS "環境"
+.sp
+.LP
+環境 (\fIenvironment\fR) は、通常の引数リストが実行されるプログラムに引き渡される場合と同様の方法で引き渡される、名前と値の対の集まりです (\fBenviron\fR(5) を参照) 。シェルが環境と対話する方法はいくつかあります。シェルは、呼び出されると、環境を走査して、見つけた名前ごとに変数を作成し、対応する値を設定します。ユーザーがこれらのパラメータの値を変更したり 新しいパラメータを作成したときには、\fBexport\fR コマンドを用いてシェルのパラメータを環境に関連付けなければ、これらのパラメータは環境に何の影響も与えません (\fBset\fR \fB-a\fR の説明を参照)。環境からパラメータを削除するには、\fBunset\fR コマンドを使用します。したがって、実行されるコマンドが参照する環境は、シェルが最初に引き継いだ「名前 = 値」の対のうち 変更されていないものから、\fBunset\fR によって削除された対を引き、変更または追加した対をくわえたものです。これらはいずれも \fBexport\fR コマンドで指定する必要があります。
+.sp
+.LP
+単純コマンドの環境は、いくつかのパラメータ代入指定を先頭に付加すれば拡張できます。\fI\fRしたがって、
+.sp
+.in +2
+.nf
+\fBTERM=450  \fIcommand\fR\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+および
+.sp
+.in +2
+.nf
+\fB(export TERM; TERM=450;   \fIcommand\fR\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+は、\fIcommand\fR が特殊コマンドでなければ、\fIcommand\fR の実行に関するかぎり同じことを意味します。\fIcommand\fR が特殊コマンドの場合、
+.sp
+.in +2
+.nf
+\fBTERM=450   \fIcommand\fR\fR
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+現在のシェル内の \fBTERM\fR 変数を修正します。
+.sp
+.LP
+\fB-k\fR フラグを設定すると、すべてのキーワード引数は環境に格納されます。これらの引数がコマンド名の後に指定された場合も同様です。\fI\fR以下の例では、まず \fBa=b c\fR を、次に \fBc\fR を表示します。
+.sp
+.in +2
+.nf
+\fBecho a=b  c
+
+a=b  c
+
+set  \(mik
+
+echo a=b  c
+
+c\fR
+.fi
+.in -2
+.sp
+
+.SS "シグナル"
+.sp
+.LP
+起動されたコマンドに対する \fBINTERRUPT\fR シグナルと \fBQUIT\fR シグナルは、コマンドの後に \fB&\fR が付く場合には無視されます。その他の場合、シグナルは、シェルが親から引き継いだ値を持ちます。ただし、シグナル 11 だけは例外です ( 後述の \fBtrap\fR コマンドの説明を参照 ) 。
+.SS "実行"
+.sp
+.LP
+コマンド実行のたびに、前述の コマンドの置換、パラメータの置換、ブランクの解釈、入出力のリダイレクション、およびファイル名の生成が行われます。コマンド名が定義済みの関数名と一致する場合、その関数がシェルプロセスで実行されます ( これと実行時にサブシェルを要求する シェルスクリプトファイルの実行の違いに注意 ) 。定義済み関数名とは一致しないが、後述の特殊コマンドのいずれかと一致するコマンド名の場合、そのコマンドがシェルプロセスで実行されます。\fB\fR
+.sp
+.LP
+定位置パラメータの \fB$1\fR、\fB$2\fR、. \|.\|.  は関数の引数に設定されます。コマンド名が特殊コマンドとも定義済み関数の名前とも一致しない場合、新しいプロセスが作成され、\fBexec\fR(2) を用いてそのコマンドの実行が試みられます。\fB\fR
+.sp
+.LP
+\fBPATH\fR というシェルパラメータは、コマンドを含んでいる ディレクトリの検索パスを定義します。2 つのディレクトリ名は、コロン (\fB:\fR) で区切ります。デフォルトのパスは \fB/usr/bin\fR です。現在のディレクトリは NULL パス名によって指定されます。これは等号の直後、パスリスト内の任意の場所にある 2 つの区切り文字のコロンの間、またはパスリストの最後に記述できます。コマンド名に \fB/\fR が含まれている場合は、検索パスは使用されません。そうでない場合は、パスにおける各ディレクトリに実行可能ファイルがあるか検索します。ファイルが実行権を有するが、それが \fBa.out\fR ファイルでない場合、シェルコマンドの入ったファイルとみなされます。そのファイルを読み取るときは、サブシェルが生成されます。括弧で囲まれたコマンドもサブシェル内で実行されます。
+.sp
+.LP
+シェルは、(あとで不必要な \fIexec\fR を行わなくてもいいように) 検索パス内のコマンドの位置を記憶します。コマンドが相対ディレクトリにあった場合、その位置を 現在のディレクトリの変更のたびに再決定しなければなりません。シェルは、\fBPATH\fR 変数が変更されるか \fBhash\fR \fB-r\fR コマンドが実行されるたびに、記憶していたすべての位置を忘れてしまいます ( 下記参照 ) 。
+.SS "特殊コマンド"
+.sp
+.LP
+以下に示す特殊コマンドに対しては、入出力のリダイレクションが可能です。ファイル記述子 1 は、デフォルトの出力位置です。ジョブ制御が可能なときには、さらにいくつかの特殊コマンドがシェル環境に追加されます (「ジョブ制御」の節を参照)。\fB\fR\fB\fR
+.sp
+.ne 2
+.mk
+.na
+\fB\fB:\fR\fR
+.ad
+.sp .6
+.RS 4n
+コマンドは何もせず、実行による影響は何もありません。終了ステータス 0 が返されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\&.\|\fR \fIfilename\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIfilename\fR からコマンドを読み取り実行し、戻ります。\fBPATH\fR によって指定された検索パスを用いて、\fIfilename\fR を含むディレクトリを探します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+ジョブ制御が可能なとき、\fBbg\fR コマンドはジョブの操作用に ユーザー環境に追加されます。停止状態のジョブをバックグラウンドで再び実行します。\fB%\fR\fIjobid\fR を省略すると、現在のジョブとみなされます。 (詳細については後述の「ジョブ制御」の節を参照)。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbreak\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+\fBfor\fR または \fBwhile\fR ループがあれば抜け出します。\fIn\fR を指定すると、\fIn\fR レベル分ブレークします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcd\fR [ \fIargument\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+現在のディレクトリを \fIargument\fR に変更します。シェルパラメータ \fBHOME\fR は、\fIargument\fR のデフォルト値です。シェルパラメータ \fBCDPATH\fR は、\fIargument\fR を含むディレクトリの検索パスを定義します。2 つのディレクトリ名は、コロン (\fB:\fR) で区切ります。デフォルトのパスは空の文字列です (現在のディレクトリの指定)。\fB\fR\fBなお \fR現在のディレクトリは 空のパス名で指定します。このパス名は、等号の直後か、パスリスト内の区切り文字のコロンの間に指定します。\fIargument\fR の先頭文字が \fB/\fR の場合、検索パスは使用しません。それ以外の場合は、パス中の各ディレクトリで \fIargument\fR を検索します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBchdir\fR [ \fIdir\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+\fBchdir\fR はシェルの作業用ディレクトリを \fIdir\fR が示すディレクトリに変更します。引数を指定しないと、そのユーザーのホームディレクトリに変更します。\fIdir\fR が現在のディレクトリからは見つからない相対パス名の場合、変数 \fBCDPATH\fR 環境内のディレクトリリストを検索します。\fIdir\fR が \fB/\fR で始まる値を持つシェル変数の名前である場合、その変数の値が示すディレクトリに変更します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBcontinue\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+\fBfor\fR または \fBwhile\fR ループの次の繰り返しを実行します。\fIn\fR を指定すると、\fIn\fR 番目のループから実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBecho\fR [ \fIarguments\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+\fIarguments\fR の文字列が スペース文字に区切られて、シェルの標準出力に書かれます。使用法と説明については \fBecho\fR(1) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBeval\fR [ \fIargument\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+引数をシェルへの入力として読み取り、生成されるコマンドを実行します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBexec\fR [ \fIargument\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+このシェルの代わりに、引数で指定されたコマンドを (新規プロセスは生成せずに) 実行します。入出力引数が指定可能で、その他の引数が指定されない場合は、これによってシェルの入出力が変更されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBexit\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+呼び出し元のシェルまたはシェルスクリプトを \fIn\fR で指定した終了ステータスで終了させます。\fIn\fR を省略すると、最後に実行されたコマンドの終了ステータスがシェルの終了ステータスになります (\fBEOF\fR によっても、シェルは終了します)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBexport\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+指定された \fIname\fR 群に対し、後で実行されるコマンドの環境へ自動的にエクスポートされるようにマークを付けます。\fI\fR引数を省略すると、現在のシェル実行中にエクスポートのマークが付けられた 変数名を一覧表示します。親シェルからエクスポートされた変数名は、現在のシェル実行中に再びエクスポートされた場合にだけ 一覧表示されます。関数名はエクスポートされません。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+ジョブ制御が可能なとき、\fBfg\fR はジョブの操作用に ユーザー環境に追加されます。このコマンドは、フォアグラウンド状態の停止ジョブを再び実行します。また、実行中のバックグラウンドジョブをフォアグラウンドへ移します。\fB%\fR\fIjobid\fR を省略すると、現在のジョブとみなされます。(詳細については後述の「ジョブ制御」の節を参照。)\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetopts\fR\fR
+.ad
+.sp .6
+.RS 4n
+コマンドシンタクス標準のサポート用に、シェルスクリプト内で使用されるコマンドです (\fBIntro\fR(1) を参照)。このコマンドは、定位置パラメータを構文解析し、オプションの正当性をチェックします。使用法と説明については、\fBgetoptcvt\fR(1) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBhash\fR [ \fB-r\fR ] [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+シェルは、各 \fIname\fR ごとに、それが示すコマンドの検索パス内の位置を決定し、記憶します。\fI\fR\fB-r\fR オプションを指定すると、シェルは記憶したすべての位置を忘れます。引数をまったく指定しないと、記憶されたコマンドに関する情報が表示されます。この出力表示において、\fIhits\fR はシェルプロセスによってコマンドが呼び出された回数を表します。\fIcost\fR は、検索パスのコマンドを見つけるのに必要な作業です。コマンドが検索パスの「相対」ディレクトリにある場合、そのディレクトリの変更後にそのコマンドが格納された位置が再計算されます。これが行われるコマンドに対しては、\fIhits\fR 情報の隣にアスタリスク (\fB*\fR) が示されます。\fICost\fR の値は、再計算が行われるたびに増加されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBjobs\fR [\fB\fR\fB-p\fR\fB|\fR\fB-l\fR] [\fB%\fR\fIjobid ...\fR]\fR
+.ad
+.br
+.na
+\fB\fBjobs\fR \fB-x\fR \fIcommand\fR [\fIarguments\fR] \fR
+.ad
+.sp .6
+.RS 4n
+停止中またはバックグラウンドで実行中の すべてのジョブを報告します。\fB%\fR\fIjobid\fR を省略すると、停止中またはバックグラウンドで稼動中のすべてのジョブが報告されます。(詳細については後述の「ジョブ制御」の節を参照。)\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkill\fR [ \fB-\fR\fIsig\fR ] \fB%\fR\fIjob\fR .\|.\|.\fR
+.ad
+.br
+.na
+\fB\fBkill\fR \fB-l\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBTERM\fR (終了) シグナルまたは指定されたシグナルのいずれかを、指定されたジョブまたはプロセスに送信します。シグナルは、番号または名前 (\fBsignal.h\fR(3HEAD) に示されるもので、ただし「SIG」という接頭辞を取り除いたもの (\fBCHLD\fR と名付けられる \fBSIGCHD\fR 以外)) で指定します。送信するシグナルが \fBTERM\fR (終了) または \fBHUP\fR (ハングアップ) の場合、停止中のジョブまたはプロセスには \fBCONT\fR (継続) シグナルを送信します。\fIjob\fR という引数は、活動中のジョブではないプロセスのプロセス ID を指定することもできます。後述の「ジョブ制御」の節を参照してください。\fB\fR\fI\fR第 2 の形式の \fBkill\fR \fB-l\fR は、シグナル番号とシグナル名をリスト表示します。(\fBkill\fR(1) 参照)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBlogin\fR [ \fIargument\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+`\fBexec\fR \fBlogin\fR \fIargument\fR.\|.\|.\|' と同機能です。使用法と説明については、\fBlogin\fR(1) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBnewgrp\fR [ \fIargument\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+\fBexec\fR \fBnewgrp\fR\fI argument\fR と同機能です。使用法と説明については、\fBnewgrp\fR(1) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBpwd\fR\fR
+.ad
+.sp .6
+.RS 4n
+現在の作業用ディレクトリを表示します。使用法と説明については、\fBpwd\fR(1) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBread\fR \fIname\fR .\|.\|.\fR
+.ad
+.sp .6
+.RS 4n
+標準入力から 1 行を読み取り、内部フィールドセパレータの \fBIFS\fR (通常はスペースまたはタブ) を用いてワード境界を区切り、最初のワードを最初の \fIname\fR に割り当て、2 番目のワードを 2 番目の \fIname\fR に割り当て、続くワードも順次割り当てます。残ったワードは最後の \fIname\fR に割り当てます。\fB\e \fR に続いて復帰改行を入力すれば、行を継続できます。復帰改行以外の文字の前にバックスラッシュを付加すれば、その文字をクォートできます。\fB\fRこのバックスラッシュは、ワードが \fIname\fR に割り当てられる前に削除され、バックスラッシュの後に位置する文字は解釈されません。\fBEOF\fR に到達した場合を除き、リターンコードは \fB0\fR となります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBreadonly\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+指定された各 \fIname\fR に「読み取り専用」のマークを付け、これらの名前が後続の割り当てでは変更できないようにします。\fB\fR\fI\fR引数を省略すると、読み取り専用と指定された名前がすべて一覧表示されます。\fB\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBreturn\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+関数を、\fIn\fR が示すリターンステータスで終了させます。\fIn\fR を省略すると、リターンステータスは最後に実行された コマンドのリターンステータスになります。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBset\fR [ \fB-aefhkntuvx\fR [ \fIargument\fR .\|.\|. ] ]\fR
+.ad
+.sp .6
+.RS 4n
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.RS 6n
+.rt  
+エクスポート用に修正または作成された変数にマークを付けます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR\fR
+.ad
+.RS 6n
+.rt  
+コマンドが 0 以外の終了ステータスで終了した場合、直ちに終了します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+ファイル名を生成しないようにします。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR\fR
+.ad
+.RS 6n
+.rt  
+関数の定義時に、関数コマンドを検索しその位置を記憶します ( 通常、関数コマンドは関数実行時に検索されます ) 。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-k\fR\fR
+.ad
+.RS 6n
+.rt  
+コマンド名の前にあるキーワード引数だけでなく、すべてのキーワード引数がコマンド用の環境に置かれます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+コマンドを読み取るが、実行しません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+1 つのコマンドを読み取り、実行し、終了します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR\fR
+.ad
+.RS 6n
+.rt  
+未設定の変数を置換時にエラーとして扱います。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.RS 6n
+.rt  
+シェルへの入力行の読み取り時に、その内容を表示出力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+コマンドおよび引数の実行時に、その内容を表示出力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-\fR\fR
+.ad
+.RS 6n
+.rt  
+どのフラグも変更しません。\fB$1\fR に \fB-\fR を設定する際に便利です。
+.RE
+
+\fB-\fR の代わりに \fB+\fR を使用すると、 これらのフラグは無効になります。これらのフラグはシェル起動時にも使用できます。現在セットされているフラグは、\fB$-\fR で見つけられます。残りの引数は定位置パラメータで、次の順に割り当てられます。\fB$1\fR、\fB$2\fR、. \|.\|. 引数が指定されない場合、すべての名前の値が出力されます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBshift\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+\fB$\fR\fIn\fR\fB+1\fR .\|.\|. から始まる一連の定位置パラメータを、次の名前に変更します。\fB$1\fR .\|.\|. 。 \fIn\fR を省略すると、1 と見なされます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBstop\fR \fIpid .\|.\|.\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fIpid\fR (プロセス ID 番号) の実行を停止します (\fBps\fR(1) を参照)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBsuspend\fR\fR
+.ad
+.sp .6
+.RS 4n
+現在のシェルがログインシェルでない場合、その実行を中断します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtest\fR\fR
+.ad
+.sp .6
+.RS 4n
+条件式を評価します。使用法と説明については、\fBtest\fR(1) を参照してください。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtimes\fR\fR
+.ad
+.sp .6
+.RS 4n
+シェルから実行されたプロセスの、 ユーザー時間およびシステム時間の累計値を表示します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtrap\fR [ \fIargument\fR \fIn\fR [ \fIn2\fR .\|.\|. ]]\fR
+.ad
+.sp .6
+.RS 4n
+\fIargument\fR が示すコマンドを、シェルが数値または記号シグナル (\fIn\fR) を受信した時に読み取り実行します。(\fB注:\fR \fIargument\fR は、トラップ設定時に一度、トラップ取り出し時に一度検索されます。)トラップコマンドは、シグナル番号または対応するシンボリック名の順序で実行されます。現在のシェルへの入力時に無視されたシグナルにトラップを 設定しようとしても無効となります。シグナル 11 ( メモリフォールト ) にトラップを指定しようとすると、エラーになります。\fIargument\fR を省略すると、すべてのトラップ \fIn\fR は元の値に再設定されます。\fIargument\fR が NULL 文字列の場合、シェルおよびシェルが呼び出したコマンドは、このシグナルを無視します。\fIn\fR が 0 の場合、\fIargument\fR が示すコマンドはシェル終了時に実行されます。引数なしの \fBtrap\fR コマンドは、コマンドの一覧を各々が対応しているシグナル番号とともに表示します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBtype\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+各 \fIname\fR ごとに、コマンド名として使用される場合に どのように解釈されるかを指示します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBulimit\fR [ [\fB-HS\fR] [\fB-a\fR | \fB-cdfnstv\fR] ]\fR
+.ad
+.br
+.na
+\fB\fBulimit\fR [ [\fB-HS\fR] [\fB-c\fR | \fB-d\fR | \fB-f\fR | \fB-n\fR | \fB-s\fR | \fB-t\fR | \fB- v\fR] ] \fBlimit\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBulimit\fR は、リソースの強い制限値または弱い制限値を 表示または設定します。これらの制限値については \fBgetrlimit\fR(2) の説明を参照してください。
+.sp
+\fIlimit\fR 引数を省略すると、\fBulimit\fR は指定されている制限値を表示します。制限値は一度にいくつでも表示できます。\fB-a\fR オプションは制限値すべてを表示します。
+.sp
+\fIlimit\fR 引数を指定すると、\fBulimit\fR は指定されたフラグに対応する制限値をその引数の値に設定します。\fI\fR文字列 \fBunlimited\fR は、現在の制限値 (ある場合) の削除を要求します。ユーザーはだれでも、強い制限値以下の値に弱い制限値を設定できます。ユーザーはだれでも、強い制限値を下げることができます。適切な特権を持ったユーザーだけが、強い制限値を上げたり、削除したりできます。\fBgetrlimit\fR(2) を参照してください。
+.sp
+\fB-H\fR オプションは強い制限値を表し、\fB-S\fR オプションは弱い制限値を表します。どちらのオプションも指定しない場合、\fBulimit\fR は両方の制限値を設定し、弱い制限値を表示します。
+.sp
+次のオプションは、制限値を表示または設定するリソースを指定します。オプションを一切指定しないと、ファイルサイズ限界値を表示または設定します。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fR
+.ad
+.RS 6n
+.rt  
+最大 core ファイルサイズ (512 バイトブロック単位)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-d\fR\fR
+.ad
+.RS 6n
+.rt  
+データセグメントまたはヒープの最大サイズ (K バイト単位)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fR
+.ad
+.RS 6n
+.rt  
+最大ファイルサイズ (512 バイトブロック単位)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.RS 6n
+.rt  
+最大ファイル記述子プラス 1
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 6n
+.rt  
+スタックセグメントの最大サイズ (K バイト単位)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 6n
+.rt  
+最大 CPU 時間 (秒単位)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.RS 6n
+.rt  
+仮想メモリーの最大サイズ (K バイト単位)
+.RE
+
+システムで利用可能な最大上限値を 調べるには \fBsysdef\fR(1M) コマンドを実行してください。表示される値は 16 進数ですが、\fBbc\fR(1) コマンドを使って 10 進数に変換できます。\fBswap\fR(1M) を参照してください。)
+.sp
+たとえば、0M バイトにコアファイルダンプのサイズを制限するには次のように入力します。\fB\fR
+.sp
+.in +2
+.nf
+\fBulimit -c 0\fR
+.fi
+.in -2
+.sp
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBumask\fR [ \fInnn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+ユーザーファイル作成マスクを \fInnn\fR が示す値に設定します (\fBumask\fR(1) を参照)。\fInnn\fR を省略すると、マスクの現在の値を出力します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBunset\fR [ \fIname\fR .\|.\|. ]\fR
+.ad
+.sp .6
+.RS 4n
+\fIname\fR ごとに、対応する変数または関数値を削除します。変数 \fBPATH\fR、\fBPS1\fR、\fBPS2\fR、\fBMAILCHECK\fR、および \fBIFS\fR は設定解除できません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwait\fR [ \fIn\fR ]\fR
+.ad
+.sp .6
+.RS 4n
+当該ユーザーのバックグラウンドプロセスのうち ID が \fIn\fR のプロセスを待ち、その終了ステータスを報告します。\fIn\fR が省略された場合、当該ユーザーの現在活動中のすべてのバックグラウンドプロセスを待ち、リターンコードは 0 になります。
+.RE
+
+.SS "呼び出し"
+.sp
+.LP
+\fBexec\fR(2) を介してシェルが呼び出される場合で、引数 0 の先頭文字が \fB\(mi\fR のとき、コマンドは、まず \fB/etc/profile\fR から読み込まれ、次に \fB$HOME/.profile\fR から読み込まれます (これらのファイルがある場合)。その後、コマンドは後述のように読み込まれます。シェルが \fB/usr/bin/sh\fR として呼び出される場合にも、このようになります。以下に述べるフラグは、呼び出し時にのみ、シェルによって解釈されます。\fBなお \fR \fB-c\fR または \fB-s\fR フラグが指定されないかぎり、先頭引数はコマンドを含むファイルの名前であるとみなされ、残りの引数は定位置パラメータとして そのコマンドファイルに引き渡されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR\fI\| string\fR\fR
+.ad
+.RS 15n
+.rt  
+このフラグが指定されると、\fIstring\fR からコマンドを読み取ります。\fB-\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR\fR
+.ad
+.RS 15n
+.rt  
+このフラグが指定された場合あるいはシェル入出力が端末に接続されている場合、このシェルは対話型となります。\fB-\fR\fB\fRこの場合、\fBkill 0\fR が対話型シェルを終了しないように TERM を無視し、\fBwait\fR が割り込み可能になるように INTERRUPT を捕え、無視します。いずれの場合も、シェルは QUIT を無視します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-p\fR フラグが指定されると、シェルは実効ユーザーおよびグループ ID に、実ユーザーおよびグループ ID を設定しません。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-r\fR\fR
+.ad
+.RS 15n
+.rt  
+\fB-r\fR フラグを指定すると、シェルは制限付きシェルになります (\fBrsh\fR(1M) を参照)。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.RS 15n
+.rt  
+このフラグが指定された場合または引数が残っていない場合、標準入力からコマンドを読み取ります。\fB-\fR引数が残っていれば、それらは定位置パラメータを指定します。前述の特殊コマンドの出力を除くシェル出力は、ファイル記述子 2 に書き込まれます。\fB\fR
+.RE
+
+.sp
+.LP
+他のフラグと引数については、前述の \fBset\fR コマンドの箇所で説明されています。
+.SS "ジョブ制御 (jsh)"
+.sp
+.LP
+シェルを \fBjsh\fR として呼び出すと、\fBsh\fR の説明で述べたすべての機能に加えて、ジョブ制御が可能になります。通常、ジョブ制御は対話型シェルに対してだけ可能です。非対話型シェルは、ジョブ制御の機能が追加されても、その恩恵を受けないのが通常です。
+.sp
+.LP
+ジョブ制御が可能な場合、ユーザーが端末から入力したコマンドまたはパイプラインは、すべてジョブ ( \fIjob\fR) と呼ばれます。どのジョブも、必ず次のいずれかの状態にあります。 フォアグラウンド、バックグラウンド、または停止です。これらの用語の定義を次に示します。
+.RS +4
+.TP
+1.
+フォアグラウンド状態にある ジョブは、制御している端末への読み取り および書き込み権を持っています。
+.RE
+.RS +4
+.TP
+2.
+バックグラウンド状態にあるジョブは、制御している端末への読み取り権を拒否されていますが、条件付き書き込み権は持っています (\fBstty\fR(1) を参照)。
+.RE
+.RS +4
+.TP
+3.
+停止ジョブは保留状態に置かれた ジョブであり、通常は \fBSIGTSTP\fR シグナルにより、この状態になります (\fBsignal.h\fR(3HEAD) を参照)。
+.RE
+.sp
+.LP
+シェルが起動するすべてのジョブには、ジョブ番号 (\fIjob number\fR) と呼ばれる正の整数が割り当てられます。シェルはこの番号を把握し、特定のジョブを示す識別子として使用します。また、シェルは現在 (\fIcurrent\fR) および直前 (\fIprevious\fR) のジョブも把握しています。現在のジョブとは、最後に起動または再起動されたジョブです。\fI\fR前回のジョブとは、その直前のジョブです。\fI\fR
+.sp
+.LP
+ジョブ識別子の正しい構文は次のような形式です。
+.sp
+.LP
+\fB%\fR\fIjobid\fR
+.sp
+.LP
+このうち \fIjobid\fR は、次のいずれかの形式で指定できます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB%\fR または \fB+\fR\fR
+.ad
+.RS 17n
+.rt  
+現在のジョブ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB\(mi\fR\fR
+.ad
+.RS 17n
+.rt  
+前回のジョブ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB?\fR\fI<string>\fR\fR
+.ad
+.RS 17n
+.rt  
+コマンド行が \fIstring\fR を含んでいるジョブ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIn\fR\fR
+.ad
+.RS 17n
+.rt  
+ジョブ番号が \fIn\fR のジョブ
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIpref\fR\fR
+.ad
+.RS 17n
+.rt  
+コマンド名の先頭が \fIpref\fR のコマンド。たとえば \fBls\fR \fB-l\fR \fIname\fR がバックグラウンドで実行中だった場合、\fB%ls\fR と指定すればこのコマンドを示すことができます。\fIpref\fR は、クォートしない限り、ブランクを含めることができません。
+.RE
+
+.sp
+.LP
+ジョブ制御が可能なとき、ジョブの操作用に 次のコマンドがユーザー環境に追加されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fBbg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+停止状態のジョブをバックグラウンドで再び実行します。\fB%\fR\fIjobid\fR を省略すると、現在のジョブとみなされます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBfg\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+停止状態のジョブをフォアグラウンドで再び実行します。また、実行中のバックグラウンドジョブをフォアグラウンドへ移します。\fB%\fR\fIjobid\fR を省略すると、現在のジョブとみなされます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBjobs\fR [\fB-p\fR|\fB-l\fR] [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.br
+.na
+\fB\fBjobs\fR \fB-x\fR \fBcommand\fR [\fIarguments\fR]\fR
+.ad
+.sp .6
+.RS 4n
+停止中またはバックグラウンドで実行中の すべてのジョブを報告します。\fB%\fR\fIjobid\fR を省略すると、停止中またはバックグラウンドで稼動中のすべてのジョブが報告されます。次のオプションは、\fBjobs\fR の出力を変更または拡張するために使用します。 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-l\fR\fR
+.ad
+.RS 6n
+.rt  
+ジョブのプロセスグループ ID および作業ディレクトリを報告します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+.rt  
+ジョブのプロセスグループ ID のみを報告します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR\fR
+.ad
+.RS 6n
+.rt  
+コマンドまたは引数中に見つかった \fIjobid\fR を、対応するプロセスグループ ID に置き換え、コマンドに引数を渡して実行します。\fI\fR\fI\fR\fI\fR\fI\fR
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBkill\fR [ \fB-signal\fR ] \fB%\fR\fIjobid\fR\fR
+.ad
+.sp .6
+.RS 4n
+\fBkill\fR コマンドの組み込みバージョン。\fBjobid\fR で示すプロセスに対して \fIkill\fR コマンドの機能を提供します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBstop\fR \fB%\fR\fIjobid .\|.\|.\fR\fR
+.ad
+.sp .6
+.RS 4n
+バックグラウンドジョブの実行を停止します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBsuspend\fR\fR
+.ad
+.sp .6
+.RS 4n
+現在のシェルがログインシェルでない場合、その実行を中断します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBwait\fR [\fB%\fR\fIjobid .\|.\|.\fR]\fR
+.ad
+.sp .6
+.RS 4n
+\fBwait\fR コマンドの組み込みバージョンで、ジョブ識別子の指定を受け入れます。\fB%\fR\fIjobid\fR が省略された場合、\fBwait\fR は、前述の「特殊コマンド」で説明したように動作します。\fB\fR
+.RE
+
+.SS "大規模ファイルの動作"
+.sp
+.LP
+ファイルが 2G バイト (2^31 バイト) 以上ある場合の \fBsh\fR と \fBjsh\fR の動作については、\fBlargefile\fR(5) を参照してください。
+.SH 終了ステータス
+.sp
+.LP
+構文エラーなどのエラーを検出すると、シェルは 0 以外の終了ステータスを返します。シェルを非対話型で使用している場合、シェルファイルの実行は中止されます。そうでない場合は、シェルは最後に実行されたコマンドの 終了ステータスを返します ( 前述の \fBexit\fR コマンドの説明を参照 ) 。
+.SS "jsh のみ"
+.sp
+.LP
+シェルが \fBjsh\fR として呼び出された場合、停止ジョブがあるのにシェルを終了させようとすると、シェルは次のような警告を出します。
+.sp
+.LP
+\fBThere are stopped jobs.\fR
+.sp
+.LP
+これが唯一のメッセージです。もう一度終了が試みられ、停止ジョブがまだ存在している場合、これらのジョブにカーネルから \fBSIGHUP\fR シグナルが送られ、シェルは終了します。
+.SH ファイル
+.sp
+.LP
+\fB$HOME/.profile\fR
+.sp
+.LP
+\fB/dev/null\fR
+.sp
+.LP
+\fB/etc/profile\fR
+.sp
+.LP
+\fB/tmp/sh*\fR
+.SH 属性
+.sp
+.LP
+属性についての詳細は、\fBattributes\fR(5) を参照してください。
+.SS "/usr/bin/sh, /usr/bin/jsh"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性タイプ属性値
+_
+使用条件system/core-os
+_
+CSI有効
+.TE
+
+.SS "/usr/xpg4/bin/sh"
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性タイプ属性値
+_
+使用条件system/core-os
+_
+CSI有効
+.TE
+
+.SH 関連項目
+.sp
+.LP
+\fBIntro\fR(1), \fBbc\fR(1), \fBecho\fR(1), \fBgetoptcvt\fR(1), \fBkill\fR(1), \fBksh88\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpfsh\fR(1), \fBpfexec\fR(1), \fBps\fR(1), \fBpwd\fR(1), \fBset\fR(1), \fBshell_builtins\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBwait\fR(1), \fBrsh\fR(1M), \fBsu\fR(1M), \fBswap\fR(1M), \fBsysdef\fR(1M), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBgetrlimit\fR(2), \fBpipe\fR(2), \fBulimit\fR(2), \fBsetlocale\fR(3C), \fBsignal.h\fR(3HEAD), \fBpasswd\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBXPG4\fR(5)
+.SH 警告
+.sp
+.LP
+シェルスクリプトを \fBsetuid\fR して使用することは避けてください。\fB\fR
+.SH 注意事項
+.sp
+.LP
+入出力のリダイレクションでファイル名に使用されたワードは、ファイル名生成では解釈されません (前述の「ファイル名の生成」の節を参照)。\fB\fRたとえば \fBcat file1 >a*\fR という指定は、\fBa*\fR という名前のファイルを生成します。
+.sp
+.LP
+パイプラインにあるコマンド群は それぞれ別個のプロセスとして稼動するので、パイプラインに設定された変数は親シェルには何の影響も与えません。
+.sp
+.LP
+\fBwhile\fR ループまたは \fBuntil\fR ループの入力または出力をリダイレクトする場合、ループ内のコマンドはサブシェルで実行されます。サブシェル内で設定または変更された変数は、親プロセスでは効力を失います。
+.sp
+.in +2
+.nf
+   lastline=
+   while read line
+   do
+
+           lastline=$line
+   done < /etc/passwd
+   echo "lastline=$lastline"       # lastline is empty!
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+このような場合、入力または出力をリダイレクトするには、次の例のように \fBexec\fR を使用します。
+.sp
+.in +2
+.nf
+   # Save standard input (file descriptor 0) as file
+   # descriptor 3, and redirect standard input from the file
+   /etc/passwd:
+
+   exec 3<&0               # save standard input as fd 3
+   exec </etc/passwd       # redirect input from file
+
+   lastline=
+   while read line
+   do
+           lastline=$line
+   done
+
+   exec 0<&3               # restore standard input
+   exec 3<&-               # close file descriptor 3
+   echo "$lastline"        # lastline
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+\fBcannot fork, too many processes\fR というエラーメッセージを受け取った場合には、\fBwait\fR(1) コマンドを用いてユーザーのバックグラウンドプロセスをクリーンアップしてください。これを行なっても問題が解決しない場合には、システムのプロセステーブルが一杯になっていること、または実行中のフォアグラウンドプロセスの数が多すぎることが考えられます。ユーザーログインに結合するプロセス ID の数、およびシステムが把握できる数には 限度があります。
+.sp
+.LP
+パイプラインの最後のプロセスだけが、待つ対象になり得ます。
+.sp
+.LP
+あるコマンドを実行し、そのあとで同一名のコマンドが、検索パスにおいて元のコマンドがあるディレクトリの前に位置するディレクトリにインストールされた場合、シェルは元のコマンドの方を実行し続けます。\fB\fR新しい方のコマンドを実行させたければ、\fBhash\fR コマンドを使用してください。
+.sp
+.LP
+Bourne シェルにはプロセスの実効ユーザー \fBID\fR に対して制限があります。このユーザー ID が 100 よりも小さい (さらにプロセスの実ユーザー ID と同等ではない) 場合には、ユーザー ID はプロセスの実ユーザー ID にリセットされます。\fB\fR\fB\fR
+.sp
+.LP
+同じプロセスグループで フォアグラウンドジョブと バックグラウンドジョブの両方を シェルが実行しているため、ジョブは同じシグナルを受け取り、予期しない結果を招くことがあります。したがって、特に対話型のシェルを動作している場合は、他のジョブ制御のシェルを使用することを おすすめします。
+.sp
+.LP
+存在しないコマンドのインタプリタを実行しようとするシェルスクリプトを、シェルが処理した場合、シェルはシェルスクリプトが存在しないという間違った診断メッセージを 返します。
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/shcomp.1	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,160 @@
+'\" te
+.\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+.TH shcomp 1 "12 Jul 2011" "SunOS 5.11" "User Commands"
+.SH NAME
+shcomp \- compile a ksh shell script
+.SH SYNOPSIS
+.LP
+.nf
+\fBshcomp\fR [\fB-nv\fR] [\fIinfile\fR [\fIoutfile\fR]]
+.fi
+
+.LP
+.nf
+\fBshcomp\fR \fB-D\fR [\fIinfile\fR [\fIoutfile\fR]]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+If the \fB-D\fR option is not specified, \fBshcomp\fR takes a shell script, \fIinfile\fR, and creates a binary format file, \fIoutfile\fR, that \fBksh\fR reads and executes with the same effect as the original script.
+.sp
+.LP
+Aliases are processed as the script is read. Alias definitions whose value requires variable expansion will not work correctly. 
+.SH OPTIONS
+.sp
+.LP
+The following options are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR\fR
+.ad
+.br
+.na
+\fB\fB--dictionary\fR\fR
+.ad
+.RS 16n
+.rt  
+Generate a list of strings that need to be placed in a message catalog for internationalization.
+.sp
+With this option, all double quoted strings that are preceded by \fB$\fR are printed, one literal per line. A literal \fB$"foo"\fR prints \fB"foo"\fR in the output. These are the messages that need to be translated to locale specific versions for internationalization. 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.br
+.na
+\fB\fB--noexec\fR\fR
+.ad
+.RS 16n
+.rt  
+Display warning messages for obsolete or non-conforming constructs.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.br
+.na
+\fB\fB--verbose\fR\fR
+.ad
+.RS 16n
+.rt  
+Display input from \fIinfile\fR onto standard error as it reads it.
+.RE
+
+.SH OPERANDS
+.sp
+.LP
+The following operands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIinfile\fR\fR
+.ad
+.RS 11n
+.rt  
+Specifies the name of the file that contains the shell script to be used as input.
+.sp
+If \fIinfile\fR is omitted, the shell script is read from standard input.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIoutfile\fR\fR
+.ad
+.RS 11n
+.rt  
+Specifies the name of the output file.
+.sp
+If \fIoutfile\fR is omitted, both modes write their results to standard output. 
+.RE
+
+.SH EXIT STATUS
+.sp
+.LP
+The following exit values are returned:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+Successful completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+An error occurred.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Availabilitysystem/core-os
+_
+CSIEnabled
+_
+Interface StabilitySee below.
+.TE
+
+.sp
+.LP
+The command-line interface and the system variables are Committed. The compiled shell code format is Private. The output of the \fB-D\fR option is Volatile.
+.SH SEE ALSO
+.sp
+.LP
+\fBksh\fR(1), \fBattributes\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/shcomp.1.ja_JP.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,160 @@
+'\" te
+.\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+.TH shcomp 1 "2011 7 月 12 日" "SunOS 5.11" "ユーザーコマンド"
+.SH 名前
+shcomp \- ksh シェルスクリプトのコンパイル
+.SH 形式
+.LP
+.nf
+\fBshcomp\fR [\fB-nv\fR] [\fIinfile\fR [\fIoutfile\fR]]
+.fi
+
+.LP
+.nf
+\fBshcomp\fR \fB-D\fR [\fIinfile\fR [\fIoutfile\fR]]
+.fi
+
+.SH 機能説明
+.sp
+.LP
+\fB-D\fR オプションが指定されていない場合、\fBshcomp\fR はシェルスクリプト \fIinfile\fR を使用して、\fBksh\fR が元のスクリプトと同様に読み取りおよび実行を行うバイナリ形式ファイル \fIoutfile\fR を作成します。
+.sp
+.LP
+スクリプトが読み込まれると別名が処理されます。変数の展開が必要な値を持つ別名定義は正常に動作しません。 
+.SH オプション
+.sp
+.LP
+次のオプションがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR\fR
+.ad
+.br
+.na
+\fB\fB--dictionary\fR\fR
+.ad
+.RS 16n
+.rt  
+国際化のためにメッセージカタログに格納する必要がある文字列のリストが生成されます。
+.sp
+このオプションを指定すると、\fB$\fR が前に付いた二重引用符で囲まれているすべての文字列が、1 行に 1 つのリテラルという形式で出力されます。リテラル \fB$"foo"\fR は、出力に \fB"foo"\fR と書き込まれます。これらは、国際化のためにロケール固有のバージョンに変換する必要があるメッセージです。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.br
+.na
+\fB\fB--noexec\fR\fR
+.ad
+.RS 16n
+.rt  
+廃止された構成または準拠していない構成に対する警告メッセージを表示します。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.br
+.na
+\fB\fB--verbose\fR\fR
+.ad
+.RS 16n
+.rt  
+\fIinfile\fR から読み込んだ入力内容を標準エラー出力に書き込みます。
+.RE
+
+.SH オペランド
+.sp
+.LP
+次のオペランドがサポートされています。
+.sp
+.ne 2
+.mk
+.na
+\fB\fIinfile\fR\fR
+.ad
+.RS 11n
+.rt  
+入力として使用される、シェルスクリプトを含むファイルの名前を指定します。
+.sp
+\fIinfile\fR を省略した場合、シェルスクリプトは標準入力から読み込まれます。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIoutfile\fR\fR
+.ad
+.RS 11n
+.rt  
+出力ファイルの名前を指定します。
+.sp
+\fIoutfile\fR を省略した場合、いずれのモードでも結果は標準出力に書き込まれます。 
+.RE
+
+.SH 終了ステータス
+.sp
+.LP
+次の終了値が返されます。
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+正常終了。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+エラーが発生しました。
+.RE
+
+.SH 属性
+.sp
+.LP
+属性についての詳細は、\fBattributes\fR(5) を参照してください。
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性タイプ属性値
+_
+使用条件system/core-os
+_
+CSI有効
+_
+インタフェースの安定性下記を参照。
+.TE
+
+.sp
+.LP
+コマンド行インタフェースとシステム変数は「確実」です。コンパイルされたシェルコードの形式は「非公開」です。\fB-D\fR オプションの出力は「流動的」です。
+.SH 関連項目
+.sp
+.LP
+\fBksh\fR(1), \fBattributes\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/files/shcomp.1.zh_CN.UTF-8	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,160 @@
+'\" te
+.\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
+.\" Portions Copyright (c) 2009, 2011, Oracle and/or its affiliates. 保留所有权利。
+.TH shcomp 1 "2011 年 7 月 12 日" "SunOS 5.11" "用户命令"
+.SH 名称
+shcomp \- 编译 ksh shell 脚本
+.SH 用法概要
+.LP
+.nf
+\fBshcomp\fR [\fB-nv\fR] [\fIinfile\fR [\fIoutfile\fR]]
+.fi
+
+.LP
+.nf
+\fBshcomp\fR \fB-D\fR [\fIinfile\fR [\fIoutfile\fR]]
+.fi
+
+.SH 描述
+.sp
+.LP
+如果未指定 \fB-D\fR 选项,\fBshcomp\fR 会采用 shell 脚本 \fIinfile\fR,并且会创建二进制格式的文件 \fIoutfile\fR,\fBksh\fR 读取和执行该文件的效果与使用原始脚本的效果相同。
+.sp
+.LP
+读取脚本时处理别名。如果别名定义的值需要变量扩展,该定义将不能正常工作。 
+.SH 选项
+.sp
+.LP
+支持下列选项:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR\fR
+.ad
+.br
+.na
+\fB\fB--dictionary\fR\fR
+.ad
+.RS 16n
+.rt  
+生成需要放置在消息目录中以实现国际化的字符串列表。
+.sp
+使用该选项,会打印字符串前有 \fB$\fR 的所有双引号括起来的字符串,每行一个字符串型。字符串型 \fB$"foo"\fR 会在输出中打印出 \fB"foo"\fR。这些消息需要转换为国际化的语言环境特定版本。 
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR\fR
+.ad
+.br
+.na
+\fB\fB--noexec\fR\fR
+.ad
+.RS 16n
+.rt  
+显示有关过时或尚未确认的结构的警告信息。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.br
+.na
+\fB\fB--verbose\fR\fR
+.ad
+.RS 16n
+.rt  
+读取时将来自 \fIinfile\fR 的输入显示为标准错误。
+.RE
+
+.SH 操作数
+.sp
+.LP
+支持下列操作数:
+.sp
+.ne 2
+.mk
+.na
+\fB\fIinfile\fR\fR
+.ad
+.RS 11n
+.rt  
+指定包含要用作输入的 shell 脚本的文件名称。
+.sp
+如果省略 \fIinfile\fR,将从标准输入读取 shell 脚本。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIoutfile\fR\fR
+.ad
+.RS 11n
+.rt  
+指定输出文件的名称。
+.sp
+如果省略 \fIoutfile\fR,则这两种模式都会将其结果写入标准输出。 
+.RE
+
+.SH 退出状态
+.sp
+.LP
+将返回以下退出值:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB0\fR\fR
+.ad
+.RS 6n
+.rt  
+成功完成。
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB>0\fR\fR
+.ad
+.RS 6n
+.rt  
+出现错误。
+.RE
+
+.SH 属性
+.sp
+.LP
+有关下列属性的描述,请参见 \fBattributes\fR(5):
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i) 
+lw(2.75i) |lw(2.75i) 
+.
+属性类型属性值
+_
+可用性system/core-os
+_
+CSIEnabled(已启用)
+_
+接口稳定性请参见下文。
+.TE
+
+.sp
+.LP
+命令行界面和系统变量是 "Committed"(已确定)。编译的 shell 代码格式是 "Private"(专用)。\fB-D\fR 选项的输出是 "Volatile"(可变)。
+.SH 另请参见
+.sp
+.LP
+\fBksh\fR(1)、\fBattributes\fR(5)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/ksh.kshrc	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,62 @@
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This file is sourced by interactive ksh93 shells before ${HOME}/.kshrc
+#
+
+# Enable "gmacs"+"multiline" editor mode if the user did not set an
+# input mode yet (for example via ${EDITOR}, ${VISUAL} or any
+# "set -o" flag)
+if [[ "$(set +o)" != ~(Er)--(gmacs|emacs|vi)( .*|) ]] ; then
+	set -o gmacs
+	# enable multiline input mode
+	set -o multiline
+	# enable globstar mode (match subdirs with **/)
+	set -o globstar
+fi
+
+# Set a default prompt (<username>@<hostname>:<path><"($|#) ">) if
+# then variable does not exist in the environment.
+#
+# Algorithm:
+# 1. Define "ellipsis", either Unicode #2026 for unicode locales
+# and "..." otherwise
+# ([[ "${LC_ALL}/${LANG}" = ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]]
+# ensures that the pattern matches the leftmost sequence
+# containing *.UTF-8, allowing to match either LC_ALL or
+# LANG when LC_ALL is not set)
+# 2. If PWD is within HOME replace value of HOME with '~'
+# If the PWD is longer than 30 charatcers shorten it to 30 chars
+# print '#' for user "root" and '$' for normal users
+# Notes:
+# - printf "%*s\r%s" COLUMNS "") # is used at the beginning to
+#   work around a bug in the "multiline" handling code which
+#   causes the shell to override its own prompt when the edit
+#   line overflows (this happens if the terminal cursor
+#   position is not 0 when PS1 is printed).
+# - PS1 will initially be empty until either...
+#   a) ... someone sets the variable
+#       or
+#   b) ... the prompt is displayed for the first time (default is
+#     '$ ' for normal users and '# ' for user "root")
+# - The statement below will not work if someone sources /etc/ksh.kshrc
+#   unless PS1 gets "unset" first.
+# - Make sure to use absolute paths (e.g. /usr/bin/hostname) to make
+#   sure PS1 works in cases where PATH does not contain /usr/bin/
+if [[ "$(set)" != ~(E)PS1= && "${PS1}" == '' ]] ; then
+	PS1='$(set +o xtrace +o errexit
+                printf "%*s\r%s" COLUMNS ""
+                printf "%s@%s:" "${LOGNAME}" "$(/usr/bin/hostname)"
+		ellip="${
+			[[ "${LC_ALL}/${LANG}" == ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]] &&
+				printf "\u[2026]\n" || print "..." ; }"
+		p="${PWD/~(El)${HOME}/\~}"
+		(( ${#p} > 30 )) &&
+			print -r -n -- "${ellip}${p:${#p}-30:30}" ||
+			print -r -n -- "${p}"
+		[[ "${LOGNAME}" == "root" ]] && print -n "# " || print -n "\$ "
+		)'
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/ksh93.license	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,215 @@
+Common Public License Version 1.0
+[OSI Approved License]
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution 'originates' from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor's behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+	including all Contributors.
+
+	2. GRANT OF RIGHTS
+
+	a) Subject to the terms of this Agreement, each Contributor hereby grants
+	Recipient a non-exclusive, worldwide, royalty-free copyright license to
+	reproduce, prepare derivative works of, publicly display, publicly perform,
+	distribute and sublicense the Contribution of such Contributor, if any, and such
+	derivative works, in source code and object code form.
+
+	b) Subject to the terms of this Agreement, each Contributor hereby grants
+	Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+	Patents to make, use, sell, offer to sell, import and otherwise transfer the
+	Contribution of such Contributor, if any, in source code and object code form.
+	This patent license shall apply to the combination of the Contribution and the
+	Program if, at the time the Contribution is added by the Contributor, such
+	addition of the Contribution causes such combination to be covered by the
+	Licensed Patents. The patent license shall not apply to any other combinations
+	which include the Contribution. No hardware per se is licensed hereunder.
+
+	c) Recipient understands that although each Contributor grants the licenses
+	to its Contributions set forth herein, no assurances are provided by any
+	Contributor that the Program does not infringe the patent or other intellectual
+	property rights of any other entity. Each Contributor disclaims any liability to
+	Recipient for claims brought by any other entity based on infringement of
+	intellectual property rights or otherwise. As a condition to exercising the
+	rights and licenses granted hereunder, each Recipient hereby assumes sole
+	responsibility to secure any other intellectual property rights needed, if any.
+	For example, if a third party patent license is required to allow Recipient to
+	distribute the Program, it is Recipient's responsibility to acquire that license
+	before distributing the Program.
+
+	d) Each Contributor represents that to its knowledge it has sufficient
+	copyright rights in its Contribution, if any, to grant the copyright license set
+	forth in this Agreement.
+
+	3. REQUIREMENTS
+
+	A Contributor may choose to distribute the Program in object code form under its
+	own license agreement, provided that:
+
+	a) it complies with the terms and conditions of this Agreement; and
+
+	b) its license agreement:
+
+	i) effectively disclaims on behalf of all Contributors all warranties and
+	conditions, express and implied, including warranties or conditions of title and
+	non-infringement, and implied warranties or conditions of merchantability and
+	fitness for a particular purpose;
+
+	ii) effectively excludes on behalf of all Contributors all liability for
+	damages, including direct, indirect, special, incidental and consequential
+	damages, such as lost profits;
+
+	iii) states that any provisions which differ from this Agreement are offered
+	by that Contributor alone and not by any other party; and
+
+	iv) states that source code for the Program is available from such
+	Contributor, and informs licensees how to obtain it in a reasonable manner on or
+	through a medium customarily used for software exchange.
+
+	When the Program is made available in source code form:
+
+	a) it must be made available under this Agreement; and
+
+	b) a copy of this Agreement must be included with each copy of the Program.
+
+	Contributors may not remove or alter any copyright notices contained within the
+	Program.
+
+	Each Contributor must identify itself as the originator of its Contribution, if
+	any, in a manner that reasonably allows subsequent Recipients to identify the
+	originator of the Contribution.
+
+	4. COMMERCIAL DISTRIBUTION
+
+	Commercial distributors of software may accept certain responsibilities with
+	respect to end users, business partners and the like. While this license is
+	intended to facilitate the commercial use of the Program, the Contributor who
+	includes the Program in a commercial product offering should do so in a manner
+	which does not create potential liability for other Contributors. Therefore, if
+	a Contributor includes the Program in a commercial product offering, such
+	Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+	every other Contributor ("Indemnified Contributor") against any losses, damages
+	and costs (collectively "Losses") arising from claims, lawsuits and other legal
+	actions brought by a third party against the Indemnified Contributor to the
+	extent caused by the acts or omissions of such Commercial Contributor in
+	connection with its distribution of the Program in a commercial product
+	offering. The obligations in this section do not apply to any claims or Losses
+	relating to any actual or alleged intellectual property infringement. In order
+	to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+	Contributor in writing of such claim, and b) allow the Commercial Contributor to
+	control, and cooperate with the Commercial Contributor in, the defense and any
+	related settlement negotiations. The Indemnified Contributor may participate in
+	any such claim at its own expense.
+
+	For example, a Contributor might include the Program in a commercial product
+	offering, Product X. That Contributor is then a Commercial Contributor. If that
+	Commercial Contributor then makes performance claims, or offers warranties
+	related to Product X, those performance claims and warranties are such
+	Commercial Contributor's responsibility alone. Under this section, the
+	Commercial Contributor would have to defend claims against the other
+	Contributors related to those performance claims and warranties, and if a court
+	requires any other Contributor to pay any damages as a result, the Commercial
+	Contributor must pay those damages.
+
+	5. NO WARRANTY
+
+	EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+	IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+	NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+	Recipient is solely responsible for determining the appropriateness of using and
+	distributing the Program and assumes all risks associated with its exercise of
+	rights under this Agreement, including but not limited to the risks and costs of
+	program errors, compliance with applicable laws, damage to or loss of data,
+	programs or equipment, and unavailability or interruption of operations.
+
+	6. DISCLAIMER OF LIABILITY
+
+	EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+	CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+												  PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+	OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+	GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+	7. GENERAL
+
+	If any provision of this Agreement is invalid or unenforceable under applicable
+	law, it shall not affect the validity or enforceability of the remainder of the
+	terms of this Agreement, and without further action by the parties hereto, such
+	provision shall be reformed to the minimum extent necessary to make such
+	provision valid and enforceable.
+
+	If Recipient institutes patent litigation against a Contributor with respect to
+	a patent applicable to software (including a cross-claim or counterclaim in a
+									 lawsuit), then any patent licenses granted by that Contributor to such Recipient
+	under this Agreement shall terminate as of the date such litigation is filed. In
+	addition, if Recipient institutes patent litigation against any entity
+	(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+	itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient's rights under this Agreement terminate,
+	 Recipient agrees to cease use and distribution of the Program as soon as
+	 reasonably practicable. However, Recipient's obligations under this Agreement
+	 and any licenses granted by Recipient relating to the Program shall continue and
+	 survive.
+
+	 Everyone is permitted to copy and distribute copies of this Agreement, but in
+	 order to avoid inconsistency the Agreement is copyrighted and may only be
+	 modified in the following manner. The Agreement Steward reserves the right to
+	 publish new versions (including revisions) of this Agreement from time to time.
+	 No one other than the Agreement Steward has the right to modify this Agreement.
+	 IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
+	 as the Agreement Steward to a suitable separate entity. Each new version of the
+	 Agreement will be given a distinguishing version number. The Program (including
+																		   Contributions) may always be distributed subject to the version of the Agreement
+	 under which it was received. In addition, after a new version of the Agreement
+	 is published, Contributor may elect to distribute the Program (including its
+																	Contributions) under the new version. Except as expressly stated in Sections
+	 2(a) and 2(b) above, Recipient receives no rights or licenses to the
+	 intellectual property of any Contributor under this Agreement, whether
+	 expressly, by implication, estoppel or otherwise. All rights in the Program not
+	 expressly granted under this Agreement are reserved.
+
+	 This Agreement is governed by the laws of the State of New York and the
+	 intellectual property laws of the United States of America. No party to this
+	 Agreement will bring a legal action under this Agreement more than one year
+	 after the cause of action arose. Each party waives its rights to a jury trial in
+	 any resulting litigation.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/ksh93.p5m	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,110 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+
+# The man pages are all at the top of a "files" directory; setting the hash to
+# point to the files therein.
+<transform file path=usr/share/man/man.+/(.+)$ -> set action.hash %<\1> >
+# Bypassing the mangler for these files because they are pre-Solarified.
+<transform file path=usr/share/man/.+$ -> add mangler.bypass true >
+set name=pkg.fmri \
+    value=pkg:/shell/ksh@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.description \
+    value="Korn Shell 93: A command and programming language that executes commands read from a terminal or a file"
+set name=pkg.summary value="Ksh93 - The AT&T Korn Shell"
+set name=info.classification value=org.opensolaris.category.2008:System/Shells
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream \
+    value="AT&T Software Technology (AST) OpenSource Software Collection"
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2012/002
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+dir path=usr group=sys
+dir path=usr/include
+dir path=usr/share group=sys
+dir path=usr/share/doc group=other
+dir path=usr/share/doc/ksh
+dir path=usr/share/man/ja_JP.UTF-8/man1
+dir path=usr/share/man/man1
+dir path=usr/share/man/zh_CN.UTF-8/man1
+file path=etc/ksh.kshrc group=sys original_name=SUNWcs:etc/ksh.kshrc \
+    preserve=renameold
+file $(MACH32)/bin/ksh path=usr/bin/$(MACH32)/ksh mode=0555
+file $(MACH32)/bin/shcomp path=usr/bin/$(MACH32)/shcomp mode=0555
+file $(MACH64)/bin/alias path=usr/bin/alias mode=0555
+file $(MACH64)/bin/ksh path=usr/bin/$(MACH64)/ksh mode=0555
+file $(MACH64)/bin/shcomp path=usr/bin/$(MACH64)/shcomp mode=0555
+file alias.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/alias.1
+file jsh.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/jsh.1
+file ksh.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/ksh.1
+file ksh93.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/ksh93.1
+file rksh.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/rksh.1
+file sh.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/sh.1
+file shcomp.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/shcomp.1
+file path=usr/share/man/man1/alias.1
+file path=usr/share/man/man1/jsh.1
+file path=usr/share/man/man1/ksh.1
+file path=usr/share/man/man1/ksh93.1
+file path=usr/share/man/man1/rksh.1
+file path=usr/share/man/man1/sh.1
+file path=usr/share/man/man1/shcomp.1
+file ksh.1.zh_CN.UTF-8 path=usr/share/man/zh_CN.UTF-8/man1/ksh.1
+file ksh93.1.zh_CN.UTF-8 path=usr/share/man/zh_CN.UTF-8/man1/ksh93.1
+file rksh.1.zh_CN.UTF-8 path=usr/share/man/zh_CN.UTF-8/man1/rksh.1
+file shcomp.1.zh_CN.UTF-8 path=usr/share/man/zh_CN.UTF-8/man1/shcomp.1
+hardlink path=usr/bin/$(MACH32)/ksh93 target=ksh
+hardlink path=usr/bin/$(MACH32)/rksh target=ksh
+hardlink path=usr/bin/$(MACH32)/rksh93 target=ksh
+hardlink path=usr/bin/$(MACH64)/ksh93 target=ksh
+hardlink path=usr/bin/$(MACH64)/rksh target=ksh
+hardlink path=usr/bin/$(MACH64)/rksh93 target=ksh
+hardlink path=usr/bin/bg target=alias
+hardlink path=usr/bin/cd target=alias
+hardlink path=usr/bin/command target=alias
+hardlink path=usr/bin/fc target=alias
+hardlink path=usr/bin/fg target=alias
+hardlink path=usr/bin/getopts target=alias
+hardlink path=usr/bin/hash target=alias
+hardlink path=usr/bin/jobs target=alias
+hardlink path=usr/bin/kill target=alias
+hardlink path=usr/bin/ksh target=../lib/isaexec
+hardlink path=usr/bin/ksh93 target=../lib/isaexec
+hardlink path=usr/bin/pfksh target=pfexec
+hardlink path=usr/bin/pfksh93 target=pfexec
+hardlink path=usr/bin/pfrksh target=pfexec
+hardlink path=usr/bin/pfrksh93 target=pfexec
+hardlink path=usr/bin/print target=alias
+hardlink path=usr/bin/read target=alias
+hardlink path=usr/bin/rksh target=../lib/isaexec
+hardlink path=usr/bin/rksh93 target=../lib/isaexec
+hardlink path=usr/bin/test target=alias
+hardlink path=usr/bin/type target=alias
+hardlink path=usr/bin/ulimit target=alias
+hardlink path=usr/bin/umask target=alias
+hardlink path=usr/bin/unalias target=alias
+hardlink path=usr/bin/wait target=alias
+license ksh93.license license=CPL
+link path=usr/bin/jsh target=ksh93
+link path=usr/bin/sh target=$(MACH32)/ksh93
+link path=usr/lib/rsh target=../bin/ksh93
+link path=usr/sbin/jsh target=../bin/ksh93
+link path=usr/sbin/sh target=../bin/$(MACH32)/ksh93
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR6919590.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,24 @@
+--- a/src/cmd/ksh93/sh/args.c	Thu Sep  2 22:38:27 2010
++++ b/src/cmd/ksh93/sh/args.c	Tue Sep 27 10:48:45 2011
+@@ -26,6 +26,9 @@
+  * AT&T Labs
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	"defs.h"
+ #include	"path.h"
+@@ -302,6 +305,11 @@
+ 		}
+ 		else
+ 		{
++			if ((o == SH_RESTRICTED) &&
++			    sh_isoption(SH_RESTRICTED)) {
++				errormsg(SH_DICT, ERROR_exit(1),
++				    e_restricted, "r");
++			}
+ 			if(o==SH_XTRACE)
+ 				trace = 0;
+ 			off_option(&newflags,o);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR6964621.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,553 @@
+--- a/src/cmd/ksh93/sh/io.c	Tue Feb  8 17:15:45 2011
++++ b/src/cmd/ksh93/sh/io.c	Tue Sep 27 10:48:45 2011
+@@ -26,6 +26,9 @@
+  *   AT&T Labs
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	"defs.h"
+ #include	<fcin.h>
+@@ -596,8 +599,10 @@
+ 		((struct checkpt*)shp->jmplist)->mode = SH_JMPERREXIT;
+ 		errormsg(SH_DICT,ERROR_system(1),e_toomany);
+ 	}
+-	if(f2 >= shp->gd->lim.open_max)
+-		sh_iovalidfd(shp,f2);
++
++	VALIDATE_FD(shp, fd);
++	VALIDATE_FD(shp, f2);
++
+ 	if(shp->fdptrs[fd]=shp->fdptrs[f2])
+ 	{
+ 		if(f2==job.fd)
+@@ -623,7 +628,12 @@
+  */
+ int sh_iorenumber(Shell_t *shp, register int f1,register int f2)
+ {
+-	register Sfio_t *sp = shp->sftable[f2];
++	register Sfio_t *sp;
++
++	VALIDATE_FD(shp, f1);
++	VALIDATE_FD(shp, f2);
++
++	sp = shp->sftable[f2];
+ 	if(f1!=f2)
+ 	{
+ 		/* see whether file descriptor is in use */
+@@ -663,8 +673,7 @@
+ 		if(f2<=2)
+ 			sfset(sp,SF_SHARE|SF_PUBLIC,1);
+ 	}
+-	if(f2>=shp->gd->lim.open_max)
+-		sh_iovalidfd(shp,f2);
++	VALIDATE_FD(shp, f2);
+ 	return(f2);
+ }
+ 
+@@ -678,8 +687,9 @@
+ 	register int r = 0;
+ 	if(fd<0)
+ 		return(-1);
+-	if(fd >= shp->gd->lim.open_max)
+-		sh_iovalidfd(shp,fd);
++
++	VALIDATE_FD(shp, fd);
++
+ 	if(!(sp=shp->sftable[fd]) || sfclose(sp) < 0)
+ 	{
+ 		if(fdnotify)
+@@ -835,6 +845,9 @@
+ 		mode = (IOREAD|IOWRITE);
+ 	else
+ 		mode = IOREAD;
++
++	VALIDATE_FD(shp, fd);
++
+ 	shp->fdstatus[fd] = mode;
+ 	return(fd);
+ }
+@@ -858,9 +871,15 @@
+ {
+ 	Shell_t *shp = sh_getinterp();
+ 	register int fdnew;
++
++	VALIDATE_FD(shp, fdold);
++
+ 	if(fdold<0 || fdold>2)
+ 		return(fdold);
+ 	fdnew = sh_iomovefd(dup(fdold));
++
++	VALIDATE_FD(shp, fdnew);
++
+ 	shp->fdstatus[fdnew] = (shp->fdstatus[fdold]&~IOCLEX);
+ 	close(fdold);
+ 	shp->fdstatus[fdold] = IOCLOSE;
+@@ -878,6 +897,8 @@
+ 		errormsg(SH_DICT,ERROR_system(1),e_pipe);
+ 	pv[0] = sh_iomovefd(pv[0]);
+ 	pv[1] = sh_iomovefd(pv[1]);
++	VALIDATE_FD(shp, pv[0]);
++	VALIDATE_FD(shp, pv[1]);
+ 	shp->fdstatus[pv[0]] = IONOSEEK|IOREAD;
+ 	shp->fdstatus[pv[1]] = IONOSEEK|IOWRITE;
+ 	sh_subsavefd(pv[0]);
+@@ -897,6 +918,9 @@
+ 		sh_close(fd);
+ 	else
+ 		pv[out] = sh_iomovefd(fd);
++
++	VALIDATE_FD(shp, pv[out]);
++
+ 	if(fcntl(pv[out],F_SETFD,FD_CLOEXEC) >=0)
+ 		shp->fdstatus[pv[out]] |= IOCLEX;
+ 	shp->fdstatus[pv[out]] = (out?IOWRITE:IOREAD);
+@@ -929,6 +953,9 @@
+ 		errormsg(SH_DICT,ERROR_system(1),e_pipe);
+ 	}
+ 	fcntl(pv[out],F_SETFD,FD_CLOEXEC);
++
++	VALIDATE_FD(shp, pv[out]);
++
+ 	shp->fdstatus[pv[out]] |= IOCLEX;
+ 	pv[1-out] = -1;
+ 	pv[2] = port;
+@@ -958,9 +985,13 @@
+ static int io_patseek(Shell_t *shp, regex_t *rp, Sfio_t* sp, int flags)
+ {
+ 	char	*cp, *match;
+-	int	r, fd=sffileno(sp), close_exec = shp->fdstatus[fd]&IOCLEX;
++	int	r, fd, close_exec;
+ 	int	was_share,s=(PIPE_BUF>SF_BUFSIZE?SF_BUFSIZE:PIPE_BUF);
+ 	size_t	n,m;
++
++	fd = sffileno(sp);
++	VALIDATE_FD(shp, fd);
++	close_exec = shp->fdstatus[fd]&IOCLEX;
+ 	shp->fdstatus[sffileno(sp)] |= IOCLEX;
+ 	if(fd==0)
+ 		was_share = sfset(sp,SF_SHARE,1);
+@@ -994,12 +1025,17 @@
+ 
+ static Sfoff_t	file_offset(Shell_t *shp, int fn, char *fname)
+ {
+-	Sfio_t		*sp = shp->sftable[fn];
++	Sfio_t		*sp;
+ 	char		*cp;
+ 	Sfoff_t		off;
+ 	struct Eof	endf;
+ 	Namval_t	*mp = nv_open("EOF",shp->var_tree,0);
+ 	Namval_t	*pp = nv_open("CUR",shp->var_tree,0);
++
++	VALIDATE_FD(shp, fn);
++
++	sp = shp->sftable[fn];
++
+ 	memset(&endf,0,sizeof(struct Eof));
+ 	endf.fd = fn;
+ 	endf.hdr.disc = &EOF_disc;
+@@ -1169,7 +1205,7 @@
+ 			if((iof&IOLSEEK) || ((iof&IOMOV) && *fname=='-'))
+ 				fn = nv_getnum(np);
+ 		}
+-		if(fn>=shp->gd->lim.open_max && !sh_iovalidfd(shp,fn))
++		if (!VALIDATE_FD(shp, fn))
+ 			errormsg(SH_DICT,ERROR_system(1),e_file+4);
+ 		if(iof&IOLSEEK)
+ 		{
+@@ -1212,6 +1248,7 @@
+ 						message = e_file;
+ 						goto fail;
+ 					}
++					VALIDATE_FD(shp, dupfd);
+ 					if(shp->subshell && dupfd==1)
+ 					{
+ 						if(sfset(sfstdout,0,0)&SF_STRING)
+@@ -1248,8 +1285,7 @@
+ 					goto traceit;
+ 				if((fd=sh_fcntl(dupfd,F_DUPFD,3))<0)
+ 					goto fail;
+-				if(fd>= shp->gd->lim.open_max)
+-					sh_iovalidfd(shp,fd);
++				VALIDATE_FD(shp, fd);
+ 				sh_iocheckfd(shp,dupfd);
+ 				shp->fdstatus[fd] = (shp->fdstatus[dupfd]&~IOCLEX);
+ 				if(toclose<0 && shp->fdstatus[fd]&IOREAD)
+@@ -1362,7 +1398,11 @@
+ 			}
+ 			if(iof&IOLSEEK)
+ 			{
+-				Sfio_t *sp = shp->sftable[fn];
++				Sfio_t *sp;
++
++				VALIDATE_FD(shp, fn);
++
++				sp = shp->sftable[fn];
+ 				r = shp->fdstatus[fn];
+ 				if(!(r&(IOSEEK|IONOSEEK)))
+ 					r = sh_iocheckfd(shp,fn);
+@@ -1443,6 +1483,7 @@
+ 			}
+ 			if(fd<0)
+ 			{
++				VALIDATE_FD(shp, fn);
+ 				if(sh_inuse(shp,fn) || (fn && fn==shp->infd))
+ 				{
+ 					if(fn>9 || !(shp->inuse_bits&(1<<fn)))
+@@ -1462,7 +1503,7 @@
+ 					{
+ 						if((fn=fcntl(fd,F_DUPFD,10)) < 0)
+ 							goto fail;
+-						if(fn>=shp->gd->lim.open_max && !sh_iovalidfd(shp,fn))
++						if (!VALIDATE_FD(shp, fn))
+ 							goto fail;
+ 						shp->fdstatus[fn] = shp->fdstatus[fd];
+ 						sh_close(fd);
+@@ -1622,7 +1663,12 @@
+ 	filemap[shp->topfd++].save_fd = savefd;
+ 	if(savefd >=0)
+ 	{
+-		register Sfio_t* sp = shp->sftable[origfd];
++		register Sfio_t* sp;
++
++		VALIDATE_FD(shp, origfd);
++		VALIDATE_FD(shp, savefd);
++
++		sp = shp->sftable[origfd];
+ 		/* make saved file close-on-exec */
+ 		sh_fcntl(savefd,F_SETFD,FD_CLOEXEC);
+ 		if(origfd==job.fd)
+@@ -1655,6 +1701,7 @@
+ 			filemap[newfd++] = filemap[fd];
+ 		else
+ 		{
++			VALIDATE_FD(shp, savefd);
+ 			shp->sftable[savefd] = 0;
+ 			sh_close(savefd);
+ 		}
+@@ -1678,6 +1725,7 @@
+ 		{
+ 			if ((savefd = filemap[fd].save_fd) >= 0)
+ 			{
++				VALIDATE_FD(shp, savefd);
+ 				shp->sftable[savefd] = 0;
+ 				sh_close(savefd);
+ 			}
+@@ -1684,10 +1732,12 @@
+ 			continue;
+ 		}
+ 		origfd = filemap[fd].orig_fd;
++		VALIDATE_FD(shp, origfd);
+ 		if(origfd<0)
+ 		{
+ 			/* this should never happen */
+ 			savefd = filemap[fd].save_fd;
++			VALIDATE_FD(shp, savefd);
+ 			shp->sftable[savefd] = 0;
+ 			sh_close(savefd);
+ 			return;
+@@ -1699,6 +1749,7 @@
+ 		sh_close(origfd);
+ 		if ((savefd = filemap[fd].save_fd) >= 0)
+ 		{
++			VALIDATE_FD(shp, savefd);
+ 			sh_fcntl(savefd, F_DUPFD, origfd);
+ 			if(savefd==job.fd)
+ 				job.fd=origfd;
+@@ -1954,6 +2005,9 @@
+ int sh_iocheckfd(Shell_t *shp, register int fd)
+ {
+ 	register int flags, n;
++
++	VALIDATE_FD(shp, fd);
++
+ 	if((n=shp->fdstatus[fd])&IOCLOSE)
+ 		return(n);
+ 	if(!(n&(IOREAD|IOWRITE)))
+@@ -2145,7 +2199,7 @@
+ 		return;
+ 	}
+ #endif
+-	if(fd<0 || (fd>=shp->gd->lim.open_max && !sh_iovalidfd(shp,fd)))
++	if (fd < 0 || !VALIDATE_FD(shp, fd))
+ 		return;
+ 	if(sh_isstate(SH_NOTRACK))
+ 		return;
+@@ -2413,6 +2467,8 @@
+ {
+ 	Shell_t *shp = sh_getinterp();
+ 	register Sfio_t *sp;
++
++	VALIDATE_FD(shp, fd);
+ 	if(sp=shp->sftable[fd])
+ 		return(sfread(sp,buff,n));
+ 	else
+@@ -2427,6 +2483,8 @@
+ {
+ 	Shell_t *shp = sh_getinterp();
+ 	register Sfio_t *sp;
++
++	VALIDATE_FD(shp, fd);
+ 	if(sp=shp->sftable[fd])
+ 		return(sfwrite(sp,buff,n));
+ 	else
+@@ -2441,6 +2499,8 @@
+ {
+ 	Shell_t *shp = sh_getinterp();
+ 	register Sfio_t *sp;
++
++	VALIDATE_FD(shp, fd);
+ 	if((sp=shp->sftable[fd]) && (sfset(sp,0,0)&(SF_READ|SF_WRITE)))
+ 		return(sfseek(sp,offset,whence));
+ 	else
+@@ -2452,6 +2512,9 @@
+ {
+ 	Shell_t *shp = sh_getinterp();
+ 	register int fd = dup(old);
++
++	VALIDATE_FD(shp, old);
++	VALIDATE_FD(shp, fd);
+ 	if(fd>=0)
+ 	{
+ 		if(shp->fdstatus[old] == IOCLOSE)
+@@ -2473,13 +2536,15 @@
+ 	arg =  va_arg(ap, int) ;
+ 	va_end(ap);
+ 	newfd = fcntl(fd,op,arg);
++
++	VALIDATE_FD(shp, fd);
++	VALIDATE_FD(shp, newfd);
++
+ 	if(newfd>=0) switch(op)
+ 	{
+ 	    case F_DUPFD:
+ 		if(shp->fdstatus[fd] == IOCLOSE)
+ 			shp->fdstatus[fd] = 0;
+-		if(newfd>=shp->gd->lim.open_max)
+-			sh_iovalidfd(shp,newfd);
+ 		shp->fdstatus[newfd] = (shp->fdstatus[fd]&~IOCLEX);
+ 		if(fdnotify)
+ 			(*fdnotify)(fd,newfd);
+@@ -2548,6 +2613,7 @@
+ 		return(iop);
+ 	if(mode==SF_READ && !(n&IOREAD))
+ 		return(iop);
++	VALIDATE_FD(shp, fd);
+ 	if(!(iop = shp->sftable[fd]))
+ 		iop=sh_iostream(shp,fd);
+ 	return(iop);
+@@ -2567,7 +2633,10 @@
+ {
+ 	Shell_t	*shp = sh_getinterp();
+ 	register int status;
+-	Sfio_t *sp = shp->sftable[fd];
++	Sfio_t *sp;
++
++	VALIDATE_FD(shp, fd);
++	sp = shp->sftable[fd];
+ 	if(!sp  && (status = sh_iocheckfd(shp,fd))!=IOCLOSE)
+ 	{
+ 		register int flags=0;
+--- a/src/cmd/ksh93/include/io.h	Mon Nov 29 15:02:53 2010
++++ b/src/cmd/ksh93/include/io.h	Tue Aug 30 13:06:36 2011
+@@ -23,6 +23,9 @@
+  *	David Korn
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	<ast.h>
+ #include	<sfio.h>
+@@ -84,6 +87,12 @@
+ extern int	sh_isdevfd(const char*);
+ extern int	sh_source(Shell_t*, Sfio_t*, const char*);
+ 
++extern int	VALIDATE_FD(Shell_t *, int);
++
++#define	VALIDATE_FD(shp, fd) \
++	(((fd) >= (shp)->gd->lim.open_max) ? sh_iovalidfd(shp, fd) : 1)
++
++
+ /* the following are readonly */
+ extern const char	e_pexists[];
+ extern const char	e_query[];
+@@ -123,4 +132,5 @@
+ extern const char	e_stdprompt[];
+ extern const char	e_supprompt[];
+ extern const char	e_ambiguous[];
++
+ #endif /* KSHELL */
+--- a/src/cmd/ksh93/sh/lex.c	Fri Jan  7 16:37:35 2011
++++ b/src/cmd/ksh93/sh/lex.c	Tue Aug 30 13:06:36 2011
+@@ -25,6 +25,9 @@
+  * AT&T Labs
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	<ast.h>
+ #include	<stak.h>
+@@ -2053,6 +2056,7 @@
+ 	else
+ 		lp->lastline = shp->inlineno;
+ 	tokstr = fmttoken(lp,tok,tokbuf);
++	VALIDATE_FD(shp, shp->infd);
+ 	if((sp=fcfile()) || (shp->infd>=0 && (sp=shp->sftable[shp->infd])))
+ 	{
+ 		/* clear out any pending input */
+--- a/src/cmd/ksh93/sh/main.c	Wed Dec  1 22:10:07 2010
++++ b/src/cmd/ksh93/sh/main.c	Tue Aug 30 13:06:36 2011
+@@ -396,8 +401,10 @@
+ 		if(fno > 0)
+ 		{
+ 			int r;
++			VALIDATE_FD(shp, fno);
+ 			if(fno < 10 && ((r=sh_fcntl(fno,F_DUPFD,10))>=10))
+ 			{
++				VALIDATE_FD(shp, r);
+ 				shp->fdstatus[r] = shp->fdstatus[fno];
+ 				sh_close(fno);
+ 				fno = r;
+--- a/src/cmd/ksh93/sh/path.c	Mon Nov 22 20:55:38 2010
++++ b/src/cmd/ksh93/sh/path.c	Tue Sep 27 10:48:45 2011
+@@ -23,6 +23,9 @@
+  * AT&T Labs
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	"defs.h"
+ #include	<fcin.h>
+@@ -562,6 +565,7 @@
+ 	if(fd>=0 && (fd = sh_iomovefd(fd)) > 0)
+ 	{
+ 		fcntl(fd,F_SETFD,FD_CLOEXEC);
++		VALIDATE_FD(shp, fd);
+ 		shp->fdstatus[fd] |= IOCLEX;
+ 	}
+ 	return(fd);
+@@ -1239,6 +1243,7 @@
+ 	if(sp=fcfile())
+ 		while(sfstack(sp,SF_POPSTACK));
+ 	job_clear();
++	VALIDATE_FD(shp, shp->infd);
+ 	if(shp->infd>0 && (shp->fdstatus[shp->infd]&IOCLEX))
+ 		sh_close(shp->infd);
+ 	sh_setstate(sh_state(SH_FORKED));
+--- a/src/cmd/ksh93/sh/xec.c	Tue Feb  8 19:08:15 2011
++++ b/src/cmd/ksh93/sh/xec.c	Tue Aug 30 13:06:36 2011
+@@ -25,6 +25,9 @@
+  *   AT&T Labs
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	"defs.h"
+ #include	<fcin.h>
+@@ -94,6 +97,8 @@
+ 	usepipe++;
+ 	fcntl(subpipe[0],F_SETFD,FD_CLOEXEC);
+ 	subpipe[2] = fcntl(1,F_DUPFD,10);
++	VALIDATE_FD(shp, subpipe[1]);
++	VALIDATE_FD(shp, subpipe[2]);
+ 	shp->fdstatus[subpipe[2]] = shp->fdstatus[1];
+ 	close(1);
+ 	fcntl(subpipe[1],F_DUPFD,1);
+@@ -117,6 +122,7 @@
+ 	usepipe = 0;
+ 	close(1);
+ 	fcntl(subpipe[2], F_DUPFD, 1);
++	VALIDATE_FD(shp, subpipe[2]);
+ 	shp->fdstatus[1] = shp->fdstatus[subpipe[2]];
+ 	if(subdup) for(n=0; n < 10; n++)
+ 	{
+@@ -583,7 +589,10 @@
+ 	if(lineno)
+ 		shp->inlineno = lineno;
+ 	if(io_save)
++	{
+ 		sfclose(io_save);
++		io_save = 0;
++	}
+ 	sh_freeup(shp);
+ 	shp->st.staklist = saveslp;
+ 	shp->fn_reset = 0;
+@@ -844,6 +853,7 @@
+ 			if(filt > 2)
+ 			{
+ 				shp->coutpipe = shp->inpipe[1];
++				VALIDATE_FD(shp, shp->coutpipe);
+ 				shp->fdptrs[shp->coutpipe] = &shp->coutpipe;
+ 			}
+ 		}
+@@ -1487,6 +1497,7 @@
+ 						if(shp->cpipe[0]<0 || shp->cpipe[1] < 0)
+ 						{
+ 							sh_copipe(shp,shp->outpipe=shp->cpipe,0);
++							VALIDATE_FD(shp, shp->cpipe[0]);
+ 							shp->fdptrs[shp->cpipe[0]] = shp->cpipe;
+ 						}
+ 						sh_copipe(shp,shp->inpipe=pipes,0);
+@@ -3419,6 +3430,8 @@
+ 		if((outfd=shp->cpipe[1]) < 10) 
+ 		{
+ 		        int fd=fcntl(shp->cpipe[1],F_DUPFD,10);
++			VALIDATE_FD(shp, outfd);
++			VALIDATE_FD(shp, fd);
+ 			if(fd>=10)
+ 			{
+ 			        shp->fdstatus[fd] = (shp->fdstatus[outfd]&~IOCLEX);
+@@ -3427,6 +3440,9 @@
+ 				shp->cpipe[1] = fd;
+ 			}
+ 		}
++		VALIDATE_FD(shp, shp->cpipe[0]);
++		VALIDATE_FD(shp, shp->cpipe[1]);
++
+ 		if(fcntl(*shp->cpipe,F_SETFD,FD_CLOEXEC)>=0)
+ 			shp->fdstatus[shp->cpipe[0]] |= IOCLEX;
+ 		shp->fdptrs[shp->cpipe[0]] = shp->cpipe;
+@@ -3437,7 +3453,9 @@
+ 	shp->outpipe = shp->cpipe;
+ 	sh_pipe(shp->inpipe=pipes);
+ 	shp->coutpipe = shp->inpipe[1];
++	VALIDATE_FD(shp, shp->coutpipe);
+ 	shp->fdptrs[shp->coutpipe] = &shp->coutpipe;
++	VALIDATE_FD(shp, shp->outpipe[0]);
+ 	if(fcntl(shp->outpipe[0],F_SETFD,FD_CLOEXEC)>=0)
+ 		shp->fdstatus[shp->outpipe[0]] |= IOCLEX;
+ }
+@@ -3608,6 +3626,7 @@
+ 				int fd = shp->inpipe[1];
+ 				sh_iosave(shp,0,buff.topfd,(char*)0);
+ 				sh_iorenumber(shp,shp->inpipe[0],0);
++				VALIDATE_FD(shp, fd);
+ 				if(fd>=0 && (!(otype&FPOU) || (otype&FCOOP)) && fcntl(fd,F_SETFD,FD_CLOEXEC)>=0)
+ 					shp->fdstatus[fd] |= IOCLEX;
+ 			}
+@@ -3619,6 +3638,7 @@
+ #endif /* SHOPT_COSHELL */
+ 				sh_iosave(shp,1,buff.topfd,(char*)0);
+ 				sh_iorenumber(shp,sh_dup(shp->outpipe[1]),1);
++				VALIDATE_FD(shp, shp->outpipe[0]);
+ 				if(fcntl(shp->outpipe[0],F_SETFD,FD_CLOEXEC)>=0)
+ 					shp->fdstatus[shp->outpipe[0]] |= IOCLEX;
+ 			}
+@@ -3658,6 +3678,7 @@
+ 			signal(SIGQUIT,sh_fault);
+ 			signal(SIGINT,sh_fault);
+ 		}
++		VALIDATE_FD(shp, shp->inpipe[1]);
+ 		if((otype&FPIN) && (!(otype&FPOU) || (otype&FCOOP)) && fcntl(shp->inpipe[1],F_SETFD,FD_CLOEXEC)>=0)
+ 			shp->fdstatus[shp->inpipe[1]] &= ~IOCLEX;
+ 		if(t->fork.forkio || otype)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7025778.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,44 @@
+--- a/src/lib/libcmd/cmp.c	Mon Apr 12 15:39:53 2010
++++ b/src/lib/libcmd/cmp.c	Tue Jun 28 13:59:47 2011
+@@ -1,3 +1,7 @@
++/*
++ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
++ */
++
+ /***********************************************************************
+ *                                                                      *
+ *               This software is part of the ast package               *
+@@ -164,6 +168,10 @@
+ 				return ret;
+ 			if (!(p1 = (unsigned char*)sfreserve(f1, SF_UNBOUND, 0)) || (c1 = sfvalue(f1)) <= 0)
+ 			{
++				if (sferror(f1)) {
++					error(ERROR_exit(2),
++					    "read error on %s", file1);
++				}
+ 				if ((e2 - p2) > 0 || sfreserve(f2, SF_UNBOUND, 0) && sfvalue(f2) > 0)
+ 				{
+ 					ret = 1;
+@@ -170,6 +178,10 @@
+ 					if (!(flags & CMP_SILENT))
+ 						error(ERROR_exit(1), "EOF on %s", file1);
+ 				}
++				if (sferror(f2)) {
++					error(ERROR_exit(2),
++					    "read error on %s", file2);
++				}
+ 				return ret;
+ 			}
+ 			if (count > 0 && c1 > count)
+@@ -181,6 +193,10 @@
+ 		{
+ 			if (!(p2 = (unsigned char*)sfreserve(f2, SF_UNBOUND, 0)) || (c2 = sfvalue(f2)) <= 0)
+ 			{
++				if (sferror(f2)) {
++					error(ERROR_exit(2),
++					    "read error on %s", file2);
++				}
+ 				if (!(flags & CMP_SILENT))
+ 					error(ERROR_exit(1), "EOF on %s", file2);
+ 				return 1;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7026179.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,49 @@
+--- a/src/lib/libcmd/wclib.c	Tue Dec  1 17:10:57 2009
++++ b/src/lib/libcmd/wclib.c	Wed Jun 29 15:22:42 2011
+@@ -18,6 +18,9 @@
+ *                  David Korn <[email protected]>                   *
+ *                                                                      *
+ ***********************************************************************/
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ #pragma prototyped
+ /*
+  * David Korn
+@@ -341,7 +344,9 @@
+ 		int		xspace;
+ 		int		wasspace = 1;
+ 		unsigned char*	start;
++		int             flagm = 0;
+ 
++
+ 		lastchar = 0;
+ 		start = (endbuff = side) + 1;
+ 		xspace = iswspace(0xa0) || iswspace(0x85);
+@@ -367,6 +372,7 @@
+ 			if(mbc(lasttype))
+ 			{
+ 				c = lasttype;
++				flagm = 1;
+ 				goto mbyte;
+ 			}
+ 			if(!lasttype && spc(type[*cp]))
+@@ -415,6 +421,18 @@
+ 							skip = (c&7);
+ 							adjust += skip;
+ 							state = 0;
++							if (flagm == 1) {
++								flagm = 0;
++								oldc = *cp;
++								if (xspace && (
++								    iswspace
++								    (*cp)
++								    == 1)) {
++									state
++									    = 8;
++								}
++								continue;
++							}
+ 							if(skip==2 && (cp[-1]&0xc)==0 && (state=(cp[-1]&0x3)))
+ 								oldc = *cp;
+ 							else if(xspace && cp[-1]==0xc2)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7032821.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,11 @@
+--- a/src/cmd/ksh93/bltins/typeset.c	Fri Dec 31 00:15:57 2010
++++ b/src/cmd/ksh93/bltins/typeset.c	Tue Jun 28 13:59:53 2011
+@@ -608,7 +608,7 @@
+ 			}
+ 			if(!nv_isarray(np) && !strchr(name,'=') && !(shp->envlist  && nv_onlist(shp->envlist,name)))
+ 			{
+-				if(comvar || (shp->last_root==shp->var_tree && (tp->tp || (!shp->st.real_fun && (nvflags&NV_STATIC)) || (!(flag&NV_EXPORT) && nv_isattr(np,(NV_EXPORT|NV_IMPORT))==(NV_EXPORT|NV_IMPORT)))))
++				if(comvar || (shp->last_root==shp->var_tree && (tp->tp || (!shp->st.real_fun && (nvflags&NV_STATIC)) || (!(flag&(NV_EXPORT|NV_RDONLY)) && nv_isattr(np,(NV_EXPORT|NV_IMPORT))==(NV_EXPORT|NV_IMPORT)))))
+ {
+ 					_nv_unset(np,0);
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7036535.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,68 @@
+--- a/src/cmd/ksh93/sh/path.c	Mon Nov 22 20:55:38 2010
++++ b/src/cmd/ksh93/sh/path.c	Tue Sep 27 10:48:45 2011
+@@ -1430,7 +1435,7 @@
+ 		len = strlen(name);
+ 	for(pp=first; pp; pp=pp->next)
+ 	{
+-		if(memcmp(name,pp->name,len)==0 && (pp->name[len]==':' || pp->name[len]==0))
++		if(strncmp(name,pp->name,len)==0 && (pp->name[len]==':' || pp->name[len]==0))
+ 		{
+ 			pp->flags |= flag;
+ 			return(first);
+@@ -1740,7 +1745,7 @@
+ 	register Pathcomp_t *pp=first;
+ 	while(pp)
+ 	{
+-		if(memcmp(name,pp->name,pp->len)==0 && name[pp->len]==c) 
++		if(strncmp(name,pp->name,pp->len)==0 && name[pp->len]==c) 
+ 			return(pp);
+ 		pp = pp->next;
+ 	}
+--- a/src/cmd/ksh93/sh/nvtree.c	Sun Jan  2 17:45:14 2011
++++ b/src/cmd/ksh93/sh/nvtree.c	Fri Jul 22 00:30:31 2011
+@@ -26,6 +26,9 @@
+  *   AT&T Labs
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	"defs.h"
+ #include	"name.h"
+@@ -188,7 +191,7 @@
+ 		{
+ 			char *cp = nv_name(dp->hp);
+ 			c = strlen(cp);
+-			if(memcmp(name,cp,c) || name[c]!='[')
++			if(strncmp(name,cp,c) || name[c]!='[')
+ 				dp->hp = (Namval_t*)dtnext(dp->root,dp->hp);
+ 			else
+ 			{
+@@ -266,7 +269,7 @@
+ {
+ 	if(dp->nextnode)
+ 		return((*dp->nextnode)(dp->hp,dp->root,dp->fun));
+-	if(dp->len && memcmp(dp->data, dp->hp->nvname, dp->len))
++	if(dp->len && strncmp(dp->data, dp->hp->nvname, dp->len))
+ 		return(0);
+ 	return((Namval_t*)dtnext(dp->root,dp->hp));
+ }
+@@ -311,7 +314,7 @@
+ 					dp->hp = (*dp->nextnode)(np,(Dt_t*)0,dp->fun);
+ 			}
+ 			sh.last_table = last_table;
+-			if(!dp->len || memcmp(cp,dp->data,dp->len)==0)
++			if(!dp->len || strncmp(cp,dp->data,dp->len)==0)
+ 			{
+ 				if((nfp=nextdisc(np)) && (nfp->disc->getval||nfp->disc->getnum) && nv_isvtree(np) && strcmp(cp,dp->data))
+ 					nfp = 0;
+@@ -861,7 +864,7 @@
+ 					continue;
+ 				break;
+ 			}
+-			else if(outfile && !wp->nofollow && argv[1] && memcmp(arg,argv[1],l=strlen(arg))==0 && argv[1][l]=='[')
++			else if(outfile && !wp->nofollow && argv[1] && strncmp(arg,argv[1],l=strlen(arg))==0 && argv[1][l]=='[')
+ 			{
+ 				int	k=1;
+ 				Namarr_t *ap=0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7057565.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,12 @@
+diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/Makefile INIT.2011-02-08/src/cmd/ksh93/Makefile
+--- INIT.2011-02-08.clean/src/cmd/ksh93/Makefile	2012-04-11 17:48:34.919720887 +0100
++++ INIT.2011-02-08/src/cmd/ksh93/Makefile	2012-04-11 17:51:33.474974484 +0100
+@@ -40,7 +40,7 @@ SHOPT_NAMESPACE == 1		/* allow namespace
+ SHOPT_OLDTERMIO ==		/* support both TCGETA and TCGETS */
+ SHOPT_OPTIMIZE == 1		/* optimize loop invariants */
+ SHOPT_PFSH == 1			/* solaris exec_attr(4) profile execution */
+-SHOPT_P_SUID ==			/* real uid's that require -p for set[ug]id */
++SHOPT_P_SUID == 1		/* real uid's that require -p for set[ug]id */
+ SHOPT_RAWONLY == 1		/* make viraw the only vi mode */
+ SHOPT_REGRESS ==		/* enable __regress__ builtin and instrumented intercepts for testing */
+ SHOPT_REMOTE ==			/* enable --rc if running as a remote shell */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7065478.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,46 @@
+--- a/src/lib/libast/comp/setlocale.c	Mon Dec 27 04:23:49 2010
++++ b/src/lib/libast/comp/setlocale.c	Fri Jul 22 00:30:31 2011
+@@ -19,6 +19,9 @@
+ *                   Phong Vo <[email protected]>                    *
+ *                                                                      *
+ ***********************************************************************/
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ #pragma prototyped
+ 
+ /*
+@@ -2236,6 +2239,24 @@
+ 
+ typedef int (*Isw_f)(wchar_t);
+ 
++static int
++wide_wctomb(char* u, wchar_t w) 
++{
++	int size = 0;
++
++	if (u)
++	{
++		size = wctomb(u, w);
++		if (size < 0)
++		{
++			*u = (char)(w & 0xff);
++			size = 1;
++		}
++	}
++
++	return size;
++}
++
+ /*
+  * called when LC_CTYPE initialized or changes
+  */
+@@ -2280,7 +2301,7 @@
+ 	{
+ 		if (!(ast.mb_width = wcwidth))
+ 			ast.mb_width = default_wcwidth;
+-		ast.mb_conv = wctomb;
++		ast.mb_conv = wide_wctomb;
+ #ifdef mb_state
+ 		{
+ 			/*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7065900.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,11 @@
+--- a/src/cmd/ksh93/data/builtins.c	Tue Dec  7 19:23:04 2010
++++ b/src/cmd/ksh93/data/builtins.c	Mon Jul 18 12:08:50 2011
+@@ -108,7 +108,6 @@
+ 	"printf",	NV_BLTIN|BLT_ENV,		bltin(printf),
+ 	"pwd",		NV_BLTIN,			bltin(pwd),
+ 	"read",		NV_BLTIN|BLT_ENV,		bltin(read),
+-	"sleep",	NV_BLTIN,			bltin(sleep),
+ 	"alarm",	NV_BLTIN,			bltin(alarm),
+ 	"ulimit",	NV_BLTIN|BLT_ENV,		bltin(ulimit),
+ 	"umask",	NV_BLTIN|BLT_ENV,		bltin(umask),
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7071431.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,11 @@
+--- a/src/cmd/ksh93/include/ulimit.h	Tue Oct 26 16:25:26 2010
++++ b/src/cmd/ksh93/include/ulimit.h	Thu Aug 25 10:19:37 2011
+@@ -157,7 +157,7 @@
+ 
+ typedef struct Limit_s
+ {
+-	const char	name[8];
++	const char*	name;
+ 	const char*	description;
+ 	int		index;
+ 	const char*	conf;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7105086.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,46 @@
+diff -r bb8978c251cb -r 6fbea5c30b60 usr/src/cmd/ast/lib/libshell/common/sh/jobs.c
+--- a/src/cmd/ksh93/sh/jobs.c	Sun Mar 25 23:19:46 2012 -0700
++++ b/src/cmd/ksh93/sh/jobs.c	Mon Mar 26 05:09:19 2012 -0700
+@@ -28,6 +28,9 @@
+  *  Rewritten April, 1988
+  *  Revised January, 1992
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #include	"defs.h"
+ #include	<wait.h>
+@@ -57,6 +60,7 @@
+ {
+ 	struct jobsave	*next;
+ 	pid_t		pid;
++	short		curenv;
+ 	unsigned short	exitval;
+ };
+ 
+@@ -232,6 +236,7 @@
+ 		jp->pid = pid;
+ 		jp->next = bck.list;
+ 		bck.list = jp;
++		jp->curenv = 0;
+ 		jp->exitval = 0;
+ 	}
+ 	return(jp);
+@@ -1790,6 +1795,7 @@
+ 			/* save status for future wait */
+ 			if(jp = jobsave_create(pw->p_pid))
+ 			{
++				jp->curenv = pw->p_env;
+ 				jp->exitval = pw->p_exit;
+ 				if(pw->p_flag&P_SIGNALLED)
+ 					jp->exitval |= SH_EXITSIG;
+@@ -1967,7 +1973,7 @@
+ 	for(jp=bck.list; jp; jp=jpnext)
+ 	{
+ 		jpnext = jp->next;
+-		if(jp->pid==sh.spid)
++		if(jp->curenv != sh.curenv || jp->pid==sh.spid)
+ 		{
+ 			jp->next = bp->list;
+ 			bp->list = jp;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CR7110983.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,24 @@
+diff -r bb8978c251cb -r 6fbea5c30b60 usr/src/cmd/ast/lib/libshell/common/sh/name.c
+--- a/src/cmd/ksh93/sh/name.c	Sun Mar 25 23:19:46 2012 -0700
++++ b/src/cmd/ksh93/sh/name.c	Mon Mar 26 05:09:19 2012 -0700
+@@ -22,6 +22,9 @@
+  * AT&T Labs
+  *
+  */
++/*
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
+ 
+ #define putenv	___putenv
+ 
+@@ -1832,7 +1835,10 @@
+ 			else
+ #endif
+ 			if(size==0 && nv_isattr(np,NV_HOST)!=NV_HOST &&nv_isattr(np,NV_LJUST|NV_RJUST|NV_ZFILL))
++			{
+ 				nv_setsize(np,size=dot);
++				tofree = up->cp;
++			}
+ 			else if(size > dot)
+ 				dot = size;
+ 			else if(nv_isattr(np,NV_LJUST|NV_RJUST)==NV_LJUST && dot>size)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/CRXXX_Error_Catalog.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,11 @@
+--- a/src/cmd/builtin/asa.c	Wed Nov  1 16:47:27 2006
++++ b/src/cmd/builtin/asa.c	Tue Jun 28 13:59:47 2011
+@@ -110,7 +110,7 @@
+ 	register Sfio_t	*fp;
+ 	register int	n, reclen=0;
+ 
+-	cmdinit(argc, argv,(void*)0,(const char*)0,0);
++	cmdinit(argc, argv, context, ERROR_CATALOG, 0);
+ 	while (n = optget(argv, usage)) switch (n)
+ 	{
+ 	    case 'r':
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/build_cflags.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,36 @@
+diff -rupN a/src/cmd/cs/Makefile b/src/cmd/cs/Makefile
+--- a/src/cmd/cs/Makefile	2000-05-12 20:08:02.000000000 +0000
++++ b/src/cmd/cs/Makefile	2011-11-02 13:55:16.327160444 +0000
+@@ -22,9 +22,9 @@ pid udp :SERVICE: pid.c
+ 
+ rsh tcp :SERVICE: rsh.c
+ 
+-tst-old tcp :SERVICE: CCFLAGS=-g tst-old.c
++tst-old tcp :SERVICE: CCFLAGS+=-g tst-old.c
+ 
+-tst tcp :SERVICE: CCFLAGS=-g tst.c
++tst tcp :SERVICE: CCFLAGS+=-g tst.c
+ 
+ 6263 tcp :SERVICE: 6263.c
+ 
+diff -rupN a/src/cmd/cs/Mamfile b/src/cmd/cs/Mamfile
+--- a/src/cmd/cs/Mamfile	2011-02-09 05:47:50.000000000 +0000
++++ b/src/cmd/cs/Mamfile	2011-11-02 13:31:23.512475642 +0000
+@@ -335,7 +335,7 @@ prev ${PACKAGE_ast_INCLUDE}/cs.h implici
+ done tst-old.c
+ meta tst-old.o %.c>%.o tst-old.c tst-old
+ prev tst-old.c
+-exec - ${CC} -g -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c tst-old.c
++exec - ${CC}  ${mam_cc_FLAGS} ${CCFLAGS} -g -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c tst-old.c
+ done tst-old.o generated
+ exec - ${CC} ${CCLDFLAGS} -g ${LDFLAGS} ${mam_cc_L+-L${INSTALLROOT}/lib} -o tst-old.svc tst-old.o ${mam_libcs} ${mam_libast}
+ done tst-old.svc generated
+@@ -350,7 +350,7 @@ meta tst.o %.c>%.o tst.c tst
+ prev tst.c
+ exec - ${CC} -g -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c tst.c
+ done tst.o generated
+-exec - ${CC} ${CCLDFLAGS} -g ${LDFLAGS} ${mam_cc_L+-L${INSTALLROOT}/lib} -o tst.svc tst.o ${mam_libcs} ${mam_libast}
++exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${CCLDFLAGS} -g ${LDFLAGS} ${mam_cc_L+-L${INSTALLROOT}/lib} -o tst.svc tst.o ${mam_libcs} ${mam_libast}
+ done tst.svc generated
+ make 6263.svc
+ make 6263.o
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/disable_dll.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,16 @@
+diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/Makefile INIT.2011-02-08/src/cmd/ksh93/Makefile
+--- INIT.2011-02-08.clean/src/cmd/ksh93/Makefile	2012-04-11 17:12:31.210695651 +0100
++++ INIT.2011-02-08/src/cmd/ksh93/Makefile	2012-04-11 17:19:23.339887285 +0100
+@@ -167,12 +167,6 @@ shell$(RELEASE) $(VERSION) id=shell :LIB
+ "sol*.i386*"	:NOOPTIMIZE: main.c
+ "win32*"	:NOOPTIMIZE: strdata.c trestore.c
+ 
+-if CC.HOSTTYPE == "win32*"
+-:DLL: $(CC.DEBUG)
+-else
+-:DLL: $(CC.OPTIMIZE)
+-end
+-
+ :READONLY: $(DATAFILES)
+ 
+ $(INCLUDEDIR) :INSTALLPROTO: nval.h shell.h history.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/multi_lang_arith.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,12 @@
+diff -rupN a/src/lib/libast/sfio/sfstrtof.h b/src/lib/libast/sfio/sfstrtof.h
+--- a/src/lib/libast/sfio/sfstrtof.h	2010-12-24 14:32:27.000000000 +0000
++++ b/src/lib/libast/sfio/sfstrtof.h	2011-10-25 12:21:57.749942750 +0100
+@@ -414,7 +414,7 @@ S2F_function(str, end) char* str; char**
+ 			m = 0;
+ 			fraction = digits;
+ 		}
+-		else if (c != thousand)
++		else if (c != thousand || (c == thousand && decimal == -1)
+ 			break;
+ 		else if (!(m = digits))
+ 		{
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/package-pax-suid.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,78 @@
+diff -ru clean/bin/package patched/bin/package
+--- clean/bin/package	Thu Feb  3 15:45:18 2011
++++ patched/bin/package	Wed Sep 21 13:21:39 2011
+@@ -5111,7 +5111,7 @@
+ 						export INSTALLROOT VPATH
+ 						echo lib/$command
+ 						$MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign
+-						) | sort -u | pax -drw -ps $dest
++						) | sort -u | pax -drw $dest
+ 					)
+ 				fi
+ 			fi
+@@ -5916,7 +5916,7 @@
+ 					;;
+ 				esac
+ 			elif	test "" != "$PAX"
+-			then	$exec pax -L --from=ascii --local -m -ps -rvf "$f" || {
++			then	$exec pax -L --from=ascii --local -m -rvf "$f" || {
+ 					code=1
+ 					continue
+ 				}
+@@ -6010,7 +6010,7 @@
+ 					esac
+ 				}
+ 				# -m with delta bug fixed 2005-02-08
+-				$exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || {
++				$exec pax -L --from=ascii --local -rvf "$f" -z "$b" || {
+ 					code=1
+ 					continue
+ 				}
+@@ -6052,7 +6052,7 @@
+ 					esac
+ 				}
+ 				# -m with delta bug fixed 2005-02-08
+-				$exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || {
++				$exec pax -L --from=ascii --local -rvf "$f" -z "$b" || {
+ 					code=1
+ 					continue
+ 				}
+diff -ru clean/src/cmd/INIT/package.sh patched/src/cmd/INIT/package.sh
+--- clean/src/cmd/INIT/package.sh	Thu Feb  3 15:45:16 2011
++++ patched/src/cmd/INIT/package.sh	Wed Sep 21 13:22:04 2011
+@@ -5129,7 +5129,7 @@
+ 						export INSTALLROOT VPATH
+ 						echo lib/$command
+ 						$MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign
+-						) | sort -u | pax -drw -ps $dest
++						) | sort -u | pax -drw $dest
+ 					)
+ 				fi
+ 			fi
+@@ -5934,7 +5934,7 @@
+ 					;;
+ 				esac
+ 			elif	test "" != "$PAX"
+-			then	$exec pax -L --from=ascii --local -m -ps -rvf "$f" || {
++			then	$exec pax -L --from=ascii --local -m -rvf "$f" || {
+ 					code=1
+ 					continue
+ 				}
+@@ -6028,7 +6028,7 @@
+ 					esac
+ 				}
+ 				# -m with delta bug fixed 2005-02-08
+-				$exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || {
++				$exec pax -L --from=ascii --local -rvf "$f" -z "$b" || {
+ 					code=1
+ 					continue
+ 				}
+@@ -6070,7 +6070,7 @@
+ 					esac
+ 				}
+ 				# -m with delta bug fixed 2005-02-08
+-				$exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || {
++				$exec pax -L --from=ascii --local -rvf "$f" -z "$b" || {
+ 					code=1
+ 					continue
+ 				}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/path_utmp.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,24 @@
+diff -rupN a/src/cmd/ss/ssd.c b/src/cmd/ss/ssd.c
+--- a/src/cmd/ss/ssd.c	2010-06-09 16:06:54.000000000 +0100
++++ b/src/cmd/ss/ssd.c	2011-10-24 15:46:09.321811427 +0100
+@@ -118,9 +118,6 @@ struct whod
+ #if	!defined(UTMP_PATHNAME) && defined(UTMPX_PATHNAME)
+ #define UTMP_PATHNAME	UTMPX_PATHNAME
+ #endif	
+-#if	!defined(_PATH_UTMP) && defined(_PATH_UTMPX)
+-#define _PATH_UTMP	_PATH_UTMPX
+-#endif     
+ 
+ #else
+ 
+@@ -142,8 +139,8 @@ static char*		usrfiles[] =
+ #ifdef	UTMP_PATHNAME
+ 	UTMP_PATHNAME,
+ #endif
+-#ifdef	_PATH_UTMP
+-	_PATH_UTMP,
++#ifdef	_PATH_UTMPX
++	_PATH_UTMPX,
+ #endif
+ #if _hdr_utmpx
+ 	"/etc/utmpx",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/solaris_alias.patch	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,363 @@
+diff -rupN b/lib/package/ast-base.pkg a/lib/package/ast-base.pkg
+--- b/lib/package/ast-base.pkg	2009-09-21 20:35:51.000000000 +0000
++++ a/lib/package/ast-base.pkg	2011-11-10 16:24:52.515495613 +0000
+@@ -3,7 +3,7 @@ ast-base :PACKAGE: \
+ 		libdll libexpr libodelta librecsort libsum libuu libvdelta \
+ 		libbz libz tests 3d coshell cpp cs mam msgcc nmake probe ss \
+ 		libcoshell libcs libmam libpp libcodex paxlib codexlib \
+-		libdss libpz dsslib
++		libdss libpz dsslib alias
+ 
+ :COVERS: ast-make ast-ksh ast-ast
+ 
+diff -rupN b/src/cmd/alias/alias.c a/src/cmd/alias/alias.c
+--- b/src/cmd/alias/alias.c	1970-01-01 00:00:00.000000000 +0000
++++ a/src/cmd/alias/alias.c	2011-11-10 16:24:28.356925339 +0000
+@@ -0,0 +1,255 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
++ */
++
++/*
++ * alias.c is a C version of the alias.sh wrapper (which links ksh
++ * builtins to commands in /usr/bin/, e.g. calling this wrapper as
++ * /usr/bin/alias will call the ksh "alias" builtin, running it as
++ * /usr/bin/cut will call the ksh "cut" builtin etc.
++ */
++
++#include <shell.h>
++#include <nval.h>
++#include <stdio.h>
++#include <alias.h>
++
++typedef struct {
++	const char *name;
++	int (* func)(int, char **, void *);
++} bfastpathrec;
++
++/*
++ * We've disabled the "fastpath" codepath for some commands below
++ * because it causes a paradoxon for large input files (as used by
++ * ON PerfPIT for testing). For /usr/bin/rev (where the issue was
++ * first discovered) it looks like this:
++ * - for small files like /etc/profile the fastpath is faster in a loop
++ *   with 1000 iterations (8 seconds with fastpath, 14 seconds without
++ *   fastpath)
++ * - for large files (/usr/pub/UTF-8 replicated until the test file
++ *   reaches 24884706 bytes) the benchmark reverses: The fastpath now
++ *   needs 40 seconds and without fastpath it needs 30 seconds (for 100
++ *   iterations).
++ */
++#if 0
++#define	ENABLE_PERFORMANCE_PARADOXON 1
++#endif
++
++/*
++ * List of libcmd builtins which do not require a |Shell_t| context.
++ * This list was automatically generated from <ast/cmdext.h>
++ */
++static const
++bfastpathrec fastpath_builtins[] =
++{
++	/* This list must be alphabetically sorted for |strcmp()| usage */
++	{ "basename",	b_basename	},
++	{ "cat",	b_cat		},
++	{ "chgrp",	b_chgrp		},
++	{ "chmod",	b_chmod		},
++	{ "chown",	b_chown		},
++#ifdef ENABLE_PERFORMANCE_PARADOXON
++	{ "cksum",	b_cksum		},
++#endif /* ENABLE_PERFORMANCE_PARADOXON */
++	{ "cmp",	b_cmp		},
++	{ "comm",	b_comm		},
++	{ "cp",		b_cp		},
++	{ "cut",	b_cut		},
++	{ "date",	b_date		},
++	{ "dirname",	b_dirname	},
++	{ "expr",	b_expr		},
++	{ "fds",	b_fds		},
++	{ "fmt",	b_fmt		},
++	{ "fold",	b_fold		},
++	{ "getconf",	b_getconf	},
++	{ "head",	b_head		},
++	{ "id",		b_id		},
++	{ "join",	b_join		},
++	{ "ln",		b_ln		},
++	{ "logname",	b_logname	},
++	{ "md5sum",	b_md5sum	},
++	{ "mkdir",	b_mkdir		},
++	{ "mkfifo",	b_mkfifo	},
++	{ "mktemp",	b_mktemp	},
++	{ "mv",		b_mv		},
++	{ "paste",	b_paste 	},
++	{ "pathchk",	b_pathchk	},
++	{ "pids",	b_pids		},
++#ifdef ENABLE_PERFORMANCE_PARADOXON
++	{ "rev",	b_rev		},
++#endif /* ENABLE_PERFORMANCE_PARADOXON */
++	{ "rm",		b_rm		},
++	{ "rmdir",	b_rmdir		},
++	{ "stty",	b_stty		},
++#ifdef ENABLE_PERFORMANCE_PARADOXON
++	{ "sum",	b_sum		},
++#endif /* ENABLE_PERFORMANCE_PARADOXON */
++	{ "sync",	b_sync		},
++	{ "tail",	b_tail		},
++	{ "tee",	b_tee		},
++	{ "tty",	b_tty		},
++	{ "uname",	b_uname		},
++	{ "uniq",	b_uniq		},
++	{ "wc",		b_wc		},
++	{ NULL, 	(int (*)(int, char **, void *))NULL }
++};
++
++static inline
++const bfastpathrec *
++find_bfastpathrec(const char *name)
++{
++	unsigned int i;
++	signed int cmpres;
++	for (i = 0; fastpath_builtins[i].name != NULL; i++) {
++		cmpres = strcmp(fastpath_builtins[i].name, name);
++		if (cmpres == 0)
++			return (&fastpath_builtins[i]);
++		else if (cmpres > 0)
++			return (NULL);
++
++	}
++	return (NULL);
++}
++
++static inline
++int
++fastpath_builtin_main(const bfastpathrec *brec, int argc, char *argv[])
++{
++	setlocale(LC_ALL, ""); /* calls |_ast_setlocale()| */
++
++	return ((*brec->func)(argc, argv, NULL));
++}
++
++
++/* Builtin script, original derived from alias.sh */
++static const char *script = "\n"
++/* Get name of builtin */
++"typeset cmd=\"${0##*/}\"\n"
++/*
++ * If the requested command is not an alias load it explicitly
++ * to make sure it is not bound to a path (those built-ins which
++ * are mapped via shell aliases point to commands which are
++ * "special shell built-ins" which cannot be bound to a specific
++ * PATH element) - otherwise we may execute the wrong command
++ * if an executable with the same name sits in a PATH element
++ * before /usr/bin (e.g. /usr/xpg4/bin/ls would be executed
++ * before /usr/bin/ls if the path was something like
++ * PATH=/usr/xpg4/bin:/usr/bin).
++ */
++"if [[ \"${cmd}\" != ~(Elr)(alias|unalias|command) ]] && "
++	"! alias \"${cmd}\" >/dev/null 2>&1 ; then\n"
++	"PATH='' builtin \"${cmd}\"\n"
++"fi\n"
++/* command is a keyword and needs to be handled separately */
++"if [[ \"${cmd}\" == \"command\" ]] ; then\n"
++	"command \"$@\"\n"
++"else\n"
++#ifdef WORKAROUND_FOR_ALIAS_CRASH
++/*
++ * Work around a crash in /usr/bin/alias when invalid options are
++ * passed (e.g. $ /usr/bin/alias -c #). The shell code will call
++ * an error handler which does a |longjmp()| but somehow the code
++ * failed to do the |setjmp()| before this point.
++ * Putting the "alias" command in a subshell avoids the crash.
++ * Real cause of the issue is under investigation and a fix be
++ * delivered with the next ast-ksh update.
++ */
++	"( \"${cmd}\" \"$@\" )\n"
++#else
++	"\"${cmd}\" \"$@\"\n"
++#endif /* WORKAROUND_FOR_ALIAS_CRASH */
++"fi\n"
++"exitval=$?";
++
++
++static inline
++int
++script_builtin_main(int argc, char *argv[])
++{
++	int i;
++	Shell_t *shp;
++	Namval_t *np;
++	int exitval;
++
++	/*
++	 * Create copy of |argv| array shifted by one position to
++	 * emulate $ /usr/bin/sh <scriptname> <args1> <arg2> ... #.
++	 * First position is set to "/usr/bin/sh" since other
++	 * values may trigger special shell modes (e.g. *rsh* will
++	 * trigger "restricted" shell mode etc.).
++	 */
++	char *xargv[argc+2];
++	xargv[0] = "/usr/bin/sh";
++	xargv[1] = "scriptname";
++	for (i = 0; i < argc; i++) {
++		xargv[i+1] = argv[i];
++	}
++	xargv[i+1] = NULL;
++
++	shp = sh_init(argc+1, xargv, 0);
++	if (!shp)
++		error(ERROR_exit(1), "shell initialisation failed.");
++	(void) sh_trap(script, 0);
++
++	np = nv_open("exitval", shp->var_tree, 0);
++	if (!np)
++		error(ERROR_exit(1), "variable %s not found.", "exitval");
++	exitval = (int)nv_getnum(np);
++	nv_close(np);
++
++	return (exitval);
++}
++
++int
++main(int argc, char *argv[])
++{
++	const char *progname;
++	const bfastpathrec *brec;
++	char execnamebuff[PATH_MAX+1];
++
++	/* Get program name */
++	if (pathprog(argv[0], execnamebuff, sizeof (execnamebuff)) <= 0)
++		error(ERROR_exit(1), "could not determinate exec name.");
++
++	progname = (const char *)strrchr(execnamebuff, '/');
++	if (progname != NULL) {
++		progname++;
++	}
++	else
++	{
++		progname = execnamebuff;
++	}
++
++	/* Execute command... */
++	if (brec = find_bfastpathrec(progname)) {
++		/* ... either via a fast path (calling the code directly) ... */
++		return (fastpath_builtin_main(brec, argc, argv));
++	}
++	else
++	{
++		/* ... or from within a full shell. */
++		return (script_builtin_main(argc, argv));
++	}
++}
+diff -rupN b/src/cmd/alias/alias.h a/src/cmd/alias/alias.h
+--- b/src/cmd/alias/alias.h	1970-01-01 00:00:00.000000000 +0000
++++ a/src/cmd/alias/alias.h	2011-11-10 16:24:28.357387725 +0000
+@@ -0,0 +1,79 @@
++/***********************************************************************
++*                                                                      *
++*               This software is part of the ast package               *
++*          Copyright (c) 1992-2011 AT&T Intellectual Property          *
++*                      and is licensed under the                       *
++*                  Common Public License, Version 1.0                  *
++*                    by AT&T Intellectual Property                     *
++*                                                                      *
++*                A copy of the License is available at                 *
++*            http://www.opensource.org/licenses/cpl1.0.txt             *
++*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
++*                                                                      *
++*              Information and Software Systems Research               *
++*                            AT&T Research                             *
++*                           Florham Park NJ                            *
++*                                                                      *
++*                 Glenn Fowler <[email protected]>                  *
++*                  David Korn <[email protected]>                   *
++*                                                                      *
++***********************************************************************/
++
++extern int b_asa (int, char**, void *);
++extern int b_basename (int, char**, void *);
++extern int b_cat (int, char**, void *);
++extern int b_chgrp (int, char**, void *);
++extern int b_chmod (int, char**, void *);
++extern int b_chown (int, char**, void *);
++extern int b_cksum (int, char**, void *);
++extern int b_cmp (int, char**, void *);
++extern int b_comm (int, char**, void *);
++extern int b_cp (int, char**, void *);
++extern int b_cut (int, char**, void *);
++extern int b_date (int, char**, void *);
++extern int b_dirname (int, char**, void *);
++extern int b_egrep (int, char**, void *);
++extern int b_expr (int, char**, void *);
++extern int b_fds (int, char**, void *);
++extern int b_fgrep (int, char**, void *);
++extern int b_find (int, char**, void *);
++extern int b_fmt (int, char**, void *);
++extern int b_fold (int, char**, void *);
++extern int b_getconf (int, char**, void *);
++extern int b_grep (int, char**, void *);
++extern int b_head (int, char**, void *);
++extern int b_id (int, char**, void *);
++extern int b_join (int, char**, void *);
++extern int b_line (int, char**, void *);
++extern int b_ln (int, char**, void *);
++extern int b_logname (int, char**, void *);
++extern int b_ls (int, char**, void *);
++extern int b_md5sum (int, char**, void *);
++extern int b_mkdir (int, char**, void *);
++extern int b_mkfifo (int, char**, void *);
++extern int b_mktemp (int, char**, void *);
++extern int b_mv (int, char**, void *);
++extern int b_paste (int, char**, void *);
++extern int b_od (int, char**, void *);
++extern int b_pathchk (int, char**, void *);
++extern int b_pids (int, char**, void *);
++extern int b_pr (int, char**, void *);
++extern int b_rev (int, char**, void *);
++extern int b_readlink (int, char**, void *);
++extern int b_rm (int, char**, void *);
++extern int b_rmdir (int, char**, void *);
++extern int b_stty (int, char**, void *);
++extern int b_sum (int, char**, void *);
++extern int b_sync (int, char**, void *);
++extern int b_strings (int, char**, void *);
++extern int b_tail (int, char**, void *);
++extern int b_tee (int, char**, void *);
++extern int b_tr (int, char**, void *);
++extern int b_tty (int, char**, void *);
++extern int b_uname (int, char**, void *);
++extern int b_uniq (int, char**, void *);
++extern int b_vmstate (int, char**, void *);
++extern int b_wc (int, char**, void *);
++extern int b_who (int, char**, void *);
++extern int b_xgrep (int, char**, void *);
++extern int b_xargs (int, char**, void *);
+diff -rupN b/src/cmd/alias/Makefile a/src/cmd/alias/Makefile
+--- b/src/cmd/alias/Makefile	1970-01-01 00:00:00.000000000 +0000
++++ a/src/cmd/alias/Makefile	2011-11-10 16:24:28.357746164 +0000
+@@ -0,0 +1,5 @@
++:PACKAGE: ast:static
++
++LICENSE = cddl
++libtype = :static
++alias :: RELEASE alias.c +lshell
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/source-demo-ksh.p5m	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,58 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+#
+
+# The man pages are all at the top of a "files" directory; setting the hash to
+# point to the files therein.
+<transform file path=usr/share/man/man.+/(.+)$ -> set action.hash %<\1> >
+# Bypassing the mangler for these files because they are pre-Solarified.
+<transform file path=usr/share/man/.+$ -> add mangler.bypass true >
+set name=pkg.fmri \
+    value=pkg:/source/demo/ksh@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.description value="Source code to demonstrate the KornShell"
+set name=pkg.summary value="KornShell demos"
+set name=info.classification value=org.opensolaris.category.2008:System/Core
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream \
+    value="AT&T Software Technology (AST) OpenSource Software Collection"
+set name=info.upstream-url value=$(COMPONENT_ARCHIVE_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2012/002
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+dir path=usr group=sys
+dir path=usr/demo
+dir path=usr/demo/ksh
+dir path=usr/demo/ksh/fun
+dir path=usr/share/man/ja_JP.UTF-8/man1
+dir path=usr/share/man/man1
+file $(MACH64)/fun/dirs path=usr/demo/ksh/fun/dirs mode=0755 preserve=true
+file $(MACH64)/fun/popd path=usr/demo/ksh/fun/popd mode=0755 preserve=true
+file $(MACH64)/fun/pushd path=usr/demo/ksh/fun/pushd mode=0755 preserve=true
+file $(MACH64)/fun/title path=usr/demo/ksh/fun/title mode=0755 preserve=true
+file dirs.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/dirs.1
+file popd.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/popd.1
+file pushd.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/pushd.1
+file path=usr/share/man/man1/dirs.1
+file path=usr/share/man/man1/popd.1
+file path=usr/share/man/man1/pushd.1
+license ksh93.license license=CPL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/attpackagemake.mk	Mon Apr 23 08:30:27 2012 -0700
@@ -0,0 +1,95 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+#
+# Rules and Macros for building opens source software that uses AT&T's package
+# tool.
+#
+# To use these rules, include ../make-rules/attpackagemake.mk in your Makefile
+# and define "build", "install" targets appropriate to building your component.
+# Ex:
+#
+# 	build:		$(BUILD_32) \
+#	 		$(BUILD_64)
+# 
+#	install:	$(INSTALL_32) \
+#	 		$(INSTALL_64)
+#
+# Any additional pre/post configure, build, or install actions can be specified
+# in your Makefile by setting them in on of the following macros:
+#	COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
+#	COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
+#
+# If component specific make targets need to be used for build or install, they
+# can be specified in
+#	COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
+#
+
+# Environment variables and arguments passed into the build and install
+# environment(s).  These are the initial settings.
+COMPONENT_BUILD_ENV += \
+	CC="$(CC)" \
+	CCFLAGS="$(CFLAGS)" \
+	CCFLAGS.FORCE="$(CXXFLAGS)" \
+	CC.RUNPATH="$(CC.RUNPATH)" \
+	CC.LD.RUNPATH="$(CC.LD.RUNPATH)" \
+	CC.LD.ORIGIN="$(CC.LD.ORIGIN)" \
+	CC.DLL.ORIGIN="$(CC.DLL.ORIGIN)" \
+	CCLDFLAGS="$(CXXFLAGS)" \
+	LDOPTIONS="$(CXXFLAGS)" \
+	NPROCS="$(NPROCS)" \
+	LDFLAGS="$(CXXFLAGS)"
+
+# This is a workaround for the AT&T nmake failing to always use
+# the environmental CCFLAGS in sub-compiles
+COMPONENT_BUILD_ARGS= $(COMPONENT_BUILD_ENV)
+
+# build the configured source
+$(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep
+	$(RM) -r $(@D) ; $(MKDIR) $(@D)
+	$(CLONEY) $(SOURCE_DIR) $(@D)
+	$(COMPONENT_PRE_BUILD_ACTION)
+	cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
+   		bin/package make $(COMPONENT_BUILD_TARGETS) $(COMPONENT_BUILD_ARGS)
+	$(COMPONENT_POST_BUILD_ACTION)
+	$(TOUCH) $@
+
+# install the built source into a prototype area
+$(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built
+	$(COMPONENT_PRE_INSTALL_ACTION)
+	$(RM) -r $(PROTO_DIR)/$(MACH$(BITS)); $(MKDIR) $(PROTO_DIR)/$(MACH$(BITS));
+	cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
+		bin/package flat $(COMPONENT_INSTALL_TARGETS) \
+		$(PROTO_DIR)/$(MACH$(BITS)) $(COMPONENT_INSTALL_PACKAGES) 
+	$(COMPONENT_POST_INSTALL_ACTION)
+	$(TOUCH) $@
+
+# test the built source
+$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
+	$(COMPONENT_PRE_TEST_ACTION)
+	cd $(@D) ; $(ENV) $(COMPONENT_TEST_ENV) bin/package \
+		test $(COMPONENT_TEST_TARGETS) 
+	$(COMPONENT_POST_TEST_ACTION)
+	$(TOUCH) $@
+
+clean::
+	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
--- a/make-rules/prep.mk	Mon Apr 23 02:00:40 2012 -0700
+++ b/make-rules/prep.mk	Mon Apr 23 08:30:27 2012 -0700
@@ -21,6 +21,9 @@
 # Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
+# One must do all unpack and patch in sequence.
+.NOTPARALLEL: (SOURCE_DIR)/.prep
+
 UNPACK =	$(WS_TOOLS)/userland-unpack
 FETCH =		$(WS_TOOLS)/userland-fetch
 
@@ -30,7 +33,8 @@
 # In order to override PATCH_DIR and PATCH_PATTERN in component makefiles, they
 # need to be conditionally set here.  This means that the override needs to
 # happen prior to including prep.mk.  Otherwise other variables set here which
-# are based on those will be expanded too early for the override to take effect.
+# are based on those will be expanded too early for the override to take 
+# effect.
 # You also can't override PATCHES after including prep.mk; if you want to
 # append filenames to PATCHES, you'll have to set $(EXTRA_PATCHES) prior to
 # inclusion.
@@ -43,22 +47,20 @@
 PATCH_PATTERN ?=	*.patch
 PATCHES =	$(shell find $(PATCH_DIR) $(PARFAIT_PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \
 				2>/dev/null | sort) $(EXTRA_PATCHES)
-STAMPS =	$(PATCHES:$(PATCH_DIR)/%=$(SOURCE_DIR)/.%ed)
-ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-STAMPS +=	$(PATCHES:$(PARFAIT_PATCH_DIR)/%=$(SOURCE_DIR)/.%ed)
-endif
 
+# Rule to perform the patching.
 $(SOURCE_DIR)/.%ed:	$(PATCH_DIR)/%
 	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
 	$(TOUCH) $@
 
+# Parfait patches rule: TODO - Integrate with other patch rules
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
 $(SOURCE_DIR)/.%ed:	$(PARFAIT_PATCH_DIR)/%
 	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
 	$(TOUCH) $@
 endif
 
-# template for download rules. add new rules with $(call download-rule, suffix)
+# Template for download rules.
 define download-rule
 ARCHIVES += $$(COMPONENT_ARCHIVE$(1))
 CLOBBER_PATHS += $$(COMPONENT_ARCHIVE$(1))
@@ -69,21 +71,64 @@
 	$$(TOUCH) $$@
 endef
 
-# Generate the download rules from the above template
-NUM_ARCHIVES =	1 2 3 4 5 6 7
-$(eval $(call download-rule,))
-$(foreach suffix,$(NUM_ARCHIVES),$(eval $(call download-rule,_$(suffix))))
+# Template for patching rules, note that patching is actually done by the 
+# %.ed pattern rule above.
+# To maintain backwards compatibility, the flag PATCH_EACH_ARCHIVE must
+# be non-empty in order to activate individual archive patching.
+define patch-rule
+ifneq ($(strip $$(PATCH_EACH_ARCHIVE)),)
+# Prepend the patch directory to each archive patch.
+#$$(COMPONENT_PATCHES$(1):%=$$(PATCH_DIR)/%)
+#PATCHDIR_PATCHES$(1) += $$(COMPONENT_PATCHES)
+PATCHDIR_PATCHES$(1) += $$(foreach patch,$$(COMPONENT_PATCHES$(1)), \
+						 $$(PATCH_DIR)/$$(patch))
+else
+PATCHDIR_PATCHES = $$(PATCHES)
+endif
+# Substitute the patch dir for the source dir on the patches
+STAMPS$(1)+= $$(PATCHDIR_PATCHES$(1):$$(PATCH_DIR)/%=$$(SOURCE_DIR)/.%ed)
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+STAMPS$(1)+= $$(PATCHDIR_PATCHES$(1):$$(PARFAIT_PATCH_DIR)/%=$$(SOURCE_DIR)/.%ed)
+endif
+$$(SOURCE_DIR)/.patched$(1): $$(SOURCE_DIR)/.unpacked$(1) $$(STAMPS$(1))
+	$$(TOUCH) $$@
+endef
 
-$(SOURCE_DIR)/.unpacked:	download Makefile $(PATCHES)
-	$(RM) -r $(SOURCE_DIR)
-	$(UNPACK) $(UNPACK_ARGS) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE)
-	$(COMPONENT_POST_UNPACK_ACTION)
-	$(TOUCH) $@
+# Template for unpacking rules.
+define unpack-rule
+$$(SOURCE_DIR)/.unpacked$(1): download Makefile $$(PATCHDIR_PATCHES$(1)) 
+	$$(RM) -r $$(COMPONENT_SRC$(1))
+	$$(UNPACK) $$(UNPACK_ARGS$(1)) \
+		$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
+	$$(COMPONENT_POST_UNPACK_ACTION$(1))
+	$$(TOUCH) $$@
+endef
 
-$(SOURCE_DIR)/.patched:	$(SOURCE_DIR)/.unpacked $(STAMPS)
-	$(TOUCH) $@
+# If an archive is defined, create a download, unpack and patch rule.
+define archive-rule
+ifneq ($(strip $$(COMPONENT_ARCHIVE$(1))),)
+$(eval $(call download-rule,$(1)))
+$(eval $(call unpack-rule,$(1)))
+$(eval $(call patch-rule,$(1)))
+ARCHIVE_STAMPS +=$$(SOURCE_DIR)/.patched$(1)
+endif
+endef
 
-$(SOURCE_DIR)/.prep:	$(SOURCE_DIR)/.patched
+# Calculate the number of defined archives.
+# Always generate at least the basic prep rules.
+# Work out if there are any other archives to be downloaded and patched.
+NUM_EXTRA_ARCHIVES= 1 2 3 4 5 6 7 8 9
+$(eval $(call archive-rule,))
+ifneq ($(strip $(PATCH_EACH_ARCHIVE)),)
+$(foreach suffix,$(NUM_EXTRA_ARCHIVES), \
+	$(eval $(call archive-rule,_$(suffix))))
+else
+# Backwards compatibility - only download, do not unpack or patch automatically
+$(foreach suffix,$(NUM_EXTRA_ARCHIVES), \
+	$(eval $(call download-rule,_$(suffix))))
+endif
+
+$(SOURCE_DIR)/.prep: $(ARCHIVE_STAMPS)
 	$(COMPONENT_PREP_ACTION)
 	$(TOUCH) $@