Post AjBtdpbAwRjxOkhW2y by awb@mastodon.sdf.org
 (DIR) More posts by awb@mastodon.sdf.org
 (DIR) Post #AjBtdo70T80umtZuNs by awb@mastodon.sdf.org
       2024-06-21T19:25:01Z
       
       0 likes, 0 repeats
       
       Question for fellow Shell experts: Is there a POSIX-portable utility to find another user's home directory? I am looking for an alternative to ~user in scripts.#shell #posix #linux #unix
       
 (DIR) Post #AjBtdpbAwRjxOkhW2y by awb@mastodon.sdf.org
       2024-06-21T22:19:36Z
       
       0 likes, 0 repeats
       
       Just for reference again here with public visibility. POSIX.1-2017 says:"User DatabaseThere are no references in POSIX.1-2017 to a "passwd file" or a "group file", and there is no requirement that the group or passwd databases be kept in files containing editable text."#posix
       
 (DIR) Post #AjBtdqKuCQJtga62KG by cks@mastodon.social
       2024-06-22T16:07:52Z
       
       1 likes, 0 repeats
       
       @awb I can't think of a POSIX utility for this. I wouldn't be surprised if the omission was deliberate; is there anything in POSIX that requires there to be more than one user? (Who has some arbitrary but constant UID.)That would be a perverse Unix, but the folklore I heard was that POSIX was deliberately designed so that non-Unixes could conform, for US government contracting reasons. (And I believe some non-Unixes once were POSIX certified.)