1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-16 14:04:47 +02:00

Update bash.md

Use `shopt -s` for setting Bash-specific options.
This commit is contained in:
Behnam Esfahbod ❄
2019-11-30 14:07:21 -08:00
committed by GitHub
parent 1ed003c8f4
commit f7a365b23d

10
bash.md
View File

@@ -535,11 +535,11 @@ set -o nounset # Exposes unset variables
### Glob options
```bash
set -o nullglob # Non-matching globs are removed ('*.foo' => '')
set -o failglob # Non-matching globs throw errors
set -o nocaseglob # Case insensitive globs
set -o globdots # Wildcards match dotfiles ("*.sh" => ".foo.sh")
set -o globstar # Allow ** for recursive matches ('lib/**/*.rb' => 'lib/a/b/c.rb')
shopt -s nullglob # Non-matching globs are removed ('*.foo' => '')
shopt -s failglob # Non-matching globs throw errors
shopt -s nocaseglob # Case insensitive globs
shopt -s dotglob # Wildcards match dotfiles ("*.sh" => ".foo.sh")
shopt -s globstar # Allow ** for recursive matches ('lib/**/*.rb' => 'lib/a/b/c.rb')
```
Set `GLOBIGNORE` as a colon-separated list of patterns to be removed from glob