_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()
{
COMPREPLY+=( $( compgen -W \
'$( command grep "^[[:space:]]*/" /etc/shells 2>/dev/null )' \
-- "$cur" ) )
local shell rest
while read -r shell rest; do
[[ $shell == /* && $shell == "$cur"* ]] && COMPREPLY+=( $shell )
done 2>/dev/null < /etc/shells
}
# This function completes on valid filesystem types