#compdef newgrp local expl if (( ! $+groups )); then if whence -p ypcat > /dev/null; then : ${(A)groups:=${${(s: :)$(ypcat group.byname)}%%:*}} # If you use NIS else : ${(A)groups:=${${(s: :)$(