## Worked on osx class Users @@users def initialize @@users = `/usr/bin/awk -F: '{ if ($3<=499) print "system,"$1","$6; else print "user,"$1","$6; }' < /etc/passwd` end def parse $users = @@users.split("\n") $i = 0 $return_users = {} $users.each do |user_block| $i += 1 user_block = user_block.split(",") $return_users[$i] = { 'platform' => user_block[0], 'user' => user_block[1], 'directory' => user_block[2] } end $return_users end end