Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <006d01c292e4$fe8f2cf0$78d96f83@pomello>
From: "Max Bowsher" <maxb@ukf.net>
To: <cygwin@cygwin.com>,
   "=?iso-8859-1?B?U3RldmUgTvrxZXo=?=" <nunez@helios.net>
References: <5.2.0.9.0.20021123115631.00ad1780@localhost>
Subject: Re: USER environment variable mystery
Date: Sat, 23 Nov 2002 11:39:32 -0000
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

Steve Núñez <nunez@helios.net> wrote:

> I've recently spent some time configuring cygwin, and it's mostly
> gone as expected. I say mostly because I've noticed a strange
> behavior with the USER environment variable, and possibly others.
> I've set this in both ~/.bashrc and in /etc/profile to be the user
> name that our UNIX machines expect (the surname). The windows 2000
> machine I'm using thinks that the USER is "firstname lastname". Now
> after setting these variables in ~/.bashrc, echo shows that they have
> been properly set, however both my bash prompt and applications such
> as ssh and xemacs continue to use "firstname lastname" (xemacs get's
> this from "(getenv USER)", making me suspect some strangeness in the
> getenv function).
>
> Does anyone know how to *really* change the environment variables? Is
> this set somewhere deeper in the cygwin structure?

Nope. Its a generic bash question, as far as I can tell.
Sounds like youv'e set the shell variable, but not exported it to the
environment.

> I've also tried
> setting this from the cygwin.bat file, but with no success.

Did you comment out the line in /etc/profile which resets it?

Anyway, you might be better served by modifiying your user entry in
/etc/passwd. Read Cygwin's user guide for the details, but I think you will
need to do something like (untested)

- Change your username to surname in the first passwd field
- Add a U-DOMAIN\firstname lastname to the gecos field.

But check in the cygwin user guide first!


Max.


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

