Skip to content

Instantly share code, notes, and snippets.

@rockpapergoat
Created November 27, 2010 00:07
Show Gist options
  • Save rockpapergoat/717380 to your computer and use it in GitHub Desktop.
Save rockpapergoat/717380 to your computer and use it in GitHub Desktop.
another try, declaring only one variable instead of three
#!/usr/bin/env ruby -wKU
def iterate_users
userlist=`/usr/bin/dscl . -list /users UniqueID`.split("\n").map { |pair| pair.split(" ").to_a }.find_all { |item| item.at(1).to_i > 500 }
p userlist
end
iterate_users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment