Updated SC2184 (markdown)

malamut-ubuntu
2022-02-01 22:06:51 +03:00
parent c9a27cd82c
commit 36cabd6af5

@@ -19,6 +19,12 @@ In the problematic code, having a file called `food` in the current directory wi
Quoting so that the `[..]` is passed literally to `unset` solves the issue. Quoting so that the `[..]` is passed literally to `unset` solves the issue.
Note that you can unset element using variable for index name like this:
```sh
unset 'foo[$var]'
```
### Exceptions: ### Exceptions:
If you know that pathname expansion is disabled you can ignore this message. `set -o noglob` (and variations like invoking the script with `#!/bin/bash -f`) will prevent glob expansion of arguments to `unset`. If you know that pathname expansion is disabled you can ignore this message. `set -o noglob` (and variations like invoking the script with `#!/bin/bash -f`) will prevent glob expansion of arguments to `unset`.