From f7a365b23d9d29e00a4148ee25d504216fafc129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Behnam=20Esfahbod=20=E2=9D=84?= Date: Sat, 30 Nov 2019 14:07:21 -0800 Subject: [PATCH] Update bash.md Use `shopt -s` for setting Bash-specific options. --- bash.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bash.md b/bash.md index a710fc571..32e2e7af1 100644 --- a/bash.md +++ b/bash.md @@ -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