Skip to content

Commit 1848e00

Browse files
committed
Added small section about default values
1 parent b47f5c8 commit 1848e00

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/dotenv.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ Use environment variables in values by prefixing variables with ``$``:
149149
its value will depend on the ``DB_USER`` value defined in other files
150150
instead of the value defined in this file.
151151

152+
Define a default value in case the environment variable is not set:
153+
154+
.. code-block:: terminal
155+
156+
DB_USER=
157+
DB_PASS=${DB_USER:-root}pass # results in DB_PASS=rootpass
158+
152159
Embed commands via ``$()`` (not supported on Windows):
153160

154161
.. code-block:: terminal

0 commit comments

Comments
 (0)