diff --git a/completions/perl b/completions/perl index 7ddfffe3..f46ae162 100644 --- a/completions/perl +++ b/completions/perl @@ -121,7 +121,7 @@ _perldoc() COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \ '$( PAGER=/bin/cat man perl | \ 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 _filedir 'p@(l|m|od)' fi diff --git a/completions/rpcdebug b/completions/rpcdebug index be2a8709..a7c5e971 100644 --- a/completions/rpcdebug +++ b/completions/rpcdebug @@ -13,9 +13,8 @@ _rpcdebug_flags() done if [ -n "$module" ]; then - COMPREPLY=( $( compgen -W "$(rpcdebug -vh 2>&1 \ - | command grep '^'$module' '\ - | awk '{$1 = ""; print $0}')" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( rpcdebug -vh 2>&1 | \ + sed -ne 's/^'$module'[[:space:]]\{1,\}//p' )" -- "$cur" ) ) fi }