diff --git a/docs/bash4.md b/docs/bash4.md index 03a149b..47fe28e 100644 --- a/docs/bash4.md +++ b/docs/bash4.md @@ -77,7 +77,7 @@ The `read` builtin command has some interesting new features. The `-t` option to specify a timeout value has been slightly tuned. It now accepts fractional values and the special value 0 (zero). When `-t 0` is specified, `read` immediately returns with an exit status -indicating if there\'s data waiting or not. However, when a timeout is +indicating if there's data waiting or not. However, when a timeout is given, and the `read` builtin times out, any partial data recieved up to the timeout is stored in the given variable, rather than lost. When a timeout is hit, `read` exits with a code greater than 128. @@ -90,7 +90,7 @@ See [read](commands/builtin/read.md) ### Changes to the "help" builtin -The builtin itself didn\'t change much, but the data displayed is more +The builtin itself didn't change much, but the data displayed is more structured now. The help texts are in a better format, much easier to read. diff --git a/docs/commands/builtin/caller.md b/docs/commands/builtin/caller.md index 188ed25..2cca00a 100644 --- a/docs/commands/builtin/caller.md +++ b/docs/commands/builtin/caller.md @@ -59,8 +59,8 @@ f3 ## Notes -- `caller` produces no output unless used within a script that\'s run - from a real file. It isn\'t particularly useful for interactive use, +- `caller` produces no output unless used within a script that's run + from a real file. It isn't particularly useful for interactive use, but can be used to create a decent `die` function to track down errors in moderately complex scripts. `{ bash /dev/stdin; } <<<$'f(){ g; }\ng(){ h; }\nh(){ while caller $((n++)); do :; done; }\nf'` @@ -68,7 +68,7 @@ f3 are available and a number of special parameters that give more detail than caller (e.g. BASH_ARG{C,V}). Tools such as [Bashdb](http://bashdb.sourceforge.net/) can assist in using some of - Bash\'s more advanced debug features. + Bash's more advanced debug features. - The Bash manpage and help text specifies that the argument to `caller` is an \"expr\" (whatever that means). Only an integer is actually allowed, with no special interpretation of an diff --git a/docs/commands/builtin/cd.md b/docs/commands/builtin/cd.md index 779605f..e1567da 100644 --- a/docs/commands/builtin/cd.md +++ b/docs/commands/builtin/cd.md @@ -13,7 +13,7 @@ The `cd` builtin command is used to change the current working directory - to the given directory (`cd DIRECTORY`) - to the previous working directory (`cd -`) as saved in the [OLDPWD](../../syntax/shellvars.md#OLDPWD) shell variable -- to the user\'s home directory as specified in the +- to the user's home directory as specified in the [HOME](../../syntax/shellvars.md#HOME) environment variable (when used without a `DIRECTORY` argument) @@ -30,7 +30,7 @@ is given or the shell is configured to do so (see the `-P` option of -------- ---------------------------------------------------- `-L` Follow symbolic links (default) `-P` Do not follow symbolic links - `-@` Browse a file\'s extended attributed, if supported + `-@` Browse a file's extended attributed, if supported ### Exit status @@ -41,7 +41,7 @@ is given or the shell is configured to do so (see the `-P` option of ## Examples -### Change the working directory to the user\'s home directory +### Change the working directory to the user's home directory cd diff --git a/docs/commands/builtin/declare.md b/docs/commands/builtin/declare.md index 029742a..440f181 100644 --- a/docs/commands/builtin/declare.md +++ b/docs/commands/builtin/declare.md @@ -22,7 +22,7 @@ variable. When used in a function, `declare` makes `NAMEs` local variables, unless used with the `-g` option. -Don\'t use it\'s synonym `typeset` when coding for Bash, since it\'s +Don't use it's synonym `typeset` when coding for Bash, since it's tagged as obsolete. ### Options @@ -52,7 +52,7 @@ Below, `[-+]X` indicates an attribute, use `-X` to set the attribute, `[-+]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. + Use `[[ -R NAME ]]` to test if NAME has been set to a VALUE, another variable's name. `-p` display the attributes and value of each NAME @@ -138,7 +138,7 @@ RHS. sum total a b c printf 'Final value of "total" is: %d\n' "$total" -\
\$ dash -c \'f() { if
- command shift 2\>/dev/null; then echo \"\$1\"; else echo \"no
+ errors caused by *special builtins*. \$ dash -c \'f() { if
+ command shift 2>/dev/null; then echo \"\$1\"; else echo \"no
args\"; fi; }; f\'
-no args \
While, POSIX requires this behavior, it isn\'t very
-obvious and some shells don\'t do it correctly. To work around this, you
+no args
While, POSIX requires this behavior, it isn't very
+obvious and some shells don't do it correctly. To work around this, you
can use something like:
-\ \$ mksh -c \'f() { if ! \${1+false} && shift; then echo
-\"\$1\"; else echo \"no args\"; fi; }; f\' no args \
~~The mksh
+ \$ mksh -c \'f() { if ! \${1+false} && shift; then echo
+\"\$1\"; else echo \"no args\"; fi; }; f\' no args
~~The mksh
maintainer refuses to change either the `shift` or `command` builtins.~~
[Fixed](https://github.com/MirBSD/mksh/commit/996e05548ab82f7ef2dea61f109cc7b6d13837fa).
(Thanks!)
-- Perhaps almost as bad as the above, busybox sh\'s `shift` always
+- Perhaps almost as bad as the above, busybox sh's `shift` always
returns success, even when attempting to shift beyond the final
- argument. \ \$ bb -c \'f() { if shift; then echo \"\$1\";
+ argument. \$ bb -c \'f() { if shift; then echo \"\$1\";
else echo \"no args\"; fi; }; f\'
-(no output) \
The above mksh workaround will work in this case
+(no output)
The above mksh workaround will work in this case
too.
## See also
diff --git a/docs/commands/builtin/shopt.md b/docs/commands/builtin/shopt.md
index 8f8e00e..f3f135e 100644
--- a/docs/commands/builtin/shopt.md
+++ b/docs/commands/builtin/shopt.md
@@ -33,7 +33,7 @@ When listing options, the exit code is `TRUE` (0), if all options are
enabled, `FALSE` otherwise.
When setting/unsetting an option, the exit code is `TRUE` unless the
-named option doesn\'t exitst.
+named option doesn't exitst.
## Examples
diff --git a/docs/commands/builtin/trap.md b/docs/commands/builtin/trap.md
index 3bae6f9..ee299df 100644
--- a/docs/commands/builtin/trap.md
+++ b/docs/commands/builtin/trap.md
@@ -34,7 +34,7 @@ Special events
`EXIT` 0 executed on shell exit
`DEBUG` executed before every simple command
`RETURN` executed when a shell function or a sourced code finishes executing
- `ERR` executed each time a command\'s failure would cause the shell to exit when the [`-e` option (`errexit`)](../../commands/builtin/set.md) is enabled
+ `ERR` executed each time a command's failure would cause the shell to exit when the [`-e` option (`errexit`)](../../commands/builtin/set.md) is enabled
### Options
diff --git a/docs/commands/builtin/unset.md b/docs/commands/builtin/unset.md
index fc29372..f8f4328 100644
--- a/docs/commands/builtin/unset.md
+++ b/docs/commands/builtin/unset.md
@@ -51,10 +51,10 @@ variable has been set, then the variable of the same name in the
next-outermost scope becomes visible to its scope and all children - as
if the variable that was unset was never set to begin with. This
property allows looking upwards through the stack as variable names are
-unset, so long as unset and the local it unsets aren\'t together in the
+unset, so long as unset and the local it unsets aren't together in the
same scope level.
-Here\'s a demonstration of this behavior.
+Here's a demonstration of this behavior.
#!/usr/bin/env bash
@@ -121,8 +121,8 @@ output:
Some things to observe:
- `unset2` is only really needed once. We remain 5 levels deep in
- `f`\'s for the remaining `unset` calls, which peel away the outer
- layers of `a`\'s.
+ `f`'s for the remaining `unset` calls, which peel away the outer
+ layers of `a`'s.
- Notice that the \"a\" is unset using an ordinary unset command at
recursion depth 1, and subsequently calling unset reveals a again in
the global scope, which has since been modified in a lower scope
@@ -130,7 +130,7 @@ Some things to observe:
- Declaring a global with declare -g bypasses all locals and sets or
modifies the variable of the global scope (outside of all
functions). It has no affect on the visibility of the global.
-- This doesn\'t apply to individual array elements. If two local
+- This doesn't apply to individual array elements. If two local
arrays of the same name appear in different scopes, the entire array
of the inner scope needs to be unset before any elements of the
outer array become visible. This makes \"unset\" and \"unset2\"
@@ -145,7 +145,7 @@ expands its arguments.
~ $ ( a=({a..d}); unset 'a[2]'; declare -p a )
declare -a a='([0]="a" [1]="b" [3]="d")'
-As usual in such cases, it\'s important to quote the args to avoid
+As usual in such cases, it's important to quote the args to avoid
accidental results such as globbing.
~ $ ( a=({a..d}) b=a c=d d=1; set -x; unset "${b}["{2..3}-c\]; declare -p a )
diff --git a/docs/commands/builtin/wait.md b/docs/commands/builtin/wait.md
index 78139b8..3777f74 100644
--- a/docs/commands/builtin/wait.md
+++ b/docs/commands/builtin/wait.md
@@ -34,7 +34,7 @@ The return status is the return status of the job waited for, or
Status Reason
-------- -------------------------------------------------
- 0 waited for all jobs in shell\'s job list
+ 0 waited for all jobs in shell's job list
1 the given `ID` is not a valid job or process ID
## Examples
diff --git a/docs/commands/classictest.md b/docs/commands/classictest.md
index 7c156b3..e804e78 100644
--- a/docs/commands/classictest.md
+++ b/docs/commands/classictest.md
@@ -87,60 +87,60 @@ Since Bash 4.1, all tests related to permissions respect ACLs, if the underlying
| Operator syntax | Description |
| ------------------------- | ----------------------------------------------------------------------------------------------- |
-| **-a**