Skip to content

Commit

Permalink
do not use grep -q, update #419
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Dec 1, 2011
1 parent d899e67 commit a459bfc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/functions/hooks/jruby
Expand Up @@ -2,7 +2,7 @@

jruby_ngserver_is_running()
{
ps auxww | grep -q '[c]om.martiansoftware.nailgun.NGServer'
ps auxww | grep '[c]om.martiansoftware.nailgun.NGServer' >/dev/null
}

jruby_ngserver_start()
Expand Down
6 changes: 3 additions & 3 deletions scripts/functions/installer
Expand Up @@ -353,9 +353,9 @@ install_rvm_hooks()
__rvm_rm_rf "$rvm_path/$entry"
fi
# Source is first level hook (after_use) and target is custom user hook, preserve it
if echo "$entry" | \grep -Eq '^hooks/[[:alpha:]]+_[[:alpha:]]+$' &&
if echo "$entry" | \grep -E '^hooks/[[:alpha:]]+_[[:alpha:]]+$' >/dev/null &&
[[ -f "$rvm_path/$entry" ]] &&
! grep -q "$(basename ${entry})_\*" "$rvm_path/$entry"
! grep "$(basename ${entry})_\*" "$rvm_path/$entry" >/dev/null
then
mv -f "$rvm_path/$entry" "$rvm_path/${entry}_custom"
fi
Expand Down Expand Up @@ -384,7 +384,7 @@ install_rvm_hooks()

#fix broken copy of after_use to after_use_custom
if [[ -f "$rvm_path/hooks/after_use_custom" ]] &&
grep -q "after_use_\*" "$rvm_path/hooks/after_use_custom"
grep "after_use_\*" "$rvm_path/hooks/after_use_custom" >/dev/null
then
rm -f "$rvm_path/hooks/after_use_custom"
fi
Expand Down
5 changes: 2 additions & 3 deletions scripts/functions/utility
Expand Up @@ -76,11 +76,10 @@ __rvm_quote_args()

for quoted_argument in "$@"; do

if printf "%s" "$quoted_argument" | \grep -vq "^[[:alnum:]]$"; then

if printf "%s" "$quoted_argument" | \grep -v "^[[:alnum:]]$" >/dev/null
then
quoted_string="$quoted_string '$(printf "%s" "$quoted_argument" \
| \sed "s/'/\'\\\'\'/g")'" #"-fix display quotes

else
quoted_string="$quoted_string $quoted_argument"
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/zsh/Completion/_rvm
Expand Up @@ -48,7 +48,7 @@ case $state in

if (( CURRENT == 3 )); then
# See if we’ve made it to the ‘@’; eg, 1.9.2@
if ! \grep -q '@' <<< "${line[CURRENT-1]}" ; then
if ! \grep '@' <<< "${line[CURRENT-1]}" >/dev/null ; then
_values -S , 'rubies' \
$(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \
default system $(rvm alias list | cut -d' ' -f1) && ret=0
Expand Down

0 comments on commit a459bfc

Please sign in to comment.