chore: Use grep -E / grep -F instead of egrep / fgrep (#2164)
Ensures that the -E or -F option, when used, is the first option * i.e. grep -oE => grep -E -o Updates _bash-it-grep to invoke grep with just the provided arguments * This function was (and still is) unused, but decided this new functionality was actually more useful Introduces _bash-it-fgrep to invoke grep -F Removes type -P egrep from the _bash-it-*grep functions For usages that were already going to be modified, use -F if appropriate * Does not touch grep usages that may have benefited from -F, but were not otherwise considered for this PR Adds shellcheck header to modified .bash files that didn't already have it
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# port of zork theme
|
||||
|
||||
# set colors for use throughout the prompt
|
||||
@@ -50,7 +52,7 @@ function is_integer() { # helper function for todo-txt-count
|
||||
|
||||
todo_txt_count() {
|
||||
if `hash todo.sh 2>&-`; then # is todo.sh installed
|
||||
count=`todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }'`
|
||||
count=`todo.sh ls | grep -E "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }'`
|
||||
if is_integer $count; then # did we get a sane answer back
|
||||
echo "${BRACKET_COLOR}[${STRING_COLOR}T:$count${BRACKET_COLOR}]$normal"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user