From 50bb9a270075f29d6633a5b6a1e995f5bed1c891 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 17 Aug 2012 18:25:10 +1200 Subject: Use brace expansion for grep ignores --- bash/bashrc | 8 ++------ 1 file 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. -- cgit v1.2.3