aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-08-17 18:25:10 +1200
committerTom Ryder <tom@sanctum.geek.nz>2012-08-17 18:25:10 +1200
commit50bb9a270075f29d6633a5b6a1e995f5bed1c891 (patch)
tree0d338bc656d5e58237577f0f0d3e196cc2a1f460
parentI never want to grep binaries (diff)
downloaddotfiles-50bb9a270075f29d6633a5b6a1e995f5bed1c891.tar.gz
dotfiles-50bb9a270075f29d6633a5b6a1e995f5bed1c891.zip
Use brace expansion for grep ignores
-rw-r--r--bash/bashrc8
1 files changed, 2 insertions, 6 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 07802d46..95b4a310 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -140,14 +140,10 @@ fi
# Set up more options for grep; exclude version control files.
if grep --help | grep -- --exclude &>/dev/null; then
- for pattern in .git .gitignore .gitmodules; do
- grepopts="${grepopts} --exclude=${pattern}"
- done
+ grepopts="${grepopts} --exclude=.git{,ignore,modules}"
fi
if grep --help | grep -- --exclude-dir &>/dev/null; then
- for pattern in .cvs .git .hg .svn; do
- grepopts="${grepopts} --exclude-dir=${pattern}"
- done
+ grepopts="${grepopts} --exclude-dir=.{cvs,git,hg,svn}"
fi
# Alias ls and grep with the options we've collected.