@@ -60,15 +60,21 @@ function _bash-it-array-dedup() {
6060 printf ' %s\n' " $@ " | sort -u
6161}
6262
63- # Outputs a full path of the grep found on the filesystem
63+ # Runs ` grep` with *just* the provided arguments
6464function _bash-it-grep() {
65- : " ${BASH_IT_GREP:= $(type -P egrep || type -P grep)} "
66- printf " %s " " ${BASH_IT_GREP:-/ usr/ bin/ grep} "
65+ : " ${BASH_IT_GREP:= $(type -P grep)} "
66+ " ${BASH_IT_GREP:-/ usr/ bin/ grep} " " $@ "
6767}
6868
69- # Runs `grep` with extended regular expressions
69+ # Runs `grep` with fixed-string expressions (-F)
70+ function _bash-it-fgrep() {
71+ : " ${BASH_IT_GREP:= $(type -P grep)} "
72+ " ${BASH_IT_GREP:-/ usr/ bin/ grep} " -F " $@ "
73+ }
74+
75+ # Runs `grep` with extended regular expressions (-E)
7076function _bash-it-egrep() {
71- : " ${BASH_IT_GREP:= $(type -P egrep || type -P grep)} "
77+ : " ${BASH_IT_GREP:= $(type -P grep)} "
7278 " ${BASH_IT_GREP:-/ usr/ bin/ grep} " -E " $@ "
7379}
7480
@@ -150,12 +156,12 @@ function _bash-it-component-list-matching() {
150156
151157function _bash-it-component-list-enabled() {
152158 local IFS=$' \n ' component=" $1 "
153- _bash-it-component-help " ${component} " | _bash-it-egrep ' \[x\ ]' | awk ' {print $1}' | sort -u
159+ _bash-it-component-help " ${component} " | _bash-it-fgrep ' [x ]' | awk ' {print $1}' | sort -u
154160}
155161
156162function _bash-it-component-list-disabled() {
157163 local IFS=$' \n ' component=" $1 "
158- _bash-it-component-help " ${component} " | _bash-it-egrep -v ' \[x\ ]' | awk ' {print $1}' | sort -u
164+ _bash-it-component-help " ${component} " | _bash-it-fgrep -v ' [x ]' | awk ' {print $1}' | sort -u
159165}
160166
161167# Checks if a given item is enabled for a particular component/file-type.
0 commit comments