Trying to write a Bash script that will pull all non-admin accounts into an array to which I can then remove the home directories rm -rf /Users/"$USER"
and also delete the Sys Pref user dscl . -delete /Users/"$USER"
.
I can pull all admins with dscl . -read /Groups/admin GroupMembership | grep "$USER" | awk '{ print $3 }'
but cannot figure out the command to pull non-admins.
Any help would be amazing!