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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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