aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/grep.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-20 11:30:40 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-20 11:30:40 +1200
commitc549fd2782547ebf37e0b7c08b70dba76b1a5eef (patch)
tree855535dba3539cb0d6ac9143af69dab3827cabd2 /bash/bashrc.d/grep.bash
parentUse arithmetic expression for argument count (diff)
downloaddotfiles-c549fd2782547ebf37e0b7c08b70dba76b1a5eef.tar.gz
dotfiles-c549fd2782547ebf37e0b7c08b70dba76b1a5eef.zip
Remove unneeded quoting within [[ ]]
Diffstat (limited to 'bash/bashrc.d/grep.bash')
-rw-r--r--bash/bashrc.d/grep.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash
index 656e3c77..4bd2ed5e 100644
--- a/bash/bashrc.d/grep.bash
+++ b/bash/bashrc.d/grep.bash
@@ -11,24 +11,24 @@ __grepopts() {
grepopts[${#grepopts[@]}]='-I'
# If the --exclude option is available, exclude some VCS files
- if [[ "$grephelp" == *--exclude* ]]; then
+ if [[ $grephelp == *--exclude* ]]; then
grepopts[${#grepopts[@]}]='--exclude=.git{,ignore,modules}'
fi
# If the --exclude option is available, exclude some VCS dirs
- if [[ "$grephelp" == *--exclude-dir* ]]; then
+ if [[ $grephelp == *--exclude-dir* ]]; then
grepopts[${#grepopts[@]}]='--exclude-dir=.{cvs,git,hg,svn}'
fi
# If the --color option is available and we have a terminal that supports
# at least eight colors, add --color=auto to the options
local -i colors="$(tput colors)"
- if [[ "$grephelp" == *--color* ]] && ((colors >= 8)); then
+ if [[ $grephelp == *--color* ]] && ((colors >= 8)); then
grepopts[${#grepopts[@]}]='--color=auto'
fi
# Print the options as a single string, space-delimited
- printf -- "${grepopts[*]}"
+ printf '%s' "${grepopts[*]}"
}
# Alias grep with those options