delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL |
X-Spam-Check-By: | sourceware.org |
MIME-Version: | 1.0 |
In-Reply-To: | <20100531081825.GF16885@calimero.vinschen.de> |
References: | <4C021FA8 DOT 4030403 AT users DOT sourceforge DOT net> <AANLkTilUfdSyZF6bVEKHCqImBF62vIu8aV2SNq2cx6xI AT mail DOT gmail DOT com> <20100531081825 DOT GF16885 AT calimero DOT vinschen DOT de> |
Date: | Mon, 31 May 2010 12:22:36 +0100 |
Message-ID: | <AANLkTikWtsAkY6ZasbF3ihfjtLVXBxkHDNN-Zj3AhQoL@mail.gmail.com> |
Subject: | Re: base-files: LOGNAME |
From: | Andy Koppe <andy DOT koppe AT gmail DOT com> |
To: | cygwin AT cygwin DOT com |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
On 31 May 2010 09:18, Corinna Vinschen wrote: > On May 30 10:02, Andy Koppe wrote: >> On Sunday, May 30, 2010, Yaakov wrote: >> > POSIX.1[1] describes a LOGNAME environment variable which represents t= he user's login name. =C2=A0Adding the following lines to /etc/profile shou= ld do the trick: >> > >> > LOGNAME=3D"`logname`" >> > export LOGNAME >> > >> > Where logname(1) is a program supplied by coreutils whose presence is = required by POSIX.1[2]. >> >> That would mean a costly fork() during shell startup. Could this be >> set in the DLL instead, as happens with the SHELL variable? > > Huh? =C2=A0The Cygwin DLL does not set $SHELL. You're right of course, it's actually bash that sets it. Seems I confused myself quite thoroughly when I looked into this a few weeks ago. Anyway, so we've got USERNAME, USER, and LOGNAME. Does anyone know what the differences between those are supposed to be? Apparently USERNAME is set automatically on NT systems, so could /etc/profile just copy that to USER and LOGNAME instead of invoking 'id' and 'logname'? Posix defines LOGNAME, but regarding USER it only says that it is "unwise to conflict with certain variables that are frequently exported by widely used command interpreters and applications". (http://opengroup.org/onlinepubs/007908799/xbd/envvar.html) Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |