Skip to content

Commit 957257b

Browse files
memshardedczoido
andauthored
env unset docs (#4337)
* env unset docs * Update reference/config_files/profiles.rst --------- Co-authored-by: Carlos Zoido <[email protected]>
1 parent 96015d5 commit 957257b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

reference/config_files/profiles.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ when you're composing profiles or even local variables:
275275
* ``=+`` == ``prepend``: puts values at the beginning of the existing value.
276276
* ``=!`` == ``unset``: gets rid of any variable value.
277277

278+
Note that it is different to define an empty variable, like ``MyVar1=``, which defines it with a value of an empty string,
279+
that requesting it to be explicitly unset with the ``MyVar1=!`` syntax.
280+
278281
Another essential point to mention is the possibility of defining variables as `PATH` ones by simply putting ``(path)`` as
279282
the prefix of the variable. It is useful to automatically get the append/prepend of the `PATH` in different systems
280283
(Windows uses ``;`` as separation, and UNIX ``:``).
@@ -289,6 +292,9 @@ the prefix of the variable. It is useful to automatically get the append/prepend
289292
# Append another value to "MyVar1"
290293
MyVar1+=MyValue12
291294
295+
# Define a variable with an empty string value
296+
MyVar2=
297+
292298
# Define a PATH variable "MyPath1"
293299
MyPath1=(path)/some/path11
294300
@@ -302,6 +308,7 @@ the prefix of the variable. It is useful to automatically get the append/prepend
302308
Then, the result of applying this profile is:
303309

304310
* ``MyVar1``: ``My Value; other MyValue12``
311+
* ``MyVar2``: An empty string value
305312
* ``MyPath1``:
306313
* Unix: ``/other path/path12:/some/path11``
307314
* Windows: ``/other path/path12;/some/path11``

0 commit comments

Comments
 (0)