aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/grep.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-06-24 23:52:44 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-06-24 23:52:44 +1200
commit60898acf2c29565ea086bf84034fc399df72e567 (patch)
tree9dd97a5fd3bed47aa04ae9c2bfa325a1d6572db0 /bash/bashrc.d/grep.bash
parentFix broken return value prompt element (diff)
downloaddotfiles-60898acf2c29565ea086bf84034fc399df72e567.tar.gz
dotfiles-60898acf2c29565ea086bf84034fc399df72e567.zip
Just check ls/grep option calls once
Diffstat (limited to 'bash/bashrc.d/grep.bash')
-rw-r--r--bash/bashrc.d/grep.bash7
1 files changed, 4 insertions, 3 deletions
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash
index 7cb38c4d..625f10ac 100644
--- a/bash/bashrc.d/grep.bash
+++ b/bash/bashrc.d/grep.bash
@@ -1,11 +1,12 @@
# Function returns calculated options for grep
function __grepopts {
local grepopts='-I'
- grep --help | grep -- --color &>/dev/null \
+ local grephelp=$(grep --help )
+ echo $grephelp | grep -- --color &>/dev/null \
&& grepopts="${grepopts} --color=auto"
- grep --help | grep -- --exclude &>/dev/null \
+ echo $grephelp | grep -- --exclude &>/dev/null \
&& grepopts="${grepopts} --exclude=.git{,ignore,modules}"
- grep --help | grep -- --exclude-dir &>/dev/null \
+ echo $grephelp | grep -- --exclude-dir &>/dev/null \
&& grepopts="${grepopts} --exclude-dir=.{cvs,git,hg,svn}"
echo $grepopts
}