mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 01:24:23 +08:00
parent
17116366dc
commit
05b2d4ee54
|
@ -40,6 +40,9 @@ The following options control variable scope:
|
|||
|
||||
- ``-u`` or ``--unexport`` causes the specified shell variable to NOT be exported to child processes
|
||||
|
||||
- ``--path`` causes the specified variable to be treated as a path variable, meaning it will automatically be split on colons, and joined using colons when quoted (`echo "$PATH"`) or exported.
|
||||
|
||||
- ``--unpath`` causes the specified variable to not be treated as a path variable. Variables with a name ending in "PATH" are automatically path variables, so this can be used to treat such a variable normally.
|
||||
|
||||
The following options are available:
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ Other variables, like ``$PATH``, really do have multiple values. During variable
|
|||
/usr/bin /bin /usr/sbin /sbin /usr/local/bin
|
||||
|
||||
|
||||
Note that there are three environment variables that are automatically split on colons to become lists when fish starts running: ``PATH``, ``CDPATH``, ``MANPATH``. Conversely, they are joined on colons when exported to subcommands. All other environment variables (e.g., ``LD_LIBRARY_PATH``) which have similar semantics are treated as simple strings.
|
||||
Variables whose name ends in "PATH" are automatically split on colons to become lists. They are joined using colons when exported to subcommands. This is for compatibility with other tools, which expect $PATH to use colons. You can also explicitly add this quirk to a variable with `set --path`, or remove it with `set --unpath`.
|
||||
|
||||
Lists cannot contain other lists: there is no recursion. A variable is a list of strings, full stop.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user