Skip to content

Instantly share code, notes, and snippets.

@glarizza
Created January 14, 2011 14:53
Show Gist options
  • Select an option

  • Save glarizza/779695 to your computer and use it in GitHub Desktop.

Select an option

Save glarizza/779695 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
users = []
users += %x(ps aux 2> /dev/null | grep loginwindow | cut -d " " -f1).split()
puts (users - ['root']).join(",")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment