January 2001
Intermediate to advanced
480 pages
7h 22m
English
Tilde substitution is used to substitute the pathname of a user's home directory for ∼user. Words in the command line that start with the tilde character cause the Korn shell to check the rest of the word up to a slash. If the tilde character is found alone or is only followed by a slash, it is replaced with the value of the HOME variable. This is a handy shortcut borrowed from the C shell. For example, to print the pathname of your home directory:
$ echo ∼ /home/anatole
or to list its contents:
$ ls ∼/ NEWS bin pc asp mail src
If the tilde character is followed by a login name file, it is replaced with the home directory of that user. Here we change directory to the tools directory in smith's home directory:
$ cd ∼smith/tools ...Read now
Unlock full access