+1 using `id` instead of `grep /etc/group` seems like a good approach.