This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Windows login name, USER and HOME env variables..


Hello all,

I'm just wondering about something here: I've patched up my profile 
script like this:
-- BEGIN diff -u profile~ profile --
--- profile~    Wed Sep  5 12:17:56 2001
+++ profile     Wed Sep  5 12:32:18 2001
@@ -1,6 +1,6 @@
 PATH="/usr/local/bin:/usr/bin:/bin:$PATH"

-USER="`id -un`"
+USER="`id -un | sed s/[' '\t]//`"

 # Set up USER's home directory
 if [ -z "$HOME" ]; then
--- END diff -u profile~ profile ---
This kicks the whitespaces out of the USER, and subsequently the HOME 
env variables - works like a charm: when I do printenv | grep Ronald (my 
name) I get:

-- BEGIN SNAPSHOT --
Ronald Landheer@ALLY ~
$ printenv | grep Ronald
PWD=/home/RonaldLandheer
USER=RonaldLandheer
HOME=/home/RonaldLandheer
--- END SNAPSHOT ---

Now here's the strange part - and the reason why I'm mailing:
If you look at the "snapshot" above, you'll see by full name four times 
- three times without the space, once *with* the space. I.e.: somehow 
Bash still knows there's a space in my name!
Another thing: when I try to get developers access to one of my projects 
on sourceforge through CVS, it tries to make the directory 
"/home/Ronald Landheer/.ssh"
           ^^^^^-- note the space!
This being slightly annoying, I'd like to know if there's another 
workaround than just logging in under another name on my system.

I've searched the Windoze registry for my name and did "cygcheck -s -r | 
grep Ronald" which got this from cygcheck:
-- BEGIN SNAPSHOT --
Ronald Landheer@ALLY /etc
$ cygcheck -s -r | grep Ronald
USER = `RonaldLandheer'
HOME = `/home/RonaldLandheer'
--- END SNAPSHOT ---
i.e. the two env vars
>From the registry, I got one of my sites on the local server a couple of 
times, my mail address, my profile path, some micro$oft program prefs 
with my name in it, etc.. I also got the key "HKEY_LOCAL_MACHINE\Network
\Logon" which is actually the only one I thought Cygwin might be 
interested in - is it?

In summary, my questions:
  a. Where does Bash get the space from? (the registry key mentioned 
     above, or elsewhere?)
  b. Idem for CVS - isn't that supposed to use the $HOME variable to 
     find out where my files live (and where it should plant the .ssh 
     dir)?
  c. Other than logging in under another name, is there a workaround?
  d. Should this be considered a bug?

Greetz!

Ronald


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]