Skip to content

Commit 9d39ffc

Browse files
committed
unset GREP_OPTIONS before to use grep
1 parent 38daba7 commit 9d39ffc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

virtualenvwrapper.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fi
5959

6060
# If the path is relative, prefix it with $HOME
6161
# (note: for compatibility)
62-
if echo "$WORKON_HOME" | grep -e '^[^/~]' > /dev/null
62+
if echo "$WORKON_HOME" | (unset GREP_OPTIONS; grep -e '^[^/~]' > /dev/null)
6363
then
6464
export WORKON_HOME="$HOME/$WORKON_HOME"
6565
fi
@@ -68,7 +68,7 @@ fi
6868
# path might contain stuff to expand.
6969
# (it might be possible to do this in shell, but I don't know a
7070
# cross-shell-safe way of doing it -wolever)
71-
if echo "$WORKON_HOME" | egrep -e "([$~]|//)" >/dev/null
71+
if echo "$WORKON_HOME" | (unset GREP_OPTIONS; egrep -e "([$~]|//)" >/dev/null)
7272
then
7373
# This will normalize the path by:
7474
# - Removing extra slashes (e.g., when TMPDIR ends in a slash)
@@ -142,7 +142,7 @@ virtualenvwrapper_initialize () {
142142

143143
# Verify that virtualenv is installed and visible
144144
virtualenvwrapper_verify_virtualenv () {
145-
typeset venv=$(\which virtualenv | grep -v "not found")
145+
typeset venv=$(\which virtualenv | (unset GREP_OPTIONS; grep -v "not found"))
146146
if [ "$venv" = "" ]
147147
then
148148
echo "ERROR: virtualenvwrapper could not find virtualenv in your path" >&2
@@ -226,7 +226,7 @@ virtualenvwrapper_show_workon_options () {
226226
# NOTE: DO NOT use ls here because colorized versions spew control characters
227227
# into the output list.
228228
# echo seems a little faster than find, even with -depth 3.
229-
(cd "$WORKON_HOME"; for f in */bin/activate; do echo $f; done) 2>/dev/null | sed 's|^\./||' | sed 's|/bin/activate||' | sort | egrep -v '^\*$'
229+
(cd "$WORKON_HOME"; for f in */bin/activate; do echo $f; done) 2>/dev/null | sed 's|^\./||' | sed 's|/bin/activate||' | sort | (unset GREP_OPTIONS; egrep -v '^\*$')
230230
# (cd "$WORKON_HOME"; find -L . -depth 3 -path '*/bin/activate') | sed 's|^\./||' | sed 's|/bin/activate||' | sort
231231
}
232232

@@ -445,7 +445,7 @@ cpvirtualenv() {
445445
echo "Please specify target virtualenv"
446446
return 1
447447
fi
448-
if echo "$WORKON_HOME" | grep -e "/$" > /dev/null
448+
if echo "$WORKON_HOME" | (unset GREP_OPTIONS; grep -e "/$" > /dev/null)
449449
then
450450
typset env_home="$WORKON_HOME"
451451
else

0 commit comments

Comments
 (0)