Skip to content

Commit 6cfac9a

Browse files
authored
Merge pull request #20 from sahal/main
More table formatting fixes along with some extra formatting fixes for free
2 parents 5fdf713 + 2849f0a commit 6cfac9a

File tree

21 files changed

+393
-419
lines changed

21 files changed

+393
-419
lines changed

docs/commands/builtin/cd.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ is given or the shell is configured to do so (see the `-P` option of
2626

2727
### Options
2828

29-
Option Description
30-
-------- ----------------------------------------------------
31-
`-L` Follow symbolic links (default)
32-
`-P` Do not follow symbolic links
33-
`-@` Browse a file's extended attributed, if supported
29+
|Option|Description|
30+
|------|-----------|
31+
|`-L`|Follow symbolic links (default)|
32+
|`-P`|Do not follow symbolic links|
33+
|`-@`|Browse a file's extended attributed, if supported|
3434

3535
### Exit status
3636

docs/commands/builtin/declare.md

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,54 +30,36 @@ tagged as obsolete.
3030
Below, `[-+]X` indicates an attribute, use `-X` to set the attribute,
3131
`+X` to remove it.
3232

33-
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
34-
Option Description
35-
--------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------
36-
`[-+]a` make NAMEs indexed arrays (removing with `+a` is valid syntax, but leads to an error message)
37-
38-
`[-+]A` make NAMEs associative arrays
39-
40-
`[-+]c` **Undocumented** convert NAMEs to "capcase" on assignment (makes the first letter upper-case and the rest lower). Requires Bash built with `-DCASEMOD_CAPCASE`
41-
42-
`-f` restrict action or display to function names and definitions (removing with `+f` is valid syntax, but leads to an error message)
43-
44-
`-F` restrict display to function names only (plus line number and source file when debugging)
45-
46-
`-g` create global variables when used in a shell function; otherwise ignored (by default, `declare` declares local scope variables when used in shell functions)
47-
48-
`[-+]i` make NAMEs have the "integer" attribute
49-
50-
`[-+]l` convert NAMEs to lower case on assignment (makes sure the variable contains only lower case letters)
51-
52-
`[-+]n` make NAME a reference to the variable named by its value. Introduced in Bash 4.3-alpha.
53-
''`${!NAME}`'' reveals the reference variable name, VALUE.
54-
Use `unset -n NAME` to unset the variable. (`unset -v NAME` unsets the VALUE variable.)
55-
Use `[[ -R NAME ]]` to test if NAME has been set to a VALUE, another variable's name.
56-
57-
`-p` display the attributes and value of each NAME
58-
59-
`[-+]r` make NAMEs readonly (removing with `+r` is valid syntax, but not possible)
60-
61-
`[-+]t` make NAMEs have the "trace" attribute (effective only for functions)
62-
63-
`[-+]u` convert NAMEs to upper case on assignment (makes sure the variable contains only upper case letters)
64-
65-
`[-+]x` make NAMEs exported
66-
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
33+
|Option|Description|
34+
|------|-----------|
35+
|`[-+]a`|make NAMEs indexed arrays (removing with `+a` is valid syntax, but leads to an error message)|
36+
|`[-+]A`|make NAMEs associative arrays|
37+
|`[-+]c`|**Undocumented** convert NAMEs to "capcase" on assignment (makes the first letter upper-case and the rest lower). Requires Bash built with `-DCASEMOD_CAPCASE`|
38+
|`-f`|restrict action or display to function names and definitions (removing with `+f` is valid syntax, but leads to an error message)|
39+
|`-F`|restrict display to function names only (plus line number and source file when debugging)|
40+
|`-g`|create global variables when used in a shell function; otherwise ignored (by default, `declare` declares local scope variables when used in shell functions)|
41+
|`[-+]i`|make NAMEs have the "integer" attribute|
42+
|`[-+]l`|convert NAMEs to lower case on assignment (makes sure the variable contains only lower case letters)|
43+
|`[-+]n`|make NAME a reference to the variable named by its value. Introduced in Bash 4.3-alpha. ''`${!NAME}`'' reveals the reference variable name, VALUE. Use `unset -n NAME` to unset the variable. (`unset -v NAME` unsets the VALUE variable.) Use `[[ -R NAME ]]` to test if NAME has been set to a VALUE, another variable's name.|
44+
|`-p`|display the attributes and value of each NAME|
45+
|`[-+]r`|make NAMEs readonly (removing with `+r` is valid syntax, but not possible)|
46+
|`[-+]t`|make NAMEs have the "trace" attribute (effective only for functions)|
47+
|`[-+]u`|convert NAMEs to upper case on assignment (makes sure the variable contains only upper case letters)|
48+
|`[-+]x`|make NAMEs exported|
6749

6850
### Return status
6951

70-
Status Reason
71-
-------- ----------------------------------------------------------------------------------------
72-
0 no error
73-
!= 0 invalid option
74-
!= 0 invalid variable name given
75-
!= 0 attempt to **define** a function using `-f`
76-
!= 0 assignment to a readonly variable
77-
!= 0 removing the readonly-attribute from a readonly variable
78-
!= 0 assignment to an array variable without the compound assignment syntax (`array=(...)`)
79-
!= 0 attempt to use `+a` to "destroy" an array
80-
!= 0 attemt to display a non-existent function with `-f`
52+
|Status|Reason|
53+
|------|------|
54+
|0|no error|
55+
|!= 0|invalid option|
56+
|!= 0|invalid variable name given|
57+
|!= 0|attempt to **define** a function using `-f`|
58+
|!= 0|assignment to a readonly variable|
59+
|!= 0|removing the readonly-attribute from a readonly variable|
60+
|!= 0|assignment to an array variable without the compound assignment syntax (`array=(...)`)|
61+
|!= 0|attempt to use `+a` to "destroy" an array|
62+
|!= 0|attemt to display a non-existent function with `-f`|
8163

8264
## Notes
8365

docs/commands/builtin/echo.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@ if given.
1616

1717
### Options
1818

19-
Option Description
20-
-------- ----------------------------------------------------------------------------------------------------------------
21-
`-n` The trailing newline is suppressed.
22-
`-e` Interpretation of the following backslash-escaped characters (below) is enabled.
23-
`-E` Disables the interpretation of these escape characters, even on systems where they are interpreted by default.
19+
Option|Description|
20+
------|-----------|
21+
|`-n`|The trailing newline is suppressed.|
22+
|`-e`|Interpretation of the following backslash-escaped characters (below) is enabled.|
23+
|`-E`|Disables the interpretation of these escape characters, even on systems where they are interpreted by default.|
2424

2525
### Escape sequences
2626

27-
Escape Description
28-
-------------- ---------------------------------------------------------------------------------------------------------------
29-
`\a` alert (bell)
30-
`\b` backspace
31-
`\c` suppress further output
32-
`\e`
33-
`\E` an escape character
34-
`\f` form feed
35-
`\n` new line
36-
`\r` carriage return
37-
`\t` horizontal tab
38-
`\v` vertical tab
39-
`\\` backslash
40-
`\0nnn` the eight-bit character whose value is the octal value nnn (zero to three octal digits)
41-
`\xHH` the eight-bit character whose value is the hexadecimal value HH (one or two hex digits)
42-
`\uHHHH` the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits)
43-
`\UHHHHHHHH` the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits)
27+
|Escape|Description|
28+
|------|-----------|
29+
|`\a`|alert (bell)|
30+
|`\b`|backspace|
31+
|`\c`|suppress further output|
32+
|`\e`|
33+
|`\E`|an escape character|
34+
|`\f`|form feed|
35+
|`\n`|new line|
36+
|`\r`|carriage return|
37+
|`\t`|horizontal tab|
38+
|`\v`|vertical tab|
39+
|`\\`|backslash|
40+
|`\0nnn`|the eight-bit character whose value is the octal value nnn (zero to three octal digits)|
41+
|`\xHH`|the eight-bit character whose value is the hexadecimal value HH (one or two hex digits)|
42+
|`\uHHHH`|the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits)|
43+
|`\UHHHHHHHH`|the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits)|
4444

4545
## Examples
4646

docs/commands/builtin/exec.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ shell without executing any program.
1717

1818
### Options
1919

20-
Option Description
21-
----------- ----------------------------------------------------------------------------------------------------------------------
22-
`-a NAME` Passes `NAME` as zeroth argument for the program to be executed
23-
`-c` Execute the program with an empty (cleared) environment
24-
`-l` Prepends a dash (`-`) to the zeroth argument of the program to be executed, similar to what the `login` program does
20+
|Option|Description|
21+
|------|-----------|
22+
|`-a NAME`|Passes `NAME` as zeroth argument for the program to be executed|
23+
|`-c`|Execute the program with an empty (cleared) environment|
24+
|`-l`|Prepends a dash (`-`) to the zeroth argument of the program to be executed, similar to what the `login` program does|
2525

2626
### Exit status
2727

docs/commands/builtin/exit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ There are no options.
2525
Naturally, you can't ask for the exit status from within the shell that
2626
executed the `exit` command, because the shell exits.
2727

28-
Status Reason
29-
-------- ----------------------------------------------------------------------------
30-
255 invalid (e.g. non-numeric) argument - this staus is returned to the parent
28+
|Status|Reason|
29+
|------|------|
30+
|255|invalid (e.g. non-numeric) argument - this staus is returned to the parent|
3131

3232
## Examples
3333

docs/commands/builtin/export.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ it.
1414

1515
### Options
1616

17-
Option Description
18-
-------- ------------------------------------------------------------------------------------------------------------
19-
`-f` refer to shell functions
20-
`-n` remove the export property from any referenced `NAME`
21-
`-p` print all exported variables, with `-f`, print all exported functions - all in a format re-usable as input
17+
|Option|Description|
18+
|------|-----------|
19+
|`-f`|refer to shell functions|
20+
|`-n`|remove the export property from any referenced `NAME`|
21+
|`-p`|print all exported variables, with `-f`, print all exported functions - all in a format re-usable as input|
2222

2323
An argument of `--` disables further option processing.
2424

2525
### Return status
2626

27-
Status Reason
28-
-------- ---------------------------
29-
0 no error
30-
!=0 invalid option
31-
!=0 a given `NAME` is invalid
27+
|Status|Reason|
28+
|------|------|
29+
|0|no error|
30+
|!=0|invalid option|
31+
|!=0|a given `NAME` is invalid|
3232

3333
## Examples
3434

docs/commands/builtin/kill.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ external `kill` command of the operating system to
3232

3333
### Options
3434

35-
Option Description
36-
------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
37-
`-s SIGNAL` specifies the signal to send
38-
`-n SIGNALNUMBER` specifies the signal to send
39-
`-SIGNAL` specifies the signal to send
40-
`-l [SIGNAL...]` Lists supported/known signal numbers and their symbolic name. If `SIGNAL` is given, only list this signal, translated (if a number is given the symbolic name is printed, and vice versa)
41-
`-L [SIGNAL...]` Same as `-l [SIGNAL]` (compatiblity option)
35+
|Option|Description|
36+
|------|-----------|
37+
|`-s SIGNAL`|specifies the signal to send|
38+
|`-n SIGNALNUMBER`|specifies the signal to send|
39+
|`-SIGNAL`|specifies the signal to send|
40+
|`-l [SIGNAL...]`|Lists supported/known signal numbers and their symbolic name. If `SIGNAL` is given, only list this signal, translated (if a number is given the symbolic name is printed, and vice versa)|
41+
|`-L [SIGNAL...]`|Same as `-l [SIGNAL]` (compatiblity option)|
4242

4343
### Return status
4444

45-
Status Reason
46-
-------- -----------------------------------------------------------------------------------------------------
47-
0 no error/success
48-
!=0 invalid option
49-
!=0 invalid signal specification
50-
!=0 error returned by the system function (e.g. insufficient permissions to send to a specific process)
45+
|Status|Reason|
46+
|------|------|
47+
|0|no error/success|
48+
|!=0|invalid option|
49+
|!=0|invalid signal specification|
50+
|!=0|error returned by the system function (e.g. insufficient permissions to send to a specific process)|
5151

5252
## Examples
5353

docs/commands/builtin/let.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ 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
45-
other expansions are processed as usual (from left-to-right), and the
46-
resulting text is evaluated as an arithmetic expression. Arithmetic
47-
already has a way to control precedence using parentheses, so it's very
48-
rare to need to nest arithmetic expansions within one another. It's
49-
used above only to illustrate how this precedence works. </WRAP>
44+
!!! INFO ""
45+
Remember that inside arithmetic evaluation contexts, all
46+
other expansions are processed as usual (from left-to-right), and the
47+
resulting text is evaluated as an arithmetic expression. Arithmetic
48+
already has a way to control precedence using parentheses, so it's very
49+
rare to need to nest arithmetic expansions within one another. It's
50+
used above only to illustrate how this precedence works.
5051

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

docs/commands/builtin/mapfile.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ target array must be a "normal" integer indexed array.
1919
`mapfile` returns success (0) unless an invalid option is given or the
2020
given array `ARRAY` is set readonly.
2121

22-
Option Description
23-
--------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------
24-
`-c QUANTUM` Specifies the number of lines that have to be read between every call to the callback specified with `-C`. The default QUANTUM is 5000
25-
`-C CALLBACK` Specifies a callback. The string `CALLBACK` can be any shell code, the index of the array that will be assigned, and the line is appended at evaluation time.
26-
`-n COUNT` Reads at most `COUNT` lines, then terminates. If `COUNT` is 0, then all lines are read (default).
27-
`-O ORIGIN` Starts populating the given array `ARRAY` at the index `ORIGIN` rather than clearing it and starting at index 0.
28-
`-s COUNT` Discards the first `COUNT` lines read.
29-
`-t` Remove any trailing newline from a line read, before it is assigned to an array element.
30-
`-u FD` Read from filedescriptor `FD` rather than standard input.
22+
|Option|Description|
23+
|------|-----------|
24+
|`-c QUANTUM`|Specifies the number of lines that have to be read between every call to the callback specified with `-C`. The default QUANTUM is 5000|
25+
|`-C CALLBACK`|Specifies a callback. The string `CALLBACK` can be any shell code, the index of the array that will be assigned, and the line is appended at evaluation time.|
26+
|`-n COUNT`|Reads at most `COUNT` lines, then terminates. If `COUNT` is 0, then all lines are read (default).|
27+
|`-O ORIGIN`|Starts populating the given array `ARRAY` at the index `ORIGIN` rather than clearing it and starting at index 0.|
28+
|`-s COUNT`|Discards the first `COUNT` lines read.|
29+
|`-t`|Remove any trailing newline from a line read, before it is assigned to an array element.|
30+
|`-u FD`|Read from filedescriptor `FD` rather than standard input.|
3131

3232
While `mapfile` isn't a common or portable shell feature, it's
3333
functionality will be familiar to many programmers. Almost all

0 commit comments

Comments
 (0)