Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2007 04:20:52 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 130311 for review
Message-ID:  <200712060420.lB64KqUp029311@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=130311

Change 130311 by kmacy@entropy_kmacy_xen31 on 2007/12/06 04:20:36

	IFC #130310

Affected files ...

.. //depot/projects/xen31/bin/sh/sh.1#2 integrate
.. //depot/projects/xen31/contrib/amd/AUTHORS#2 integrate
.. //depot/projects/xen31/contrib/amd/BUGS#2 integrate
.. //depot/projects/xen31/contrib/amd/COPYING#2 integrate
.. //depot/projects/xen31/contrib/amd/ChangeLog#2 integrate
.. //depot/projects/xen31/contrib/amd/FAQ#1 branch
.. //depot/projects/xen31/contrib/amd/INSTALL#2 integrate
.. //depot/projects/xen31/contrib/amd/NEWS#2 integrate
.. //depot/projects/xen31/contrib/amd/README.attrcache#1 branch
.. //depot/projects/xen31/contrib/amd/README.ldap#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/am_ops.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amd.8#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amd.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amd.h#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_auto.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_direct.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_error.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_generic.c#1 branch
.. //depot/projects/xen31/contrib/amd/amd/amfs_host.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_inherit.c#2 delete
.. //depot/projects/xen31/contrib/amd/amd/amfs_link.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_linkx.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_nfsl.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_nfsx.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_program.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_root.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_toplvl.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amfs_union.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amq_subr.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/amq_svc.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/autil.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/clock.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/conf.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/conf_parse.y#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/conf_tok.l#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/get_args.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_exec.c#1 branch
.. //depot/projects/xen31/contrib/amd/amd/info_file.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_hesiod.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_ldap.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_ndbm.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_nis.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_nisplus.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_passwd.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/info_union.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/map.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/mapc.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/mntfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/nfs_prot_svc.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/nfs_start.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/nfs_subr.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_TEMPLATE.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_cachefs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_cdfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_efs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_lofs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_mfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_nfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_nfs3.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_nullfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_pcfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_tfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_tmpfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_ufs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_umapfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_unionfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/ops_xfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/opts.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/readdir.c#1 branch
.. //depot/projects/xen31/contrib/amd/amd/restart.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/rpc_fwd.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/sched.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/srvr_amfs_auto.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amd/srvr_nfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amq/amq.8#2 integrate
.. //depot/projects/xen31/contrib/amd/amq/amq.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amq/amq.h#2 integrate
.. //depot/projects/xen31/contrib/amd/amq/amq_clnt.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amq/amq_xdr.c#2 integrate
.. //depot/projects/xen31/contrib/amd/amq/pawd.1#2 integrate
.. //depot/projects/xen31/contrib/amd/amq/pawd.c#2 integrate
.. //depot/projects/xen31/contrib/amd/aux_conf.h.in#2 integrate
.. //depot/projects/xen31/contrib/amd/bootstrap#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/checkmount/checkmount_bsd44.c#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/mtab/mtab_bsd.c#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/sa_dref/sa_dref_bsd44.h#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/transp/transp_sockets.c#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/trap/trap_default.h#2 integrate
.. //depot/projects/xen31/contrib/amd/conf/umount/umount_bsd44.c#2 integrate
.. //depot/projects/xen31/contrib/amd/doc/am-utils.texi#2 integrate
.. //depot/projects/xen31/contrib/amd/doc/stamp-vti#1 branch
.. //depot/projects/xen31/contrib/amd/doc/texinfo.tex#2 integrate
.. //depot/projects/xen31/contrib/amd/doc/version.texi#2 integrate
.. //depot/projects/xen31/contrib/amd/fixmount/fixmount.8#2 integrate
.. //depot/projects/xen31/contrib/amd/fixmount/fixmount.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsi_analyze.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsi_data.h#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsi_dict.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsi_gram.y#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsi_lex.l#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsi_util.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsinfo.8#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsinfo.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/fsinfo.h#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/wr_atab.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/wr_bparam.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/wr_dumpset.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/wr_exportfs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/fsinfo/wr_fstab.c#2 integrate
.. //depot/projects/xen31/contrib/amd/hlfsd/hlfsd.8#2 integrate
.. //depot/projects/xen31/contrib/amd/hlfsd/hlfsd.c#2 integrate
.. //depot/projects/xen31/contrib/amd/hlfsd/hlfsd.h#2 integrate
.. //depot/projects/xen31/contrib/amd/hlfsd/homedir.c#2 integrate
.. //depot/projects/xen31/contrib/amd/hlfsd/nfs_prot_svc.c#2 integrate
.. //depot/projects/xen31/contrib/amd/hlfsd/stubs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/include/am_compat.h#2 integrate
.. //depot/projects/xen31/contrib/amd/include/am_defs.h#2 integrate
.. //depot/projects/xen31/contrib/amd/include/am_utils.h#2 integrate
.. //depot/projects/xen31/contrib/amd/include/am_xdr_func.h#2 integrate
.. //depot/projects/xen31/contrib/amd/include/amq_defs.h#2 integrate
.. //depot/projects/xen31/contrib/amd/include/mount_headers1.h#2 integrate
.. //depot/projects/xen31/contrib/amd/include/mount_headers2.h#2 integrate
.. //depot/projects/xen31/contrib/amd/ldap-id.ms#2 integrate
.. //depot/projects/xen31/contrib/amd/ldap.schema#1 branch
.. //depot/projects/xen31/contrib/amd/libamu/alloca.c#2 delete
.. //depot/projects/xen31/contrib/amd/libamu/amu.h#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/hasmntopt.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/misc_rpc.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/mount_fs.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/mtab.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/nfs_prot_xdr.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/strerror.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/strutil.c#1 branch
.. //depot/projects/xen31/contrib/amd/libamu/util.c#2 delete
.. //depot/projects/xen31/contrib/amd/libamu/wire.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/xdr_func.c#2 integrate
.. //depot/projects/xen31/contrib/amd/libamu/xutil.c#2 integrate
.. //depot/projects/xen31/contrib/amd/m4/GNUmakefile#2 delete
.. //depot/projects/xen31/contrib/amd/m4/amdgrep#2 delete
.. //depot/projects/xen31/contrib/amd/m4/amindent#2 delete
.. //depot/projects/xen31/contrib/amd/m4/autopat#2 delete
.. //depot/projects/xen31/contrib/amd/m4/chop-aclocal.pl#2 delete
.. //depot/projects/xen31/contrib/amd/m4/copy-if-newbig#2 delete
.. //depot/projects/xen31/contrib/amd/m4/macros/HEADER#2 delete
.. //depot/projects/xen31/contrib/amd/m4/macros/TRAILER#2 delete
.. //depot/projects/xen31/contrib/amd/m4/mk-aclocal#2 delete
.. //depot/projects/xen31/contrib/amd/m4/mkconf#2 delete
.. //depot/projects/xen31/contrib/amd/m4/rmtspc#2 delete
.. //depot/projects/xen31/contrib/amd/m4/update_build_version#2 delete
.. //depot/projects/xen31/contrib/amd/mk-amd-map/mk-amd-map.8#2 integrate
.. //depot/projects/xen31/contrib/amd/mk-amd-map/mk-amd-map.c#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/am-eject.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/amd.conf-sample#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/amd.conf.5#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/amd2ldif.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/amd2sun.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/automount2amd.8#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/automount2amd.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/ctl-amd.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/ctl-hlfsd.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/expn.1#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/expn.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/fix-amd-map.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/fixrmtab.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/redhat-ctl-amd.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/test-attrcache.in#1 branch
.. //depot/projects/xen31/contrib/amd/scripts/wait4amd.in#2 integrate
.. //depot/projects/xen31/contrib/amd/scripts/wait4amd2die.in#2 integrate
.. //depot/projects/xen31/contrib/amd/tasks#2 integrate
.. //depot/projects/xen31/contrib/amd/vers.m4#1 branch
.. //depot/projects/xen31/contrib/amd/wire-test/wire-test.8#2 integrate
.. //depot/projects/xen31/contrib/amd/wire-test/wire-test.c#2 integrate
.. //depot/projects/xen31/sbin/dhclient/dispatch.c#2 integrate
.. //depot/projects/xen31/share/man/man4/msk.4#3 integrate
.. //depot/projects/xen31/sys/conf/NOTES#6 integrate
.. //depot/projects/xen31/sys/conf/files#6 integrate
.. //depot/projects/xen31/sys/conf/options#4 integrate
.. //depot/projects/xen31/sys/dev/aac/aac_pci.c#2 integrate
.. //depot/projects/xen31/sys/dev/ipw/if_ipw.c#3 integrate
.. //depot/projects/xen31/sys/dev/iwi/if_iwi.c#2 integrate
.. //depot/projects/xen31/sys/dev/msk/if_msk.c#3 integrate
.. //depot/projects/xen31/sys/dev/msk/if_mskreg.h#3 integrate
.. //depot/projects/xen31/sys/dev/sio/sio.c#2 integrate
.. //depot/projects/xen31/sys/dev/utopia/utopia.c#2 integrate
.. //depot/projects/xen31/sys/geom/part/g_part.c#3 integrate
.. //depot/projects/xen31/sys/geom/part/g_part.h#3 integrate
.. //depot/projects/xen31/sys/geom/part/g_part_bsd.c#1 branch
.. //depot/projects/xen31/sys/i386/bios/apm.c#3 integrate
.. //depot/projects/xen31/sys/ia64/conf/DEFAULTS#2 integrate
.. //depot/projects/xen31/sys/kern/kern_mbuf.c#5 integrate
.. //depot/projects/xen31/sys/kern/vfs_subr.c#3 integrate
.. //depot/projects/xen31/sys/netinet/sctp_output.c#4 integrate
.. //depot/projects/xen31/sys/netinet/sctputil.c#4 integrate
.. //depot/projects/xen31/sys/sys/param.h#7 integrate
.. //depot/projects/xen31/usr.sbin/Makefile#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/amd/Makefile#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/fsinfo/Makefile#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/include/amu_autofs_prot.h#1 branch
.. //depot/projects/xen31/usr.sbin/amd/include/aux_conf.h#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/include/build_version.h#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/include/config.h#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/include/newvers.sh#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/libamu/Makefile#2 integrate
.. //depot/projects/xen31/usr.sbin/amd/mk-amd-map/Makefile#2 integrate
.. //depot/projects/xen31/usr.sbin/syslogd/syslogd.c#2 integrate

Differences ...

==== //depot/projects/xen31/bin/sh/sh.1#2 (text+ko) ====

@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	from: @(#)sh.1	8.6 (Berkeley) 5/4/95
-.\" $FreeBSD: src/bin/sh/sh.1,v 1.125 2007/10/04 16:14:48 stefanf Exp $
+.\" $FreeBSD: src/bin/sh/sh.1,v 1.126 2007/12/05 12:29:26 ru Exp $
 .\"
 .Dd October 7, 2006
 .Dt SH 1
@@ -57,9 +57,12 @@
 This version has many features which make
 it appear
 similar in some respects to the Korn shell, but it is not a Korn
-shell clone like pdksh.
+shell clone like
+.Nm pdksh .
 Only features
-designated by POSIX, plus a few Berkeley extensions, are being
+designated by
+.Tn POSIX ,
+plus a few Berkeley extensions, are being
 incorporated into this shell.
 This man page is not intended to be a tutorial nor a complete
 specification of the shell.
@@ -107,6 +110,7 @@
 .Pa /etc/profile
 and then
 .Pa .profile
+in a user's home directory,
 if they exist.
 If the environment variable
 .Ev ENV
@@ -129,13 +133,15 @@
 .Pa .shinit
 the filename desired:
 .Pp
-.Dl ENV=$HOME/.shinit; export ENV
+.Dl "ENV=$HOME/.shinit; export ENV"
 .Pp
 The first non-option argument specified on the command line
 will be treated as the
 name of a file from which to read commands (a shell script), and
 the remaining arguments are set as the positional parameters
-of the shell ($1, $2, etc).
+of the shell
+.Li ( $1 , $2 ,
+etc.).
 Otherwise, the shell reads commands
 from its standard input.
 .Pp
@@ -180,7 +186,7 @@
 A
 .Dq Li --
 or plain
-.Dq Ql -
+.Ql -
 will stop option processing and will force the remaining
 words on the command line to be treated as arguments.
 The
@@ -198,7 +204,7 @@
 (UNIMPLEMENTED)
 .It Fl C Li noclobber
 Do not overwrite existing files with
-.Dq Li > .
+.Ql > .
 .It Fl E Li emacs
 Enable the built-in
 .Xr emacs 1
@@ -228,7 +234,7 @@
 Disable pathname expansion.
 .It Fl I Li ignoreeof
 Ignore
-.Dv EOF Ns ' Ns s
+.Dv EOF Ap s
 from input when in interactive mode.
 .It Fl i Li interactive
 Force the shell to behave interactively.
@@ -253,10 +259,10 @@
 .It Fl p Li privileged
 Turn on privileged mode.
 This mode is enabled on startup
-if either the effective user or group id is not equal to the
-real user or group id.
+if either the effective user or group ID is not equal to the
+real user or group ID.
 Turning this mode off sets the
-effective user and group ids to the real user and group ids.
+effective user and group IDs to the real user and group IDs.
 When this mode is enabled for interactive shells, the file
 .Pa /etc/suid_profile
 is sourced instead of
@@ -288,7 +294,6 @@
 .Bd -literal -offset indent
 sh -T -c "trap 'exit 1' 2 ; some-blocking-program"
 .Ed
-.Pp
 .It Fl u Li nounset
 Write a message to standard error when attempting
 to expand a variable that is not set, and if the
@@ -306,7 +311,7 @@
 .It Fl x Li xtrace
 Write each command
 (preceded by the value of the
-.Ev PS4
+.Va PS4
 variable)
 to standard error before it is executed.
 Useful for debugging.
@@ -384,7 +389,7 @@
 it impossible to put single-quotes in a single-quoted string).
 .It Double Quotes
 Enclosing characters within double quotes preserves the literal
-meaning of all characters except dollarsign
+meaning of all characters except dollar sign
 .Pq Ql $ ,
 backquote
 .Pq Ql ` ,
@@ -423,16 +428,14 @@
 For example, if there is an alias called
 .Dq Li lf
 with the value
-.Dq Li ls -F ,
+.Dq Li "ls -F" ,
 then the input
-.Bd -literal -offset indent
-lf foobar
-.Ed
+.Pp
+.Dl "lf foobar"
 .Pp
 would become
-.Bd -literal -offset indent
-ls -F foobar
-.Ed
+.Pp
+.Dl "ls -F foobar"
 .Pp
 Aliases provide a convenient way for naive users to
 create shorthands for commands without having to learn how
@@ -498,10 +501,10 @@
 The overall format
 used for redirection is:
 .Pp
-.Dl [n] redir-op file
+.D1 Oo Ar n Oc Ar redir-op file
 .Pp
 The
-.Ql redir-op
+.Ar redir-op
 is one of the redirection operators mentioned
 previously.
 The following gives some examples of how these
@@ -509,42 +512,66 @@
 Note that stdin and stdout are commonly used abbreviations
 for standard input and standard output respectively.
 .Bl -tag -width "1234567890XX" -offset indent
-.It Li [n]> file
-redirect stdout (or file descriptor n) to file
-.It Li [n]>| file
+.It Oo Ar n Oc Ns Li > Ar file
+redirect stdout (or file descriptor
+.Ar n )
+to
+.Ar file
+.It Oo Ar n Oc Ns Li >| Ar file
 same as above, but override the
 .Fl C
 option
-.It Li [n]>> file
-append stdout (or file descriptor n) to file
-.It Li [n]< file
-redirect stdin (or file descriptor n) from file
-.It Li [n]<> file
-redirect stdin (or file descriptor n) to and from file
-.It Li [n1]<&n2
-duplicate stdin (or file descriptor n1) from file descriptor n2
-.It Li [n]<&-
-close stdin (or file descriptor n)
-.It Li [n1]>&n2
-duplicate stdout (or file descriptor n1) to file descriptor n2
-.It Li [n]>&-
-close stdout (or file descriptor n)
+.It Oo Ar n Oc Ns Li >> Ar file
+append stdout (or file descriptor
+.Ar n )
+to
+.Ar file
+.It Oo Ar n Oc Ns Li < Ar file
+redirect stdin (or file descriptor
+.Ar n )
+from
+.Ar file
+.It Oo Ar n Oc Ns Li <> Ar file
+redirect stdin (or file descriptor
+.Ar n )
+to and from
+.Ar file
+.It Oo Ar n1 Oc Ns Li <& Ns Ar n2
+duplicate stdin (or file descriptor
+.Ar n1 )
+from file descriptor
+.Ar n2
+.It Oo Ar n Oc Ns Li <&-
+close stdin (or file descriptor
+.Ar n )
+.It Oo Ar n1 Oc Ns Li >& Ns Ar n2
+duplicate stdout (or file descriptor
+.Ar n1 )
+to file descriptor
+.Ar n2
+.It Oo Ar n Oc Ns Li >&-
+close stdout (or file descriptor
+.Ar n )
 .El
 .Pp
 The following redirection is often called a
 .Dq here-document .
-.Bd -literal -offset indent
-[n]<< delimiter
-	here-doc-text
-	...
-delimiter
+.Bd -unfilled -offset indent
+.Oo Ar n Oc Ns Li << Ar delimiter
+.D1 Ar here-doc-text
+.D1 ...
+.Ar delimiter
 .Ed
 .Pp
 All the text on successive lines up to the delimiter is
 saved away and made available to the command on standard
-input, or file descriptor n if it is specified.
-If the delimiter
-as specified on the initial line is quoted, then the here-doc-text
+input, or file descriptor
+.Ar n
+if it is specified.
+If the
+.Ar delimiter
+as specified on the initial line is quoted, then the
+.Ar here-doc-text
 is treated literally, otherwise the text is subjected to
 parameter expansion, command substitution, and arithmetic
 expansion (as described in the section on
@@ -554,7 +581,9 @@
 instead of
 .Dq Li << ,
 then leading tabs
-in the here-doc-text are stripped.
+in the
+.Ar here-doc-text
+are stripped.
 .Ss Search and Execution
 There are three types of commands: shell functions,
 built-in commands, and normal programs.
@@ -562,7 +591,9 @@
 The three types of commands are all executed in a different way.
 .Pp
 When a shell function is executed, all of the shell positional
-parameters (except $0, which remains unchanged) are
+parameters (except
+.Li $0 ,
+which remains unchanged) are
 set to the arguments of the shell function.
 The variables which are explicitly placed in the environment of
 the command (by placing assignments to them before the
@@ -583,11 +614,11 @@
 passing the arguments and the environment to the program.
 If the program is not a normal executable file
 (i.e., if it does not begin with the
-.Qq magic number
+.Dq "magic number"
 whose
 .Tn ASCII
 representation is
-.Qq #! ,
+.Dq Li #! ,
 resulting in an
 .Er ENOEXEC
 return value from
@@ -597,13 +628,16 @@
 so that the effect will be
 as if a new shell had been invoked to handle the ad-hoc shell script,
 except that the location of hashed commands located in
-the parent shell will be remembered by the child.
+the parent shell will be remembered by the child
+(see the description of the
+.Ic hash
+built-in command below).
 .Pp
 Note that previous versions of this document
 and the source code itself misleadingly and sporadically
 refer to a shell script without a magic number
 as a
-.Qq shell procedure .
+.Dq "shell procedure" .
 .Ss Path Search
 When locating a command, the shell first looks to see if
 it has a shell function by that name.
@@ -616,8 +650,9 @@
 Command names containing a slash are simply executed without
 performing any searches.
 .It
-The shell searches each entry in
+The shell searches each entry in the
 .Ev PATH
+environment variable
 in turn for the command.
 The value of the
 .Ev PATH
@@ -666,7 +701,8 @@
 that of the last simple command executed by the command.
 .Ss Pipelines
 A pipeline is a sequence of one or more commands separated
-by the control operator |.
+by the control operator
+.Ql \&| .
 The standard output of all but
 the last command is connected to the standard input
 of the next command.
@@ -675,10 +711,12 @@
 .Pp
 The format for a pipeline is:
 .Pp
-.Dl [!] command1 [ | command2 ...]
+.D1 Oo Li \&! Oc Ar command1 Op Li \&| Ar command2 ...
 .Pp
-The standard output of command1 is connected to the standard
-input of command2.
+The standard output of
+.Ar command1
+is connected to the standard input of
+.Ar command2 .
 The standard input, standard output, or
 both of a command is considered to be assigned by the
 pipeline before any redirection specified by redirection
@@ -704,22 +742,22 @@
 modified by redirection.
 For example:
 .Pp
-.Dl $ command1 2>&1 | command2
+.Dl "command1 2>&1 | command2"
 .Pp
 sends both the standard output and standard error of
-.Ql command1
+.Ar command1
 to the standard input of
-.Ql command2 .
+.Ar command2 .
 .Pp
 A
-.Dq Li \&;
+.Ql \&;
 or newline terminator causes the preceding
 AND-OR-list
 (described below in the section called
 .Sx Short-Circuit List Operators )
 to be executed sequentially;
 an
-.Dq Li &
+.Ql &
 causes asynchronous execution of the preceding AND-OR-list.
 .Pp
 Note that unlike some other shells,
@@ -738,12 +776,12 @@
 before executing the next command.
 .Pp
 The format for running a command in background is:
-.Bd -literal -offset indent
-command1 & [command2 & ...]
-.Ed
+.Pp
+.D1 Ar command1 Li & Op Ar command2 Li & Ar ...
 .Pp
 If the shell is not interactive, the standard input of an
-asynchronous command is set to /dev/null.
+asynchronous command is set to
+.Pa /dev/null .
 .Ss Lists (Generally Speaking)
 A list is a sequence of zero or more commands separated by
 newlines, semicolons, or ampersands,
@@ -773,22 +811,23 @@
 The syntax of the
 .Ic if
 command is:
-.\"
-.\" XXX Use .Dl to work around broken handling of .Ic inside .Bd and .Ed .
-.\"
-.Dl Ic if Ar list
-.Dl Ic then Ar list
-.Dl [ Ic elif Ar list
-.Dl Ic then Ar list ] ...
-.Dl [ Ic else Ar list ]
-.Dl Ic fi
+.Bd -unfilled -offset indent -compact
+.Ic if Ar list
+.Ic then Ar list
+.Oo Ic elif Ar list
+.Ic then Ar list Oc Ar ...
+.Op Ic else Ar list
+.Ic fi
+.Ed
 .Pp
 The syntax of the
 .Ic while
 command is:
-.Dl Ic while Ar list
-.Dl Ic do Ar list
-.Dl Ic done
+.Bd -unfilled -offset indent -compact
+.Ic while Ar list
+.Ic do Ar list
+.Ic done
+.Ed
 .Pp
 The two lists are executed repeatedly while the exit status of the
 first list is zero.
@@ -804,9 +843,11 @@
 The syntax of the
 .Ic for
 command is:
-.Dl Ic for Ar variable Op Ic in Ar word ...
-.Dl Ic do Ar list
-.Dl Ic done
+.Bd -unfilled -offset indent -compact
+.Ic for Ar variable Op Ic in Ar word ...
+.Ic do Ar list
+.Ic done
+.Ed
 .Pp
 If
 .Ic in
@@ -820,17 +861,17 @@
 and
 .Ic done
 commands may be replaced with
-.Dq Li {
+.Ql {
 and
-.Dq Li } .
+.Ql } .
 .Pp
 The syntax of the
 .Ic break
 and
 .Ic continue
 commands is:
-.Dl Ic break Op Ar num
-.Dl Ic continue Op Ar num
+.D1 Ic break Op Ar num
+.D1 Ic continue Op Ar num
 .Pp
 The
 .Ic break
@@ -848,18 +889,20 @@
 .Pp
 The syntax of the
 .Ic case
-command is
-.Dl Ic case Ar word Ic in
-.Dl pattern) list ;;
-.Dl ...
-.Dl Ic esac
+command is:
+.Bd -unfilled -offset indent -compact
+.Ic case Ar word Ic in
+.Ar pattern Ns Li ) Ar list Li ;;
+.Ar ...
+.Ic esac
+.Ed
 .Pp
 The pattern can actually be one or more patterns
 (see
 .Sx Shell Patterns
 described later),
 separated by
-.Dq Li \&|
+.Ql \&|
 characters.
 The exit code of the
 .Ic case
@@ -867,14 +910,12 @@
 zero if no patterns were matched.
 .Ss Grouping Commands Together
 Commands may be grouped by writing either
-.Bd -literal -offset indent
-(list)
-.Ed
+.Pp
+.D1 Li \&( Ns Ar list Ns Li \%)
 .Pp
 or
-.Bd -literal -offset indent
-{ list; }
-.Ed
+.Pp
+.D1 Li { Ar list Ns Li \&; }
 .Pp
 The first form executes the commands in a subshell.
 Note that built-in commands thus executed do not affect the current shell.
@@ -887,18 +928,21 @@
 .Ed
 .Ss Functions
 The syntax of a function definition is
-.Bd -literal -offset indent
-name ( ) command
-.Ed
+.Pp
+.D1 Ar name Li \&( \&) Ar command
 .Pp
 A function definition is an executable statement; when
-executed it installs a function named name and returns an
+executed it installs a function named
+.Ar name
+and returns an
 exit status of zero.
-The command is normally a list
+The
+.Ar command
+is normally a list
 enclosed between
-.Dq Li {
+.Ql {
 and
-.Dq Li } .
+.Ql } .
 .Pp
 Variables may be declared to be local to a function by
 using the
@@ -906,11 +950,8 @@
 command.
 This should appear as the first statement of a function,
 and the syntax is:
-.Bd -ragged -offset indent
-.Ic local
-.Op Ar variable ...
-.Op Fl
-.Ed
+.Pp
+.D1 Ic local Oo Ar variable ... Oc Op Fl
 .Pp
 The
 .Ic local
@@ -923,38 +964,38 @@
 Otherwise, the variable is initially unset.
 The shell
 uses dynamic scoping, so that if the variable
-.Em x
+.Va x
 is made local to function
 .Em f ,
 which then calls function
 .Em g ,
 references to the variable
-.Em x
+.Va x
 made inside
 .Em g
 will refer to the variable
-.Em x
+.Va x
 declared inside
 .Em f ,
 not to the global variable named
-.Em x .
+.Va x .
 .Pp
 The only special parameter that can be made local is
-.Dq Li - .
+.Ql - .
 Making
-.Dq Li -
+.Ql -
 local causes any shell options that are
-changed via the set command inside the function to be
+changed via the
+.Ic set
+command inside the function to be
 restored to their original values when the function
 returns.
 .Pp
 The syntax of the
 .Ic return
 command is
-.Bd -ragged -offset indent
-.Ic return
-.Op Ar exitstatus
-.Ed
+.Pp
+.D1 Ic return Op Ar exitstatus
 .Pp
 It terminates the current executional scope, returning from the previous
 nested function, sourced script, or shell instance, in that order.
@@ -969,9 +1010,8 @@
 the shell turns all the environment variables into shell
 variables.
 New variables can be set using the form
-.Bd -literal -offset indent
-name=value
-.Ed
+.Pp
+.D1 Ar name Ns = Ns Ar value
 .Pp
 Variables set by the user must have a name consisting solely
 of alphabetics, numerics, and underscores.
@@ -1001,12 +1041,10 @@
 the expansion occurs within a double-quoted string
 it expands to a single field with the value of each parameter
 separated by the first character of the
-.Ev IFS
+.Va IFS
 variable,
-or by a
-.Aq space
-if
-.Ev IFS
+or by a space if
+.Va IFS
 is unset.
 .It Li $@
 Expands to the positional parameters, starting from one.
@@ -1020,12 +1058,16 @@
 .Li @
 is double-quoted.
 What this basically means, for example, is
-if $1 is
-.Dq abc
-and $2 is
-.Dq def ghi ,
+if
+.Li $1
+is
+.Dq Li abc
+and
+.Li $2
+is
+.Dq Li "def ghi" ,
 then
-.Qq Li $@
+.Dq Li $@
 expands to
 the two arguments:
 .Bd -literal -offset indent
@@ -1033,18 +1075,22 @@
 .Ed
 .It Li $#
 Expands to the number of positional parameters.
-.It Li $\&?
+.It Li $?
 Expands to the exit status of the most recent pipeline.
 .It Li $-
 (hyphen) Expands to the current option flags (the single-letter
 option names concatenated into a string) as specified on
-invocation, by the set built-in command, or implicitly
+invocation, by the
+.Ic set
+built-in command, or implicitly
 by the shell.
 .It Li $$
 Expands to the process ID of the invoked shell.
 A subshell
-retains the same value of $ as its parent.
-.It Li $\&!
+retains the same value of
+.Va $
+as its parent.
+.It Li $!
 Expands to the process ID of the most recent background
 command executed from the current shell.
 For a
@@ -1067,7 +1113,7 @@
 fields from a single word.
 The single exception to this rule is
 the expansion of the special parameter
-.Li @
+.Va @
 within double-quotes,
 as was described above.
 .Pp
@@ -1079,7 +1125,7 @@
 .It
 Field Splitting is performed on fields generated by step (1)
 unless the
-.Ev IFS
+.Va IFS
 variable is null.
 .It
 Pathname Expansion (unless the
@@ -1090,7 +1136,7 @@
 .El
 .Pp
 The
-.Dq Li $
+.Ql $
 character is used to introduce parameter expansion, command
 substitution, or arithmetic evaluation.
 .Ss Tilde Expansion (substituting a user's home directory)
@@ -1103,30 +1149,34 @@
 or the end of the word are treated as a username
 and are replaced with the user's home directory.
 If the
-username is missing (as in ~/foobar), the tilde is replaced
-with the value of the HOME variable (the current user's
-home directory).
+username is missing (as in
+.Pa ~/foobar ) ,
+the tilde is replaced with the value of the
+.Ev HOME
+variable (the current user's home directory).
 .Ss Parameter Expansion
 The format for parameter expansion is as follows:
-.Bd -literal -offset indent
-${expression}
-.Ed
+.Pp
+.D1 Li ${ Ns Ar expression Ns Li }
 .Pp
-where expression consists of all characters until the matching
-.Dq Li } .
+where
+.Ar expression
+consists of all characters until the matching
+.Ql } .
 Any
-.Dq Li }
+.Ql }
 escaped by a backslash or within a quoted string, and characters in
 embedded arithmetic expansions, command substitutions, and variable
 expansions, are not examined in determining the matching
-.Dq Li } .
+.Ql } .
 .Pp
 The simplest form for parameter expansion is:
-.Bd -literal -offset indent
-${parameter}
-.Ed
+.Pp
+.D1 Li ${ Ns Ar parameter Ns Li }
 .Pp
-The value, if any, of parameter is substituted.
+The value, if any, of
+.Ar parameter
+is substituted.
 .Pp
 The parameter name or symbol can be enclosed in braces, which are
 optional except for positional parameters with more than one digit or
@@ -1140,57 +1190,71 @@
 .It
 Field splitting is not performed on the results of the
 expansion, with the exception of the special parameter
-.Li @ .
+.Va @ .
 .El
 .Pp
 In addition, a parameter expansion can be modified by using one of the
 following formats.
 .Bl -tag -width indent
-.It Li ${parameter:-word}
+.It Li ${ Ns Ar parameter Ns Li :- Ns Ar word Ns Li }
 Use Default Values.
-If parameter is unset or
-null, the expansion of word is
-substituted; otherwise, the value of
-parameter is substituted.
-.It Li ${parameter:=word}
+If
+.Ar parameter
+is unset or null, the expansion of
+.Ar word
+is substituted; otherwise, the value of
+.Ar parameter
+is substituted.
+.It Li ${ Ns Ar parameter Ns Li := Ns Ar word Ns Li }
 Assign Default Values.
-If parameter is unset
-or null, the expansion of word is
-assigned to parameter.
+If
+.Ar parameter
+is unset or null, the expansion of
+.Ar word
+is assigned to

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712060420.lB64KqUp029311>