Skip to content

Commit 99161c5

Browse files
author
coronary
committed
format(docs): replace escaped special characters
1 parent 4166a76 commit 99161c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+244
-244
lines changed

docs/commands/builtin/declare.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ RHS.
138138
sum total a b c
139139
printf 'Final value of "total" is: %d\n' "$total"
140140

141-
\<div hide\> function sum {
141+
<div hide> function sum {
142142

143143
typeset -n _result=$1
144144
shift
@@ -153,7 +153,7 @@ RHS.
153153
}
154154

155155
a=(1 2 3); b=(6 5 4); c=(2 4 6) sum total a b c printf \'Final value of
156-
\"total\" is: %d\\n\' \"\$total\" \</div\>
156+
\"total\" is: %d\\n\' \"\$total\" </div>
157157

158158
`typeset -n` is currently implemented in ksh93, mksh, and Bash 4.3. Bash
159159
and mksh's implementations are quite similar, but much different from

docs/commands/builtin/eval.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ controlled carefully by the caller is a good way to use it.
109109
~~ksh93~~ and zsh don't do this properly
110110
([fixed](http://article.gmane.org/gmane.comp.programming.tools.ast.devel/686)
111111
in ksh 93v- 2012-10-24 alpha). Earlier versions of zsh work (with
112-
`setopt POSIX_BUILTINS` \-- looks like a regression). This works
112+
`setopt POSIX_BUILTINS` -- looks like a regression). This works
113113
correctly in Bash POSIX mode, Dash, and mksh.
114114

115115
```{=html}
@@ -161,14 +161,14 @@ identical to those of [let](../../commands/builtin/let.md).
161161
## See also
162162

163163
- [BashFAQ 48 - eval and security
164-
issues](http://mywiki.wooledge.org/BashFAQ/048) \-- **IMPORTANT**
164+
issues](http://mywiki.wooledge.org/BashFAQ/048) -- **IMPORTANT**
165165
- [Another eval
166166
article](http://fvue.nl/wiki/Bash:_Why_use_eval_with_variable_expansion%3F)
167167
- [Indirection via
168168
eval](http://mywiki.wooledge.org/BashFAQ/006#Assigning_indirect.2BAC8-reference_variables)
169169
- [More indirection via
170170
eval](http://fvue.nl/wiki/Bash:_Passing_variables_by_reference)
171-
- [Martin Väth's \"push\"](https://github.com/vaeth/push) \--
171+
- [Martin Väth's \"push\"](https://github.com/vaeth/push) --
172172
`printf %q` work-alike for POSIX.
173173
- [The \"magic alias\"
174174
hack](http://www.chiark.greenend.org.uk/~sgtatham/aliases.html)

docs/commands/builtin/let.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ command](../../syntax/ccmd/arithmetic_eval.md):
4141
$ echo "$a - $b - $?"
4242
4 - 2 - 0
4343

44-
\<WRAP info\> Remember that inside arithmetic evaluation contexts, all
44+
<WRAP info> Remember that inside arithmetic evaluation contexts, all
4545
other expansions are processed as usual (from left-to-right), and the
4646
resulting text is evaluated as an arithmetic expression. Arithmetic
4747
already has a way to control precedence using parentheses, so it's very
4848
rare to need to nest arithmetic expansions within one another. It's
49-
used above only to illustrate how this precedence works. \</WRAP\>
49+
used above only to illustrate how this precedence works. </WRAP>
5050

5151
Unlike `((`, being a simple command `let` has its own environment. In
5252
Bash, built-ins that can set variables process any arithmetic under

docs/commands/builtin/mapfile.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ illustrates the callback behavior:
121121

122122
Since redirects are syntactically allowed anywhere in a command, we put
123123
it before the printf to stay out of the way of additional arguments.
124-
Rather than opening \"outfile\<n\>\" for appending on each call by
124+
Rather than opening \"outfile<n>\" for appending on each call by
125125
calculating the filename, open an FD for each first and calculate which
126126
FD to send output to by measuring the size of x mod 2. The zero-width
127127
format specification is used to absorb the index number argument.

docs/commands/builtin/printf.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# The printf command
22

3-
\<div center round todo box 70%\> FIXME Stranger, this is a very big
3+
<div center round todo box 70%> FIXME Stranger, this is a very big
44
topic that needs experience - please fill in missing information, extend
5-
the descriptions, and correct the details if you can! \</div\> \<div
6-
center round tip 70%\> [**Attention:**]{.underline} This is about the
5+
the descriptions, and correct the details if you can! </div> <div
6+
center round tip 70%> [**Attention:**]{.underline} This is about the
77
Bash-builtin command `printf` - however, the description should be
88
nearly identical for an external command that follows POSIX(r).
99

1010
[GNU Awk](http://www.gnu.org/software/gawk/manual/gawk.html#Printf)
1111
expects a comma after the format string and between each of the
1212
arguments of a **printf** command. For examples, see: [code
13-
snippet](../../printf?&.md#using_printf_inside_of_awk). \</div\>
13+
snippet](../../printf?&.md#using_printf_inside_of_awk). </div>
1414

1515
Unlike other documentations, I don't want to redirect you to the manual
1616
page for the `printf()` C function family. However, if you\'re more
@@ -57,7 +57,7 @@ argument!).
5757
The `-v` Option can't assign directly to array indexes in Bash versions
5858
older than Bash 4.1.
5959

60-
\<note warning\> In versions newer than 4.1, one must be careful when
60+
<note warning> In versions newer than 4.1, one must be careful when
6161
performing expansions into the first non-option argument of printf as
6262
this opens up the possibility of an easy code injection vulnerability.
6363

@@ -66,11 +66,11 @@ this opens up the possibility of an easy code injection vulnerability.
6666
declare -a x='([0]="hi")'
6767

6868
\...where the echo can of course be replaced with any arbitrary command.
69-
If you must, either specify a hard-coded format string or use \-- to
69+
If you must, either specify a hard-coded format string or use -- to
7070
signal the end of options. The exact same issue also applies to
7171
[read](../../commands/builtin/read.md), and a similar one to
7272
[mapfile](../../commands/builtin/mapfile.md), though performing expansions into
73-
their arguments is less common. \</note\>
73+
their arguments is less common. </note>
7474

7575
### Arguments
7676

@@ -97,15 +97,15 @@ Take care to avoid [word splitting](../../syntax/expansion/wordsplit.md), as
9797
accidentally passing the wrong number of arguments can produce wildly
9898
different and unexpected results. See [this article](../../syntax/words.md).
9999

100-
\<note warning\> [**Again, attention:**]{.underline} When a numerical
100+
<note warning> [**Again, attention:**]{.underline} When a numerical
101101
format expects a number, the internal `printf`-command will use the
102102
common Bash arithmetic rules regarding the base. A command like the
103103
following example **will** throw an error, since `08` is not a valid
104104
octal number (`00` to `07`!):
105105

106106
printf '%d\n' 08
107107

108-
\</note\>
108+
</note>
109109

110110
### Format strings
111111

@@ -216,8 +216,8 @@ argument corresponding to a `%b` format.
216216
`\v` Prints a vertical tabulator
217217
`\"` Prints a `'`
218218
`\?` Prints a `?`
219-
`\<NNN>` Interprets `<NNN>` as **octal** number and prints the corresponding character from the character set
220-
`\0<NNN>` same as `\<NNN>`
219+
`<NNN>` Interprets `<NNN>` as **octal** number and prints the corresponding character from the character set
220+
`\0<NNN>` same as `<NNN>`
221221
`\x<NNN>` Interprets `<NNN>` as **hexadecimal** number and prints the corresponding character from the character set (**3 digits**)
222222
`\u<NNNN>` same as `\x<NNN>`, but **4 digits**
223223
`\U<NNNNNNNN>` same as `\x<NNN>`, but **8 digits**
@@ -412,7 +412,7 @@ fmt++;
412412
system's `/usr/bin/printf` or equivalent. The mksh maintainer
413413
recommends using `print`. The development version (post- R40f) adds
414414
a new parameter expansion in the form of `${name@Q}` which fills the
415-
role of `printf %q` \-- expanding in a shell-escaped format.
415+
role of `printf %q` -- expanding in a shell-escaped format.
416416

417417
```{=html}
418418
<!-- -->

docs/commands/builtin/read.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If `<NAME...>` is given, the line is word-split using
2020
`<NAME>`. The remaining words are all assigned to the last `<NAME>` if
2121
more words than variable names are present.
2222

23-
\<WRAP center round info 90%\> If no `<NAME>` is given, the whole line
23+
<WRAP center round info 90%> If no `<NAME>` is given, the whole line
2424
read (without performing word-splitting!) is assigned to the shell
2525
variable [REPLY](../../syntax/shellvars.md#REPLY). Then, `REPLY` really contains
2626
the line as it was read, without stripping pre- and postfix spaces and
@@ -30,7 +30,7 @@ other things!
3030
printf '"%s"\n' "$REPLY"
3131
done <<<" a line with prefix and postfix space "
3232

33-
\</WRAP\>
33+
</WRAP>
3434

3535
If a timeout is given, or if the shell variable
3636
[TMOUT](../../syntax/shellvars.md#TMOUT) is set, it is counted from initially
@@ -61,7 +61,7 @@ Of course it's valid to set individual array elements without using
6161

6262
read MYARRAY[5]
6363

64-
\<WRAP center round important 90%\>
64+
<WRAP center round important 90%>
6565

6666
Reading into array elements using the syntax above **may cause [pathname
6767
expansion](../../syntax/expansion/globs.md) to occur**.
@@ -81,7 +81,7 @@ array name and index:
8181

8282
read 'x[1]'
8383

84-
\</WRAP\>
84+
</WRAP>
8585

8686
### Return status
8787

@@ -90,7 +90,7 @@ array name and index:
9090
0 no error
9191
0 error when assigning to a read-only variable [^1]
9292
2 invalid option
93-
\>128 timeout (see `-t`)
93+
>128 timeout (see `-t`)
9494
!=0 invalid filedescriptor supplied to `-u`
9595
!=0 end-of-file reached
9696

docs/commands/builtin/set.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ set flags (true for most commands on UNIX(r)).
4141
`-v` `verbose` Print shell input lines as they are read - useful for debugging.
4242
`-x` `xtrace` Print commands just before execution - with all expansions and substitutions done, and words marked - useful for debugging.
4343
`-B` `braceexpand` The shell performs [brace expansion](../../syntax/expansion/brace.md) This is on by default.
44-
`-C` \<BOOKMARK:tag_noclobber\>`noclobber` Don't overwrite files on redirection operations. You can override that by specifying the `>|` redirection operator when needed. See [redirection](../../syntax/redirection.md)
44+
`-C` <BOOKMARK:tag_noclobber>`noclobber` Don't overwrite files on redirection operations. You can override that by specifying the `>|` redirection operator when needed. See [redirection](../../syntax/redirection.md)
4545
`-E` `errtrace` `ERR`-traps are inherited by by shell functions, command substitutions, and commands executed in a subshell environment.
4646
`-H` `histexpand` Enable `!`-style history expansion. Defaults to `on` for interactive shells.
4747
`-P` `physical` Don't follow symlinks when changing directories - use the physical filesystem structure.

docs/commands/builtin/shift.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,26 @@ There are no options.
6363
dash: 1: shift: can't shift that many
6464
` In most shells, you can work around this problem using the
6565
[command](../../commands/builtin/command.md) builtin to suppress fatal
66-
errors caused by *special builtins*. \<code\> \$ dash -c \'f() { if
67-
command shift 2\>/dev/null; then echo \"\$1\"; else echo \"no
66+
errors caused by *special builtins*. <code> \$ dash -c \'f() { if
67+
command shift 2>/dev/null; then echo \"\$1\"; else echo \"no
6868
args\"; fi; }; f\'
6969

70-
no args \</code\> While, POSIX requires this behavior, it isn't very
70+
no args </code> While, POSIX requires this behavior, it isn't very
7171
obvious and some shells don't do it correctly. To work around this, you
7272
can use something like:
7373

74-
\<code\> \$ mksh -c \'f() { if ! \${1+false} && shift; then echo
75-
\"\$1\"; else echo \"no args\"; fi; }; f\' no args \</code\> ~~The mksh
74+
<code> \$ mksh -c \'f() { if ! \${1+false} && shift; then echo
75+
\"\$1\"; else echo \"no args\"; fi; }; f\' no args </code> ~~The mksh
7676
maintainer refuses to change either the `shift` or `command` builtins.~~
7777
[Fixed](https://github.com/MirBSD/mksh/commit/996e05548ab82f7ef2dea61f109cc7b6d13837fa).
7878
(Thanks!)
7979

8080
- Perhaps almost as bad as the above, busybox sh's `shift` always
8181
returns success, even when attempting to shift beyond the final
82-
argument. \<code\> \$ bb -c \'f() { if shift; then echo \"\$1\";
82+
argument. <code> \$ bb -c \'f() { if shift; then echo \"\$1\";
8383
else echo \"no args\"; fi; }; f\'
8484

85-
(no output) \</code\> The above mksh workaround will work in this case
85+
(no output) </code> The above mksh workaround will work in this case
8686
too.
8787

8888
## See also

0 commit comments

Comments
 (0)