I would like to write files to a directory (not under the user's home) which includes the userid.
Example:
userid = john
John's home dir is /home/john
I want to create a directory /var/prog/john
MSG_HOME=/var/prog; export MSG_HOME;
USR_NAME=@@@@; export USER_NAME;
if [ ! -d "$MSG_HOME/$USR_NAME" ];
then
mkdir $MSG_HOME/$USR_NAME || USAGE_EXIT "Unable to create " "$MSG_HOME/$USR_NAME "
fi
How do i define @@@@ ?
id -u -n will return john
but how do I get is assigned to USR_NAME?