New functionality has been added to the
command. You can change back to your previous directory with:
$ cd ?/span>
It also causes the name of the new current directory to be displayed. Here, we start in
, then change directory to
$ cd /usr/spool/news/lib
$ cd ?/span>
cd ?/span>, and we are back in
$ cd ?/span>
You can also change directories by substituting
of the current pathname with something else using this format:
in the current pathname is substituted with
. The new current working directory is displayed after the move. In this example, we start in
, we change directory to
$ cd uucp cron
variable is provided to make directory navigation easier. It contains a list of
-separated directories to check when a full pathname is not given to the
command. Each directory in
is searched from
for a directory that matches the
stands for the current directory. This
$ print $CDPATH
indicates to check the current directory first,
is not given a full pathname. Instead of typing
, you could just type
$ cd uucp
Or to change directory to
, you could type
$ cd bin
There is no default for
, so if it not specifically set, this feature is not enabled.
Make sure that only frequently used directories are included, because if
is too large, performance can be adversely affected by having to check so many directories each time
variable contains a list of colon-separated directories to check when a command is invoked. Each directory in
is searched from left-to-right for a file whose name matches the command name. If not found, an error message is displayed. A : alone in
specifies to check the current directory. This
setting specifies to check the
directory first, then
, and finally the current directory:
$ print $PATH
get too large, because performance can be adversely affected by having to check so many directories each time a command is invoked.
If not set, the default value for
variable specifies the number of seconds that the Korn shell will wait for input before displaying a 60-second warning message and exiting. If not set, the default used is
, which disables the timeout feature. To set a 10-minute timer, set
This variable is usually set by the system administrator in the
The Korn shell provides a number of variables that allow you to specify your mailbox file, how often to check for mail, what your mail notification message is, and a search path for mailbox files.
variable specifies how often, in seconds, to check for new mail. If not set, or set to zero, new mail is checked before each new prompt is displayed. Otherwise, the default setting is
seconds (10 minutes).
variable contains the name of a single mailbox file to check for new mail. It is not used if
variable contains a colon-separated list of mailbox files to check for new mail and is used if you want to read multiple mailboxes. It
variable if both are set. This
setting specifies to check two mailbox files,
$ print $MAILPATH
Just so you don't think you can go snooping around someone else's mailbox, this only works if you have read permission on the mailbox file.
is not set, there is no default.
New Mail Notification Message
When you get new mail, the Korn shell displays this message on your terminal just before the prompt:
you have mail in
You can also create your own mail notification message by appending a
followed by your message to the mailbox files given in
. If you wanted your message to be '
New mail alert
would be set like this:
$ MAILPATH=~anatole/mbox?'New mail alert'
What if you had two mailboxes set in
? How would you know which one to read? For this reason, the Korn shell has the
) variable. When given in the new mail notification message, it is substituted for the name of the mail box file. This
$ MAILPATH=~anatole/mbox?'Check $_':\
would cause "
" or "
" to be displayed if new mail was received in either of the mailboxes.
variable specifies your terminal type, and is usually set by your system administrator in the global
file. If it's not set there, then it's probably in your
file. You can tell if it's not set correctly by invoking
on an existent file. If you get garbage on your screen or the
commands are not working correctly, try resetting the
variable to something else:
$ typeset x TERM=
Then try running
again and see what happens.