The
USER_HOME="$(getent passwd | awk '{ FS=":" } /'"$SUDO_USER"'/ {print $6}')"
line in enter-systemd-namespace may result in multiple entries if the value of $SUDO_USER present in multiple lines.
For example, assume that the $SUDO_USER is bus and a section of the getent passwd is as follows :
The
USER_HOME="$(getent passwd | awk '{ FS=":" } /'"$SUDO_USER"'/ {print $6}')"
line inenter-systemd-namespace
may result in multiple entries if the value of$SUDO_USER
present in multiple lines. For example, assume that the$SUDO_USER
isbus
and a section of thegetent passwd
is as follows :Then USER_HOME will be set to
To solve it, the reg. ex. in awk command should be changed to
'"^$SUDO_USER:"'