commit 27ec914870cd4ddca9c6599e47b651535eb701ef parent fb12b50d7d0837a11292b8eaf28af79527f7c4b7 Author: hellekin <hellekin@cepheide.org> Date: Mon, 3 Nov 2014 17:36:52 -0300 [cleanup] Fix path to user's temporary files Diffstat:
M | tomb | | | 13 | +++++++------ |
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/tomb b/tomb @@ -157,18 +157,19 @@ _whoami() { typeset -gi _GID _UID typeset -g _TTY _USER + # Set username from UID or environment + [[ -n $SUDO_USER ]] && _USER=$SUDO_USER + [[ -z $_USER && -n $USERNAME ]] && _USER=$USERNAME + [[ -z $_USER ]] && _USER=$(id -u) + # Get GID from option -G or the environment option_is_set -G \ - && _GID=$(option_value -G) || _GID=$(id -g) + && _GID=$(option_value -G) || _GID=$(id -g $_USER) # Get UID from option -U or the environment option_is_set -U \ - && _UID=$(option_value -U) || _UID=$(id -u) + && _UID=$(option_value -U) || _UID=$(id -u $_USER) - # Set username from UID or environment - [[ -n $SUDO_USER ]] && _USER=$SUDO_USER - [[ -z $_USER && -n $USERNAME ]] && _USER=$USERNAME - [[ -z $_USER ]] && _USER=$(id -u) # _verbose "Identified caller: ::1 username:: (::2 UID:::::3 GID::)" \ # $_USER $_UID $_GID