From d6a850bbdd4aaf66aa3db57f90651269952b2f57 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 24 Jun 2015 15:35:58 +1200 Subject: Move GREP_OPTIONS building to bashrc Shouldn't be exported because it changes the behaviour of grep(1), which might have unwanted side effects in scripts --- sh/profile.d/grep.sh | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'sh') diff --git a/sh/profile.d/grep.sh b/sh/profile.d/grep.sh index 444adb16..bcdb009e 100644 --- a/sh/profile.d/grep.sh +++ b/sh/profile.d/grep.sh @@ -9,35 +9,6 @@ case $grep_help in ;; esac -# Use GREP_OPTIONS to add some useful options to grep(1) calls if applicable -GREP_OPTIONS= -case $grep_help in - *--binary-files*) - GREP_OPTIONS=${GREP_OPTIONS:+$GREP_OPTIONS }'--binary-files=without-match' - ;; -esac -case $grep_help in - *--exclude*) - for exclude in .gitignore .gitmodules ; do - GREP_OPTIONS=${GREP_OPTIONS:+$GREP_OPTIONS }'--exclude='$exclude - done - unset -v exclude - ;; -esac -case $grep_help in - *--exclude-dir*) - for exclude_dir in .cvs .git .hg .svn ; do - GREP_OPTIONS=${GREP_OPTIONS:+$GREP_OPTIONS }'--exclude-dir='$exclude_dir - done - unset -v exclude_dir - ;; -esac - # We're done parsing grep(1)'s --help output now unset -v grep_help -# Export the grep(1) options if we decided on any -if [ -n "$GREP_OPTIONS" ] ; then - export GREP_OPTIONS -fi - -- cgit v1.2.3