hi, loggedInUser=$(stat -f%Su /dev/console) gives the username. However
the username is not always equal to the name of the users homedir. Good
news is that you already have the UID, so you can add something like:
loggedInUserHome=$(dscacheutil -q us...