aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/grep.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-12-14 17:48:52 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-12-14 17:48:52 +1300
commit06f5ca98018fd4ba357b0e70b1e710b682b6cdb5 (patch)
tree76bc12131c82c87852e4183969d6969d9eeabf7f /bash/bashrc.d/grep.bash
parentFix some English (diff)
downloaddotfiles-06f5ca98018fd4ba357b0e70b1e710b682b6cdb5.tar.gz
dotfiles-06f5ca98018fd4ba357b0e70b1e710b682b6cdb5.zip
Switch to a faster method of array appending
Does away with the nasty hack around man page discovery, and still compatible with Bash 2.05a
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 3f8e44e0..6a567e5a 100644
--- a/bash/bashrc.d/grep.bash
+++ b/bash/bashrc.d/grep.bash
@@ -12,16 +12,16 @@ grep_help=$(grep --help 2>/dev/null)
# to change grep(1)'s actual behaviour inside scripts
declare -a GREPOPTS
if [[ -n $GREP_COLORS ]] && ((colors >= 8)) ; then
- GREPOPTS=("${GREPOPTS[@]}" --color=auto)
+ GREPOPTS[${#GREPOPTS[@]}]='--color=auto'
fi
if [[ $grep_help == *--binary-files* ]] ; then
- GREPOPTS=("${GREPOPTS[@]}" --binary-files=without-match)
+ GREPOPTS[${#GREPOPTS[@]}]='--binary-files=without-match'
fi
if [[ $grep_help == *--exclude* ]] ; then
- GREPOPTS=("${GREPOPTS[@]}" --exclude={.gitignore,.gitmodules})
+ GREPOPTS[${#GREPOPTS[@]}]='--exclude={.gitignore,.gitmodules}'
fi
if [[ $grep_help == *--exclude-dir* ]] ; then
- GREPOPTS=("${GREPOPTS[@]}" --exclude-dir={.cvs,.git,.hg,.svn})
+ GREPOPTS[${#GREPOPTS[@]}]='--exclude-dir={.cvs,.git,.hg,.svn}'
fi
# Done, unset helper vars