From 08e297c631074501a1945c224007eb043ef61bef Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 9 Sep 2024 15:18:26 +0900 Subject: [PATCH] fix(lib/shopt): turn on "extglob" by default We thought that we already have `extglob` turned on, but it was just turned on by bash-completion that we loaded from "lib/bourne-shell". When the sytem does not have bash-completion, the extglob settings are not enabled and thus causes an issue with constructs using extglob. We already turn on many glob features in "lib/shopt", and there does not seem to be reason not to turn on "extglob". In this patch, we enable it by default. --- lib/shopt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/shopt.sh b/lib/shopt.sh index 589b710..6ab8057 100644 --- a/lib/shopt.sh +++ b/lib/shopt.sh @@ -18,6 +18,9 @@ PROMPT_DIRTRIM=${PROMPT_DIRTRIM:-2} # E.g. typing !! will replace the !! with your last command bind Space:magic-space +# Turn on extended glob patterns such as @(...), *(...), ?(...), and +(...) +shopt -s extglob + # Turn on recursive globbing (enables ** to recurse all directories) shopt -s globstar 2> /dev/null