Skip to content

Commit b75c3a5

Browse files
committed
Fix hyperlinks of markdown pages at depth 3
find docs/ -depth 3 -name '*.md' | xargs grep '(.*/' -l | \ xargs -I{} \ sed -i '' \ -e 's%(/\([^/#).][^/#).]*\)/\([^/#).][^/#).]*\)\(.md\)\{0\})%(../../\1/\2.md)%g' \ -e 's%(/\([^/#).][^/#).]*\)/\([^/#).][^/#).]*\)#\([a-zA-Z_-][0-9a-zA-Z_-]*\))%(../../\1/\2.md#\3)%g' \ -e 's%(/\([^/#).][^/#).]*\)/\([^/#).][^/#).]*\)/\([^/#).][^/#).]*\)\(.md\)\{0\})%(../../\1/\2/\3.md)%g' \ -e 's%(/\([^/#).][^/#).]*\)/\([^/#).][^/#).]*\)/\([^/#).][^/#).]*\)#\([a-zA-Z_-][0-9a-zA-Z_-]*\))%(../../\1/\2/\3.md#\4)%g' \ -e 's%](\([^:.>)#][^:.>)#]*\))%](../../\1.md)%g' \ -e 's%](\([^:.>)#][^:.>)#]*\)#\([^:.>)#][^:.>)#]*\))%](../../\1.md#\2)%g' \ {} Related to #10
1 parent 92be6d2 commit b75c3a5

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.

0 commit comments

Comments
 (0)