The reserved environment variable CDPATH does not work.
Source: Internet
Author: User
The reserved environment variable CDPATH does not work-Linux general technology-Linux technology and application information. The following is a detailed description. This section is mentioned in the LINUX and unix shell programming guide:
3.4 embed shell Variables
Brourne shell has some reserved environment variable names that cannot be used for other purposes. These embedded environment variables are usually created in/etc/profile, but not completely, depending on the user. The following is a list of embedded shell variables.
1. CDPATH
Change directory path variables and keep a series of path names separated by colons for cd commands. If you set CDPATH and cd as a directory, first find CDPATH. If CDPATH indicates this directory, this directory becomes the current working directory. Example:
$ CDPATH =:/home/dave/bin:/usr/local/apps; export CDPATH.
If you want
$ Cd apps
The cd command first looks for the directory list in the CDPATH. If apps are found, it becomes the current working directory.
My shell command:
$ Pwd
/Home
$ CDPATH =:/usr/local/games; export CDPATH
$ Cd games
Bash: cd: games: No such file or directory
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service