diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2012-08-17 18:25:10 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2012-08-17 18:25:10 +1200 |
commit | 50bb9a270075f29d6633a5b6a1e995f5bed1c891 (patch) | |
tree | 0d338bc656d5e58237577f0f0d3e196cc2a1f460 | |
parent | I never want to grep binaries (diff) | |
download | dotfiles-50bb9a270075f29d6633a5b6a1e995f5bed1c891.tar.gz dotfiles-50bb9a270075f29d6633a5b6a1e995f5bed1c891.zip |
Use brace expansion for grep ignores
-rw-r--r-- | bash/bashrc | 8 |
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. |