Avoid some unnecessary command invocations.

This commit is contained in:
Ville Skyttä 2011-03-21 19:23:57 +02:00
parent f973eb043c
commit 8aed79dd3e
2 changed files with 3 additions and 4 deletions

View File

@ -121,7 +121,7 @@ _perldoc()
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \ COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \
'$( PAGER=/bin/cat man perl | \ '$( PAGER=/bin/cat man perl | \
sed -ne "/perl.*Perl overview/,/perlwin32/p" | \ sed -ne "/perl.*Perl overview/,/perlwin32/p" | \
awk "\$NF=2 { print \$1}" | command grep perl )' -- "$cur" ) ) awk "\$NF=2 && \$1 ~ /^perl/ { print \$1 }" )' -- "$cur" ) )
fi fi
_filedir 'p@(l|m|od)' _filedir 'p@(l|m|od)'
fi fi

View File

@ -13,9 +13,8 @@ _rpcdebug_flags()
done done
if [ -n "$module" ]; then if [ -n "$module" ]; then
COMPREPLY=( $( compgen -W "$(rpcdebug -vh 2>&1 \ COMPREPLY=( $( compgen -W "$( rpcdebug -vh 2>&1 | \
| command grep '^'$module' '\ sed -ne 's/^'$module'[[:space:]]\{1,\}//p' )" -- "$cur" ) )
| awk '{$1 = ""; print $0}')" -- "$cur" ) )
fi fi
} }