From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79033 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5?= Newsgroups: gmane.comp.tex.context Subject: Re: System variable HOME Date: Sat, 03 Nov 2012 21:47:54 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351975712 4191 80.91.229.3 (3 Nov 2012 20:48:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Nov 2012 20:48:32 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Sat Nov 03 21:48:40 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TUkdu-00018C-Ok for gctc-ntg-context-518@m.gmane.org; Sat, 03 Nov 2012 21:48:34 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AC38B10221; Sat, 3 Nov 2012 21:48:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JWXvYubYSzCJ; Sat, 3 Nov 2012 21:48:22 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id C5EE8101F6; Sat, 3 Nov 2012 21:48:22 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 51B12101F6 for ; Sat, 3 Nov 2012 21:48:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KIf6FewcSTkL for ; Sat, 3 Nov 2012 21:48:20 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 3E746101EE for ; Sat, 3 Nov 2012 21:48:20 +0100 (CET) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qA3KmHvE029303 for ; Sat, 3 Nov 2012 21:48:19 +0100 Original-Received: from lk-2008-nbk ([88.100.123.157]) (authenticated user lpr@pontex.cz) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Sat, 3 Nov 2012 21:48:12 +0100 In-Reply-To: User-Agent: Opera Mail/12.02 (Win32) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=89.233.168.98; country=CZ; region=52; city=Prague; latitude=50.0833; longitude=14.4667; http://maps.google.com/maps?q=50.0833,14.4667&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VIj8MiHJ - aef9a7a9e367 - 20121103 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79033 Archived-At: On Sat, 03 Nov 2012 12:43:26 +0100, Sietse Brouwer wrote: >> it seems that Ctx [re]defines the system variable HOME on its run; > > This is not an answer, but a guess: Could it be that your interactive > shell uses one setting, and the non-interactive shell uses another? I'm using the windows default shell - cmd.exe; it is interactive in the manner that you can type a command on the command prompt and the command (or a program) is executed. In Windows, when a process is created, it inherits current system variables. If you launch a program from cmd.exe (= command line), the program (process) inherits all system variables existing in the moment of launching in the environment of the session of that cmd.exe. (Various instances of cmd.exe don't inter-corporate in the point-of-view of system variables.) Moreover, when the launched program changes a system variable, it changes it just in its-own scope; so values of system variables of the calling cmd.exe are not affected. BTW: I solved the problem a bit "hacky" (and hopefully temporarily, if we'll find a better solution): I'm calling "SET HOME.ORG=%HOME%" right before I launch context.exe; so I can access my previous variable value. Somewhere inside a Ctx source within a Lua scope I call: ---- local home = os.getenv("HOME.ORG") or os.getenv("HOME") or "MyUsualHomePath" ---- It works but it is not "nice" enough. Best regards, Lukas > I'm only guessing here, I don't know much about Windows > administration; I just remember being driven to despair by a similar > 'these settings are not used if the shell is not interactive' problem > under Linux. > > --Sietse ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________