1

I changed an account on a Windows 7 machine from 'user' to my own name, and after rebooting, my name is the value of the environment variable USERNAME. But USER is still set to 'user'.

How do I change that? Where does the value of USER come from?

$ set | egrep "USER=|USERNAME="
USER=user
USERNAME=warren
2

Where does the value of USER come from?

Take a look in /etc/profile. You will find the following:

# Set the user id
USER="$(/usr/bin/id -un)"

id gets it's data from /etc/passwd

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.