Skip to content

Commit 93e24b5

Browse files
authored
Merge pull request #15 from hansonchar/linkfix-depth3
Fix hyperlinks of markdown pages at depth 3
2 parents 5746562 + b75c3a5 commit 93e24b5

Some content is hidden

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

41 files changed

+237
-237
lines changed

docs/commands/builtin/cd.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ The `cd` builtin command is used to change the current working directory
1212

1313
- to the given directory (`cd DIRECTORY`)
1414
- to the previous working directory (`cd -`) as saved in the
15-
[OLDPWD](/syntax/shellvars#OLDPWD) shell variable
15+
[OLDPWD](../../syntax/shellvars.md#OLDPWD) shell variable
1616
- to the user\'s home directory as specified in the
17-
[HOME](/syntax/shellvars#HOME) environment variable (when used
17+
[HOME](../../syntax/shellvars.md#HOME) environment variable (when used
1818
without a `DIRECTORY` argument)
1919

2020
The `cd` builtin command searches the directories listed in
21-
[CDPATH](/syntax/shellvars#CDPATH) for a matching directory.
21+
[CDPATH](../../syntax/shellvars.md#CDPATH) for a matching directory.
2222

2323
The default behaviour is to follow symbolic links unless the `-P` option
2424
is given or the shell is configured to do so (see the `-P` option of
25-
[the set builtin command](/commands/builtin/set)).
25+
[the set builtin command](../../commands/builtin/set.md)).
2626

2727
### Options
2828

@@ -36,7 +36,7 @@ is given or the shell is configured to do so (see the `-P` option of
3636

3737
- true if the directory was changed successfully
3838
- false if a change to the home directory was requested, but
39-
[HOME](/syntax/shellvars#HOME) is unset
39+
[HOME](../../syntax/shellvars.md#HOME) is unset
4040
- false if anything else goes wrong
4141

4242
## Examples
@@ -53,7 +53,7 @@ is given or the shell is configured to do so (see the `-P` option of
5353

5454
## See also
5555

56-
- variable [CDPATH](/syntax/shellvars#CDPATH)
57-
- variable [HOME](/syntax/shellvars#HOME)
58-
- variable [OLDPWD](/syntax/shellvars#OLDPWD)
59-
- the `-P` option of [the set builtin command](/commands/builtin/set)
56+
- variable [CDPATH](../../syntax/shellvars.md#CDPATH)
57+
- variable [HOME](../../syntax/shellvars.md#HOME)
58+
- variable [OLDPWD](../../syntax/shellvars.md#OLDPWD)
59+
- the `-P` option of [the set builtin command](../../commands/builtin/set.md)

docs/commands/builtin/declare.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ for details. ksh93 namerefs are much more powerful than Bash\'s.
176176

177177
## See also
178178

179-
- [arrays](/syntax/arrays)
180-
- [readonly](/commands/builtin/readonly)
181-
- [unset](/commands/builtin/unset)
179+
- [arrays](../../syntax/arrays.md)
180+
- [readonly](../../commands/builtin/readonly.md)
181+
- [unset](../../commands/builtin/unset.md)
182182
- [declaration commands](http://austingroupbugs.net/view.php?id=351)
183183
will change the behavior of certain builtins such as `export` in the
184184
next version of POSIX.

docs/commands/builtin/echo.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
`echo` outputs it\'s args to stdout, separated by spaces, followed by a
1010
newline. The return status is always `0`. If the
11-
[shopt](/commands/builtin/shopt) option `xpg_echo` is set, Bash
11+
[shopt](../../commands/builtin/shopt.md) option `xpg_echo` is set, Bash
1212
dynamically determines whether echo should expand escape characters
1313
(listed below) by default based on the current platform. `echo` doesn\'t
1414
interpret `--` as the end of options, and will simply print this string
@@ -69,7 +69,7 @@ if given.
6969
```
7070
- **Never use options to `echo`! *Ever*!** Any time you feel tempted
7171
to use `echo -e`, `-n`, or any other special feature of echo, **use
72-
[printf](/commands/builtin/printf) instead!** If portability is a
72+
[printf](../../commands/builtin/printf.md) instead!** If portability is a
7373
requirement, you should consider using `printf` *exclusively* and
7474
just ignore that `echo` even exists. If you must use `echo -e` and
7575
refuse to use `printf`, it is usually acceptable to use \'\'echo
@@ -81,12 +81,12 @@ if given.
8181
```
8282
- `ksh93` has a `print` command, which if coding specifically for
8383
`ksh93` should be preferred over `echo`.
84-
[printf](/commands/builtin/printf) still includes most of the
84+
[printf](../../commands/builtin/printf.md) still includes most of the
8585
functionality of both, and should usually be the most preferred
8686
option.
8787

8888
## See also
8989

90-
- [printf](/commands/builtin/printf)
90+
- [printf](../../commands/builtin/printf.md)
9191
- <http://cfajohnson.com/shell/cus-faq.html#Q0b>
9292
- <http://www.in-ulm.de/~mascheck/various/echo+printf/>

docs/commands/builtin/eval.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ a child process.
1818
## Examples
1919

2020
In this example, the literal text within the
21-
[here-document](/syntax/redirection#here_documents) is executed as Bash
21+
[here-document](../../syntax/redirection.md#here_documents) is executed as Bash
2222
code exactly as though it were to appear within the script in place of
2323
the `eval` command below it.
2424

@@ -135,10 +135,10 @@ first example above is the same error as the second in all non-Bash
135135
shells, even those with compound assignment.
136136

137137
In the case of `eval` it isn\'t recommended to use this behavior,
138-
because unlike e.g. [declare](commands/builtin/declare), the initial
138+
because unlike e.g. [declare](../../commands/builtin/declare.md), the initial
139139
expansion is still subject to all expansions including
140-
[word-splitting](syntax/expansion/wordsplit) and [pathname
141-
expansion](syntax/expansion/glob).
140+
[word-splitting](../../syntax/expansion/wordsplit.md) and [pathname
141+
expansion](../../syntax/expansion/glob.md).
142142

143143
$ ( set -x; touch 'x+=(\[[123]\]=*)' 'x+=([3]=yo)'; eval x+=(*); echo "${x[@]}" )
144144
+ touch 'x+=(\[[123]\]=*)' 'x+=([3]=yo)'
@@ -149,14 +149,14 @@ expansion](syntax/expansion/glob).
149149
[[123]]=* yo
150150

151151
Other commands known to be affected by compound assignment arguments
152-
include: [let](commands/builtin/let),
153-
[declare](commands/builtin/declare),
154-
[typeset](commands/builtin/typeset), [local](commands/builtin/local),
155-
[export](commands/builtin/export), and
156-
[readonly](commands/builtin/readonly). More oddities below show both
152+
include: [let](../../commands/builtin/let.md),
153+
[declare](../../commands/builtin/declare.md),
154+
[typeset](../../commands/builtin/typeset.md), [local](../../commands/builtin/local.md),
155+
[export](../../commands/builtin/export.md), and
156+
[readonly](../../commands/builtin/readonly.md). More oddities below show both
157157
similarities and differences to commands like
158-
[declare](commands/builtin/declare). The rules for `eval` appear
159-
identical to those of [let](commands/builtin/let).
158+
[declare](../../commands/builtin/declare.md). The rules for `eval` appear
159+
identical to those of [let](../../commands/builtin/let.md).
160160

161161
## See also
162162

docs/commands/builtin/exec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ shell without executing any program.
2828
- on redirection errors it returns 1, otherwise 0
2929
- on exec failures:
3030
- a non-interactive shell terminates; if the [shell option
31-
execfail](/internals/shell_options#execfail) is set `exec`
31+
execfail](../../internals/shell_options.md#execfail) is set `exec`
3232
returns failure
3333
- in an interactive shell, `exec` returns failure
3434

@@ -82,4 +82,4 @@ exec >/var/adm/my.log 2>&1
8282

8383
## See also
8484

85-
- [redirection](/syntax/redirection)
85+
- [redirection](../../syntax/redirection.md)

docs/commands/builtin/exit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If `N` is given, the return code to the parent process is set to `N`. If
1212
not, the returned status the the status of the most recently executed
1313
command (i.e. `$?`).
1414

15-
A [trap](/commands/builtin/trap) on `EXIT` is executed before the shell
15+
A [trap](../../commands/builtin/trap.md) on `EXIT` is executed before the shell
1616
exits, except the executed `exit` command is part of an already running
1717
trap.
1818

@@ -42,5 +42,5 @@ executed the `exit` command, because the shell exits.
4242

4343
## See also
4444

45-
- [The trap builtin command](/commands/builtin/trap)
46-
- [The exit status](/dict/terms/exit_status)
45+
- [The trap builtin command](../../commands/builtin/trap.md)
46+
- [The exit status](../../dict/terms/exit_status.md)

docs/commands/builtin/export.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ Set your default text editor (e.g. SublimeText):
4949

5050
## See also
5151

52-
- [declare](/commands/builtin/declare)
52+
- [declare](../../commands/builtin/declare.md)

docs/commands/builtin/let.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@
77
## Description
88

99
The `let` builtin command evaluates each supplied word from left to
10-
right as an [arithmetic expression](/syntax/arith_expr) and returns an
10+
right as an [arithmetic expression](../../syntax/arith_expr.md) and returns an
1111
exit code according to the truth value of the rightmost expression.
1212

1313
- 0 (TRUE) when `arg` evaluated to not 0 (arithmetic \"true\")
1414
- 1 (FALSE) when `arg` evaluated to 0 (arithmetic \"false\")
1515

1616
For this return code mapping, please see [this
17-
section](/syntax/arith_expr#arithmetic_expressions_and_return_codes).
17+
section](../../syntax/arith_expr.md#arithmetic_expressions_and_return_codes).
1818
They work in the same way as `((`.
1919

2020
## Examples
2121

22-
`let` is very similar to [((](/syntax/ccmd/arithmetic_eval) - the only
22+
`let` is very similar to [((](../../syntax/ccmd/arithmetic_eval.md) - the only
2323
difference being `let` is a builtin (simple command), and `((` is a
2424
compound command. The arguments to `let` are therefore subject to all
2525
the same expansions and substitutions as any other simple command -
2626
requiring proper quoting and escaping - whereas the contents of `((`
27-
aren\'t subject to [word-splitting](/syntax/expansion/wordsplit) or
28-
[pathname expansion](/syntax/expansion/globs) (almost never desirable
27+
aren\'t subject to [word-splitting](../../syntax/expansion/wordsplit.md) or
28+
[pathname expansion](../../syntax/expansion/globs.md) (almost never desirable
2929
for arithmetic). For this reason, **the [arithmetic compound
30-
command](/syntax/ccmd/arithmetic_eval) should generally be preferred
30+
command](../../syntax/ccmd/arithmetic_eval.md) should generally be preferred
3131
over `let`**.
3232

3333
$ let 'b = a' "(a += 3) + $((a = 1)), b++"
3434
$ echo "$a - $b - $?"
3535
4 - 2 - 0
3636

3737
Is equivalent to the [arithmetic evaluation compound
38-
command](/syntax/ccmd/arithmetic_eval):
38+
command](../../syntax/ccmd/arithmetic_eval.md):
3939

4040
$ (( b = a, (a += 3) + $((a = 1)), b++ ))
4141
$ echo "$a - $b - $?"
@@ -78,14 +78,14 @@ needed.
7878
` Aside from differences in supported arithmetic features, this
7979
should be identical to the Bash/Ksh `let`.
8080
- It seems to be a common misunderstanding that `let` has some legacy
81-
purpose. Both `let` and [[^1]](syntax/ccmd/arithmetic_eval) were
81+
purpose. Both `let` and [[^1]](../../syntax/ccmd/arithmetic_eval.md) were
8282
ksh88 features and almost identical in terms of portability as
8383
everything that inherited one also tended to get the other. Don\'t
8484
choose `let` over `((` expecting it to work in more places.
8585
- [expr(1)](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/expr.html#tag_20_42)
8686
is a command one is likely to come across sooner or later. While it
8787
is more \"standard\" than `let`, the above should always be
88-
preferred. Both [arithmetic expansion](/syntax/arith_expr)s and the
88+
preferred. Both [arithmetic expansion](../../syntax/arith_expr.md)s and the
8989
`[` test operator are specified by POSIX(r) and satisfy almost all
9090
of expr\'s use-cases. Unlike `let`, `expr` cannot assign directly to
9191
bash variables but instead returns a result on stdout. `expr` takes
@@ -96,16 +96,16 @@ needed.
9696
without generating any output other than a return code.
9797
- For unknown reasons, `let` is one of the Bash commands with special
9898
parsing for arguments formatted like compound array assignments.
99-
See: [eval](commands/builtin/eval#portability_considerations) for
99+
See: [eval](../../commands/builtin/eval.md#portability_considerations) for
100100
details. There are no known practical uses for this. Parentheses are
101101
treated as grouping operators and compound assignment is not
102102
possible by arithmetic expressions.
103103

104104
## See also
105105

106-
- Internal: [arithmetic expansion](/syntax/expansion/arith)
107-
- Internal: [arithmetic expressions](/syntax/arith_expr)
106+
- Internal: [arithmetic expansion](../../syntax/expansion/arith.md)
107+
- Internal: [arithmetic expressions](../../syntax/arith_expr.md)
108108
- Internal: [arithmetic evaluation compound
109-
command](/syntax/ccmd/arithmetic_eval)
109+
command](../../syntax/ccmd/arithmetic_eval.md)
110110

111111
[^1]: \...

docs/commands/builtin/local.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Description
88

9-
`local` is identical to [declare](/commands/builtin/declare) in every
9+
`local` is identical to [declare](../../commands/builtin/declare.md) in every
1010
way, and takes all the same options, with 3 exceptions:
1111

1212
- Usage outside of a function is an error. Both `declare` and `local`

docs/commands/builtin/mapfile.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ each subsequent 2 iterations. The RETURN trap is unimportant.
215215

216216
## See also
217217

218-
- [arrays](/syntax/arrays)
219-
- [read](/commands/builtin/read) - If you don\'t know about this yet,
218+
- [arrays](../../syntax/arrays.md)
219+
- [read](../../commands/builtin/read.md) - If you don\'t know about this yet,
220220
why are you reading this page?
221221
- <http://mywiki.wooledge.org/BashFAQ/001> - It\'s FAQ 1 for a reason.

docs/commands/builtin/printf.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ nearly identical for an external command that follows POSIX(r).
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?&#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
@@ -68,8 +68,8 @@ this opens up the possibility of an easy code injection vulnerability.
6868
\...where the echo can of course be replaced with any arbitrary command.
6969
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
71-
[read](commands/builtin/read), and a similar one to
72-
[mapfile](commands/builtin/mapfile), though performing expansions into
71+
[read](../../commands/builtin/read.md), and a similar one to
72+
[mapfile](../../commands/builtin/mapfile.md), though performing expansions into
7373
their arguments is less common. \</note\>
7474

7575
### Arguments
@@ -93,9 +93,9 @@ interpreted. If fewer format specifiers than arguments are present, then
9393
number-formats are set to zero, while string-formats are set to null
9494
(empty).
9595

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

100100
\<note warning\> [**Again, attention:**]{.underline} When a numerical
101101
format expects a number, the internal `printf`-command will use the
@@ -234,7 +234,7 @@ associated with a `%b` format:
234234
(POSIX specifies up to three).
235235

236236
These are also respects in which `%b` differs from the escapes used by
237-
[\$\'\...\'](syntax/quoting#ansi_c_like_strings) style quoting.
237+
[\$\'\...\'](../../syntax/quoting.md#ansi_c_like_strings) style quoting.
238238

239239
## Examples
240240

@@ -447,7 +447,7 @@ fmt++;
447447

448448
- The optional Bash loadable `print` may be useful for ksh
449449
compatibility and to overcome some of
450-
[echo](commands/builtin/echo)\'s portability pitfalls. Bash, ksh93,
450+
[echo](../../commands/builtin/echo.md)\'s portability pitfalls. Bash, ksh93,
451451
and zsh\'s `print` have an `-f` option which takes a `printf` format
452452
string and applies it to the remaining arguments. Bash lists the
453453
synopsis as:
@@ -461,7 +461,7 @@ fmt++;
461461
```
462462
- Assigning to variables: The `printf -v` way is slightly different to
463463
the way using command-substitution. [Command
464-
substitution](/syntax/expansion/cmdsubst) removes trailing newlines
464+
substitution](../../syntax/expansion/cmdsubst.md) removes trailing newlines
465465
before substituting the text, `printf -v` preserves all output.
466466

467467
## See also
@@ -471,6 +471,6 @@ fmt++;
471471
and [printf()
472472
function](http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html)
473473
- [Code snip: Print a horizontal
474-
line](/snipplets/print_horizontal_line) uses some `printf` examples
474+
line](../../snipplets/print_horizontal_line.md) uses some `printf` examples
475475
- [Greg\'s BashFAQ 18: How can I use numbers with leading zeros in a
476476
loop, e.g., 01, 02?](BashFAQ>018)

docs/commands/builtin/read.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Since Bash 4.3-alpha, `read` skips any `NUL` (ASCII code 0) characters
1616
in input.
1717

1818
If `<NAME...>` is given, the line is word-split using
19-
[IFS](/syntax/shellvars#IFS) variable, and every word is assigned to one
19+
[IFS](../../syntax/shellvars.md#IFS) variable, and every word is assigned to one
2020
`<NAME>`. The remaining words are all assigned to the last `<NAME>` if
2121
more words than variable names are present.
2222

2323
\<WRAP center round info 90%\> If no `<NAME>` is given, the whole line
2424
read (without performing word-splitting!) is assigned to the shell
25-
variable [REPLY](/syntax/shellvars#REPLY). Then, `REPLY` really contains
25+
variable [REPLY](../../syntax/shellvars.md#REPLY). Then, `REPLY` really contains
2626
the line as it was read, without stripping pre- and postfix spaces and
2727
other things!
2828

@@ -33,7 +33,7 @@ other things!
3333
\</WRAP\>
3434

3535
If a timeout is given, or if the shell variable
36-
[TMOUT](/syntax/shellvars#TMOUT) is set, it is counted from initially
36+
[TMOUT](../../syntax/shellvars.md#TMOUT) is set, it is counted from initially
3737
waiting for input until the completion of input (i.e. until the complete
3838
line is read). That means the timeout can occur during input, too.
3939

@@ -64,7 +64,7 @@ Of course it\'s valid to set individual array elements without using
6464
\<WRAP center round important 90%\>
6565

6666
Reading into array elements using the syntax above **may cause [pathname
67-
expansion](/syntax/expansion/globs) to occur**.
67+
expansion](../../syntax/expansion/globs.md) to occur**.
6868

6969
Example: You are in a directory with a file named `x1`, and you want to
7070
read into an array `x`, index `1` with
@@ -172,7 +172,7 @@ Take care that you cannot use a pipe:
172172
Why? because the commands of the pipe run in subshells that cannot
173173
modify the parent shell. As a result, the variables `col1`, `col2` and
174174
`col3` of the parent shell are not modified (see article:
175-
[processtree](/scripting/processtree)).
175+
[processtree](../../scripting/processtree.md)).
176176

177177
If the variable has more fields than there are variables, the last
178178
variable get the remaining of the line:
@@ -184,7 +184,7 @@ variable get the remaining of the line:
184184

185185
By default reads separates the line in fields using spaces or tabs. You
186186
can modify this using the *special variable*
187-
[IFS](/syntax/shellvars#IFS), the Internal Field Separator.
187+
[IFS](../../syntax/shellvars.md#IFS), the Internal Field Separator.
188188

189189
IFS=":" read -r col1 col2 <<< "hello:world"
190190
printf "col1: %s col2: %s\n" "$col1" "$col2"
@@ -264,6 +264,6 @@ date/time string are recognized correctly.
264264

265265
## See also
266266

267-
- Internal: [The printf builtin command](/commands/builtin/printf)
267+
- Internal: [The printf builtin command](../../commands/builtin/printf.md)
268268

269269
[^1]: fixed in 4.2-rc1

0 commit comments

Comments
 (0)