I'd like to be able to retrieve the current user's associated Apple ID from a shell script. My first guess was to do so using
dscl which I can get using my own user. But I'm not sure how reliable/consistent this method would be generally for any user.
dscl . readpl /Users/[username] dsAttrTypeNative:LinkedIdentity appleid.apple.com:linked\ identities:0:full\ name
Are there any alternative ways to do this? Maybe reading a plist somewhere using