Using export USER=myName doesn't change the output of whoami
1
vote
1
answer
1956
views
I saw this example
$ whoami
MatsP
$ g++ -Wall -std=c++0x getenv.cpp
$ ./a.out
MatsP
$ export USER=DonaldDuck
$ ./a.out
DonaldDuck
but for me it doesn't work. I am in a Debian machine. I used
export -p
and indeed the variable changed. I refreshed the bachrc
, still nothing. How to achiece the above? whoami
displays the default value.
Asked by traveller
(111 rep)
Apr 5, 2016, 01:19 PM
Last activity: Apr 5, 2016, 02:15 PM
Last activity: Apr 5, 2016, 02:15 PM