:: Re: [DNG] How do I get the user's h…
Top Pagina
Delete this message
Reply to this message
Auteur: Edward Bartolo
Datum:  
Aan: Riccardo Boninsegna
CC: dng
Onderwerp: Re: [DNG] How do I get the user's home directory path?
Working solution found.

Thanks

On 11/10/2015, Riccardo Boninsegna <rboninsegna2@???> wrote:
> On Sun, 11 Oct 2015 13:52:36 +0200
> Edward Bartolo <edbarx@???> wrote:
>> I need to get the unprivileged user home directory path. Does anyone know
>> of a solution?
>
> Can you pass the user's name or UID to the backend in some way?
> If yes, this command could probably be adapted (credits:
> http://www.unix.com/unix-for-dummies-questions-and-answers/248183-extract-user-accounts-home-directory-etc-passwd.html)
> -- and I think there's actually a libc function for that!
>
> `while IFS=: read user shadow uid guid geco home sh; do if [[ $uid -eq 1000
> ]]; then echo $user $home; fi; done < /etc/passwd`
>
>
> --
> If you have received this e-mail by accident,
> please bake it in the oven at 250 °C for 40 minutes
> then let it cool down before frosting.
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>