delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/12/09:32:00

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Ronald Landheer" <info AT rlsystems DOT net>
To: <cygwin AT cygwin DOT com>
Subject: Windows login name, USER and HOME env variables..
Date: Wed, 12 Sep 2001 15:31:12 +0200
Message-ID: <NFBBLOMHALONCDMPGBLFEEALCBAA.info@rlsystems.net>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Importance: Normal
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id JAA32740

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 AT 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 AT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019