Method: Mac::User#uid_next

Defined in:
lib/beaker/host/mac/user.rb

#uid_nextFixnum

Gives the next uid not used on the system

Returns:

  • (Fixnum)

    The next uid not used on the system



76
77
78
79
# File 'lib/beaker/host/mac/user.rb', line 76

def uid_next
  uid_last = execute("dscl . -list /Users UniqueID | sort -k 2 -g | tail -1 | awk '{print $2}'")
  uid_last.to_i + 1
end