Mac PATH: Difference between revisions
No edit summary |
|||
Line 7: | Line 7: | ||
=Overview= | =Overview= | ||
On Macs, the value of the <code>[[Bash_Built-In_Variables#PATH|PATH]]</code> variable is built by the <code>path_helper</code> utility from the content of the <code>/etc/paths</code> file and the <code>/etc/paths.d</code> directory. | On Macs, the value of the <code>[[Bash_Built-In_Variables#PATH|PATH]]</code> variable is built by the <code>path_helper</code> utility from the content of the <code>/etc/paths</code> file and the <code>/etc/paths.d</code> directory. | ||
=<tt>/etc/paths</code>= | |||
=<tt>/etc/paths</tt>= | |||
The file contains the paths that need to be set in the <code>PATH</code> environment variable, one per line, in the order in which to show up in the environment variable value. | |||
=<tt>/etc/paths.d</tt>= | |||
This directory contains the list of files. Each of the files contains the path that needs to be added to the PATH variable. The order in which the values are added is given by the alphanumeric order of the file names. The value specified in a <code>10-something</code> file will show up before the value specified in <code>20-soemethingelse</code>. The primary reason that <code>/etc/paths.d</code> directory is used because <code>/etc/paths</code> will be modified and/or replaced by system upgrades while contents of <code>/etc/paths.d</code> directory will never be affected by such changes. |
Revision as of 03:12, 6 January 2022
External
Internal
Overview
On Macs, the value of the PATH
variable is built by the path_helper
utility from the content of the /etc/paths
file and the /etc/paths.d
directory.
/etc/paths
The file contains the paths that need to be set in the PATH
environment variable, one per line, in the order in which to show up in the environment variable value.
/etc/paths.d
This directory contains the list of files. Each of the files contains the path that needs to be added to the PATH variable. The order in which the values are added is given by the alphanumeric order of the file names. The value specified in a 10-something
file will show up before the value specified in 20-soemethingelse
. The primary reason that /etc/paths.d
directory is used because /etc/paths
will be modified and/or replaced by system upgrades while contents of /etc/paths.d
directory will never be affected by such changes.