From owner-freebsd-questions@freebsd.org Thu Jun 9 02:56:49 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BAC3B6EEAE for ; Thu, 9 Jun 2016 02:56:49 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 457351734 for ; Thu, 9 Jun 2016 02:56:48 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-156-20.dynamic.qsc.de [92.195.156.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 8C6B23CE50; Thu, 9 Jun 2016 04:56:46 +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 u592ujdV003499; Thu, 9 Jun 2016 04:56:45 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 9 Jun 2016 04:56:45 +0200 From: Polytropon To: Erich Dollansky Cc: freebsd-questions@freebsd.org Subject: Re: HOME, Home and home in tcsh Message-Id: <20160609045645.f98518c7.freebsd@edvax.de> In-Reply-To: <20160609102944.39f0e4c2@X220.alogt.com> References: <20160609102944.39f0e4c2@X220.alogt.com> Reply-To: Polytropon 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 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 02:56:49 -0000 On Thu, 9 Jun 2016 10:29:44 +0800, Erich Dollansky wrote: > Hi, > > the answer to my question might be so obvious, but I do not know it. > > I use this to set the home for the current project I am working on and > then use cd $Home to return to the project's home directory: > > setenv home "`pwd`/" > setenv Home "`pwd`/" > > 'home' contains always my real home directory. 'Home' contains the > project's home directory as expected. > > Does anybody know why it is like this? The variable $home is set by the C shell automatically, similarly as it does "set path = (... list of path elements ...)"; $home is set like $HOME by the shell itself and should not be altered by the user (without purpose). :-) >From "man csh": The character `~' at the beginning of a filename refers to home direc- tories. Standing alone, i.e., `~', it expands to the invoker's home directory as reflected in the value of the home shell variable. [...] Special shell variables The variables described in this section have special meaning to the shell. The shell sets addsuffix, argv, autologout, csubstnonl, command, echo_style, edit, gid, group, home, loginsh, oid, path, prompt, prompt2, prompt3, shell, shlvl, tcsh, term, tty, uid, user and version at startup; they do not change thereafter unless changed by the user. The shell updates cwd, dirstack, owd and status when necessary, and sets logout on logout. The shell synchronizes group, home, path, shlvl, term and user with the environment variables of the same names: whenever the environment vari- able changes the shell changes the corresponding shell variable to match (unless the shell variable is read-only) and vice versa. Note that although cwd and PWD have identical meanings, they are not syn- chronized in this manner, and that the shell automatically intercon- verts the different formats of path and PATH. [...] home Initialized to the home directory of the invoker. The filename expansion of `~' refers to this variable. [...] HOME Equivalent to the home shell variable. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...