I would like to find the umask value for a particular system user, the one that is applied when a script running as this user creates a new directory. I'm using both Ubuntu 16.04 and 20.04 systems.
The closest answer I can find to this is this question. I don't understand a word of it, but I tried the script
for user in $(awk -F: '{print $1}' /etc/passwd);
do
printf "%-10s" "$user" ; su -c 'umask' -l $user 2>/dev/null
done
given in the accepted answer; it printed the word "root" and then froze the system.
How do I find the umask value for a given system user?