Date: Thu, 09 Jun 2016 09:49:17 -0600 From: jd1008 <jd1008@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: HOME, Home and home in tcsh Message-ID: <57598FFD.9020004@gmail.com> In-Reply-To: <20160609045645.f98518c7.freebsd@edvax.de> References: <20160609102944.39f0e4c2@X220.alogt.com> <20160609045645.f98518c7.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06/08/2016 08:56 PM, Polytropon wrote: > 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. > > > > +1 Shell make no use of $Home.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57598FFD.9020004>