You are not logged in.
I recently switched over to arch and I'm loving how quick it is. but I have started noticing a problem that is a little bothersome.
When I log in, my '$HOME' variable get set to '/home/me/' instead of '/home/me'.
This has the undesirable effect of listing my full working directory in my prompt when I'm in my home directory. When you first log in, it displays my working directory as '~/', but just typing 'cd' makes the prompt list the full home directory '/home/me'.
Logging in and echoing '$HOME' shows the trailing '/'. A simple test was to manually change the $HOME variable to my home directory without a trailing '/', and the prompt started to behave.
What sets the '$HOME' variable? Can I fix this without re-defining my '$HOME' variable in my '.profile'?
For some reason, when I log into root and echo '$HOME' it isn't listed with a trailing slash.
Offline
Ok, after more searching, it looks like '$HOME' is set from the '/etc/passwd' file. Which means the entries were populated by the program 'useradd'.
Simple fix was to just edit the '/etc/passwd' file.
Thanks anyway.
Offline
Simple fix was to just edit the '/etc/passwd' file.
Really? Simple is not the adjective I'd choose. Dangerous or Ballsy, perhaps.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Strange. My $HOME doesn't have the trailing slash:
[andy:l7] ~ $ echo $HOME
/home/andyOffline
Always remember to use pwck(8) after editing /etc/passwd. You shouldn't ever have to edit that file manually but I presume an incorrect option was entered for useradd(8) when creating the new user.
I thought the perhaps pwck(8) would fix a mistake like that but it doesn't so in this case a manual edit was needed.
Jin, Jîyan, Azadî
Offline
Always remember to use pwck(8) after editing /etc/passwd. You shouldn't ever have to edit that file manually but I presume an incorrect option was entered for useradd(8) when creating the new user.
I thought the perhaps pwck(8) would fix a mistake like that but it doesn't so in this case a manual edit was needed.
You're right. I was able to track down where it originated. It was me using the '-d' option of 'useradd' with tab completion. It didn't remove the trailing slash before adding it to the passwd file.
And for the record, I'm smart enough to always make a copy of the file I'm editing, before editing.
But I do see the need to let others know not to directly edit the '/etc/passwd' file.
Was not aware of 'pwck', ty.
Offline