Tue Mar 13 20:48:00 2018 UTC ()
Fix horrendous markup abuse in the here-document example.
Consistently spell "here-document" in full.


(uwe)
diff -r1.183 -r1.184 src/bin/sh/sh.1

cvs diff -r1.183 -r1.184 src/bin/sh/sh.1 (expand / switch to unified diff)

--- src/bin/sh/sh.1 2018/03/13 20:40:52 1.183
+++ src/bin/sh/sh.1 2018/03/13 20:48:00 1.184
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sh.1,v 1.183 2018/03/13 20:40:52 uwe Exp $ 1.\" $NetBSD: sh.1,v 1.184 2018/03/13 20:48:00 uwe Exp $
2.\" Copyright (c) 1991, 1993 2.\" Copyright (c) 1991, 1993
3.\" The Regents of the University of California. All rights reserved. 3.\" The Regents of the University of California. All rights reserved.
4.\" 4.\"
5.\" This code is derived from software contributed to Berkeley by 5.\" This code is derived from software contributed to Berkeley by
6.\" Kenneth Almquist. 6.\" Kenneth Almquist.
7.\" 7.\"
8.\" Redistribution and use in source and binary forms, with or without 8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions 9.\" modification, are permitted provided that the following conditions
10.\" are met: 10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright 11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer. 12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the 14.\" notice, this list of conditions and the following disclaimer in the
@@ -890,67 +890,67 @@ Duplicate standard output (or @@ -890,67 +890,67 @@ Duplicate standard output (or
890to 890to
891.Ar n2 . 891.Ar n2 .
892.It Oo Ar n Oc Ns >&- 892.It Oo Ar n Oc Ns >&-
893Close standard output (or n). 893Close standard output (or n).
894.It Oo Ar n Oc Ns <> Ar file 894.It Oo Ar n Oc Ns <> Ar file
895Open 895Open
896.Ar file 896.Ar file
897for reading and writing on standard input (or 897for reading and writing on standard input (or
898.Ar n ) . 898.Ar n ) .
899.El 899.El
900.Pp 900.Pp
901The following redirection is often called a 901The following redirection is often called a
902.Dq here-document . 902.Dq here-document .
903.Bl -item -offset indent 903.Bd -literal -offset indent
904.It 904[n]<< delimiter
905.Li [n]<< delimiter 905\&... here-doc-text ...
906.Dl here-doc-text ... 906delimiter
907.Li delimiter 907.Ed
908.El 
909.Pp 908.Pp
910The 909The
911.Dq here-doc-text 910.Dq here-doc-text
912starts immediately after the next unquoted newline character following 911starts immediately after the next unquoted newline character following
913the here-doc redirection operator. 912the here-document redirection operator.
914If there is more than one here-document redirection on the same 913If there is more than one here-document redirection on the same
915line, then the text for the first (from left to right) is read 914line, then the text for the first (from left to right) is read
916first, and subsequent here-doc-text for later here-doc redirections 915first, and subsequent here-doc-text for later here-document redirections
917follows immediately after, until all such redirections have been 916follows immediately after, until all such redirections have been
918processed. 917processed.
919.Pp 918.Pp
920All the text on successive lines up to the delimiter, 919All the text on successive lines up to the delimiter,
921which must appear on a line by itself, with nothing other 920which must appear on a line by itself, with nothing other
922than an immediately following newline, is 921than an immediately following newline, is
923saved away and made available to the command on standard input, or file 922saved away and made available to the command on standard input, or file
924descriptor n if it is specified. 923descriptor n if it is specified.
925If the delimiter as specified on the initial line is 924If the delimiter as specified on the initial line is
926quoted, then the here-doc-text is treated literally; otherwise, the text is 925quoted, then the here-doc-text is treated literally; otherwise, the text is
927treated much like a double quoted string, except that 926treated much like a double quoted string, except that
928.Sq \&" 927.Sq \&"
929characters have no special meaning, and are not escaped by 928characters have no special meaning, and are not escaped by
930.Sq \&\e , 929.Sq \&\e ,
931and is subjected to parameter expansion, command substitution, and arithmetic 930and is subjected to parameter expansion, command substitution, and arithmetic
932expansion as described in the 931expansion as described in the
933.Sx Word Expansions 932.Sx Word Expansions
934section below. 933section below.
935If the operator is 934If the operator is
936.Dq <<\(mi 935.Dq <<\(mi
937instead of 936instead of
938.Dq << , 937.Dq << ,
939then leading tabs in all lines in the here-doc-text, including before the 938then leading tabs in all lines in the here-doc-text, including before the
940end delimiter, are stripped. 939end delimiter, are stripped.
941If the delimiter is not quoted, lines in here-doc-text that end with 940If the delimiter is not quoted, lines in here-doc-text that end with
942an unquoted \e are joined to the following line, the \e and following 941an unquoted \e are joined to the following line, the \e and following
943newline are simply removed while reading the here-doc, which thus guarantees 942newline are simply removed while reading the here-document,
 943which thus guarantees
944that neither of those lines can be the end delimiter. 944that neither of those lines can be the end delimiter.
945.Pp 945.Pp
946It is a syntax error for the end of the input file (or string) to be 946It is a syntax error for the end of the input file (or string) to be
947reached before the delimiter is encountered. 947reached before the delimiter is encountered.
948.Ss Search and Execution 948.Ss Search and Execution
949There are three types of commands: shell functions, built-in commands, and 949There are three types of commands: shell functions, built-in commands, and
950normal programs \(em and the command is searched for (by name) in that order. 950normal programs \(em and the command is searched for (by name) in that order.
951A command that contains a slash 951A command that contains a slash
952.Sq \&/ 952.Sq \&/
953in its name is always a normal program. 953in its name is always a normal program.
954They each are executed in a different way. 954They each are executed in a different way.
955.Pp 955.Pp
956When a shell function is executed, all of the shell positional parameters 956When a shell function is executed, all of the shell positional parameters