mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
parent
89687e7db7
commit
7fc72e46b3
1 changed files with 5 additions and 0 deletions
|
@ -275,6 +275,8 @@ You can erase (or "delete") a variable with ``-e`` or ``--erase``
|
|||
> env | grep MyVariable
|
||||
(no output)
|
||||
|
||||
.. _tut-exports:
|
||||
|
||||
Exports (Shell Variables)
|
||||
-------------------------
|
||||
|
||||
|
@ -290,6 +292,7 @@ To give a variable to an external command, it needs to be "exported". Unlike oth
|
|||
|
||||
It can also be unexported with ``--unexport`` or ``-u``.
|
||||
|
||||
This works the other way around as well! If fish is started by something else, it inherits that parents exported variables. So if your terminal emulator starts fish, and it exports ``$LANG`` set to ``en_US.UTF-8``, fish will receive that setting. And whatever started your terminal emulator also gave *it* some variables that it will then pass on unless it specifically decides not to. This is how fish usually receives the values for things like ``$LANG``, ``$PATH`` and ``$TERM``, without you having to specify them again.
|
||||
|
||||
.. _tut-lists:
|
||||
|
||||
|
@ -641,6 +644,8 @@ $PATH
|
|||
|
||||
``$PATH`` is an environment variable containing the directories that fish searches for commands. Unlike other shells, $PATH is a :ref:`list <tut-lists>`, not a colon-delimited string.
|
||||
|
||||
Fish takes care to set ``$PATH`` to a default, but typically it is just inherited from fish's parent process and is set to a value that makes sense for the system - see :ref:`Exports <tut-exports>`.
|
||||
|
||||
To prepend /usr/local/bin and /usr/sbin to ``$PATH``, you can write::
|
||||
|
||||
> set PATH /usr/local/bin /usr/sbin $PATH
|
||||
|
|
Loading…
Reference in a new issue