From owner-freebsd-questions@freebsd.org Mon Jul 20 09:30:43 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDEF9376E59 for ; Mon, 20 Jul 2020 09:30:43 +0000 (UTC) (envelope-from freebsd-questions@m.gmane-mx.org) Received: from ciao.gmane.io (static.214.254.202.116.clients.your-server.de [116.202.254.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9Gg61WLGz3Src for ; Mon, 20 Jul 2020 09:30:41 +0000 (UTC) (envelope-from freebsd-questions@m.gmane-mx.org) Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jxS87-0004g4-S4 for freebsd-questions@freebsd.org; Mon, 20 Jul 2020 11:30:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: freebsd-questions@freebsd.org To: freebsd-questions@freebsd.org From: Morten Bo Johansen Subject: Re: Locale oddity Date: Mon, 20 Jul 2020 11:30:33 +0200 Message-ID: References: <0467d480-ba58-3d5d-ca77-34d784b667f9@yuripv.dev> Reply-To: mbj@mbjnet.dk User-Agent: slrn/1.0.3 (FreeBSD) Mail-Copies-To: Never X-Rspamd-Queue-Id: 4B9Gg61WLGz3Src X-Spamd-Bar: +++++ X-Spamd-Result: default: False [5.65 / 15.00]; HAS_REPLYTO(0.00)[mbj@mbjnet.dk]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_POLICY_QUARANTINE(1.50)[mbjnet.dk : SPF not aligned (relaxed), No valid DKIM,quarantine]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; HFILTER_HOSTNAME_5(3.00)[static.214.254.202.116.clients.your-server.de]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_MEDIUM(0.22)[0.218]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_SHORT(0.45)[0.452]; NEURAL_SPAM_LONG(0.48)[0.475]; FORGED_SENDER(0.30)[listmail@mbjnet.dk,freebsd-questions@m.gmane-mx.org]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:116.202.0.0/16, country:DE]; FROM_NEQ_ENVFROM(0.00)[listmail@mbjnet.dk,freebsd-questions@m.gmane-mx.org]; GREYLIST(0.00)[pass,meta]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2020 09:30:43 -0000 On 2020-07-19 Yuri Pankov wrote: > I'm not sure what exactly you are asking, so I'll just quote the > specification, > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html, > for the logic used: Well, the reason I was asking was that I was working on a script where one of the functions will determine the user's language reliably from the locale settings. Therefore I tried various error handling, like e.g. the LANG variable not being set, etc. and I noticed this behaviour and I wondered why. I see the rule #4 you are referring to, but the logic in it is still not clear to me: Some script or program might set the $LANG variable to an empty value and then the LC_* variables that I set myself will be changed behind my back? Anyway, thanks for the answer to you and Polytropon. Morten