_shells: Rewrite in plain bash instead of using grep.

This commit is contained in:
Ville Skyttä 2011-06-04 19:58:52 +03:00
parent d9a5a88332
commit d0c4f5ddd2

View File

@ -1142,9 +1142,10 @@ _allowed_groups()
# #
_shells() _shells()
{ {
COMPREPLY+=( $( compgen -W \ local shell rest
'$( command grep "^[[:space:]]*/" /etc/shells 2>/dev/null )' \ while read -r shell rest; do
-- "$cur" ) ) [[ $shell == /* && $shell == "$cur"* ]] && COMPREPLY+=( $shell )
done 2>/dev/null < /etc/shells
} }
# This function completes on valid filesystem types # This function completes on valid filesystem types