mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
lib/shopt: Remove nocasematch (#503)
The setting `shopt -s nocasematch` affects every pattern matching in Bash including the case statement, [[ str == pat ]] matching, ${var/pat/rep}, and ${var#pat}. Since the affected range is too large, this potentially breaks the existing functions. This setting `shopt -s nocasematch` seems the one that should be enabled locally when it is specifically needed rather than being enabled globally.
This commit is contained in:
@ -25,10 +25,8 @@ shopt -s globstar 2> /dev/null
|
||||
# (used in case, [[]], word expansions and command completions)
|
||||
if [[ ${OMB_CASE_SENSITIVE:-${CASE_SENSITIVE:-}} == true ]]; then
|
||||
shopt -u nocaseglob
|
||||
shopt -u nocasematch
|
||||
else
|
||||
shopt -s nocaseglob
|
||||
shopt -s nocasematch
|
||||
fi
|
||||
|
||||
## SMARTER TAB-COMPLETION (Readline bindings) ##
|
||||
|
Reference in New Issue
Block a user