From owner-freebsd-questions@FreeBSD.ORG Fri Jun 14 20:50:59 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C7858914 for ; Fri, 14 Jun 2013 20:50:59 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 919C5186B for ; Fri, 14 Jun 2013 20:50:59 +0000 (UTC) Received: from r56.edvax.de (port-92-195-15-122.dynamic.qsc.de [92.195.15.122]) by mx02.qsc.de (Postfix) with ESMTP id 3E04624C37; Fri, 14 Jun 2013 22:50:58 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r5EKp7UU002245; Fri, 14 Jun 2013 22:51:07 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 14 Jun 2013 22:51:07 +0200 From: Polytropon To: "Mike." Subject: Re: Setting a locale globally Message-Id: <20130614225107.8a39e8e3.freebsd@edvax.de> In-Reply-To: <201306141554060140.016975D2@smtp.24cl.home> References: <201306141213340281.009F8EE9@smtp.24cl.home> <20130614211207.d2d105b8.freebsd@edvax.de> <201306141554060140.016975D2@smtp.24cl.home> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 20:50:59 -0000 On Fri, 14 Jun 2013 15:54:06 -0400, Mike. wrote: > On 6/14/2013 at 9:12 PM Polytropon wrote: > > |On Fri, 14 Jun 2013 12:13:34 -0400, Mike. wrote: > |> I would like to set the locale of my 9.1 server to > |> > |> LANG="en_US.ISO8859-1" > |> > |> > |> globally, i.e., put the locale entry in one file, and then have the > |> locale propagate as I go into other shells and run various scripts. > | > |You can add this to /etc/csh.cshrc as it will be inherited by > |all interactive shells (login shells), unless of course they > |override it with ~/.cshrc: > | > | setenv LANG en_US.ISO8859-1 > > That works for the login shell, but when I su to another user (e.g., > root), LANG is no longer in the environment. That depends on _how_ you su. For example, if you use su -m, the environment will not be modified, but the UID 0 is gained. See "man su" for details. But you are correct in terms of what I mentioned: If some user-configuration changes or unsets $LANG, it will be gone, and it may even be possible that the setting will not be transmitted properly to a different shell ("inheriting environment"), especially if the shell is not the default login shell, but instead bash or zsh (when the setting is being made for csh only). > |It's also possible to add it to /etc/profile and even make an > |addition to /etc/login.conf's "default" setting: > | > | default:\ > | :setenv=LANG=en_US.ISO8859-1:... > > That works for the login shell, but when I su to another user (e.g., > root), LANG is no longer in the environment. Try su -m. Anyway, login.conf should be the better solution compared to the csh approach illustrated above. It should work independently from the kind of shell. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...