mirror of
https://github.com/rawiriblundell/wiki.bash-hackers.org
synced 2024-12-25 06:00:41 +01:00
Fix a funny issue of non-idempotency
This commit is contained in:
parent
b199da5402
commit
b565249494
142
start.md
142
start.md
@ -32,88 +32,88 @@ only there to prevent SPAM.
|
|||||||
|
|
||||||
- [Bash v4 - a rough overview](bash4.md) (unmaintained, since Bash 4 is
|
- [Bash v4 - a rough overview](bash4.md) (unmaintained, since Bash 4 is
|
||||||
more or less standard)
|
more or less standard)
|
||||||
- [style](/scripting/style.md.md) -- an assorted collection of style and optic
|
- [style](/scripting/style.md) -- an assorted collection of style and optic
|
||||||
hints
|
hints
|
||||||
- [basics](/scripting/basics.md.md)
|
- [basics](/scripting/basics.md)
|
||||||
- [newbie_traps](/scripting/newbie_traps.md.md)
|
- [newbie_traps](/scripting/newbie_traps.md)
|
||||||
- [bashbehaviour](/scripting/bashbehaviour.md.md)
|
- [bashbehaviour](/scripting/bashbehaviour.md)
|
||||||
- [posparams](/scripting/posparams.md.md)
|
- [posparams](/scripting/posparams.md)
|
||||||
- [processtree](/scripting/processtree.md.md)
|
- [processtree](/scripting/processtree.md)
|
||||||
- [obsolete](/scripting/obsolete.md.md)
|
- [obsolete](/scripting/obsolete.md)
|
||||||
- [nonportable](/scripting/nonportable.md.md)
|
- [nonportable](/scripting/nonportable.md)
|
||||||
- [debuggingtips](/scripting/debuggingtips.md.md)
|
- [debuggingtips](/scripting/debuggingtips.md)
|
||||||
- [terminalcodes](/scripting/terminalcodes.md.md)
|
- [terminalcodes](/scripting/terminalcodes.md)
|
||||||
- [tutoriallist](/scripting/tutoriallist.md.md)
|
- [tutoriallist](/scripting/tutoriallist.md)
|
||||||
|
|
||||||
## Code snippets
|
## Code snippets
|
||||||
|
|
||||||
There is a [section that holds small code snippets](/snipplets/start.md.md).
|
There is a [section that holds small code snippets](/snipplets/start.md).
|
||||||
|
|
||||||
See also [some Bash source code excerpts](/misc/readthesourceluke.md.md).
|
See also [some Bash source code excerpts](/misc/readthesourceluke.md).
|
||||||
|
|
||||||
## How to
|
## How to
|
||||||
|
|
||||||
[Doing specific tasks: concepts, methods, ideas](/howto/start.md.md):
|
[Doing specific tasks: concepts, methods, ideas](/howto/start.md):
|
||||||
|
|
||||||
- [Simple locking (against parallel run)](/howto/mutex.md.md)
|
- [Simple locking (against parallel run)](/howto/mutex.md)
|
||||||
- [Rudimentary config files for your scripts](/howto/conffile.md.md)
|
- [Rudimentary config files for your scripts](/howto/conffile.md)
|
||||||
- [Editing files with ed(1)](/howto/edit-ed.md.md)
|
- [Editing files with ed(1)](/howto/edit-ed.md)
|
||||||
- [Collapsing Functions](/howto/collapsing_functions.md.md)
|
- [Collapsing Functions](/howto/collapsing_functions.md)
|
||||||
- [Illustrated Redirection Tutorial](/howto/redirection_tutorial.md.md)
|
- [Illustrated Redirection Tutorial](/howto/redirection_tutorial.md)
|
||||||
- [Calculate with dc(1)](/howto/calculate-dc.md)
|
- [Calculate with dc(1)](/howto/calculate-dc.md)
|
||||||
- [Introduction to pax - the POSIX archiver](/howto/pax.md.md)
|
- [Introduction to pax - the POSIX archiver](/howto/pax.md)
|
||||||
- [getopts_tutorial](/howto/getopts_tutorial.md.md) (*under construction!*)
|
- [getopts_tutorial](/howto/getopts_tutorial.md) (*under construction!*)
|
||||||
- [dissectabadoneliner](/howto/dissectabadoneliner.md.md) An example of a bad
|
- [dissectabadoneliner](/howto/dissectabadoneliner.md) An example of a bad
|
||||||
oneliner, breakdown and fix (by `kojoro`)
|
oneliner, breakdown and fix (by `kojoro`)
|
||||||
- [Write tests for ./your-script.sh](/howto/testing-your-scripts.md.md) by
|
- [Write tests for ./your-script.sh](/howto/testing-your-scripts.md) by
|
||||||
using bashtest util
|
using bashtest util
|
||||||
|
|
||||||
## Bash syntax and operations
|
## Bash syntax and operations
|
||||||
|
|
||||||
- [Bash features overview by version](/scripting/bashchanges.md.md)
|
- [Bash features overview by version](/scripting/bashchanges.md)
|
||||||
- [Basic grammar rules](/syntax/basicgrammar.md.md)
|
- [Basic grammar rules](/syntax/basicgrammar.md)
|
||||||
- [Quoting and character escaping](/syntax/quoting.md.md)
|
- [Quoting and character escaping](/syntax/quoting.md)
|
||||||
- [Parsing and execution](/syntax/grammar/parser_exec.md.md)
|
- [Parsing and execution](/syntax/grammar/parser_exec.md)
|
||||||
- [Some words about words...](/syntax/words.md.md)
|
- [Some words about words...](/syntax/words.md)
|
||||||
- [Patterns and pattern matching](/syntax/pattern.md.md)
|
- [Patterns and pattern matching](/syntax/pattern.md)
|
||||||
- [Arithmetic expressions](/syntax/arith_expr.md.md)
|
- [Arithmetic expressions](/syntax/arith_expr.md)
|
||||||
- [List of shell options](/internals/shell_options.md.md)
|
- [List of shell options](/internals/shell_options.md)
|
||||||
- [Redirection](/syntax/redirection.md.md)
|
- [Redirection](/syntax/redirection.md)
|
||||||
- [Special parameters and shell variables](/syntax/shellvars.md.md)
|
- [Special parameters and shell variables](/syntax/shellvars.md)
|
||||||
- [Arrays](/syntax/arrays.md.md)
|
- [Arrays](/syntax/arrays.md)
|
||||||
|
|
||||||
## Compound commands
|
## Compound commands
|
||||||
|
|
||||||
| **[Compound commands overview](/syntax/ccmd/intro.md.md)** | |
|
| **[Compound commands overview](/syntax/ccmd/intro.md)** | |
|
||||||
|:-----------------------------------------------------|------------------------------------------------------------------|
|
|:-----------------------------------------------------|------------------------------------------------------------------|
|
||||||
| Grouping | |
|
| Grouping | |
|
||||||
| `{ ...; }` | [command grouping](/syntax/ccmd/grouping_plain.md.md) |
|
| `{ ...; }` | [command grouping](/syntax/ccmd/grouping_plain.md) |
|
||||||
| `( ... )` | [command grouping in a subshell](/syntax/ccmd/grouping_subshell.md.md) |
|
| `( ... )` | [command grouping in a subshell](/syntax/ccmd/grouping_subshell.md) |
|
||||||
| Conditionals | |
|
| Conditionals | |
|
||||||
| `[[ ... ]]` | [conditional expression](/syntax/ccmd/conditional_expression.md.md) |
|
| `[[ ... ]]` | [conditional expression](/syntax/ccmd/conditional_expression.md) |
|
||||||
| `if ...; then ...; fi` | [conditional branching](/syntax/ccmd/if_clause.md.md) |
|
| `if ...; then ...; fi` | [conditional branching](/syntax/ccmd/if_clause.md) |
|
||||||
| `case ... esac` | [pattern-based branching](/syntax/ccmd/case.md.md) |
|
| `case ... esac` | [pattern-based branching](/syntax/ccmd/case.md) |
|
||||||
| Loops | |
|
| Loops | |
|
||||||
| `for word in ...; do ...; done` | [classic for-loop](/syntax/ccmd/classic_for.md.md) |
|
| `for word in ...; do ...; done` | [classic for-loop](/syntax/ccmd/classic_for.md) |
|
||||||
| `for ((x=1; x<=10; x++)); do ...; done` | [C-style for-loop](/syntax/ccmd/c_for.md.md) |
|
| `for ((x=1; x<=10; x++)); do ...; done` | [C-style for-loop](/syntax/ccmd/c_for.md) |
|
||||||
| `while ...; do ...; done` | [while loop](/syntax/ccmd/while_loop.md.md) |
|
| `while ...; do ...; done` | [while loop](/syntax/ccmd/while_loop.md) |
|
||||||
| `until ...; do ...; done` | [until loop](/syntax/ccmd/until_loop.md.md) |
|
| `until ...; do ...; done` | [until loop](/syntax/ccmd/until_loop.md) |
|
||||||
| Misc | |
|
| Misc | |
|
||||||
| `(( ... ))` | [arithmetic evaluation](/syntax/ccmd/arithmetic_eval.md.md) |
|
| `(( ... ))` | [arithmetic evaluation](/syntax/ccmd/arithmetic_eval.md) |
|
||||||
| `select word in ...; do ...; done` | [user selections](/syntax/ccmd/user_select.md.md) |
|
| `select word in ...; do ...; done` | [user selections](/syntax/ccmd/user_select.md) |
|
||||||
|
|
||||||
## Expansions and substitutions
|
## Expansions and substitutions
|
||||||
|
|
||||||
| **[Introduction to expansions and substitutions](/syntax/expansion/intro.md.md)** | |
|
| **[Introduction to expansions and substitutions](/syntax/expansion/intro.md)** | |
|
||||||
|:----------------------------------------------------------------------------|------------------------------------------------------|
|
|:----------------------------------------------------------------------------|------------------------------------------------------|
|
||||||
| `{A,B,C} {A..C}` | [Brace expansion](/syntax/expansion/brace.md.md) |
|
| `{A,B,C} {A..C}` | [Brace expansion](/syntax/expansion/brace.md) |
|
||||||
| `~/ ~root/` | [Tilde expansion](/syntax/expansion/tilde.md.md) |
|
| `~/ ~root/` | [Tilde expansion](/syntax/expansion/tilde.md) |
|
||||||
| `$FOO ${BAR%.mp3}` | [Parameter expansion](/syntax/pe.md.md) |
|
| `$FOO ${BAR%.mp3}` | [Parameter expansion](/syntax/pe.md) |
|
||||||
| `` `command` $(command) `` | [Command substitution](/syntax/expansion/cmdsubst.md.md) |
|
| `` `command` $(command) `` | [Command substitution](/syntax/expansion/cmdsubst.md) |
|
||||||
| `<(command) >(command)` | [Process substitution](/syntax/expansion/proc_subst.md.md) |
|
| `<(command) >(command)` | [Process substitution](/syntax/expansion/proc_subst.md) |
|
||||||
| `$((1 + 2 + 3)) $[4 + 5 + 6]` | [Arithmetic expansion](/syntax/expansion/arith.md.md) |
|
| `$((1 + 2 + 3)) $[4 + 5 + 6]` | [Arithmetic expansion](/syntax/expansion/arith.md) |
|
||||||
| `Hello <---> Word!` | [Word splitting](/syntax/expansion/wordsplit.md.md) |
|
| `Hello <---> Word!` | [Word splitting](/syntax/expansion/wordsplit.md) |
|
||||||
| `/data/*-av/*.mp?` | [Pathname expansion](/syntax/expansion/globs.md.md) |
|
| `/data/*-av/*.mp?` | [Pathname expansion](/syntax/expansion/globs.md) |
|
||||||
|
|
||||||
|
|
||||||
## Builtin Commands
|
## Builtin Commands
|
||||||
@ -137,7 +137,7 @@ datastructures.</th>
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/declare.md.md">declare</a></td>
|
href="/commands/builtin/declare.md">declare</a></td>
|
||||||
<td>Display or set shell variables or functions along with
|
<td>Display or set shell variables or functions along with
|
||||||
attributes.</td>
|
attributes.</td>
|
||||||
<td style="text-align: center;"><code>typeset</code></td>
|
<td style="text-align: center;"><code>typeset</code></td>
|
||||||
@ -167,14 +167,14 @@ href="/commands/builtin/local">local</a></td>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/read.md.mdonly">readonly</a></td>
|
href="/commands/builtin/read.mdonly">readonly</a></td>
|
||||||
<td>Mark variables or functions as read-only.</td>
|
<td>Mark variables or functions as read-only.</td>
|
||||||
<td style="text-align: center;"><code>typeset -r</code></td>
|
<td style="text-align: center;"><code>typeset -r</code></td>
|
||||||
<td style="text-align: center;">special builtin</td>
|
<td style="text-align: center;">special builtin</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/unset.md.md">unset</a></td>
|
href="/commands/builtin/unset.md">unset</a></td>
|
||||||
<td>Unset variables and functions.</td>
|
<td>Unset variables and functions.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
<td style="text-align: center;">special builtin</td>
|
<td style="text-align: center;">special builtin</td>
|
||||||
@ -197,7 +197,7 @@ streams.</td>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/syntax/keywords/coproc.md.md">coproc</a></td>
|
href="/syntax/keywords/coproc.md">coproc</a></td>
|
||||||
<td>Co-processes: Run a command in the background with pipes for reading
|
<td>Co-processes: Run a command in the background with pipes for reading
|
||||||
/ writing its standard streams.</td>
|
/ writing its standard streams.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
@ -212,21 +212,21 @@ href="/commands/builtin/echo">echo</a></td>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/mapfile.md.md">mapfile</a></td>
|
href="/commands/builtin/mapfile.md">mapfile</a></td>
|
||||||
<td>Read lines of input into an array.</td>
|
<td>Read lines of input into an array.</td>
|
||||||
<td style="text-align: center;"><code>readarray</code></td>
|
<td style="text-align: center;"><code>readarray</code></td>
|
||||||
<td style="text-align: center;">builtin</td>
|
<td style="text-align: center;">builtin</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/printf.md.md">printf</a></td>
|
href="/commands/builtin/printf.md">printf</a></td>
|
||||||
<td>"advanced <code>echo</code>."</td>
|
<td>"advanced <code>echo</code>."</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
<td style="text-align: center;">builtin</td>
|
<td style="text-align: center;">builtin</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/read.md.md">read</a></td>
|
href="/commands/builtin/read.md">read</a></td>
|
||||||
<td>Read input into variables or arrays, or split strings into fields
|
<td>Read input into variables or arrays, or split strings into fields
|
||||||
using delimiters.</td>
|
using delimiters.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
@ -241,14 +241,14 @@ Commands that modify shell behavior, change special options, assist in debugging
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/caller.md.md">caller</a></td>
|
href="/commands/builtin/caller.md">caller</a></td>
|
||||||
<td>Identify/print execution frames.</td>
|
<td>Identify/print execution frames.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
<td style="text-align: center;">builtin</td>
|
<td style="text-align: center;">builtin</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/set.md.md">set</a></td>
|
href="/commands/builtin/set.md">set</a></td>
|
||||||
<td>Set the positional parameters and/or set options that affect shell
|
<td>Set the positional parameters and/or set options that affect shell
|
||||||
behaviour.</td>
|
behaviour.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
@ -256,7 +256,7 @@ behaviour.</td>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/shopt.md.md">shopt</a></td>
|
href="/commands/builtin/shopt.md">shopt</a></td>
|
||||||
<td>set/get some bash-specific shell options.</td>
|
<td>set/get some bash-specific shell options.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
<td style="text-align: center;">builtin</td>
|
<td style="text-align: center;">builtin</td>
|
||||||
@ -305,7 +305,7 @@ href="/commands/builtin/continueBreak">continue / break</a></td>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/let.md.md">let</a></td>
|
href="/commands/builtin/let.md">let</a></td>
|
||||||
<td>Arithmetic evaluation simple command.</td>
|
<td>Arithmetic evaluation simple command.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
<td style="text-align: center;">builtin</td>
|
<td style="text-align: center;">builtin</td>
|
||||||
@ -319,7 +319,7 @@ href="/commands/builtin/return">return</a></td>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/classictest.md.md">[</a></td>
|
href="/commands/classictest.md">[</a></td>
|
||||||
<td>The classic <code>test</code> simple command.</td>
|
<td>The classic <code>test</code> simple command.</td>
|
||||||
<td style="text-align: center;">test</td>
|
<td style="text-align: center;">test</td>
|
||||||
<td style="text-align: center;">builtin</td>
|
<td style="text-align: center;">builtin</td>
|
||||||
@ -334,7 +334,7 @@ signals, process groups, subshells.</td>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: center;"><a
|
<td style="text-align: center;"><a
|
||||||
href="/commands/builtin/exec.md.md">exec</a></td>
|
href="/commands/builtin/exec.md">exec</a></td>
|
||||||
<td>Replace the current shell process or set redirections.</td>
|
<td>Replace the current shell process or set redirections.</td>
|
||||||
<td style="text-align: center;">-</td>
|
<td style="text-align: center;">-</td>
|
||||||
<td style="text-align: center;">special builtin</td>
|
<td style="text-align: center;">special builtin</td>
|
||||||
@ -385,7 +385,7 @@ href="/commands/builtin/wait">wait</a></td>
|
|||||||
|
|
||||||
## Dictionary
|
## Dictionary
|
||||||
|
|
||||||
| :bulb: A list of expressions, words, and their meanings is [here](/dict/index.md.md). |
|
| :bulb: A list of expressions, words, and their meanings is [here](/dict/index.md). |
|
||||||
| --- |
|
| --- |
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
@ -474,7 +474,7 @@ href="/commands/builtin/wait">wait</a></td>
|
|||||||
commands](https://www.rosehosting.com/blog/basic-shell-commands-after-putty-ssh-logon/)
|
commands](https://www.rosehosting.com/blog/basic-shell-commands-after-putty-ssh-logon/)
|
||||||
- [Bashphorism list from the Bash IRC channel on
|
- [Bashphorism list from the Bash IRC channel on
|
||||||
Freenode](/misc/bashphorisms)
|
Freenode](/misc/bashphorisms)
|
||||||
- [Some more or less funny commandline stuff](/misc/shell_humor.md.md)
|
- [Some more or less funny commandline stuff](/misc/shell_humor.md)
|
||||||
- [How to Enable SSH on Ubuntu
|
- [How to Enable SSH on Ubuntu
|
||||||
Tutorial](https://thishosting.rocks/how-to-enable-ssh-on-ubuntu/)
|
Tutorial](https://thishosting.rocks/how-to-enable-ssh-on-ubuntu/)
|
||||||
- [How To Make an Awesome Custom Shell with
|
- [How To Make an Awesome Custom Shell with
|
||||||
@ -499,7 +499,7 @@ If you have critiques or suggestions, please feel free to send a mail
|
|||||||
using the contact form on the right. Note that there is a simple
|
using the contact form on the right. Note that there is a simple
|
||||||
discussion option below every article.
|
discussion option below every article.
|
||||||
|
|
||||||
Please also see the [imprint](/user/thebonsai/imprint.md.md) if you have
|
Please also see the [imprint](/user/thebonsai/imprint.md) if you have
|
||||||
problems with the site and its contents (legality, ...)!
|
problems with the site and its contents (legality, ...)!
|
||||||
|
|
||||||
It also would be nice to drop a line when
|
It also would be nice to drop a line when
|
||||||
|
Loading…
Reference in New Issue
Block a user