[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/25] Style redirection operators consistently.
From: |
G. Branden Robinson |
Subject: |
[PATCH 25/25] Style redirection operators consistently. |
Date: |
Thu, 21 Nov 2024 22:24:10 -0600 |
In bash.1, set them in bold like other operators in this document. Also
escape their hyphens. Use `Q` local quotation macro to quote individual
characters of a redirection operator where these are called out for
discussion. This is also a better parallel with bashref.texi's use of
the Texinfo `samp` command to present the same material.
In bashref.texi, use the Texinfo `code` command to set redirection
operators. The document doesn't seem to be strongly consistent in
preferring either of `samp` or `code` for operators; as I understand
Texinfo, `code` would be more idiomatic. (But the way Texinfo formats
for plain text output is often a source of frustration when documenting
programming languages.)
Break lines in the same places in both documents for easier diffing and
future maintenance.
---
doc/bash.1 | 21 +++++++++++++--------
doc/bashref.texi | 23 ++++++++++++++---------
2 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/doc/bash.1 b/doc/bash.1
index 2031de7b..0cda85ff 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -4461,9 +4461,15 @@ .SH REDIRECTION
Each redirection that may be preceded by a file descriptor number
may instead be preceded by a word of the form {\fIvarname\fP}.
In this case, for each redirection operator except
->&- and <&-, the shell will allocate a file descriptor greater
+.B >&\-
+and
+.BR <&\- ,
+the shell will allocate a file descriptor greater
than or equal to 10 and assign it to \fIvarname\fP.
-If {\fIvarname\fP} precedes >&- or <&-,
+If {\fIvarname\fP} precedes
+.B >&\-
+or
+.BR <&\- ,
the value of \fIvarname\fP defines the file descriptor to close.
If {\fIvarname\fP} is supplied, the redirection persists beyond
the scope of the command, which allows the shell programmer to manage
@@ -4473,12 +4479,11 @@ .SH REDIRECTION
.PP
In the following descriptions, if the file descriptor number is
omitted, and the first character of the redirection operator is
-.BR < ,
-the redirection refers to the standard input (file descriptor
-0). If the first character of the redirection operator is
-.BR > ,
-the redirection refers to the standard output (file descriptor
-1).
+.Q < ,
+the redirection refers to the standard input (file descriptor 0).
+If the first character of the redirection operator is
+.Q > ,
+the redirection refers to the standard output (file descriptor 1).
.PP
The \fIword\fP following the redirection operator in the following
descriptions, unless otherwise noted, is subjected to
diff --git a/doc/bashref.texi b/doc/bashref.texi
index 17c642ce..8af08256 100644
--- a/doc/bashref.texi
+++ b/doc/bashref.texi
@@ -3193,11 +3193,16 @@ @node Top
Each redirection that may be preceded by a file descriptor number
may instead be preceded by a word of the form @{@var{varname}@}.
In this case, for each redirection operator except
->&- and <&-, the shell allocates a file descriptor greater
+@code{>&-}
+and
+@code{<&-},
+the shell allocates a file descriptor greater
than 10 and assigns it to @{@var{varname}@}.
-If @{@var{varname}@} precedes >&- or <&-,
-the value of @var{varname} defines the file
-descriptor to close.
+If @{@var{varname}@} precedes
+@code{>&-}
+or
+@code{<&-},
+the value of @var{varname} defines the file descriptor to close.
If @{@var{varname}@} is supplied, the redirection persists beyond
the scope of the command, which allows the shell programmer to manage
the file descriptor's lifetime manually without using
@@ -3207,11 +3212,11 @@ @node Top
In the following descriptions, if the file descriptor number is
omitted, and the first character of the redirection operator is
-@samp{<}, the redirection refers to the standard input (file
-descriptor 0).
-If the first character of the redirection operator
-is @samp{>}, the redirection refers to the standard output (file
-descriptor 1).
+@samp{<},
+the redirection refers to the standard input (file descriptor 0).
+If the first character of the redirection operator is
+@samp{>},
+the redirection refers to the standard output (file descriptor 1).
The @var{word} following the redirection operator in the following
descriptions, unless otherwise noted, is subjected to
--
2.30.2
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 25/25] Style redirection operators consistently.,
G. Branden Robinson <=