Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: named directories



> What difference between named directory and home directory?

The named directories are a list of directories for which a name is associated
explicitly by the user. That way, you can use the alias instead of the full
directory name. For example, if there is a variable
mydir=/home/me/foo/bar/qux
you can use ~mydir instead of /home/me/foo/bar/qux

The named directories are defined by the user by setting a variable to a valid
path ; there can be as many as you want.


The home directories are the directories where users have their actual home.
This is defined by how the system is installed and can usually be changed
by root only. The shell treats the name of the user exactly as if it was a
named directory pointing to the home of the user, though there is no variable
by that name. The home directories are defined in /etc/passwd, and are not
only used by the shell but a variety of other things, including the system
itself, even if most of the time the shell is the one who does the actual
substitution.


A last difference is that home directories can be reffered to as ~user in every
shell I can think of, whereas named directories work in zsh only (and maybe
ksh, I can't remember).

-- 
J
"If you wish to leave a record of your call,
 please state your messij at the sound of the tone."



Messages sorted by: Reverse Date, Date, Thread, Author