Skip to content

Commit

Permalink
Merge pull request #14 from hansonchar/linkfix-depth2
Browse files Browse the repository at this point in the history
Fix hyperlinks of markdown pages at depth 2
  • Loading branch information
flokoe authored Jan 29, 2024
2 parents 6f3dbe3 + e966036 commit 5746562
Show file tree
Hide file tree
Showing 39 changed files with 358 additions and 358 deletions.
14 changes: 7 additions & 7 deletions docs/commands/classictest.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi
As you definitely noted, the filename contains spaces.
Since we call a normal ordinary command (`test` or `[`) the shell will word-split the expansion of the variable `mymusic`:
You need to quote it when you don't want the `test`-command to complain about too many arguments for this test-type!
If you didn't understand it, please read the [article about words\...](/syntax/words).
If you didn't understand it, please read the [article about words\...](../syntax/words.md).

Please also note that the file-tests want **one filename** to test.
Don't give a glob (filename-wildcards) as it can expand to many filenames => **too many arguments!**
Expand Down Expand Up @@ -138,7 +138,7 @@ Since Bash 4.1, all tests related to permissions respect ACLs, if the underlying
| <TEST1\> **-o** <TEST2\> | True, if either \<TEST1\> **or** <TEST2\> is true (OR). |
| **!** <TEST\> | True, if <TEST\> is **false** (NOT). |
| **(** <TEST\> **)** | Group a test (for precedence). **Attention:** In normal shell-usage, the `(` and `)` must be escaped; use `\(` and `\)`! |
| **-o** <OPTION_NAME\> | True, if the [shell option](/internals/shell_options) <OPTION_NAME\> is set. |
| **-o** <OPTION_NAME\> | True, if the [shell option](../internals/shell_options.md) <OPTION_NAME\> is set. |
| **-v** <VARIABLENAME\> | True if the variable <VARIABLENAME\> has been set. Use `var[n]` for array elements. |
| **-R** <VARIABLENAME\> | True if the variable <VARIABLENAME\> has been set and is a nameref variable (since 4.3-alpha) |

Expand Down Expand Up @@ -503,18 +503,18 @@ Some code snipplets follow, different ways of shell reaction is used.
- **check if a variable is defined/non-NULL**
- `test "$MYVAR"`
- `[ "$MYVAR" ]`
- **Note:** There are possibilities to make a difference if a variable is *undefined* or *NULL* - see [Parameter Expansion - Using an alternate value](/syntax/pe#use_an_alternate_value)
- **Note:** There are possibilities to make a difference if a variable is *undefined* or *NULL* - see [Parameter Expansion - Using an alternate value](../syntax/pe.md#use_an_alternate_value)
- **check if a directory exists, if not, create it**
- `test ! -d /home/user/foo && mkdir /home/user/foo`
- `[ ! -d /home/user/foo ] && mkdir /home/user/foo`
- `if [ ! -d /home/user/foo ]; then mkdir /home/user/foo; fi`
- **check if minimum one parameter was given, and that one is "Hello"**
- `test $# -ge 1 -a "$1" = "Hello" || exit 1`
- `[ $# -ge 1 ] && [ "$1" = "Hello" ] || exit 1` (see [lists description](/syntax/basicgrammar#lists))
- `[ $# -ge 1 ] && [ "$1" = "Hello" ] || exit 1` (see [lists description](../syntax/basicgrammar.md#lists))
### Listing directories
Using a [for-loop](/syntax/ccmd/classic_for) to iterate through all entries of a directory, if an entry is a directory (`[ -d "$fn" ]`), print its name:
Using a [for-loop](../syntax/ccmd/classic_for.md) to iterate through all entries of a directory, if an entry is a directory (`[ -d "$fn" ]`), print its name:
```bash
for fn in *; do
Expand All @@ -524,8 +524,8 @@ done
## See also
- Internal: [conditional expression](/syntax/ccmd/conditional_expression) (aka "the new test command")
- Internal: [the if-clause](/syntax/ccmd/if_clause)
- Internal: [conditional expression](../syntax/ccmd/conditional_expression.md) (aka "the new test command")
- Internal: [the if-clause](../syntax/ccmd/if_clause.md)
[^1]: <rant\>Of course, one can wonder what is the use of including the
parenthesis in the specification without defining the behaviour with
Expand Down
8 changes: 4 additions & 4 deletions docs/dict/directory.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Directory

In terms of UNIX(r), a directory is a special file which contains a list
of [hardlinks](/dict/terms/hardlink) to other files. These other files
of [hardlinks](../dict/terms/hardlink.md) to other files. These other files
also can be directories of course, so it\'s possible to create a
\"hierarchy of directories\" - the UNIX(r)-typical filesystem structure.

Expand All @@ -10,6 +10,6 @@ all other directory entries are **subdirectories** of it.

## See also

- [hardlink](/dict/terms/hardlink)
- [file](/dict/terms/file)
- [special file](/dict/terms/special_file)
- [hardlink](../dict/terms/hardlink.md)
- [file](../dict/terms/file.md)
- [special file](../dict/terms/special_file.md)
2 changes: 1 addition & 1 deletion docs/dict/end_of_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ except
## See also

- Scripting article, internal:
[getopts_tutorial](/howto/getopts_tutorial)
[getopts_tutorial](../howto/getopts_tutorial.md)
18 changes: 9 additions & 9 deletions docs/dict/file.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# File

A file is a pool of data in the [filesystem](/dict/terms/filesystem). On
A file is a pool of data in the [filesystem](../dict/terms/filesystem.md). On
userlevel, it\'s referenced using a name, a
[hardlink](/dict/terms/hardlink) to the file.
[hardlink](../dict/terms/hardlink.md) to the file.

If a file is not referenced anymore (number of hardlinks to it drops to
0) then the space allocated for that file is re-used, unless it\'s still
used by some process.

The file-data splits into actual payload (file contents) and some
metadata like filesize, filemode or timestamps. The metadata is stored
in the [inode](/dict/terms/inode).
in the [inode](../dict/terms/inode.md).

Strictly spoken, a [hardlink](/dict/terms/hardlink) (also called
\"filename\") points to the [inode](/dict/terms/inode) which organizes a
Strictly spoken, a [hardlink](../dict/terms/hardlink.md) (also called
\"filename\") points to the [inode](../dict/terms/inode.md) which organizes a
file, not to the file itself.

## See also

- [filesystem](/dict/terms/filesystem)
- [filetimes](/dict/terms/filetimes)
- [hardlink](/dict/terms/hardlink)
- [inode](/dict/terms/inode)
- [filesystem](../dict/terms/filesystem.md)
- [filetimes](../dict/terms/filetimes.md)
- [hardlink](../dict/terms/hardlink.md)
- [inode](../dict/terms/inode.md)
6 changes: 3 additions & 3 deletions docs/dict/globbing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ which serves the same purpose.

## See also

- [shell](/dict/terms/shell)
- [hardlink](/dict/terms/hardlink)
- [shell](../dict/terms/shell.md)
- [hardlink](../dict/terms/hardlink.md)

## See also (article)

- [pathname expansion](/syntax/expansion/globs)
- [pathname expansion](../syntax/expansion/globs.md)
12 changes: 6 additions & 6 deletions docs/dict/hardlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Also the article for:

- filename

A hardlink associates a *filename* with a [file](/dict/terms/file). That
A hardlink associates a *filename* with a [file](../dict/terms/file.md). That
name is an entry in a directory listing. Of course a file can have more
hardlinks to it (usually the number of hardlinks to a file is limited),
but all hardlinks to a file must reside on the same
[filesystem](/dict/terms/filesystem) as the file itself!
[filesystem](../dict/terms/filesystem.md) as the file itself!

What you usually call a file is just a name for that file, and thus, a
hardlink.

The difference between a [symbolic link](/dict/terms/symlink) and a hard
The difference between a [symbolic link](../dict/terms/symlink.md) and a hard
link is that there is no easy way to differentiate between a \'real\'
file and a hard link, let\'s take a look at the example:

Expand Down Expand Up @@ -46,6 +46,6 @@ is freed when the last hard link pointing to it is deleted.

## See also

- [file](/dict/terms/file)
- [filesystem](/dict/terms/filesystem)
- [symlink](/dict/terms/symlink)
- [file](../dict/terms/file.md)
- [filesystem](../dict/terms/filesystem.md)
- [symlink](../dict/terms/symlink.md)
12 changes: 6 additions & 6 deletions docs/dict/parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A positional parameter is denoted by a number other than `0` (zero).
Positional parameters reflect the shell\'s arguments that are not given
to the shell itself (in practise, the script arguments, also the
function arguments). You can\'t directly assign to the positional
parameters, however, [the set builtin command](/commands/builtin/set)
parameters, however, [the set builtin command](../commands/builtin/set.md)
can be used to indirectly set them.

The first to ninth positional parameter is referenced by `$1` to `$9`.
Expand All @@ -50,18 +50,18 @@ by the number given in curly braces, i.e., `${10}` or `${432}`.
Unlike popular belief, `$0` is *not a positional parameter*.

See also the [scripting article about handling positional
parameters](/scripting/posparams).
parameters](../scripting/posparams.md).

## special parameters

There are a bunch of special parameters, which are set by the shell.
Direct assignment to them is not possible. These parameter names are
formed of one character.

Please see [shellvars](/syntax/shellvars).
Please see [shellvars](../syntax/shellvars.md).

## See also

- Syntax article, internal: [pe](/syntax/pe)
- Syntax article, internal: [shellvars](/syntax/shellvars)
- Scripting article, internal: [posparams](/scripting/posparams)
- Syntax article, internal: [pe](../syntax/pe.md)
- Syntax article, internal: [shellvars](../syntax/shellvars.md)
- Scripting article, internal: [posparams](../scripting/posparams.md)
2 changes: 1 addition & 1 deletion docs/dict/posix.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ behaviour of the system shell and some utilities (commands).

## See also

- Dictionary, internal: [shell](/dict/terms/shell)
- Dictionary, internal: [shell](../dict/terms/shell.md)
6 changes: 3 additions & 3 deletions docs/dict/special_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ too.

## See also

- [file](/dict/terms/file)
- [filename](/dict/terms/hardlink)
- [directory](/dict/terms/directory)
- [file](../dict/terms/file.md)
- [filename](../dict/terms/hardlink.md)
- [directory](../dict/terms/directory.md)
6 changes: 3 additions & 3 deletions docs/dict/symlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ it can

## See also

- [hardlink](/dict/terms/hardlink)
- [filesystem](/dict/terms/filesystem)
- [directory](/dict/terms/directory)
- [hardlink](../dict/terms/hardlink.md)
- [filesystem](../dict/terms/filesystem.md)
- [directory](../dict/terms/directory.md)
8 changes: 4 additions & 4 deletions docs/howto/dissectabadoneliner.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ In fact, there is a POSIX(r)-compliant command to do this: `basename`
The implementation here is suboptimal in several ways, but the only
thing that\'s genuinely error-prone with this is \"`echo $i`\". Echoing
an *unquoted* variable means
[wordsplitting](/syntax/expansion/wordsplit) will take place, so any
[wordsplitting](../syntax/expansion/wordsplit.md) will take place, so any
whitespace in `$i` will essentially be normalized. In `sh` it is
necessary to use an external command and a subshell to achieve the goal,
but we can eliminate the pipe (subshells, external commands, and pipes
carry extra overhead when they launch, so they can really hurt
performance in a loop). Just for good measure, let\'s use the more
readable, [modern](/syntax/expansion/cmdsubst) `$()` construct instead
readable, [modern](../syntax/expansion/cmdsubst.md) `$()` construct instead
of the old style backticks:

``` bash
Expand All @@ -47,7 +47,7 @@ sh $ for i in *.zip; do j=$(basename "$i" ".zip"); mkdir $j; cd $j; unzip ../$i;

In Bash we don\'t need the subshell or the external basename command.
See [Substring removal with parameter
expansion](/syntax/pe#substring_removal):
expansion](../syntax/pe.md#substring_removal):

``` bash
bash $ for i in *.zip; do j="${i%.zip}"; mkdir $j; cd $j; unzip ../$i; cd ..; done
Expand All @@ -65,7 +65,7 @@ hurt: When a following command depends on the success of a previous
command(s), check for success! You can do this with the \"`&&`\"
conjunction, that way, if the previous command fails, bash will not try
to execute the following command(s). It\'s fully POSIX(r). Oh, and
remember what I said about [wordsplitting](/syntax/expansion/wordsplit)
remember what I said about [wordsplitting](../syntax/expansion/wordsplit.md)
in the previous step? Well, if you don\'t quote `$j`, wordsplitting can
happen again.

Expand Down
18 changes: 9 additions & 9 deletions docs/howto/getopts_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ are:

Some other methods to parse positional parameters - using neither
**getopt** nor **getopts** - are described in: [How to handle positional
parameters](/scripting/posparams).
parameters](../scripting/posparams.md).

### Terminology

Expand Down Expand Up @@ -82,15 +82,15 @@ left to parse, it\'s easy to use in a while-loop:
parsing on the first non-option argument (a string that doesn\'t begin
with a hyphen (`-`) that isn\'t an argument for any option in front of
it). It will also stop parsing when it sees the `--` (double-hyphen),
which means [end of options](/dict/terms/end_of_options).
which means [end of options](../dict/terms/end_of_options.md).

### Used variables

variable description
------------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[OPTIND](/syntax/shellvars#OPTIND) Holds the index to the next argument to be processed. This is how `getopts` \"remembers\" its own status between invocations. Also useful to shift the positional parameters after processing with `getopts`. `OPTIND` is initially set to 1, and **needs to be re-set to 1 if you want to parse anything again with getopts**
[OPTARG](/syntax/shellvars#OPTARG) This variable is set to any argument for an option found by `getopts`. It also contains the option flag of an unknown option.
[OPTERR](/syntax/shellvars#OPTERR) (Values 0 or 1) Indicates if Bash should display error messages generated by the `getopts` builtin. The value is initialized to **1** on every shell startup - so be sure to always set it to **0** if you don\'t want to see annoying messages! **`OPTERR` is not specified by POSIX for the `getopts` builtin utility \-\-- only for the C `getopt()` function in `unistd.h` (`opterr`).** `OPTERR` is bash-specific and not supported by shells such as ksh93, mksh, zsh, or dash.
[OPTIND](../syntax/shellvars.md#OPTIND) Holds the index to the next argument to be processed. This is how `getopts` \"remembers\" its own status between invocations. Also useful to shift the positional parameters after processing with `getopts`. `OPTIND` is initially set to 1, and **needs to be re-set to 1 if you want to parse anything again with getopts**
[OPTARG](../syntax/shellvars.md#OPTARG) This variable is set to any argument for an option found by `getopts`. It also contains the option flag of an unknown option.
[OPTERR](../syntax/shellvars.md#OPTERR) (Values 0 or 1) Indicates if Bash should display error messages generated by the `getopts` builtin. The value is initialized to **1** on every shell startup - so be sure to always set it to **0** if you don\'t want to see annoying messages! **`OPTERR` is not specified by POSIX for the `getopts` builtin utility \-\-- only for the C `getopt()` function in `unistd.h` (`opterr`).** `OPTERR` is bash-specific and not supported by shells such as ksh93, mksh, zsh, or dash.

`getopts` also uses these variables for error reporting (they\'re set to
value-combinations which arent possible in normal operation).
Expand Down Expand Up @@ -133,7 +133,7 @@ messages.
#### Custom arguments to parse

The `getopts` utility parses the [positional
parameters](/scripting/posparams) of the current shell or function by
parameters](../scripting/posparams.md) of the current shell or function by
default (which means it parses `"$@"`).

You can give your own set of arguments to the utility to parse. Whenever
Expand Down Expand Up @@ -346,9 +346,9 @@ Let\'s provide **the argument**:

## See also

- Internal: [posparams](/scripting/posparams)
- Internal: [case](/syntax/ccmd/case)
- Internal: [while_loop](/syntax/ccmd/while_loop)
- Internal: [posparams](../scripting/posparams.md)
- Internal: [case](../syntax/ccmd/case.md)
- Internal: [while_loop](../syntax/ccmd/while_loop.md)
- POSIX
[getopts(1)](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/getopts.html#tag_20_54)
and
Expand Down
4 changes: 2 additions & 2 deletions docs/howto/redirection_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ recommendations:
<!-- -->
```
- **Never** use the Csh `&>foo` and `>&foo` shorthand redirects. Use
the long form `>foo 2>&1`. (see: [obsolete](obsolete))
the long form `>foo 2>&1`. (see: [obsolete](../obsolete.md))

```{=html}
<!-- -->
Expand Down Expand Up @@ -694,4 +694,4 @@ The last example comes from this post:

# See also

- Internal: [Redirection syntax overview](/syntax/redirection)
- Internal: [Redirection syntax overview](../syntax/redirection.md)
22 changes: 11 additions & 11 deletions docs/internals/shell_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This information was taken from a Bash version \"`4.1`\", every now and
then new options are added, so likely, this list isn\'t complete.

The shell-options can be set with the [shopt builtin
command](/commands/builtin/shopt).
command](../commands/builtin/shopt.md).

## Shell options

Expand Down Expand Up @@ -78,8 +78,8 @@ stopped.

If set, Bash checks the window size after each command and, if
necessary, updates the values of the variables
[LINES](/syntax/shellvars#LINES) and
[COLUMNS](/syntax/shellvars#COLUMNS).
[LINES](../syntax/shellvars.md#LINES) and
[COLUMNS](../syntax/shellvars.md#COLUMNS).

### cmdhist

Expand Down Expand Up @@ -174,7 +174,7 @@ match a glob.
Shell mode: all Default: off

If set, Bash includes filenames beginning with a `.` (dot) in the
results of [pathname expansion](/syntax/expansion/globs).
results of [pathname expansion](../syntax/expansion/globs.md).

### execfail

Expand Down Expand Up @@ -209,7 +209,7 @@ If set, behavior intended for use by debuggers is enabled.
------------- ----------- ---------- -------------
Shell mode: all Default: off

If set, the extended [pattern matching](/syntax/pattern) features are
If set, the extended [pattern matching](../syntax/pattern.md) features are
enabled. See the important note below under [Parser
configurations](#parser_configurations).

Expand All @@ -220,7 +220,7 @@ configurations](#parser_configurations).
Shell mode: all Default: on

If set, `$'string'` and `$"string"` quoting is performed within
[parameter expansions](/syntax/pe) enclosed in double quotes. See the
[parameter expansions](../syntax/pe.md) enclosed in double quotes. See the
important note below under [Parser
configurations](#parser_configurations).

Expand All @@ -240,7 +240,7 @@ result in an error message.
Shell mode: interactive Default: on

If set, the suffixes specified by the
[FIGNORE](/syntax/shellvars#FIGNORE) shell variable cause words to be
[FIGNORE](../syntax/shellvars.md#FIGNORE) shell variable cause words to be
ignored when performing word completion even if the ignored words are
the only possible completions. This option is enabled by default.

Expand Down Expand Up @@ -280,7 +280,7 @@ message format\".
Shell mode: interactive (?) Default: off

If set, the history list is appended to the file named by the value of
the [HISTFILE](/syntax/shellvars#HISTFILE) variable when the shell
the [HISTFILE](../syntax/shellvars.md#HISTFILE) variable when the shell
exits, rather than overwriting the file.

### histreedit
Expand Down Expand Up @@ -324,7 +324,7 @@ interactive login shell exits.
------------- ------------------------ ---------- ---------
Shell mode: interactive Default: on

Allow [commenting](/scripting/basics#comments) in interactive shells, on
Allow [commenting](../scripting/basics.md#comments) in interactive shells, on
by default.

### lastpipe
Expand Down Expand Up @@ -505,5 +505,5 @@ parsed:

## See also

- Internal: [shopt builtin command](/commands/builtin/shopt)
- Internal: [set builtin command](/commands/builtin/set)
- Internal: [shopt builtin command](../commands/builtin/shopt.md)
- Internal: [set builtin command](../commands/builtin/set.md)
Loading

0 comments on commit 5746562

Please sign in to comment.