Is the $LOGNAME env variable deprecated or broken in 11.10 Oneiric?

Asked by Chris

I have a few scripts for backup and restore type operations that use the environment variable $LOGNAME to reference the user's home directory. This works fine in previous releases (mostly 10.04 LTS) but it seems to be broken in 11.10 beta2. Is this something unexpected that should actually work, or has it been deprecated at some point and no longer works? Google searches so far have not yielded any information on this.


Question information

English Edit question
Ubuntu bash Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :

I get

andy@fileserver:~$ echo $LOGNAME
andy@fileserver:~$ whoami

You can set it if you want.

Revision history for this message
Chris (fabricator4) said :

Is that on Oneiric beta2? The environment variable is blank:

chris@chris-oneiric:~$ echo $LOGNAME


It does say LOGNAME should not be relied on because it _can_ be changed, but this is either a mistake that needs to be fixed, or something that's going to break a lot of scripts written since UNIX III.

Doubly, if it's working for you in beta2 but not for me, then it appears to be a bug, so the question still remains, is it a bug, or was it deprecated while I wasn't looking? I'm tending more towards a bug.


Revision history for this message
Best actionparsnip (andrew-woodhead666) said :

Its in Oneiric with all the updates as of the time I replied. Feel free to log a bug if you suspect one.

Revision history for this message
Chris (fabricator4) said :

I think I'll have to report a bug... Seems like the wheels have fallen off it somewhere along the way. First I will make sure that everything is updated even though I did this morning, and do a clean boot etc.


Revision history for this message
Chris (fabricator4) said :

OK, I've dropped a bug report into Launchpad, initially against bash, but changed to core-utils which I think is more correct:

Thanks for the help - if our two systems are acting differently, and mine is a new install with not much done to it, then there's an problem there somewhere.


Revision history for this message
Chris (fabricator4) said :

Thanks actionparsnip, that solved my question.