Skip to content

Commit 4139aad

Browse files
committed
Cleanup environment variables FAQ.
1 parent 4ef1da9 commit 4139aad

File tree

1 file changed

+23
-45
lines changed

1 file changed

+23
-45
lines changed

doc/faq/environment_variables_faq.rst

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Environment Variables
1717

1818
.. envvar:: HOME
1919

20-
The user's home directory. On linux, :envvar:`~ <HOME>` is shorthand for :envvar:`HOME`.
20+
The user's home directory. On Linux, :envvar:`~ <HOME>` is shorthand for :envvar:`HOME`.
2121

2222
.. envvar:: MPLBACKEND
2323

@@ -26,13 +26,14 @@ Environment Variables
2626

2727
.. envvar:: MPLCONFIGDIR
2828

29-
This is the directory used to store user customizations to matplotlib, as
30-
well as some caches to improve performance. If :envvar:`MPLCONFIGDIR` is not
31-
defined, :file:`{HOME}/.config/matplotlib` is generally used on unix-like
32-
systems and :file:`{HOME}/.matplotlib` is used on other platforms, if they are
33-
writable. Otherwise, the python standard library :func:`tempfile.gettempdir`
34-
is used to find a base directory in which the :file:`matplotlib` subdirectory
35-
is created.
29+
This is the directory used to store user customizations to
30+
Matplotlib, as well as some caches to improve performance. If
31+
:envvar:`MPLCONFIGDIR` is not defined, :file:`{HOME}/.config/matplotlib`
32+
and :file:`{HOME}/.cache/matplotlib` are used on Linux, and
33+
:file:`{HOME}/.matplotlib` on other platforms, if they are
34+
writable. Otherwise, the Python standard library's `tempfile.gettempdir` is
35+
used to find a base directory in which the :file:`matplotlib` subdirectory is
36+
created.
3637

3738
.. envvar:: PATH
3839

@@ -50,64 +51,41 @@ Environment Variables
5051

5152
.. _setting-linux-osx-environment-variables:
5253

53-
Setting environment variables in Linux and OS-X
54-
===============================================
54+
Setting environment variables in Linux and macOS
55+
================================================
5556

5657
To list the current value of :envvar:`PYTHONPATH`, which may be empty, try::
5758

5859
echo $PYTHONPATH
5960

6061
The procedure for setting environment variables in depends on what your default
61-
shell is. :program:`BASH` seems to be the most common, but :program:`CSH` is
62-
also common. You should be able to determine which by running at the command
63-
prompt::
62+
shell is. Common shells include :program:`bash` and :program:`csh`. You
63+
should be able to determine which by running at the command prompt::
6464

6565
echo $SHELL
6666

67-
68-
BASH/KSH
69-
--------
70-
71-
To create a new environment variable::
72-
73-
export PYTHONPATH=~/Python
74-
75-
To prepend to an existing environment variable::
76-
77-
export PATH=~/bin:${PATH}
78-
79-
The search order may be important to you, do you want :file:`~/bin` to
80-
be searched first or last? To append to an existing environment
81-
variable::
82-
83-
export PATH=${PATH}:~/bin
84-
85-
To make your changes available in the future, add the commands to your
86-
:file:`~/.bashrc` file.
87-
88-
89-
CSH/TCSH
90-
--------
91-
9267
To create a new environment variable::
9368

94-
setenv PYTHONPATH ~/Python
69+
export PYTHONPATH=~/Python # bash/ksh
70+
setenv PYTHONPATH ~/Python # csh/tcsh
9571

9672
To prepend to an existing environment variable::
9773

98-
setenv PATH ~/bin:${PATH}
74+
export PATH=~/bin:${PATH} # bash/ksh
75+
setenv PATH ~/bin:${PATH} # csh/tcsh
9976

100-
The search order may be important to you, do you want :file:`~/bin` to be searched
101-
first or last? To append to an existing environment variable::
77+
The search order may be important to you, do you want :file:`~/bin` to be
78+
searched first or last? To append to an existing environment variable::
10279

103-
setenv PATH ${PATH}:~/bin
80+
export PATH=${PATH}:~/bin # bash/ksh
81+
setenv PATH ${PATH}:~/bin # csh/tcsh
10482

10583
To make your changes available in the future, add the commands to your
106-
:file:`~/.cshrc` file.
84+
:file:`~/.bashrc`/:file:`.cshrc` file.
10785

10886
.. _setting-windows-environment-variables:
10987

110-
Setting environment variables in windows
88+
Setting environment variables in Windows
11189
========================================
11290

11391
Open the :program:`Control Panel` (:menuselection:`Start --> Control Panel`),

0 commit comments

Comments
 (0)