Skip to content

Instantly share code, notes, and snippets.

@rockpapergoat
Created March 5, 2011 20:37
Show Gist options
  • Save rockpapergoat/856694 to your computer and use it in GitHub Desktop.
Save rockpapergoat/856694 to your computer and use it in GitHub Desktop.
more user record stuff
#!/usr/bin/env ruby -wKU
# cf. http://twitter.com/nigelkersten/status/44114754112995328
require 'pp'
require 'etc'
users = []
Etc.passwd() { |u|
users << Hash[u.name, u.uid] if u.uid >= 500
}
pp users
pp users.class
users.each {|u,k| pp u if u.has_value?(501)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment